├── .gitignore ├── AUTHORS.txt ├── ChangeLog.txt ├── Makefile ├── README.txt ├── code ├── Makefile ├── bin │ └── translations │ │ └── chs │ │ └── strings │ │ ├── corelog.xml │ │ └── framextp.xml ├── pkg_AppUI │ ├── Interface │ │ ├── CmdMsgObserverSimple.h │ │ ├── FrameApp │ │ │ ├── FrameApp.h │ │ │ ├── FrameAppImpl.h │ │ │ └── Ix_FrameWndFactory.h │ │ ├── Ix_CreateWnd.h │ │ ├── Ix_UIConfig.h │ │ ├── RawCmdMsgObserver.h │ │ └── mfc │ │ │ ├── Cx_CreateWnd.h │ │ │ ├── EmbedWnd.cpp │ │ │ └── EmbedWnd.h │ └── Modules │ │ ├── FrameXtp │ │ ├── ChildFrm.cpp │ │ ├── ChildFrm.h │ │ ├── Cx_FrameWndFactory.cpp │ │ ├── Cx_FrameWndFactory.h │ │ ├── DummyDoc.cpp │ │ ├── DummyDoc.h │ │ ├── EmbedView.cpp │ │ ├── EmbedView.h │ │ ├── FrameXtp.rc │ │ ├── MDIFrameWnd.cpp │ │ ├── MDIFrameWnd.h │ │ ├── MainFrm.cpp │ │ ├── MainFrm.h │ │ ├── Module.cpp │ │ ├── Resource.h │ │ ├── SDIFrameWnd.cpp │ │ ├── SDIFrameWnd.h │ │ ├── StdAfx.cpp │ │ ├── StdAfx.h │ │ └── Version.rc2 │ │ └── Public │ │ ├── sinstance.cpp │ │ └── sinstance.h ├── pkg_Core │ ├── Interface │ │ ├── ChangeObserver │ │ │ ├── Cx_ChangeObserver.h │ │ │ ├── Ix_ChangeManager.h │ │ │ └── Ix_ChangeObserver.h │ │ ├── Ix_Object.h │ │ ├── Ix_ObjectFactory.h │ │ ├── Log │ │ │ ├── DebugR.cpp │ │ │ ├── DebugR.h │ │ │ ├── Ix_LogManager.h │ │ │ ├── Ix_LogObserver.h │ │ │ ├── LogHelper.h │ │ │ └── LogHelper2.h │ │ ├── Module │ │ │ ├── Cx_Module.h │ │ │ ├── Cx_Object.h │ │ │ ├── Cx_SingletonObject.h │ │ │ ├── Ix_Module.h │ │ │ ├── XClassItem.h │ │ │ ├── XClassMacro.h │ │ │ ├── XModuleImpl.h │ │ │ ├── XModuleItem.h │ │ │ └── XModuleMacro.h │ │ ├── PluginManager │ │ │ ├── Ix_AppWorkPath.h │ │ │ ├── Ix_PluginDelayLoad.h │ │ │ ├── Ix_PluginLoader.h │ │ │ ├── Ix_PluginLoader2.h │ │ │ ├── PluginManager.h │ │ │ └── XComCreator.h │ │ ├── Portability │ │ │ ├── linuximpl.h │ │ │ ├── macimpl.h │ │ │ ├── obsolete.h │ │ │ ├── pathstr.h │ │ │ ├── portimpl.h │ │ │ ├── win32impl.h │ │ │ ├── x3unix.h │ │ │ └── x3win.h │ │ ├── UtilFunc │ │ │ ├── AutoNew.h │ │ │ ├── ConvStr.h │ │ │ ├── LoadDllHelper.h │ │ │ ├── LockCount.h │ │ │ ├── LockSyn.h │ │ │ ├── PluginInc.h │ │ │ ├── ReadInts.h │ │ │ ├── RelToAbs.h │ │ │ ├── RoundStr.h │ │ │ ├── SafeCall.h │ │ │ ├── ScanFiles.h │ │ │ ├── SysErrStr.h │ │ │ ├── X3Portability.h │ │ │ ├── ctrim.h │ │ │ ├── func_s.h │ │ │ ├── vecfunc.h │ │ │ └── vecptr.h │ │ ├── Utility │ │ │ ├── ClsID_TextUtil.h │ │ │ ├── Ix_ClipboardUtil.h │ │ │ ├── Ix_FileTransaction.h │ │ │ ├── Ix_FileUtility.h │ │ │ ├── Ix_FileVersion.h │ │ │ ├── Ix_GuidGenerator.h │ │ │ ├── Ix_StringCoding.h │ │ │ ├── Ix_StringConvert.h │ │ │ ├── Ix_TempFolder.h │ │ │ └── Ix_TextFileUtil.h │ │ ├── XComPtr.h │ │ └── Xml │ │ │ ├── Cx_ConfigSection.h │ │ │ ├── IFileCryptHandler.h │ │ │ ├── Ix_ConfigData.h │ │ │ ├── Ix_ConfigSection.h │ │ │ ├── Ix_ConfigSectionXml.h │ │ │ ├── Ix_ConfigTransaction.h │ │ │ ├── Ix_ConfigXml.h │ │ │ └── Ix_StringTable.h │ ├── Makefile │ └── Modules │ │ ├── ChangeManager │ │ ├── ChangeManager.rc │ │ ├── Cx_ChangeManager.cpp │ │ ├── Cx_ChangeManager.h │ │ ├── Makefile │ │ ├── Module.cpp │ │ └── Version.rc2 │ │ ├── ConfigXml │ │ ├── ConfigXml.rc │ │ ├── ConfigXmlImpl.h │ │ ├── Cx_ConfigXml.cpp │ │ ├── Cx_ConfigXml.h │ │ ├── Cx_XmlSection.cpp │ │ ├── Cx_XmlSection.h │ │ ├── Makefile │ │ ├── Module.cpp │ │ ├── TinyXml │ │ │ ├── Makefile │ │ │ ├── XmlUtil.cpp │ │ │ ├── XmlUtil.h │ │ │ ├── tinystr.cpp │ │ │ ├── tinystr.h │ │ │ ├── tinyxml.cpp │ │ │ ├── tinyxml.h │ │ │ ├── tinyxmlerror.cpp │ │ │ └── tinyxmlparser.cpp │ │ ├── Version.rc2 │ │ └── XmlUtil │ │ │ ├── XMLHelpers.h │ │ │ ├── XmlUtil.cpp │ │ │ └── XmlUtil.h │ │ ├── FileUtility │ │ ├── Cx_FileTransaction.cpp │ │ ├── Cx_FileTransaction.h │ │ ├── Cx_FileUtility.cpp │ │ ├── Cx_FileUtility.h │ │ ├── Cx_TempFolder.cpp │ │ ├── Cx_TempFolder.h │ │ ├── FileTransaction.h │ │ ├── FileUtility.rc │ │ ├── Makefile │ │ ├── Module.cpp │ │ └── Version.rc2 │ │ ├── LogManager │ │ ├── ClsID_LogManager.h │ │ ├── Cx_LogManager.cpp │ │ ├── Cx_LogManager.h │ │ ├── LogManager.rc │ │ ├── Makefile │ │ ├── Module.cpp │ │ └── Version.rc2 │ │ ├── LogWriter │ │ ├── LogObserver.cpp │ │ ├── LogObserver.h │ │ ├── LogWriter.rc │ │ ├── Makefile │ │ ├── Module.cpp │ │ ├── Plugin.cpp │ │ ├── Version.rc2 │ │ └── log4cplus │ │ │ ├── include │ │ │ └── log4cplus │ │ │ │ ├── appender.h │ │ │ │ ├── config.h.in │ │ │ │ ├── config.hxx │ │ │ │ ├── config │ │ │ │ ├── defines.hxx │ │ │ │ ├── defines.hxx.in │ │ │ │ ├── macosx.h │ │ │ │ └── win32.h │ │ │ │ ├── configurator.h │ │ │ │ ├── consoleappender.h │ │ │ │ ├── fileappender.h │ │ │ │ ├── fstreams.h │ │ │ │ ├── helpers │ │ │ │ ├── appenderattachableimpl.h │ │ │ │ ├── loglog.h │ │ │ │ ├── logloguser.h │ │ │ │ ├── pointer.h │ │ │ │ ├── property.h │ │ │ │ ├── sleep.h │ │ │ │ ├── socket.h │ │ │ │ ├── socketbuffer.h │ │ │ │ ├── stringhelper.h │ │ │ │ ├── syncprims-pthreads.h │ │ │ │ ├── syncprims-win32.h │ │ │ │ ├── syncprims.h │ │ │ │ ├── thread-config.h │ │ │ │ ├── threads.h │ │ │ │ └── timehelper.h │ │ │ │ ├── hierarchy.h │ │ │ │ ├── hierarchylocker.h │ │ │ │ ├── layout.h │ │ │ │ ├── logger.h │ │ │ │ ├── loggingmacros.h │ │ │ │ ├── loglevel.h │ │ │ │ ├── ndc.h │ │ │ │ ├── nteventlogappender.h │ │ │ │ ├── nullappender.h │ │ │ │ ├── socketappender.h │ │ │ │ ├── spi │ │ │ │ ├── appenderattachable.h │ │ │ │ ├── factory.h │ │ │ │ ├── filter.h │ │ │ │ ├── loggerfactory.h │ │ │ │ ├── loggerimpl.h │ │ │ │ ├── loggingevent.h │ │ │ │ ├── objectregistry.h │ │ │ │ └── rootlogger.h │ │ │ │ ├── streams.h │ │ │ │ ├── syslogappender.h │ │ │ │ ├── tstring.h │ │ │ │ ├── version.h │ │ │ │ ├── win32consoleappender.h │ │ │ │ └── win32debugappender.h │ │ │ └── src │ │ │ ├── appender.cxx │ │ │ ├── appenderattachableimpl.cxx │ │ │ ├── configurator.cxx │ │ │ ├── consoleappender.cxx │ │ │ ├── factory.cxx │ │ │ ├── fileappender.cxx │ │ │ ├── filter.cxx │ │ │ ├── global-init.cxx │ │ │ ├── hierarchy.cxx │ │ │ ├── hierarchylocker.cxx │ │ │ ├── layout.cxx │ │ │ ├── logger.cxx │ │ │ ├── loggerimpl.cxx │ │ │ ├── loggingevent.cxx │ │ │ ├── loglevel.cxx │ │ │ ├── loglog.cxx │ │ │ ├── logloguser.cxx │ │ │ ├── ndc.cxx │ │ │ ├── nteventlogappender.cxx │ │ │ ├── nullappender.cxx │ │ │ ├── objectregistry.cxx │ │ │ ├── patternlayout.cxx │ │ │ ├── pointer.cxx │ │ │ ├── property.cxx │ │ │ ├── rootlogger.cxx │ │ │ ├── sleep.cxx │ │ │ ├── socket-unix.cxx │ │ │ ├── socket-win32.cxx │ │ │ ├── socket.cxx │ │ │ ├── socketappender.cxx │ │ │ ├── socketbuffer.cxx │ │ │ ├── stringhelper.cxx │ │ │ ├── syncprims.cxx │ │ │ ├── syslogappender.cxx │ │ │ ├── threads.cxx │ │ │ ├── timehelper.cxx │ │ │ ├── version.cxx │ │ │ ├── win32consoleappender.cxx │ │ │ └── win32debugappender.cxx │ │ ├── Makefile │ │ ├── PluginManager │ │ ├── Cx_ObjectFactory.cpp │ │ ├── Cx_ObjectFactory.h │ │ ├── Cx_PluginLoader.cpp │ │ ├── Cx_PluginLoader.h │ │ ├── DelayLoad.cpp │ │ ├── Makefile │ │ ├── Module.cpp │ │ ├── PluginManager.rc │ │ └── Version.rc2 │ │ ├── StringTable │ │ ├── Cx_StringTable.cpp │ │ ├── Cx_StringTable.h │ │ ├── Makefile │ │ ├── Module.cpp │ │ ├── StringTable.rc │ │ └── Version.rc2 │ │ └── TextUtility │ │ ├── Cx_ClipboardUtil.cpp │ │ ├── Cx_ClipboardUtil.h │ │ ├── Cx_GuidGenerator.cpp │ │ ├── Cx_GuidGenerator.h │ │ ├── Cx_TextUtil.cpp │ │ ├── Cx_TextUtil.h │ │ ├── Makefile │ │ ├── ManagedExt.h │ │ ├── Module.cpp │ │ ├── TextUtility.rc │ │ ├── Version.rc2 │ │ ├── base64.cpp │ │ ├── base64.h │ │ ├── md5.cpp │ │ └── md5.h ├── pkg_Example │ ├── Interface │ │ ├── ClsID_Example.h │ │ ├── ClsID_ViewExample.h │ │ ├── HelloViewRes.h │ │ ├── Ix_Example.h │ │ └── ObserverExample │ │ │ ├── ChainObserver.h │ │ │ ├── ChainObserverB.h │ │ │ ├── DocEventObserver.h │ │ │ ├── Ix_ChangeObserverTest.h │ │ │ └── NodeSelectionObserver.h │ ├── Makefile │ └── Modules │ │ ├── ChangeObserverExample │ │ ├── Cx_ObserverTest.cpp │ │ ├── Cx_ObserverTest.h │ │ ├── DocObserverTest.h │ │ ├── Makefile │ │ ├── Module.cpp │ │ ├── Plugin.cpp │ │ ├── Responsibility.h │ │ ├── ResponsibilityB.h │ │ └── SelectionObserverTest.h │ │ ├── HelloFrame │ │ ├── HelloApp.cpp │ │ ├── HelloFrame.rc │ │ ├── Resource.h │ │ ├── res │ │ │ ├── GroupClipboard.png │ │ │ ├── GroupFind.png │ │ │ ├── GroupFont.png │ │ │ ├── HelloFrame.ico │ │ │ ├── LargeIcons.png │ │ │ └── SmallIcons.png │ │ └── uifactory.xml │ │ ├── HelloView │ │ ├── CmdObserver.cpp │ │ ├── HelloView.rc │ │ ├── Makefile │ │ ├── Module.cpp │ │ ├── MoveObserver.h │ │ ├── Resource.h │ │ ├── WndA.cpp │ │ └── WndA.h │ │ ├── HelloViewApp │ │ ├── ChildView.cpp │ │ ├── ChildView.h │ │ ├── HelloViewApp.cpp │ │ ├── HelloViewApp.ico │ │ ├── HelloViewApp.rc │ │ ├── MainFrm.cpp │ │ ├── MainFrm.h │ │ ├── Makefile │ │ └── Resource.h │ │ ├── MFCExtTempl │ │ ├── Cx_Example2.cpp │ │ ├── Cx_Example2.h │ │ ├── MFCExtTempl.dsp │ │ ├── MFCExtTempl.rc │ │ ├── MFCExtTempl_vc100.vcxproj │ │ ├── MFCExtTempl_vc100.vcxproj.filters │ │ ├── MFCExtTempl_vc80.vcproj │ │ ├── MFCExtTempl_vc90.vcproj │ │ ├── Makefile │ │ ├── Module.cpp │ │ ├── Plugin.cpp │ │ ├── Resource.h │ │ ├── StdAfx.cpp │ │ └── StdAfx.h │ │ ├── Makefile │ │ ├── SimpleApp │ │ ├── Main.cpp │ │ └── Makefile │ │ ├── SimpleUse │ │ ├── Main.cpp │ │ └── Makefile │ │ └── Win32DllTempl │ │ ├── Cx_Example.cpp │ │ ├── Cx_Example.h │ │ ├── Makefile │ │ ├── Module.cpp │ │ ├── Plugin.cpp │ │ ├── Version.rc2 │ │ ├── Win32DllTempl.dsp │ │ ├── Win32DllTempl.rc │ │ ├── Win32DllTempl_vc100.vcxproj │ │ ├── Win32DllTempl_vc100.vcxproj.filters │ │ ├── Win32DllTempl_vc80.vcproj │ │ └── Win32DllTempl_vc90.vcproj ├── pkg_Platform │ ├── Interface │ │ └── Ix_HookManager.h │ ├── Makefile │ └── Modules │ │ ├── ComHook │ │ ├── ComCreator.cpp │ │ ├── ComCreator.h │ │ ├── ComFileMap.cpp │ │ ├── ComFileMap.h │ │ ├── ComHook.rc │ │ ├── Makefile │ │ ├── Module.cpp │ │ └── Version.rc2 │ │ ├── HookManager │ │ ├── Cx_HookManager.cpp │ │ ├── Cx_HookManager.h │ │ ├── HookManager.rc │ │ ├── Makefile │ │ ├── Module.cpp │ │ └── Version.rc2 │ │ ├── Makefile │ │ ├── Public │ │ ├── ApiHook.cpp │ │ ├── ApiHook.h │ │ ├── complugin_impl.h │ │ └── complugin_inc.h │ │ └── x3core │ │ ├── Makefile │ │ ├── Module.cpp │ │ ├── Version.rc2 │ │ ├── testcore.py │ │ ├── x3core.i │ │ └── x3core.rc ├── pkg_UnitTest │ ├── Interface │ │ ├── UnitTestInc.h │ │ └── cppunit │ │ │ ├── AdditionalMessage.h │ │ │ ├── Asserter.h │ │ │ ├── BriefTestProgressListener.h │ │ │ ├── CompilerOutputter.h │ │ │ ├── Exception.h │ │ │ ├── Message.h │ │ │ ├── Outputter.h │ │ │ ├── Portability.h │ │ │ ├── Protector.h │ │ │ ├── SourceLine.h │ │ │ ├── SynchronizedObject.h │ │ │ ├── Test.h │ │ │ ├── TestAssert.h │ │ │ ├── TestCaller.h │ │ │ ├── TestCase.h │ │ │ ├── TestComposite.h │ │ │ ├── TestFailure.h │ │ │ ├── TestFixture.h │ │ │ ├── TestLeaf.h │ │ │ ├── TestListener.h │ │ │ ├── TestPath.h │ │ │ ├── TestResult.h │ │ │ ├── TestResultCollector.h │ │ │ ├── TestRunner.h │ │ │ ├── TestSuccessListener.h │ │ │ ├── TestSuite.h │ │ │ ├── TextOutputter.h │ │ │ ├── TextTestProgressListener.h │ │ │ ├── TextTestResult.h │ │ │ ├── TextTestRunner.h │ │ │ ├── XmlOutputter.h │ │ │ ├── XmlOutputterHook.h │ │ │ ├── config-auto.h │ │ │ ├── config │ │ │ ├── CppUnitApi.h │ │ │ ├── SelectDllLoader.h │ │ │ ├── SourcePrefix.h │ │ │ ├── config-bcb5.h │ │ │ ├── config-evc4.h │ │ │ ├── config-mac.h │ │ │ └── config-msvc6.h │ │ │ ├── extensions │ │ │ ├── AutoRegisterSuite.h │ │ │ ├── ExceptionTestCaseDecorator.h │ │ │ ├── HelperMacros.h │ │ │ ├── Orthodox.h │ │ │ ├── RepeatedTest.h │ │ │ ├── TestCaseDecorator.h │ │ │ ├── TestDecorator.h │ │ │ ├── TestFactory.h │ │ │ ├── TestFactoryRegistry.h │ │ │ ├── TestFixtureFactory.h │ │ │ ├── TestNamer.h │ │ │ ├── TestSetUp.h │ │ │ ├── TestSuiteBuilderContext.h │ │ │ ├── TestSuiteFactory.h │ │ │ └── TypeInfoHelper.h │ │ │ ├── plugin │ │ │ ├── DynamicLibraryManager.h │ │ │ ├── DynamicLibraryManagerException.h │ │ │ ├── PlugInManager.h │ │ │ ├── PlugInParameters.h │ │ │ ├── TestPlugIn.h │ │ │ └── TestPlugInDefaultImpl.h │ │ │ ├── portability │ │ │ ├── CppUnitDeque.h │ │ │ ├── CppUnitMap.h │ │ │ ├── CppUnitSet.h │ │ │ ├── CppUnitStack.h │ │ │ ├── CppUnitVector.h │ │ │ ├── FloatingPoint.h │ │ │ └── Stream.h │ │ │ ├── tools │ │ │ ├── Algorithm.h │ │ │ ├── StringTools.h │ │ │ ├── XmlDocument.h │ │ │ └── XmlElement.h │ │ │ └── ui │ │ │ ├── mfc │ │ │ ├── MfcTestRunner.h │ │ │ └── TestRunner.h │ │ │ └── text │ │ │ ├── TestRunner.h │ │ │ └── TextTestRunner.h │ ├── Makefile │ └── Modules │ │ ├── Makefile │ │ ├── Public │ │ ├── BaseTest.cpp │ │ ├── BaseTest.h │ │ └── UnitTests.cpp │ │ ├── TestCore │ │ ├── Makefile │ │ ├── TestChangeObserver.cpp │ │ ├── TestChangeObserver.h │ │ ├── TestConfigDB.h │ │ ├── TestConfigXml.cpp │ │ ├── TestConfigXml.h │ │ ├── TestFileUtil.cpp │ │ ├── TestFileUtil.h │ │ ├── TestLoadPlugin.cpp │ │ ├── TestLoadPlugin.h │ │ ├── TestLogging.cpp │ │ ├── TestLogging.h │ │ ├── TestPluginManager.cpp │ │ ├── TestPluginManager.h │ │ ├── TestStringTable.cpp │ │ ├── TestStringTable.h │ │ ├── TestTextUtil.cpp │ │ └── TestTextUtil.h │ │ ├── TestPlatform │ │ ├── Makefile │ │ ├── TestComHook.cpp │ │ ├── TestComHook.h │ │ ├── TestHookManager.cpp │ │ ├── TestHookManager.h │ │ ├── atlcom.dll │ │ └── test.xml │ │ └── TestUtility │ │ ├── Makefile │ │ ├── TestConfigDB.cpp │ │ └── TestConfigDB.h └── pkg_Utility │ ├── Interface │ └── Database │ │ └── Ix_ConfigDBFactory.h │ ├── Makefile │ └── Modules │ ├── ConfigDB │ ├── ClsID_Internal.h │ ├── ConfigDB.rc │ ├── Cx_CfgDatabase.cpp │ ├── Cx_CfgDatabase.h │ ├── Cx_CfgDbSection.cpp │ ├── Cx_CfgDbSection.h │ ├── Cx_CfgRecord.cpp │ ├── Cx_CfgRecord.h │ ├── Cx_CfgRecordset.cpp │ ├── Cx_CfgRecordset.h │ ├── Cx_ConfigFactory.cpp │ ├── Cx_ConfigFactory.h │ ├── Cx_SQLParser.h │ ├── DbFunc.cpp │ ├── DbFunc.h │ ├── Ix_InitDatabase.h │ ├── Ix_SQLParser.h │ ├── Makefile │ ├── Module.cpp │ ├── Version.rc2 │ ├── msado15.tlh │ └── msado15.tli │ └── Makefile ├── config.mk ├── doc ├── Doxygen │ ├── Interface.doxyfile │ ├── MainPage.txt │ ├── Modules.doxyfile │ ├── Readme.txt │ └── html_footer.txt └── uml │ ├── Images │ ├── ClassCache.png │ ├── ComHook.png │ ├── CreateObject.png │ ├── DelayLoading.png │ ├── EventDriven.png │ ├── FrameXtpClasses.png │ ├── InterfaceStruct.png │ ├── Modules.png │ ├── PluginLoading.png │ └── PluginUnloading.png │ └── uml_ea.xml ├── projects ├── CodeBlocks │ ├── unix │ │ ├── ChangeManager.cbp │ │ ├── ChangeObserverExample.cbp │ │ ├── ConfigXml.cbp │ │ ├── FileUtility.cbp │ │ ├── LogManager.cbp │ │ ├── LogWriter.cbp │ │ ├── PluginManager.cbp │ │ ├── SimpleApp.cbp │ │ ├── SimpleUse.cbp │ │ ├── StringTable.cbp │ │ ├── TestCore.cbp │ │ ├── TestPlatform.cbp │ │ ├── TestUtility.cbp │ │ ├── TextUtility.cbp │ │ └── Win32DllTempl.cbp │ ├── win32 │ │ ├── ChangeManager.cbp │ │ ├── ChangeObserverExample.cbp │ │ ├── ComHook.cbp │ │ ├── ConfigXml.cbp │ │ ├── FileUtility.cbp │ │ ├── LogManager.cbp │ │ ├── LogWriter.cbp │ │ ├── PluginManager.cbp │ │ ├── SimpleApp.cbp │ │ ├── SimpleUse.cbp │ │ ├── StringTable.cbp │ │ ├── TestCore.cbp │ │ ├── TestPlatform.cbp │ │ ├── TestUtility.cbp │ │ ├── TextUtility.cbp │ │ └── Win32DllTempl.cbp │ ├── x3c-unix.workspace │ └── x3c-win32.workspace └── msvc │ ├── vcproj │ ├── ChangeManager.dsp │ ├── ChangeManager_vc80.vcproj │ ├── ChangeManager_vc90.vcproj │ ├── ChangeObserverExample.dsp │ ├── ChangeObserverExample_vc80.vcproj │ ├── ChangeObserverExample_vc90.vcproj │ ├── ComHook.dsp │ ├── ComHook_vc80.vcproj │ ├── ComHook_vc90.vcproj │ ├── ConfigDB.dsp │ ├── ConfigDB_vc80.vcproj │ ├── ConfigDB_vc90.vcproj │ ├── ConfigXml.dsp │ ├── ConfigXml_vc80.vcproj │ ├── ConfigXml_vc90.vcproj │ ├── FileUtility.dsp │ ├── FileUtility_vc80.vcproj │ ├── FileUtility_vc90.vcproj │ ├── FrameXtp.dsp │ ├── FrameXtp_vc80.vcproj │ ├── FrameXtp_vc90.vcproj │ ├── HelloFrame.dsp │ ├── HelloFrame_vc80.vcproj │ ├── HelloFrame_vc90.vcproj │ ├── HelloView.dsp │ ├── HelloViewApp.dsp │ ├── HelloViewApp_vc80.vcproj │ ├── HelloViewApp_vc90.vcproj │ ├── HelloView_vc80.vcproj │ ├── HelloView_vc90.vcproj │ ├── HookManager.dsp │ ├── HookManager_vc80.vcproj │ ├── HookManager_vc90.vcproj │ ├── LogManager.dsp │ ├── LogManager_vc80.vcproj │ ├── LogManager_vc90.vcproj │ ├── LogWriter.dsp │ ├── LogWriter_vc80.vcproj │ ├── LogWriter_vc90.vcproj │ ├── MFCExtTempl.dsp │ ├── MFCExtTempl_vc80.vcproj │ ├── MFCExtTempl_vc90.vcproj │ ├── PluginManager.dsp │ ├── PluginManager_vc80.vcproj │ ├── PluginManager_vc90.vcproj │ ├── SimpleApp.dsp │ ├── SimpleApp_vc80.vcproj │ ├── SimpleApp_vc90.vcproj │ ├── SimpleUse.dsp │ ├── SimpleUse_vc80.vcproj │ ├── SimpleUse_vc90.vcproj │ ├── StringTable.dsp │ ├── StringTable_vc80.vcproj │ ├── StringTable_vc90.vcproj │ ├── TestCore.dsp │ ├── TestCore_vc80.vcproj │ ├── TestCore_vc90.vcproj │ ├── TestPlatform.dsp │ ├── TestPlatform_vc80.vcproj │ ├── TestPlatform_vc90.vcproj │ ├── TestUtility.dsp │ ├── TestUtility_vc80.vcproj │ ├── TestUtility_vc90.vcproj │ ├── TextUtility.dsp │ ├── TextUtility_vc80.vcproj │ ├── TextUtility_vc90.vcproj │ ├── Win32DllTempl.dsp │ ├── Win32DllTempl_vc80.vcproj │ ├── Win32DllTempl_vc90.vcproj │ ├── swig.rule │ ├── x3core.dsp │ ├── x3core_vc80.vcproj │ └── x3core_vc90.vcproj │ ├── x3_vc60.dsw │ ├── x3_vc80.sln │ └── x3_vc90.sln └── tools ├── MakePluginPerl ├── Interface │ ├── ClsID_Example.h │ └── Ix_Example.h ├── MFCExtTempl │ ├── Cx_Example.cpp │ ├── Cx_Example.h │ ├── Dll.cpp │ ├── MFCExtTempl.dsp │ ├── MFCExtTempl.rc │ ├── MFCExtTempl_vc80.vcproj │ ├── MFCExtTempl_vc90.vcproj │ ├── Module.cpp │ ├── Plugin.cpp │ └── Resource.h ├── Readme.txt ├── Readme_cn.txt ├── config.ini └── makePlugin_v0.3.pl ├── deltemp.bat └── makeplugin.py /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.so 3 | *.a 4 | *.o 5 | *.d 6 | bin 7 | obj 8 | *_wrap.cxx 9 | *.ncb 10 | *.opt 11 | *.suo 12 | *.user 13 | *.obj 14 | *.aps 15 | *.*sdf 16 | ipch 17 | .idea/ 18 | build 19 | *.tmp 20 | *~ 21 | -------------------------------------------------------------------------------- /AUTHORS.txt: -------------------------------------------------------------------------------- 1 | Zhang Yungui 2 | Huang Ye (thinkhy) 3 | Li Jian (Aaron) -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # The simplest way to compile x3c on Linux, Mac or Unix is: 2 | # 1. `cd' to the directory containing the file of 'Makefile'. 3 | # 2. Type `make' to compile the package. 4 | # The program binaries files are outputed to 'code/bin/plugins/' or 'code\bin\tests'. 5 | # 6 | # 3. You can remove the program object files from the source code 7 | # directory by typing `make clean'. 8 | # 9 | 10 | ROOTDIR = . 11 | include $(ROOTDIR)/config.mk 12 | 13 | .PHONY: code clean 14 | 15 | #============================================================================== 16 | # The default build target. 17 | #============================================================================== 18 | all: code 19 | #============================================================================== 20 | 21 | code: 22 | $(MAKE) -C code 23 | 24 | #============================================================================== 25 | # Clean up the targets built by 'make all'. 26 | #============================================================================== 27 | clean: code_clean 28 | code_clean: 29 | $(MAKE) -C code clean 30 | 31 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | x3c - C++ Plugin Framework 2 | ----------------------------------- 3 | http://github.com/rhcad/x3c 4 | 5 | x3c is designed as a plugin-framework that uses C++ and STL. 6 | This framework has many frequently-used and lightweight plugins. 7 | x3c can be used to easily develop plugins and applications for multiple platforms. 8 | 9 | Makefile and config.mk are used to compile x3c on Linux, Mac or Unix. 10 | 11 | projects: C++ workspace files using IDE (MS VC++, Code::Blocks + GCC, ...). 12 | code: source code of plugins. 13 | doc: development documents and doxygen files. 14 | tools: some useful tools for development. 15 | 16 | -------------------------------------------------------- 17 | You may need to download the following files: 18 | 19 | 1. download cppunit-1.12.1 from one of the following sites, then copy cppunit's lib 20 | and dll files to the folder 'code\bin\vcxx\xxx\tests'. 21 | 22 | http://files.cnblogs.com/rhcad/cppunit-1.12.1-vc689&gcc.zip (fix for vc6 and gcc) 23 | http://sourceforge.net/projects/cppunit/files/cppunit/1.12.1/ 24 | \\dampub\Tools\CodeCheck\C++\CppUnit\cppunit-1.12.1 (Founder server) 25 | 26 | -------------------------------------------------------- 27 | License: Apache License V2.0 28 | 29 | Bug reports and suggestions are welcome. 30 | Email to the current maintainers may be sent to . 31 | Some documents in chinese may be found at http://www.cnblogs.com/rhcad . -------------------------------------------------------------------------------- /code/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | 3 | ROOTDIR = .. 4 | include $(ROOTDIR)/config.mk 5 | 6 | SUBDIRS = $(filter-out bin/ pkg_Utility/ pkg_AppUI/, $(sort $(dir $(wildcard */)))) 7 | CLEANSUBDIRS = $(addsuffix .clean, $(SUBDIRS)) 8 | 9 | .PHONY: pkg_Core pkg_Example pkg_UnitTest pkg_Platform 10 | all: pkg_Core pkg_Utility pkg_Example pkg_UnitTest pkg_Platform 11 | 12 | pkg_Core: 13 | @echo 14 | @echo Making all in subdirectory $@... 15 | $(MAKE) -C pkg_Core 16 | 17 | pkg_Example: 18 | @echo 19 | @echo Making all in subdirectory $@... 20 | $(MAKE) -C pkg_Example 21 | 22 | #pkg_UnitTest: 23 | # @echo 24 | # @echo Making all in subdirectory $@... 25 | # $(MAKE) -C pkg_UnitTest 26 | 27 | #pkg_Platform: 28 | # @echo 29 | # @echo Making all in subdirectory $@... 30 | # $(MAKE) -C pkg_Platform 31 | 32 | clean: $(CLEANSUBDIRS) 33 | 34 | $(CLEANSUBDIRS): 35 | @cd $(basename $@) ; $(MAKE) clean 36 | -------------------------------------------------------------------------------- /code/bin/translations/chs/strings/framextp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /code/pkg_AppUI/Interface/FrameApp/FrameApp.h: -------------------------------------------------------------------------------- 1 | /*! \file FrameApp.h 2 | * \brief Define the base MFC application class: CFrameApp 3 | * \author Zhang Yungui, X3 C++ PluginFramework 4 | * \date 2011.10.27 5 | */ 6 | #ifndef X3_UI_FRAME_APP_H_ 7 | #define X3_UI_FRAME_APP_H_ 8 | 9 | class CPluginManager; 10 | 11 | //! The base MFC application class. 12 | /*! This class will create the main frame window. 13 | \ingroup _GROUP_APPUI_ 14 | */ 15 | class CFrameApp : public CWinApp 16 | { 17 | public: 18 | CFrameApp(); 19 | virtual ~CFrameApp(); 20 | 21 | public: 22 | virtual BOOL InitInstance(); 23 | virtual int ExitInstance(); 24 | virtual BOOL OnIdle(LONG lCount); 25 | virtual HINSTANCE LoadAppLangResourceDLL(); 26 | 27 | protected: 28 | //! Return a unique string to indicate the application can be ran only one instance. 29 | virtual LPCWSTR GetSingletonAppUID() { return L""; } 30 | 31 | //! Return the config file name for creating the main window. 32 | virtual LPCWSTR GetFactoryFile() { return L"config/uifactory.xml"; } 33 | 34 | //! Load plugins in 'plugins' folder. 35 | virtual BOOL LoadPlugins(); 36 | 37 | //! Check the current application instance can be ran or not. 38 | virtual BOOL CheckAppInstance(); 39 | 40 | //! Create and show the main frame window. 41 | virtual BOOL CreateFrameWnd(); 42 | 43 | protected: 44 | DECLARE_MESSAGE_MAP() 45 | 46 | protected: 47 | CPluginManager* m_loader; //!< for load extra plugins. 48 | Cx_Ptr m_factory; //!< Ix_FrameWndFactory object. 49 | }; 50 | 51 | #endif // X3_UI_FRAME_APP_H_ 52 | -------------------------------------------------------------------------------- /code/pkg_AppUI/Interface/FrameApp/Ix_FrameWndFactory.h: -------------------------------------------------------------------------------- 1 | /*! \file Ix_FrameWndFactory.h 2 | * \brief Define the interface for creating the main window: Ix_FrameWndFactory 3 | * \author Zhang Yungui, X3 C++ PluginFramework 4 | * \date 2011.10.27 5 | */ 6 | #ifndef X3_UI_FRAMEWND_FACTORY_H_ 7 | #define X3_UI_FRAMEWND_FACTORY_H_ 8 | 9 | #include 10 | 11 | X3CLSID_DEFINE(CLSID_FrameWndFactory, "5c784623-69b4-4551-8e80-85d7997e194d"); 12 | 13 | //! Interface for creating the main window. 14 | /*! It's used by CFrameApp. 15 | \interface Ix_FrameWndFactory 16 | \see x3::CLSID_FrameWndFactory, CFrameApp 17 | */ 18 | class Ix_FrameWndFactory : public Ix_Object 19 | { 20 | public: 21 | X3DEFINE_IID(Ix_FrameWndFactory) 22 | 23 | virtual bool CheckAppInstance(LPCWSTR appid) = 0; 24 | virtual bool CreateFrameWnd(LPCWSTR factoryFile) = 0; 25 | virtual void OnQuit() = 0; 26 | virtual bool OnIdle(long count) = 0; 27 | }; 28 | 29 | #endif // X3_UI_FRAMEWND_FACTORY_H_ 30 | -------------------------------------------------------------------------------- /code/pkg_AppUI/Interface/Ix_CreateWnd.h: -------------------------------------------------------------------------------- 1 | /*! \file Ix_CreateWnd.h 2 | * \brief Define window creator interface: Ix_CreateWnd 3 | * \author Zhang Yungui, X3 C++ PluginFramework 4 | * \date 2011.10.11 5 | */ 6 | #ifndef X3_VIEW_ICREATEWND_H_ 7 | #define X3_VIEW_ICREATEWND_H_ 8 | 9 | #include 10 | 11 | //! Window creator interface 12 | /*! Use Cx_CreateWnd to implement this interface. 13 | Parent window class need not to known child window class or implement detail. 14 | \interface Ix_CreateWnd 15 | \ingroup _GROUP_APPUI_ 16 | \see Cx_CreateWnd 17 | */ 18 | class Ix_CreateWnd : public Ix_Object 19 | { 20 | public: 21 | X3DEFINE_IID(Ix_CreateWnd) 22 | 23 | //! Return the window handle. 24 | virtual HWND GetWindow() const = 0; 25 | 26 | //! Create window with a specified control id (eg: AFX_IDW_PANE_FIRST). 27 | virtual bool CreateWnd(HWND hwndParent, int id) = 0; 28 | 29 | //! Destroy window and object. 30 | virtual void DestroyWnd() = 0; 31 | 32 | //! Dispatch a command message. 33 | virtual bool OnCommand(int id, bool test = false) = 0; 34 | 35 | //! Dispatch the update notify of a command UI object. 36 | virtual bool OnUpdateUI(int id, bool& enabled, bool& checked, std::wstring& text) = 0; 37 | 38 | //! Refresh display. 39 | virtual void Refresh() = 0; 40 | }; 41 | 42 | #endif // X3_VIEW_ICREATEWND_H_ 43 | -------------------------------------------------------------------------------- /code/pkg_AppUI/Interface/Ix_UIConfig.h: -------------------------------------------------------------------------------- 1 | /*! \file Ix_UIConfig.h 2 | * \brief Define UI config options interface: Ix_UIConfig 3 | * \author Zhang Yungui, X3 C++ PluginFramework 4 | * \date 2010.11.2 5 | */ 6 | #ifndef X3_APPUI_IUICONFIG_H_ 7 | #define X3_APPUI_IUICONFIG_H_ 8 | 9 | #include 10 | 11 | X3CLSID_DEFINE(CLSID_UIConfig, "4472ba6d-d833-40b9-899f-edc017ec9166"); 12 | 13 | //! UI config options interface 14 | /*! 15 | \interface Ix_UIConfig 16 | \ingroup _GROUP_APPUI_ 17 | \see x3::CLSID_UIConfig 18 | */ 19 | class Ix_UIConfig 20 | { 21 | public: 22 | virtual ~Ix_UIConfig() {} 23 | 24 | //! Return UI config data object, not null. 25 | virtual Ix_ConfigData* GetUIConfig() = 0; 26 | 27 | //! Return a config node object of the specified name. 28 | virtual Cx_ConfigSection GetUISection(const wchar_t* name) = 0; 29 | 30 | //! Save UI config data if modified. 31 | virtual bool Save() = 0; 32 | }; 33 | 34 | #endif // X3_APPUI_IUICONFIG_H_ 35 | -------------------------------------------------------------------------------- /code/pkg_AppUI/Modules/FrameXtp/ChildFrm.cpp: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #include "stdafx.h" 3 | #include "ChildFrm.h" 4 | 5 | #ifdef _DEBUG 6 | #define new DEBUG_NEW 7 | #endif 8 | 9 | IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd) 10 | 11 | BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd) 12 | //{{AFX_MSG_MAP(CChildFrame) 13 | ON_WM_CREATE() 14 | //}}AFX_MSG_MAP 15 | END_MESSAGE_MAP() 16 | 17 | CChildFrame::CChildFrame() 18 | { 19 | } 20 | 21 | CChildFrame::~CChildFrame() 22 | { 23 | } 24 | 25 | BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs) 26 | { 27 | cs.style = WS_CHILD | WS_VISIBLE | WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU 28 | | FWS_ADDTOTITLE | WS_THICKFRAME | WS_MAXIMIZEBOX | WS_MAXIMIZE; 29 | 30 | return CMDIChildWnd::PreCreateWindow(cs); 31 | } 32 | 33 | int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) 34 | { 35 | if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1) 36 | return -1; 37 | 38 | CXTPPaintManager* pPaintManager = ((CXTPMDIFrameWnd*)GetParentFrame() 39 | )->GetCommandBars()->GetPaintManager(); 40 | 41 | if (pPaintManager->GetCurrentTheme() > xtpThemeWhidbey) 42 | { 43 | EnableOffice2007Frame(this, pPaintManager); 44 | } 45 | 46 | return 0; 47 | } 48 | -------------------------------------------------------------------------------- /code/pkg_AppUI/Modules/FrameXtp/ChildFrm.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #pragma once 3 | 4 | class CChildFrame : public CMDIChildWnd, CXTPOffice2007FrameHook 5 | { 6 | protected: 7 | CChildFrame(); 8 | DECLARE_DYNCREATE(CChildFrame) 9 | 10 | // Attributes 11 | public: 12 | 13 | // Operations 14 | public: 15 | 16 | // Overrides 17 | // ClassWizard generated virtual function overrides 18 | //{{AFX_VIRTUAL(CChildFrame) 19 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 20 | //}}AFX_VIRTUAL 21 | 22 | // Implementation 23 | public: 24 | virtual ~CChildFrame(); 25 | 26 | // Generated message map functions 27 | protected: 28 | //{{AFX_MSG(CChildFrame) 29 | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 30 | //}}AFX_MSG 31 | DECLARE_MESSAGE_MAP() 32 | }; 33 | -------------------------------------------------------------------------------- /code/pkg_AppUI/Modules/FrameXtp/Cx_FrameWndFactory.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #pragma once 3 | 4 | #include 5 | 6 | class Cx_ConfigSection; 7 | 8 | class Cx_FrameWndFactory : public Ix_FrameWndFactory 9 | { 10 | X3BEGIN_CLASS_DECLARE(Cx_FrameWndFactory) 11 | X3DEFINE_INTERFACE_ENTRY(Ix_FrameWndFactory) 12 | X3END_CLASS_DECLARE() 13 | protected: 14 | Cx_FrameWndFactory(); 15 | virtual ~Cx_FrameWndFactory(); 16 | 17 | private: 18 | virtual bool CheckAppInstance(LPCWSTR appid); 19 | virtual bool CreateFrameWnd(LPCWSTR factoryFile); 20 | virtual void OnQuit(); 21 | virtual bool OnIdle(long count); 22 | 23 | private: 24 | void RegisterDocTemplate(bool mdi, const Cx_ConfigSection& node); 25 | bool ProcessShellCommand(); 26 | 27 | private: 28 | std::wstring m_appid; 29 | }; 30 | -------------------------------------------------------------------------------- /code/pkg_AppUI/Modules/FrameXtp/DummyDoc.cpp: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #include "stdafx.h" 3 | #include "DummyDoc.h" 4 | 5 | #ifdef _DEBUG 6 | #define new DEBUG_NEW 7 | #endif 8 | 9 | IMPLEMENT_DYNCREATE(CDummyDoc, CDocument) 10 | 11 | BEGIN_MESSAGE_MAP(CDummyDoc, CDocument) 12 | END_MESSAGE_MAP() 13 | 14 | CDummyDoc::CDummyDoc() 15 | { 16 | } 17 | 18 | CDummyDoc::~CDummyDoc() 19 | { 20 | } 21 | 22 | BOOL CDummyDoc::OnNewDocument() 23 | { 24 | return CDocument::OnNewDocument(); 25 | } 26 | 27 | BOOL CDummyDoc::OnOpenDocument(LPCTSTR lpszPathName) 28 | { 29 | lpszPathName; 30 | return TRUE; 31 | } 32 | 33 | BOOL CDummyDoc::OnSaveDocument(LPCTSTR lpszPathName) 34 | { 35 | lpszPathName; 36 | return TRUE; 37 | } 38 | 39 | BOOL CDummyDoc::DoSave(LPCTSTR lpszPathName, BOOL bReplace) 40 | { 41 | lpszPathName; bReplace; 42 | return FALSE; 43 | } 44 | 45 | BOOL CDummyDoc::DoFileSave() 46 | { 47 | return FALSE; 48 | } 49 | -------------------------------------------------------------------------------- /code/pkg_AppUI/Modules/FrameXtp/DummyDoc.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #pragma once 3 | 4 | class CDummyDoc : public CDocument 5 | { 6 | protected: // create from serialization only 7 | CDummyDoc(); 8 | DECLARE_DYNCREATE(CDummyDoc) 9 | 10 | // Overrides 11 | public: 12 | virtual BOOL OnNewDocument(); 13 | virtual BOOL OnOpenDocument(LPCTSTR lpszPathName); 14 | virtual BOOL OnSaveDocument(LPCTSTR lpszPathName); 15 | virtual BOOL DoSave(LPCTSTR lpszPathName, BOOL bReplace = TRUE); 16 | virtual BOOL DoFileSave(); 17 | 18 | // Implementation 19 | public: 20 | virtual ~CDummyDoc(); 21 | 22 | // Generated message map functions 23 | protected: 24 | DECLARE_MESSAGE_MAP() 25 | }; 26 | -------------------------------------------------------------------------------- /code/pkg_AppUI/Modules/FrameXtp/EmbedView.cpp: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #include "stdafx.h" 3 | #include "EmbedView.h" 4 | 5 | #ifdef _DEBUG 6 | #define new DEBUG_NEW 7 | #endif 8 | 9 | IMPLEMENT_DYNCREATE(CEmbedView, CView) 10 | 11 | BEGIN_MESSAGE_MAP(CEmbedView, CView) 12 | //{{AFX_MSG_MAP(CEmbedView) 13 | ON_WM_DESTROY() 14 | //}}AFX_MSG_MAP 15 | END_MESSAGE_MAP() 16 | 17 | CEmbedView::CEmbedView() 18 | { 19 | } 20 | 21 | CEmbedView::~CEmbedView() 22 | { 23 | } 24 | 25 | BOOL CEmbedView::PreCreateWindow(CREATESTRUCT& cs) 26 | { 27 | return CView::PreCreateWindow(cs); 28 | } 29 | 30 | void CEmbedView::OnInitialUpdate() 31 | { 32 | CView::OnInitialUpdate(); 33 | } 34 | 35 | void CEmbedView::OnDestroy() 36 | { 37 | CView::OnDestroy(); 38 | } 39 | -------------------------------------------------------------------------------- /code/pkg_AppUI/Modules/FrameXtp/EmbedView.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #pragma once 3 | 4 | class CEmbedView : public CView 5 | { 6 | protected: // create from serialization only 7 | CEmbedView(); 8 | DECLARE_DYNCREATE(CEmbedView) 9 | 10 | // Attributes 11 | public: 12 | 13 | // Operations 14 | public: 15 | 16 | // Overrides 17 | // ClassWizard generated virtual function overrides 18 | //{{AFX_VIRTUAL(CEmbedView) 19 | public: 20 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 21 | protected: 22 | virtual void OnInitialUpdate(); // called first time after construct 23 | virtual void OnDraw(CDC*) {}; 24 | //}}AFX_VIRTUAL 25 | 26 | // Implementation 27 | public: 28 | virtual ~CEmbedView(); 29 | 30 | // Generated message map functions 31 | protected: 32 | //{{AFX_MSG(CEmbedView) 33 | afx_msg void OnDestroy(); 34 | //}}AFX_MSG 35 | DECLARE_MESSAGE_MAP() 36 | }; 37 | -------------------------------------------------------------------------------- /code/pkg_AppUI/Modules/FrameXtp/FrameXtp.rc: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | #include 3 | LANGUAGE 0, 0 // LANG_NEUTRAL, SUBLANG_NEUTRAL 4 | #pragma code_page(1252) 5 | #include "Version.rc2" 6 | #endif 7 | -------------------------------------------------------------------------------- /code/pkg_AppUI/Modules/FrameXtp/MDIFrameWnd.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #pragma once 3 | 4 | #include "MainFrm.h" 5 | 6 | class CMainMDIFrame : public CXTPMDIFrameWnd, CMainFrame 7 | { 8 | public: 9 | DECLARE_DYNCREATE(CMainMDIFrame) 10 | CMainMDIFrame(); 11 | virtual ~CMainMDIFrame(); 12 | 13 | // Attributes 14 | public: 15 | 16 | // Operations 17 | public: 18 | BOOL LoadFrame(UINT nIDResource, DWORD dwDefaultStyle = WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, 19 | CWnd* pParentWnd = NULL, CCreateContext* pContext = NULL); 20 | 21 | // Overrides 22 | // ClassWizard generated virtual function overrides 23 | //{{AFX_VIRTUAL(CMainMDIFrame) 24 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 25 | virtual void OnSetPreviewMode(BOOL bPreview, CPrintPreviewState* pState); 26 | virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO*); 27 | //}}AFX_VIRTUAL 28 | 29 | // Implementation 30 | private: 31 | CXTPTabClientWnd m_wndClient; 32 | 33 | // Generated message map functions 34 | protected: 35 | //{{AFX_MSG(CMainMDIFrame) 36 | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 37 | afx_msg void OnClose(); 38 | //}}AFX_MSG 39 | afx_msg void OnUpdateRibbonTab(CCmdUI* pCmdUI); 40 | afx_msg void OnCustomize(); 41 | afx_msg void OnCustomizeQuickAccess(); 42 | int OnCreateControl(LPCREATECONTROLSTRUCT lpCreateControl); 43 | DECLARE_MESSAGE_MAP() 44 | }; 45 | -------------------------------------------------------------------------------- /code/pkg_AppUI/Modules/FrameXtp/Module.cpp: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #include "stdafx.h" 3 | #include 4 | #include 5 | #include 6 | 7 | #include "Cx_FrameWndFactory.h" 8 | 9 | XBEGIN_DEFINE_MODULE() 10 | XDEFINE_CLASSMAP_ENTRY(x3::CLSID_FrameWndFactory, Cx_FrameWndFactory) 11 | XEND_DEFINE_MODULE_MFCEXTDLL() 12 | 13 | CLocalResource::CLocalResource() 14 | { 15 | m_oldResource = AfxGetResourceHandle(); 16 | AfxSetResourceHandle(MFCExtDLL.hResource); 17 | } 18 | 19 | CLocalResource::~CLocalResource() 20 | { 21 | AfxSetResourceHandle(m_oldResource); 22 | } 23 | -------------------------------------------------------------------------------- /code/pkg_AppUI/Modules/FrameXtp/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by FrameXtp.rc 4 | // 5 | 6 | // Next default values for new objects 7 | // 8 | #ifdef APSTUDIO_INVOKED 9 | #ifndef APSTUDIO_READONLY_SYMBOLS 10 | 11 | #define _APS_NEXT_RESOURCE_VALUE 100 12 | #define _APS_NEXT_CONTROL_VALUE 1000 13 | #define _APS_NEXT_SYMED_VALUE 200 14 | #define _APS_NEXT_COMMAND_VALUE 32771 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /code/pkg_AppUI/Modules/FrameXtp/SDIFrameWnd.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #pragma once 3 | 4 | #include "MainFrm.h" 5 | 6 | class CMainSDIFrame : public CXTPFrameWnd, CMainFrame 7 | { 8 | public: 9 | DECLARE_DYNCREATE(CMainSDIFrame) 10 | CMainSDIFrame(); 11 | virtual ~CMainSDIFrame(); 12 | 13 | // Attributes 14 | public: 15 | 16 | // Operations 17 | public: 18 | BOOL LoadFrame(UINT nIDResource, DWORD dwDefaultStyle = WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, 19 | CWnd* pParentWnd = NULL, CCreateContext* pContext = NULL); 20 | 21 | // Overrides 22 | // ClassWizard generated virtual function overrides 23 | //{{AFX_VIRTUAL(CMainSDIFrame) 24 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 25 | virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO*); 26 | //}}AFX_VIRTUAL 27 | 28 | // Implementation 29 | private: 30 | 31 | // Generated message map functions 32 | protected: 33 | //{{AFX_MSG(CMainSDIFrame) 34 | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 35 | afx_msg void OnClose(); 36 | //}}AFX_MSG 37 | afx_msg void OnUpdateRibbonTab(CCmdUI* pCmdUI); 38 | afx_msg void OnCustomize(); 39 | afx_msg void OnCustomizeQuickAccess(); 40 | int OnCreateControl(LPCREATECONTROLSTRUCT lpCreateControl); 41 | DECLARE_MESSAGE_MAP() 42 | }; 43 | -------------------------------------------------------------------------------- /code/pkg_AppUI/Modules/FrameXtp/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /code/pkg_AppUI/Modules/FrameXtp/StdAfx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #define LOGHEAD L"@FrameXtp:" 5 | 6 | //#define _XTP_EXCLUDE_COMMON 7 | //#define _XTP_EXCLUDE_TABMANAGER 8 | #define _XTP_EXCLUDE_GRAPHICLIBRARY 9 | //#define _XTP_EXCLUDE_CONTROLS 10 | //#define _XTP_EXCLUDE_COMMANDBARS 11 | //#define _XTP_EXCLUDE_DOCKINGPANE 12 | #define _XTP_EXCLUDE_PROPERTYGRID 13 | #define _XTP_EXCLUDE_REPORTCONTROL 14 | #define _XTP_EXCLUDE_CALENDAR 15 | #define _XTP_EXCLUDE_TASKPANEL 16 | #define _XTP_EXCLUDE_SHORTCUTBAR 17 | #define _XTP_EXCLUDE_SKINFRAMEWORK 18 | //#define _XTP_EXCLUDE_RIBBON 19 | #define _XTP_EXCLUDE_SYNTAXEDIT 20 | #define _XTP_EXCLUDE_MARKUP 21 | #define _XTP_EXCLUDE_CHART 22 | #define _XTP_EXCLUDE_FLOWGRAPH 23 | #include // Xtreme Toolkit Pro components 24 | 25 | class CLocalResource 26 | { 27 | HINSTANCE m_oldResource; 28 | public: 29 | CLocalResource(); 30 | ~CLocalResource(); 31 | }; 32 | -------------------------------------------------------------------------------- /code/pkg_AppUI/Modules/FrameXtp/Version.rc2: -------------------------------------------------------------------------------- 1 | // Version.rc2 - resources Microsoft Visual C++ does not edit directly 2 | // 3 | // TODO: Change values of FILEVERSION and FileVersion 4 | // 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION 1,0,0,0 8 | FILEFLAGSMASK 0x3fL 9 | #ifdef _DEBUG 10 | FILEFLAGS 0x1L 11 | #else 12 | FILEFLAGS 0x0L 13 | #endif 14 | FILEOS 0x4L 15 | FILETYPE 0x2L 16 | FILESUBTYPE 0x0L 17 | BEGIN 18 | BLOCK "StringFileInfo" 19 | BEGIN 20 | BLOCK "000004b0" 21 | BEGIN 22 | VALUE "FileDescription", "UI FrameWnd Plugin using Xtreme Toolkit Pro.\0" 23 | VALUE "FileVersion", "1.0.0.0\0" 24 | VALUE "LegalCopyright", "(C) 2008-2011, X3 C++ PluginFramework\0" 25 | VALUE "OriginalFilename", "FrameXtp.plugin.dll\0" 26 | VALUE "ProductName", "X3 C++ PluginFramework\0" 27 | END 28 | END 29 | BLOCK "VarFileInfo" 30 | BEGIN 31 | VALUE "Translation", 0x0, 1200 32 | END 33 | END 34 | -------------------------------------------------------------------------------- /code/pkg_Core/Interface/ChangeObserver/Ix_ChangeObserver.h: -------------------------------------------------------------------------------- 1 | /*! \file Ix_ChangeObserver.h 2 | * \brief Define change observer interface: Ix_ChangeObserver 3 | * \author Zhang Yungui, X3 C++ PluginFramework 4 | * \date 2010.10.22 5 | */ 6 | #ifndef X3_OBSERVER_ICHANGEOBSERVER_H_ 7 | #define X3_OBSERVER_ICHANGEOBSERVER_H_ 8 | 9 | class ChangeNotifyData; 10 | 11 | //! Change observer interface 12 | /*! 13 | \interface Ix_ChangeObserver 14 | \ingroup _GROUP_CHANGE_OBSERVER_ 15 | */ 16 | class Ix_ChangeObserver 17 | { 18 | public: 19 | virtual ~Ix_ChangeObserver() {} 20 | 21 | //! Notification of a event. 22 | /*! 23 | \param data the event data, it is usually a local variable's address. 24 | */ 25 | virtual void Update(ChangeNotifyData* data) = 0; 26 | }; 27 | 28 | #endif // X3_OBSERVER_ICHANGEOBSERVER_H_ 29 | -------------------------------------------------------------------------------- /code/pkg_Core/Interface/Ix_ObjectFactory.h: -------------------------------------------------------------------------------- 1 | /*! \file Ix_ObjectFactory.h 2 | * \brief Define object creator interface: Ix_ObjectFactory 3 | * \author Zhang Yungui, X3 C++ PluginFramework 4 | * \date 2011.06.30 5 | */ 6 | #ifndef X3_CORE_IOBJECTFACTORY_H_ 7 | #define X3_CORE_IOBJECTFACTORY_H_ 8 | 9 | #include "Ix_Object.h" 10 | 11 | /*! \ingroup _GROUP_PLUGIN_CORE2_ 12 | * \interface Ix_ObjectFactory 13 | * \brief Object creator interface 14 | * \see Ix_Object, Ix_Module 15 | */ 16 | class Ix_ObjectFactory : public Ix_Object 17 | { 18 | public: 19 | X3DEFINE_IID(Ix_ObjectFactory) 20 | 21 | //! Check if the class is loaded. 22 | virtual bool IsCreatorRegister(const X3CLSID& clsid) = 0; 23 | 24 | //! Create an object with the class id. 25 | virtual int CreateObject(const X3CLSID& clsid, X3IID iid, Ix_Object** ppv, HMODULE fromdll) = 0; 26 | }; 27 | 28 | #endif // X3_CORE_IOBJECTFACTORY_H_ 29 | -------------------------------------------------------------------------------- /code/pkg_Core/Interface/Log/DebugR.h: -------------------------------------------------------------------------------- 1 | /*! \file DebugR.h 2 | * \brief Redefine ASSERT and VERIFY to show assert info in InterfaceRelease configure. 3 | * \author Zhang Yungui, X3 C++ PluginFramework 4 | * \date 2010.10.19 5 | */ 6 | #ifndef X3_LOG_DEBUGR_H_ 7 | #define X3_LOG_DEBUGR_H_ 8 | 9 | int x3CrtDbgReport(const char* file, long line, const char* msg); 10 | 11 | #if !defined(__MINGW_INTRIN_INLINE) 12 | #ifdef _WIN32 13 | #ifndef _MSC_VER 14 | inline void __debugbreak() {} 15 | #elif _MSC_VER <= 1200 // VC6 16 | #define __debugbreak DebugBreak 17 | #endif 18 | #else 19 | inline void __debugbreak() {} 20 | #endif 21 | #endif 22 | 23 | #undef ASSERT 24 | #undef VERIFY 25 | 26 | #define ASSERT(expr) \ 27 | (void) ((!!(expr)) || \ 28 | (1 != x3CrtDbgReport(__FILE__, __LINE__, #expr)) || \ 29 | (__debugbreak(), 0)) 30 | 31 | #define VERIFY ASSERT 32 | 33 | #define ASSERT_MESSAGE(expr, msg) \ 34 | (void) ((!!(expr)) || \ 35 | (1 != x3CrtDbgReport(__FILE__, __LINE__, msg)) || \ 36 | (__debugbreak(), 0)) 37 | 38 | #endif // X3_LOG_DEBUGR_H_ 39 | -------------------------------------------------------------------------------- /code/pkg_Core/Interface/Module/Cx_Module.h: -------------------------------------------------------------------------------- 1 | /*! \file Cx_Module.h 2 | * \brief Define the implement class of plugin module. (for internal use only) 3 | * \author Zhang Yungui, X3 C++ PluginFramework 4 | * \date 2010.10.19 5 | */ 6 | #ifndef X3_PLUGINIMPL_MODULE_H_ 7 | #define X3_PLUGINIMPL_MODULE_H_ 8 | 9 | #include "Ix_Module.h" 10 | 11 | /*! \ingroup _GROUP_PLUGIN_CORE2_ 12 | * \brief the implement class of plugin module. 13 | * \note Each plugin has a object of this class. The object is defined in XModuleImpl.h . 14 | * \internal 15 | */ 16 | class Cx_Module : public Ix_Module 17 | { 18 | public: 19 | Cx_Module(); 20 | virtual ~Cx_Module(); 21 | 22 | //! Initialize this plugin. Used by x3GetModuleInterface(). 23 | void Initialize(Ix_ObjectFactory* pFactory, HMODULE hModule); 24 | 25 | public: 26 | void ClearModuleItems(); 27 | long GetUnfreeObjectCount(); 28 | Ix_ObjectFactory* GetObjectFactory() const; 29 | HMODULE GetModuleInstance() const { return m_hModule; } 30 | HMODULE GetModuleResourceHandle() const { return m_hResource; } 31 | HMODULE SetModuleResourceHandle(HMODULE hResource); 32 | 33 | private: 34 | mutable Ix_ObjectFactory* m_pFactory; 35 | HMODULE m_hModule; 36 | HMODULE m_hResource; 37 | }; 38 | 39 | #endif // X3_PLUGINIMPL_MODULE_H_ 40 | -------------------------------------------------------------------------------- /code/pkg_Core/Interface/PluginManager/Ix_PluginDelayLoad.h: -------------------------------------------------------------------------------- 1 | /*! \file Ix_PluginDelayLoad.h 2 | * \brief Define plugin delay-loading interface: Ix_PluginDelayLoad 3 | * \author Zhang Yungui, X3 C++ PluginFramework 4 | * \date 2011.02.08 5 | */ 6 | #ifndef X3_MANAGER_IPLUGINDELAYLOAD_H_ 7 | #define X3_MANAGER_IPLUGINDELAYLOAD_H_ 8 | 9 | #include "Ix_Object.h" 10 | 11 | X3CLSID_DEFINE(CLSID_PluginDelayLoad, "8f2a7b90-8134-4e16-9830-861df9b7f42a"); 12 | 13 | /*! \ingroup _GROUP_PLUGIN_CORE2_ 14 | * \interface Ix_PluginDelayLoad 15 | * \brief Plugin delay-loading interface. 16 | * \see x3::CLSID_PluginDelayLoad 17 | */ 18 | class Ix_PluginDelayLoad : public Ix_Object 19 | { 20 | public: 21 | X3DEFINE_IID(Ix_PluginDelayLoad) 22 | 23 | //! Register a plugin as observer owner. 24 | virtual void AddObserverPlugin(HMODULE hdll, const char* obtype, const wchar_t* subtype = L"") = 0; 25 | 26 | //! Load observer plugins when the event is first fired. 27 | virtual void FireFirstEvent(const char* obtype, const wchar_t* subtype = L"") = 0; 28 | 29 | //! Load plugin immediately which is marked as delay-loading. 30 | /*! 31 | \param filename plugin filename regardless folder. 32 | \return true if the plugin is loaded. 33 | */ 34 | virtual bool LoadDelayedPlugin(const std::wstring& filename) = 0; 35 | }; 36 | 37 | #endif // X3_MANAGER_IPLUGINDELAYLOAD_H_ 38 | -------------------------------------------------------------------------------- /code/pkg_Core/Interface/PluginManager/Ix_PluginLoader2.h: -------------------------------------------------------------------------------- 1 | /*! \file Ix_PluginLoader2.h 2 | * \brief Define plugin loading interface: Ix_PluginLoader2 3 | * \author Zhang Yungui, X3 C++ PluginFramework 4 | * \date 2011.06.30 5 | */ 6 | #ifndef X3_MANAGER_IPLUGINLOADER2_H_ 7 | #define X3_MANAGER_IPLUGINLOADER2_H_ 8 | 9 | #include "Ix_ObjectFactory.h" 10 | 11 | /*! \ingroup _GROUP_PLUGIN_CORE2_ 12 | * \interface Ix_PluginLoader2 13 | * \brief Plugin loading interface 14 | * \see Ix_PluginLoader, Ix_ObjectFactory, x3GetObjectFactory() 15 | */ 16 | class Ix_PluginLoader2 : public Ix_Object 17 | { 18 | public: 19 | X3DEFINE_IID(Ix_PluginLoader2) 20 | 21 | virtual long GetPluginCount() = 0; 22 | virtual bool GetPluginFileName(long index, HMODULE& hdll, std::wstring& filename) = 0; 23 | }; 24 | 25 | #endif // X3_MANAGER_IPLUGINLOADER2_H_ 26 | -------------------------------------------------------------------------------- /code/pkg_Core/Interface/Portability/obsolete.h: -------------------------------------------------------------------------------- 1 | #ifndef _X3_OBSOLETE_H 2 | #define _X3_OBSOLETE_H 3 | 4 | #include 5 | #include 6 | 7 | #define XCLSID X3CLSID 8 | #define CAutoLogGroup X3LogGroup 9 | #define CLogObserverImpl Cx_LogObserverImpl 10 | 11 | #define kLogType x3LogType 12 | #define kLogType_Info x3LogType_Info 13 | #define kLogType_Warning x3LogType_Warning 14 | #define kLogType_Error x3LogType_Error 15 | 16 | #define LOG_DEBUG X3LOG_DEBUG 17 | #define LOG_DEBUG2 X3LOG_DEBUG2 18 | #define LOG_INFO X3LOG_INFO 19 | #define LOG_INFO2 X3LOG_INFO2 20 | #define LOG_WARNING X3LOG_WARNING 21 | #define LOG_WARNING2 X3LOG_WARNING2 22 | #define LOG_ERROR X3LOG_ERROR 23 | #define LOG_ERROR2 X3LOG_ERROR2 24 | #define LOG_FATAL X3LOG_FATAL 25 | #define LOG_FATAL2 X3LOG_FATAL2 26 | #define X3LogGroup X3LogGroup 27 | 28 | #define CConfigIOSection Cx_ConfigSection 29 | #define CConfigTransaction Cx_ConfigTransaction 30 | 31 | using namespace x3; 32 | 33 | #endif // _X3_OBSOLETE_H 34 | -------------------------------------------------------------------------------- /code/pkg_Core/Interface/Portability/portimpl.h: -------------------------------------------------------------------------------- 1 | // Implement portability functions. 2 | // This file has included by XModuleImpl.h and XComCreator.h 3 | 4 | #ifndef X3_PORTABILITY_IMPL_H 5 | #define X3_PORTABILITY_IMPL_H 6 | 7 | #if defined (_WIN32) 8 | #include "win32impl.h" 9 | #else 10 | #include "pathstr.h" 11 | #if defined (__linux__) 12 | #include "linuximpl.h" 13 | #elif defined (__APPLE__) 14 | #include "macimpl.h" 15 | #endif 16 | #endif // _WIN32 17 | 18 | #endif // X3_PORTABILITY_IMPL_H 19 | -------------------------------------------------------------------------------- /code/pkg_Core/Interface/UtilFunc/LockCount.h: -------------------------------------------------------------------------------- 1 | /*! \file LockCount.h 2 | * \brief Define helper class to auto increment and decrement: CLockCount 3 | * \author Zhang Yungui, X3 C++ PluginFramework 4 | * \date 2010.5.19 5 | */ 6 | #ifndef UTILFUNC_LOCKCOUNT_H_ 7 | #define UTILFUNC_LOCKCOUNT_H_ 8 | 9 | //! Helper class to auto increment and decrement. 10 | /*! Use this to declare local variable in functions, 11 | then counter will be auto decreased (--counter;) when leave from the function. 12 | So you can check the counter with initial value to known some status. 13 | \ingroup _GROUP_UTILFUNC 14 | */ 15 | class CLockCount 16 | { 17 | public: 18 | //! Auto add counter. 19 | /*! 20 | \param p address of counter, the initial value of counter is usually zero. 21 | */ 22 | CLockCount(long* p) : m_count(p) 23 | { 24 | InterlockedIncrement(m_count); 25 | } 26 | 27 | //! Auto decrease counter. 28 | ~CLockCount() 29 | { 30 | Unlock(); 31 | } 32 | 33 | //! Auto decrease counter. 34 | void Unlock() 35 | { 36 | if (m_count) 37 | { 38 | InterlockedDecrement(m_count); 39 | m_count = NULL; 40 | } 41 | } 42 | 43 | private: 44 | CLockCount(const CLockCount&); 45 | void operator=(const CLockCount&); 46 | 47 | long* m_count; 48 | }; 49 | 50 | #endif // UTILFUNC_LOCKCOUNT_H_ 51 | -------------------------------------------------------------------------------- /code/pkg_Core/Interface/UtilFunc/LockSyn.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Core/Interface/UtilFunc/LockSyn.h -------------------------------------------------------------------------------- /code/pkg_Core/Interface/UtilFunc/PluginInc.h: -------------------------------------------------------------------------------- 1 | /*! \file PluginInc.h 2 | * \brief Include frequently-used files for plugin project. 3 | * \author Zhang Yungui, X3 C++ PluginFramework 4 | * \date 2011.06.30 5 | */ 6 | #ifndef X3PLUGIN_INC_H 7 | #define X3PLUGIN_INC_H 8 | 9 | #include 10 | 11 | #ifndef NO_VECFUNC 12 | #include // STL master include file and functions 13 | #endif 14 | #ifndef NO_SAFECALL 15 | #include // SafeCall and InterfaceSafeCall 16 | #endif 17 | #ifndef NO_DEBUGR 18 | #include // ASSERT, VERIFY and ASSERT_MESSAGE 19 | #endif 20 | #ifndef NO_LOGHELPER 21 | #include // X3LOG_WARNING, X3LogGroup ... 22 | #endif 23 | #ifndef NO_CLASSMACRO 24 | #include // X3BEGIN_CLASS_DECLARE 25 | #endif 26 | 27 | #endif // X3PLUGIN_INC_H -------------------------------------------------------------------------------- /code/pkg_Core/Interface/UtilFunc/ReadInts.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Core/Interface/UtilFunc/ReadInts.h -------------------------------------------------------------------------------- /code/pkg_Core/Interface/UtilFunc/RoundStr.h: -------------------------------------------------------------------------------- 1 | //! \file RoundStr.h 2 | //! \brief Define the function converting and round float-pointing number to string: RoundStr 3 | 4 | #ifndef UTILFUNC_ROUNDSTR_H_ 5 | #define UTILFUNC_ROUNDSTR_H_ 6 | 7 | #include 8 | 9 | namespace x3 { 10 | 11 | //! Returns a numeric string, rounded to the specified precision. 12 | /*! 13 | \ingroup _GROUP_UTILFUNC 14 | \param value float-pointing number to be rounded. 15 | \param decimal a positive number thar value is rounded to the number of decimal places. 16 | \return a numeric string whose zero digits ('0') after number point will be removed. 17 | */ 18 | inline std::wstring RoundStr(double value, int decimal = 4) 19 | { 20 | wchar_t buf[65] = { 0 }; 21 | 22 | wchar_t fmt[] = L"%.2lf"; 23 | if (decimal < 1) decimal = 1; 24 | if (decimal > 5) decimal = 5; 25 | fmt[2] = (wchar_t)(L'0' + decimal); 26 | swprintf_s(buf, 65, fmt, value); 27 | 28 | wchar_t* p = wcschr(buf, L'.'); 29 | if (p != NULL) 30 | { 31 | int i = decimal; 32 | for (; i > 0 && p[i] == L'0'; i--) 33 | p[i] = 0; 34 | if (p[i] == L'.') 35 | p[i] = 0; 36 | } 37 | 38 | return buf; 39 | } 40 | 41 | } // x3 42 | #endif // UTILFUNC_ROUNDSTR_H_ 43 | -------------------------------------------------------------------------------- /code/pkg_Core/Interface/UtilFunc/SysErrStr.h: -------------------------------------------------------------------------------- 1 | //! \file SysErrStr.h 2 | //! \brief Define a function to obtains error message strings: GetSystemErrorString. 3 | 4 | #ifndef UTILFUNC_SYSERRSTR_H_ 5 | #define UTILFUNC_SYSERRSTR_H_ 6 | 7 | #include 8 | 9 | namespace x3 { 10 | 11 | //! Obtains error message strings for a error code. 12 | /*! 13 | \ingroup _GROUP_UTILFUNC 14 | \param errorcode the error code returned by GetLastError or HRESULT value. 15 | \return error message strings. 16 | */ 17 | inline std::wstring GetSystemErrorString(unsigned long errorcode) 18 | { 19 | std::wstring retstr; 20 | wchar_t buf[21] = { 0 }; 21 | 22 | if (errorcode != 0) 23 | { 24 | #ifdef FormatMessage 25 | wchar_t* p = NULL; 26 | 27 | ::FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, 28 | NULL, errorcode, 29 | MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 30 | (wchar_t*)&p, 0, NULL); 31 | 32 | if (p != NULL) 33 | { 34 | retstr = p; 35 | ::LocalFree((HLOCAL)p); 36 | } 37 | #endif 38 | 39 | // define _NEED_STDIO before include PluginInc.h for vc6 or gcc. 40 | swprintf_s(buf, _countof(buf), L"[0x%x]", errorcode); 41 | retstr = buf + retstr; 42 | } 43 | 44 | return retstr; 45 | } 46 | 47 | } // x3 48 | #endif // UTILFUNC_SYSERRSTR_H_ 49 | -------------------------------------------------------------------------------- /code/pkg_Core/Interface/UtilFunc/X3Portability.h: -------------------------------------------------------------------------------- 1 | //! \file X3Portability.h 2 | //! \brief Declare portability functions. 3 | 4 | #ifndef X3C_PORTABILITY_H 5 | #define X3C_PORTABILITY_H 6 | 7 | #if defined(_WIN32) 8 | #include "../Portability/x3win.h" 9 | #else 10 | #include "../Portability/x3unix.h" 11 | #endif // _WIN32 12 | 13 | #ifndef NOSTDIO 14 | #include 15 | #include 16 | #ifndef _STDIO_DEFINED 17 | #define _STDIO_DEFINED 18 | #endif 19 | #endif 20 | 21 | #if !defined(_MSC_VER) || _MSC_VER < 1400 // not VC8 22 | #include "func_s.h" 23 | #endif 24 | 25 | #endif // X3C_PORTABILITY_H 26 | -------------------------------------------------------------------------------- /code/pkg_Core/Interface/Utility/ClsID_TextUtil.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | /*! \file ClsID_TextUtil.h 3 | * \brief Define text utility class id. 4 | */ 5 | #ifndef X3_CLS_TEXTUTIL_H_ 6 | #define X3_CLS_TEXTUTIL_H_ 7 | 8 | #include 9 | 10 | //! Text utility class id. 11 | X3CLSID_DEFINE(CLSID_TextUtil, "c1638294-2a0f-402a-96ea-174512ee982c"); 12 | 13 | #endif // X3_CLS_TEXTUTIL_H_ 14 | -------------------------------------------------------------------------------- /code/pkg_Core/Interface/Utility/Ix_ClipboardUtil.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Core/Interface/Utility/Ix_ClipboardUtil.h -------------------------------------------------------------------------------- /code/pkg_Core/Interface/Utility/Ix_FileTransaction.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Core/Interface/Utility/Ix_FileTransaction.h -------------------------------------------------------------------------------- /code/pkg_Core/Interface/Utility/Ix_FileUtility.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Core/Interface/Utility/Ix_FileUtility.h -------------------------------------------------------------------------------- /code/pkg_Core/Interface/Utility/Ix_FileVersion.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Core/Interface/Utility/Ix_FileVersion.h -------------------------------------------------------------------------------- /code/pkg_Core/Interface/Utility/Ix_StringConvert.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Core/Interface/Utility/Ix_StringConvert.h -------------------------------------------------------------------------------- /code/pkg_Core/Interface/Utility/Ix_TempFolder.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Core/Interface/Utility/Ix_TempFolder.h -------------------------------------------------------------------------------- /code/pkg_Core/Interface/Utility/Ix_TextFileUtil.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Core/Interface/Utility/Ix_TextFileUtil.h -------------------------------------------------------------------------------- /code/pkg_Core/Interface/Xml/IFileCryptHandler.h: -------------------------------------------------------------------------------- 1 | /*! \file IFileCryptHandler.h 2 | * \brief Define interface of file encryption and decryption: IFileCryptHandler 3 | * \author Zhang Yungui, X3 C++ PluginFramework 4 | * \date 2010.10.22 5 | */ 6 | #ifndef X3_IFILECRYPTHANDLER_H_ 7 | #define X3_IFILECRYPTHANDLER_H_ 8 | 9 | //! Interface of file encryption and decryption. 10 | class IFileCryptHandler 11 | { 12 | public: 13 | virtual ~IFileCryptHandler() {} 14 | 15 | //! Read decrypted content from a file encrypted. 16 | /*! 17 | \param[in] filename full filename of the file encrypted. 18 | \param[out] buffer the decrypted content readed, need free using FreeBuffer. 19 | \return 0 to indicate success. 20 | */ 21 | virtual int Decrypt(const wchar_t* filename, wchar_t** buffer) = 0; 22 | 23 | //! Free buffer returned by Decrypt. 24 | virtual void FreeBuffer(wchar_t* buffer) = 0; 25 | 26 | //! Enrypt a file. 27 | /*! Reads content from srcfile, encrypt the content, then save to destfile. 28 | \param srcfile full filename of the source file whose content is decrypted. 29 | \param destfile full filename of the target file encrypted. 30 | \return 0 to indicate success. 31 | */ 32 | virtual int CryptFile(const wchar_t* srcfile, const wchar_t* destfile) = 0; 33 | }; 34 | 35 | #endif // X3_IFILECRYPTHANDLER_H_ 36 | -------------------------------------------------------------------------------- /code/pkg_Core/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | 3 | ROOTDIR = ../.. 4 | include $(ROOTDIR)/config.mk 5 | 6 | SUBDIRS = $(filter-out Interface/, $(sort $(dir $(wildcard */)))) 7 | CLEANSUBDIRS = $(addsuffix .clean, $(SUBDIRS)) 8 | 9 | .PHONY: Modules 10 | 11 | Modules: 12 | @echo 13 | -@mkdir -p ../bin/plugins 14 | @echo Making all in subdirectory $@... 15 | $(MAKE) -C Modules 16 | 17 | clean: $(CLEANSUBDIRS) 18 | 19 | $(CLEANSUBDIRS): 20 | @cd $(basename $@) ; $(MAKE) clean 21 | 22 | 23 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/ChangeManager/ChangeManager.rc: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | #include 3 | LANGUAGE 0, 0 // LANG_NEUTRAL, SUBLANG_NEUTRAL 4 | #pragma code_page(1252) 5 | #include "Version.rc2" 6 | #endif 7 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/ChangeManager/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../../../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Core/Interface 5 | 6 | ChangeObserver: 7 | $(CC) $(CFLAGS_SO) -c Cx_ChangeManager.cpp 8 | $(CC) $(CFLAGS_SO) -c Module.cpp 9 | $(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libChangeManager.so *.o 10 | clean: 11 | rm -rf ChangeObserver 12 | rm -rf *.so 13 | rm -rf *.o 14 | 15 | 16 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/ChangeManager/Module.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "Cx_ChangeManager.h" 6 | 7 | XBEGIN_DEFINE_MODULE() 8 | XDEFINE_CLASSMAP_ENTRY_Singleton(x3::CLSID_ChangeManager, Cx_ChangeManager) 9 | XEND_DEFINE_MODULE_DLL() 10 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/ChangeManager/Version.rc2: -------------------------------------------------------------------------------- 1 | // Version.rc2 - resources Microsoft Visual C++ does not edit directly 2 | // 3 | // TODO: Change values of FILEVERSION and FileVersion 4 | // 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION 1,1,3,0 8 | FILEFLAGSMASK 0x3fL 9 | #ifdef _DEBUG 10 | FILEFLAGS 0x1L 11 | #else 12 | FILEFLAGS 0x0L 13 | #endif 14 | FILEOS 0x4L 15 | FILETYPE 0x2L 16 | FILESUBTYPE 0x0L 17 | BEGIN 18 | BLOCK "StringFileInfo" 19 | BEGIN 20 | BLOCK "000004b0" 21 | BEGIN 22 | VALUE "FileDescription", "Change Observer Manager Plugin\0" 23 | VALUE "FileVersion", "1.1.3.0\0" 24 | VALUE "LegalCopyright", "(C) 2008-2011, X3 C++ PluginFramework\0" 25 | VALUE "OriginalFilename", "ChangeManager.plugin.dll\0" 26 | VALUE "ProductName", "X3 C++ PluginFramework\0" 27 | END 28 | END 29 | BLOCK "VarFileInfo" 30 | BEGIN 31 | VALUE "Translation", 0x0, 1200 32 | END 33 | END 34 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/ConfigXml/ConfigXml.rc: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | #include 3 | LANGUAGE 0, 0 // LANG_NEUTRAL, SUBLANG_NEUTRAL 4 | #pragma code_page(1252) 5 | #include "Version.rc2" 6 | #endif 7 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/ConfigXml/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../../../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Core/Interface 5 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Core/Modules/ConfigXml 6 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Core/Modules/TinyXml 7 | 8 | all: 9 | $(CC) $(CFLAGS_SO) -c Cx_ConfigXml.cpp 10 | $(CC) $(CFLAGS_SO) -c Cx_XmlSection.cpp 11 | $(CC) $(CFLAGS_SO) -c Module.cpp 12 | $(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libConfigXml.so *.o $(LIBS) 13 | clean: 14 | rm -rf *.so 15 | rm -rf *.o 16 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/ConfigXml/Module.cpp: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #include 3 | #include 4 | #include 5 | 6 | #include "Cx_ConfigXml.h" 7 | #include "Cx_XmlSection.h" 8 | 9 | #ifdef _XMLDOM_HELPERS_H 10 | #include "XmlUtil/XmlUtil.cpp" 11 | #else 12 | #include "TinyXml/XmlUtil.cpp" 13 | #endif 14 | 15 | XBEGIN_DEFINE_MODULE() 16 | XDEFINE_CLASSMAP_ENTRY(x3::CLSID_ConfigXmlFile, Cx_ConfigXml) 17 | XDEFINE_CLASSMAP_ENTRY(CLSID_XmlSection, Cx_XmlSection) 18 | XEND_DEFINE_MODULE_DLL() 19 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/ConfigXml/TinyXml/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | @echo 3 | clean: 4 | rm -rf *.o 5 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/ConfigXml/TinyXml/XmlUtil.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Core/Modules/ConfigXml/TinyXml/XmlUtil.h -------------------------------------------------------------------------------- /code/pkg_Core/Modules/ConfigXml/TinyXml/tinystr.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Core/Modules/ConfigXml/TinyXml/tinystr.cpp -------------------------------------------------------------------------------- /code/pkg_Core/Modules/ConfigXml/Version.rc2: -------------------------------------------------------------------------------- 1 | // Version.rc2 - resources Microsoft Visual C++ does not edit directly 2 | // 3 | // TODO: Change values of FILEVERSION and FileVersion 4 | // 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION 1,1,4,0 8 | FILEFLAGSMASK 0x3fL 9 | #ifdef _DEBUG 10 | FILEFLAGS 0x1L 11 | #else 12 | FILEFLAGS 0x0L 13 | #endif 14 | FILEOS 0x4L 15 | FILETYPE 0x2L 16 | FILESUBTYPE 0x0L 17 | BEGIN 18 | BLOCK "StringFileInfo" 19 | BEGIN 20 | BLOCK "000004b0" 21 | BEGIN 22 | VALUE "FileDescription", "Xml IO Wrapper Plugin\0" 23 | VALUE "FileVersion", "1.1.4.0\0" 24 | VALUE "LegalCopyright", "(C) 2008-2011, X3 C++ PluginFramework\0" 25 | VALUE "OriginalFilename", "ConfigXml.plugin.dll\0" 26 | VALUE "ProductName", "X3 C++ PluginFramework\0" 27 | END 28 | END 29 | BLOCK "VarFileInfo" 30 | BEGIN 31 | VALUE "Translation", 0x0, 1200 32 | END 33 | END 34 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/ConfigXml/XmlUtil/XmlUtil.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Core/Modules/ConfigXml/XmlUtil/XmlUtil.h -------------------------------------------------------------------------------- /code/pkg_Core/Modules/FileUtility/Cx_FileTransaction.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #ifndef _X3_UTILITY_FILETRANSACTION_H 3 | #define _X3_UTILITY_FILETRANSACTION_H 4 | 5 | #include 6 | 7 | class Cx_FileTransaction : public Ix_FileTransaction 8 | { 9 | X3BEGIN_CLASS_DECLARE(Cx_FileTransaction) 10 | X3DEFINE_INTERFACE_ENTRY(Ix_FileTransaction) 11 | X3END_CLASS_DECLARE() 12 | protected: 13 | Cx_FileTransaction(); 14 | virtual ~Cx_FileTransaction(); 15 | 16 | private: 17 | // From Ix_FileTransaction 18 | virtual void Rollback(); 19 | virtual long GetLevel() const; 20 | virtual bool IsRollbacking() const; 21 | virtual bool DeletePathFile(const wchar_t* pszFileName, bool bRecycle = false); 22 | 23 | private: 24 | long m_lLevel; 25 | }; 26 | 27 | #endif // _X3_UTILITY_FILETRANSACTION_H 28 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/FileUtility/Cx_FileUtility.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Core/Modules/FileUtility/Cx_FileUtility.cpp -------------------------------------------------------------------------------- /code/pkg_Core/Modules/FileUtility/Cx_TempFolder.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #ifndef _X3_UTILITY_TEMPFOLDER_H 3 | #define _X3_UTILITY_TEMPFOLDER_H 4 | 5 | #include 6 | 7 | class Cx_TempFolder : public Ix_TempFolder 8 | { 9 | X3BEGIN_CLASS_DECLARE(Cx_TempFolder) 10 | X3DEFINE_INTERFACE_ENTRY(Ix_TempFolder) 11 | X3END_CLASS_DECLARE() 12 | protected: 13 | Cx_TempFolder(); 14 | virtual ~Cx_TempFolder(); 15 | 16 | private: 17 | // From Ix_TempFolder 18 | virtual void SetRootPath(const std::wstring& wstrPath); 19 | virtual bool DeleteFolder(); 20 | virtual std::wstring CreateFolder(const std::wstring& wstrPrefix); 21 | virtual std::wstring GetPath() const; 22 | virtual std::wstring CreateFileName(const std::wstring& wstrPrefix, 23 | const std::wstring& wstrExtName); 24 | 25 | private: 26 | std::wstring m_wstrPath; 27 | std::wstring m_wstrRootPath; 28 | static std::vector c_arrToDel; 29 | }; 30 | 31 | #endif // _X3_UTILITY_TEMPFOLDER_H 32 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/FileUtility/FileUtility.rc: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | #include 3 | LANGUAGE 0, 0 // LANG_NEUTRAL, SUBLANG_NEUTRAL 4 | #pragma code_page(1252) 5 | #include "Version.rc2" 6 | #endif 7 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/FileUtility/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../../../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Core/Interface 5 | 6 | 7 | all: 8 | $(CC) $(CFLAGS_SO) -c Cx_FileTransaction.cpp 9 | $(CC) $(CFLAGS_SO) -c Cx_FileUtility.cpp 10 | $(CC) $(CFLAGS_SO) -c Cx_TempFolder.cpp 11 | $(CC) $(CFLAGS_SO) -c Module.cpp 12 | $(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libFileUtility.so *.o $(LIBS) 13 | clean: 14 | rm -rf *.so 15 | rm -rf *.o 16 | 17 | 18 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/FileUtility/Module.cpp: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #include 3 | #include 4 | #include 5 | 6 | #include "Cx_FileUtility.h" 7 | #include "Cx_FileTransaction.h" 8 | #include "Cx_TempFolder.h" 9 | 10 | XBEGIN_DEFINE_MODULE() 11 | XDEFINE_CLASSMAP_ENTRY_Singleton(x3::CLSID_FileUtility, Cx_FileUtility) 12 | XDEFINE_CLASSMAP_ENTRY(x3::CLSID_FileTransaction, Cx_FileTransaction) 13 | XDEFINE_CLASSMAP_ENTRY(x3::CLSID_TempFolder, Cx_TempFolder) 14 | XEND_DEFINE_MODULE_DLL() 15 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/FileUtility/Version.rc2: -------------------------------------------------------------------------------- 1 | // Version.rc2 - resources Microsoft Visual C++ does not edit directly 2 | // 3 | // TODO: Change values of FILEVERSION and FileVersion 4 | // 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION 1,1,3,0 8 | FILEFLAGSMASK 0x3fL 9 | #ifdef _DEBUG 10 | FILEFLAGS 0x1L 11 | #else 12 | FILEFLAGS 0x0L 13 | #endif 14 | FILEOS 0x4L 15 | FILETYPE 0x2L 16 | FILESUBTYPE 0x0L 17 | BEGIN 18 | BLOCK "StringFileInfo" 19 | BEGIN 20 | BLOCK "000004b0" 21 | BEGIN 22 | VALUE "FileDescription", "File Utility Plugin\0" 23 | VALUE "FileVersion", "1.1.3.0\0" 24 | VALUE "LegalCopyright", "(C) 2008-2011, X3 C++ PluginFramework\0" 25 | VALUE "OriginalFilename", "FileUtility.plugin.dll\0" 26 | VALUE "ProductName", "X3 C++ PluginFramework\0" 27 | END 28 | END 29 | BLOCK "VarFileInfo" 30 | BEGIN 31 | VALUE "Translation", 0x0, 1200 32 | END 33 | END 34 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/LogManager/ClsID_LogManager.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #ifndef _X3_CLS_LOGMANAGER_H 3 | #define _X3_CLS_LOGMANAGER_H 4 | 5 | X3CLSID_DEFINE(CLSID_LogManager, "bbf48a97-9aef-4368-9dc0-2d2937c326ec"); 6 | 7 | #endif // _X3_CLS_LOGMANAGER_H 8 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/LogManager/Cx_LogManager.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #ifndef _X3_CORE_LOGMANAGER_H 3 | #define _X3_CORE_LOGMANAGER_H 4 | 5 | #include 6 | 7 | class Cx_LogManager 8 | : public Ix_LogManager 9 | { 10 | X3BEGIN_CLASS_DECLARE(Cx_LogManager) 11 | X3DEFINE_INTERFACE_ENTRY(Ix_LogManager) 12 | X3END_CLASS_DECLARE() 13 | protected: 14 | Cx_LogManager(); 15 | virtual ~Cx_LogManager(); 16 | 17 | private: 18 | virtual bool RegisterObserver(Ix_LogObserver* observer, HMODULE fromdll); 19 | virtual void UnRegisterObserver(Ix_LogObserver* observer); 20 | virtual bool PushGroup(const wchar_t* msg, const wchar_t* extra, 21 | const char* file, long line); 22 | virtual bool PopGroup(); 23 | virtual bool WriteLog(x3LogType type, const wchar_t* msg, 24 | const wchar_t* extra, const char* file, long line); 25 | virtual bool WriteLog(x3LogType type, const char* msg, 26 | const char* extra, const char* file, long line); 27 | virtual int CrtDbgReport(const char* msg, const char* file, long line); 28 | 29 | private: 30 | const char* TrimFileName(const char* file); 31 | bool CheckMsgParam(std::wstring& msg2, std::wstring& extra2, 32 | std::wstring& module, std::wstring& idname, 33 | const wchar_t* msg, const wchar_t* extra); 34 | void FireFirstEvent(); 35 | 36 | private: 37 | typedef std::pair ITEM; 38 | typedef std::vector::iterator ObserverIt; 39 | std::vector m_observers; 40 | long m_groupLevel; 41 | long m_loglock; 42 | }; 43 | 44 | #endif // _X3_CORE_LOGMANAGER_H 45 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/LogManager/LogManager.rc: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | #include 3 | LANGUAGE 0, 0 // LANG_NEUTRAL, SUBLANG_NEUTRAL 4 | #pragma code_page(1252) 5 | #include "Version.rc2" 6 | #endif 7 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/LogManager/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../../../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Core/Interface 5 | 6 | 7 | all: 8 | $(CC) $(CFLAGS_SO) -c Cx_LogManager.cpp 9 | $(CC) $(CFLAGS_SO) -c Module.cpp 10 | $(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libLogManager.so *.o 11 | clean: 12 | rm -rf *.so 13 | rm -rf *.o 14 | 15 | 16 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/LogManager/Module.cpp: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #include 3 | #include 4 | #include 5 | 6 | #include "Cx_LogManager.h" 7 | 8 | XBEGIN_DEFINE_MODULE() 9 | XDEFINE_CLASSMAP_ENTRY_Singleton(x3::CLSID_LogManager, Cx_LogManager) 10 | XEND_DEFINE_MODULE_DLL() 11 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/LogManager/Version.rc2: -------------------------------------------------------------------------------- 1 | // Version.rc2 - resources Microsoft Visual C++ does not edit directly 2 | // 3 | // TODO: Change values of FILEVERSION and FileVersion 4 | // 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION 1,1,3,0 8 | FILEFLAGSMASK 0x3fL 9 | #ifdef _DEBUG 10 | FILEFLAGS 0x1L 11 | #else 12 | FILEFLAGS 0x0L 13 | #endif 14 | FILEOS 0x4L 15 | FILETYPE 0x2L 16 | FILESUBTYPE 0x0L 17 | BEGIN 18 | BLOCK "StringFileInfo" 19 | BEGIN 20 | BLOCK "000004b0" 21 | BEGIN 22 | VALUE "FileDescription", "Logging Observer Manager Plugin\0" 23 | VALUE "FileVersion", "1.1.3.0\0" 24 | VALUE "LegalCopyright", "(C) 2008-2011, X3 C++ PluginFramework\0" 25 | VALUE "OriginalFilename", "LogManager.plugin.dll\0" 26 | VALUE "ProductName", "X3 C++ PluginFramework\0" 27 | END 28 | END 29 | BLOCK "VarFileInfo" 30 | BEGIN 31 | VALUE "Translation", 0x0, 1200 32 | END 33 | END 34 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/LogWriter/LogObserver.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #ifndef _X3_LOGWRITER_LOGOBSERVER_H 3 | #define _X3_LOGWRITER_LOGOBSERVER_H 4 | 5 | #include 6 | 7 | #include 8 | using namespace log4cplus; 9 | 10 | class CLogObserver : public Cx_LogObserverImpl 11 | { 12 | public: 13 | CLogObserver(); 14 | virtual ~CLogObserver(); 15 | 16 | protected: 17 | virtual void OnPushGroup(long level, 18 | const std::wstring& msg, const std::wstring& extra, 19 | const std::wstring& module, const std::wstring& idname, 20 | const char* file, long line); 21 | virtual void OnPopGroup(long level); 22 | virtual void OnWriteLog(int type, 23 | const std::wstring& msg, const std::wstring& extra, 24 | const std::wstring& module, const std::wstring& idname, 25 | const char* file, long line); 26 | 27 | private: 28 | Logger GetLogger(); 29 | void InitLogFile(); 30 | void MakerInitVars(); 31 | void WritePropFile(const wchar_t* filename); 32 | bool GetServerPath(wchar_t* path); 33 | bool CopyLogFilesToServer(); 34 | const char* TrimFileName(const char* file); 35 | 36 | private: 37 | std::wstring m_path; // logging path ending with backslash. 38 | std::wstring m_appname; // application name for logging. 39 | bool m_inited; // logging file is setted or not. 40 | long m_level; // group level of current group. 41 | int m_haserr; // see OnWriteLog 42 | long m_copyflags; // flags for CopyLogFilesToServer 43 | }; 44 | 45 | #endif // _X3_LOGWRITER_LOGOBSERVER_H 46 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/LogWriter/LogWriter.rc: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | #include 3 | LANGUAGE 0, 0 // LANG_NEUTRAL, SUBLANG_NEUTRAL 4 | #pragma code_page(1252) 5 | #include "Version.rc2" 6 | #endif 7 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/LogWriter/Module.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | XBEGIN_DEFINE_MODULE() 6 | XEND_DEFINE_MODULE_DLL() 7 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/LogWriter/Plugin.cpp: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #include 3 | #include "LogObserver.h" 4 | 5 | static CLogObserver* s_pObserver = NULL; 6 | 7 | OUTAPI bool x3InitializePlugin() 8 | { 9 | if (!s_pObserver) 10 | { 11 | s_pObserver = new CLogObserver; 12 | } 13 | 14 | return true; 15 | } 16 | 17 | OUTAPI void x3UninitializePlugin() 18 | { 19 | x3::SafeDelete(s_pObserver); 20 | } 21 | 22 | OUTAPI Ix_LogObserver* GetLogObserver() 23 | { 24 | if (!s_pObserver) 25 | { 26 | s_pObserver = new CLogObserver; 27 | } 28 | 29 | return s_pObserver; 30 | } 31 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/LogWriter/Version.rc2: -------------------------------------------------------------------------------- 1 | // Version.rc2 - resources Microsoft Visual C++ does not edit directly 2 | // 3 | // TODO: Change values of FILEVERSION and FileVersion 4 | // 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION 1,1,3,0 8 | FILEFLAGSMASK 0x3fL 9 | #ifdef _DEBUG 10 | FILEFLAGS 0x1L 11 | #else 12 | FILEFLAGS 0x0L 13 | #endif 14 | FILEOS 0x4L 15 | FILETYPE 0x2L 16 | FILESUBTYPE 0x0L 17 | BEGIN 18 | BLOCK "StringFileInfo" 19 | BEGIN 20 | BLOCK "000004b0" 21 | BEGIN 22 | VALUE "FileDescription", "Logging Writer Plugin\0" 23 | VALUE "FileVersion", "1.1.3.0\0" 24 | VALUE "LegalCopyright", "(C) 2008-2011, X3 C++ PluginFramework\0" 25 | VALUE "OriginalFilename", "LogWriter.plugin.dll\0" 26 | VALUE "ProductName", "X3 C++ PluginFramework\0" 27 | END 28 | END 29 | BLOCK "VarFileInfo" 30 | BEGIN 31 | VALUE "Translation", 0x0, 1200 32 | END 33 | END 34 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/LogWriter/log4cplus/include/log4cplus/config/defines.hxx: -------------------------------------------------------------------------------- 1 | #ifndef LOG4CPLUS_CONFIG_DEFINES_HXX 2 | #define LOG4CPLUS_CONFIG_DEFINES_HXX 3 | 4 | /* */ 5 | #undef LOG4CPLUS_HAVE_SYSLOG_H 6 | 7 | /* */ 8 | #undef LOG4CPLUS_HAVE_NETINET_IN_H 9 | 10 | /* */ 11 | #undef LOG4CPLUS_HAVE_FTIME 12 | 13 | /* */ 14 | #undef LOG4CPLUS_HAVE_GETTIMEOFDAY 15 | 16 | /* */ 17 | #undef LOG4CPLUS_HAVE_GMTIME_R 18 | 19 | /* */ 20 | #undef LOG4CPLUS_HAVE_HTONL 21 | 22 | /* */ 23 | #undef LOG4CPLUS_HAVE_HTONS 24 | 25 | /* */ 26 | #undef LOG4CPLUS_HAVE_LOCALTIME_R 27 | 28 | /* */ 29 | #undef LOG4CPLUS_HAVE_LSTAT 30 | 31 | /* */ 32 | #undef LOG4CPLUS_HAVE_NTOHL 33 | 34 | /* */ 35 | #undef LOG4CPLUS_HAVE_NTOHS 36 | 37 | /* */ 38 | #undef LOG4CPLUS_HAVE_STAT 39 | 40 | /* Define if this is a single-threaded library. */ 41 | #define LOG4CPLUS_SINGLE_THREADED 42 | 43 | /* */ 44 | #undef LOG4CPLUS_USE_PTHREADS 45 | 46 | /* Define for compilers/standard libraries that support more than just the "C" 47 | locale. */ 48 | #undef LOG4CPLUS_WORKING_LOCALE 49 | 50 | /* Define to int if undefined. */ 51 | #undef socklen_t 52 | 53 | /* Defined for --enable-debugging builds. */ 54 | #undef LOG4CPLUS_DEBUGGING 55 | 56 | /* Defined if the compiler understands __declspec(export) or __attribute__((export)) construct. */ 57 | #define LOG4CPLUS_DECLSPEC_EXPORT 58 | 59 | /* Defined if the compiler understands __declspec(import) or __attribute__((import)) construct. */ 60 | #undef LOG4CPLUS_DECLSPEC_IMPORT 61 | 62 | #define LOG4CPLUS_HAVE_NETDB_H 63 | 64 | #endif // LOG4CPLUS_CONFIG_DEFINES_HXX 65 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/LogWriter/log4cplus/include/log4cplus/config/macosx.h: -------------------------------------------------------------------------------- 1 | // Module: Log4CPLUS 2 | // File: config-macosx.h 3 | // Created: 7/2003 4 | // Author: Christopher R. Bailey 5 | // 6 | // 7 | // Copyright (C) Tad E. Smith All rights reserved. 8 | // 9 | // This software is published under the terms of the Apache Software 10 | // License version 1.1, a copy of which has been included with this 11 | // distribution in the LICENSE.APL file. 12 | // 13 | 14 | /** @file */ 15 | 16 | #ifndef LOG4CPLUS_CONFIG_MACOSX_HEADER_ 17 | #define LOG4CPLUS_CONFIG_MACOSX_HEADER_ 18 | 19 | #if (defined(__APPLE__) || (defined(__MWERKS__) && defined(__MACOS__))) 20 | 21 | #define LOG4CPLUS_HAVE_GETTIMEOFDAY 1 22 | #define socklen_t int 23 | 24 | #endif // MACOSX 25 | #endif // LOG4CPLUS_CONFIG_MACOSX_HEADER_ 26 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/LogWriter/log4cplus/include/log4cplus/fstreams.h: -------------------------------------------------------------------------------- 1 | // Module: Log4CPLUS 2 | // File: fstreams.h 3 | // Created: 4/2003 4 | // Author: Tad E. Smith 5 | // 6 | // 7 | // Copyright 2003-2009 Tad E. Smith 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | 21 | /** @file */ 22 | 23 | #ifndef LOG4CPLUS_FSTREAMS_HEADER_ 24 | #define LOG4CPLUS_FSTREAMS_HEADER_ 25 | 26 | #include 27 | 28 | #include 29 | 30 | #if defined(__DECCXX) && !defined(__USE_STD_IOSTREAM) 31 | # define LOG4CPLUS_FSTREAM_NAMESPACE 32 | #else 33 | # define LOG4CPLUS_FSTREAM_NAMESPACE std 34 | #endif 35 | 36 | 37 | #ifdef UNICODE 38 | namespace log4cplus { 39 | typedef LOG4CPLUS_FSTREAM_NAMESPACE::wofstream tofstream; 40 | typedef LOG4CPLUS_FSTREAM_NAMESPACE::wifstream tifstream; 41 | } 42 | #else 43 | namespace log4cplus { 44 | typedef LOG4CPLUS_FSTREAM_NAMESPACE::ofstream tofstream; 45 | typedef LOG4CPLUS_FSTREAM_NAMESPACE::ifstream tifstream; 46 | } 47 | #endif // UNICODE 48 | 49 | #endif // LOG4CPLUS_FSTREAMS_HEADER_ 50 | 51 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/LogWriter/log4cplus/include/log4cplus/helpers/sleep.h: -------------------------------------------------------------------------------- 1 | // Module: Log4CPLUS 2 | // File: sleep.h 3 | // Created: 5/2003 4 | // Author: Tad E. Smith 5 | // 6 | // 7 | // Copyright 2003-2009 Tad E. Smith 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | 21 | /** @file */ 22 | 23 | #ifndef _LOG4CPLUS_HELPERS_SLEEP_HEADER_ 24 | #define _LOG4CPLUS_HELPERS_SLEEP_HEADER_ 25 | 26 | #include 27 | 28 | 29 | namespace log4cplus { 30 | namespace helpers { 31 | LOG4CPLUS_EXPORT void sleep(unsigned long secs, 32 | unsigned long nanosecs = 0); 33 | LOG4CPLUS_EXPORT void sleepmillis(unsigned long millis); 34 | } // end namespace helpers 35 | } // end namespace log4cplus 36 | 37 | #endif // _LOG4CPLUS_HELPERS_SLEEP_HEADER_ 38 | 39 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | 3 | ROOTDIR = ../../.. 4 | include $(ROOTDIR)/config.mk 5 | 6 | SUBDIRS = $(filter-out Interface/, $(sort $(dir $(wildcard */)))) 7 | CLEANSUBDIRS = $(addsuffix .clean, $(SUBDIRS)) 8 | 9 | .PHONY: ChangeManager ConfigXml FileUtility LogManager PluginManager StringTable TextUtility 10 | all: ChangeManager ConfigXml FileUtility LogManager PluginManager StringTable TextUtility 11 | 12 | ChangeManager: 13 | @echo 14 | @echo Making all in subdirectory $@... 15 | $(MAKE) -C ChangeManager 16 | 17 | ConfigXml: 18 | @echo 19 | @echo Making all in subdirectory $@... 20 | $(MAKE) -C ConfigXml 21 | 22 | FileUtility: 23 | @echo 24 | @echo Making all in subdirectory $@... 25 | $(MAKE) -C FileUtility 26 | 27 | LogManager: 28 | @echo 29 | @echo Making all in subdirectory $@... 30 | $(MAKE) -C LogManager 31 | 32 | LogWriter: 33 | @echo 34 | @echo Making all in subdirectory $@... 35 | $(MAKE) -C LogWriter 36 | 37 | PluginManager: 38 | @echo 39 | @echo Making all in subdirectory $@... 40 | $(MAKE) -C PluginManager 41 | 42 | StringTable: 43 | @echo 44 | @echo Making all in subdirectory $@... 45 | $(MAKE) -C StringTable 46 | 47 | TextUtility: 48 | @echo 49 | @echo Making all in subdirectory $@... 50 | $(MAKE) -C TextUtility 51 | 52 | clean: $(CLEANSUBDIRS) 53 | 54 | $(CLEANSUBDIRS): 55 | @cd $(basename $@) ; $(MAKE) clean 56 | 57 | 58 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/PluginManager/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../../../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Core/Interface 5 | 6 | all: 7 | $(CC) $(CFLAGS_SO) -c Cx_ObjectFactory.cpp 8 | $(CC) $(CFLAGS_SO) -c Module.cpp 9 | $(CC) $(CFLAGS_SO) -c Cx_PluginLoader.cpp 10 | $(CC) $(CFLAGS_SO) -c DelayLoad.cpp 11 | $(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libPluginManager.so *.o $(LIBS) 12 | clean: 13 | rm -rf *.so 14 | rm -rf *.o 15 | 16 | 17 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/PluginManager/PluginManager.rc: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | #include 3 | LANGUAGE 0, 0 // LANG_NEUTRAL, SUBLANG_NEUTRAL 4 | #pragma code_page(1252) 5 | #include "Version.rc2" 6 | #endif 7 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/PluginManager/Version.rc2: -------------------------------------------------------------------------------- 1 | // Version.rc2 - resources Microsoft Visual C++ does not edit directly 2 | // 3 | // TODO: Change values of FILEVERSION and FileVersion 4 | // 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION 1,1,4,0 8 | FILEFLAGSMASK 0x3fL 9 | #ifdef _DEBUG 10 | FILEFLAGS 0x1L 11 | #else 12 | FILEFLAGS 0x0L 13 | #endif 14 | FILEOS 0x4L 15 | FILETYPE 0x2L 16 | FILESUBTYPE 0x0L 17 | BEGIN 18 | BLOCK "StringFileInfo" 19 | BEGIN 20 | BLOCK "000004b0" 21 | BEGIN 22 | VALUE "FileDescription", "Plugin Manager DLL\0" 23 | VALUE "FileVersion", "1.1.4.0\0" 24 | VALUE "LegalCopyright", "(C) 2008-2011, X3 C++ PluginFramework\0" 25 | VALUE "OriginalFilename", "PluginManagerX3.dll\0" 26 | VALUE "ProductName", "X3 C++ PluginFramework\0" 27 | END 28 | END 29 | BLOCK "VarFileInfo" 30 | BEGIN 31 | VALUE "Translation", 0x0, 1200 32 | END 33 | END 34 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/StringTable/Cx_StringTable.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #ifndef _X3_CORE_STRINGTABLE_H 3 | #define _X3_CORE_STRINGTABLE_H 4 | 5 | #include 6 | 7 | class Cx_StringTable : public Ix_StringTable 8 | { 9 | X3BEGIN_CLASS_DECLARE(Cx_StringTable) 10 | X3DEFINE_INTERFACE_ENTRY(Ix_StringTable) 11 | X3END_CLASS_DECLARE() 12 | protected: 13 | Cx_StringTable(); 14 | ~Cx_StringTable(); 15 | 16 | private: 17 | bool GetValue(std::wstring& value, const std::wstring& name, 18 | std::wstring& module, std::wstring& id); 19 | bool GetValue(std::wstring& value, 20 | const std::wstring& module, const std::wstring& id); 21 | long LoadFiles(const std::wstring& path); 22 | long RegisterFile(const std::wstring& filename); 23 | std::wstring GetValue(const std::wstring& module, 24 | const std::wstring& id, bool* hasvalue = NULL); 25 | 26 | private: 27 | struct ITEM 28 | { 29 | std::wstring module; 30 | Cx_Ptr group; // Ix_ConfigSection 31 | Cx_Ptr file; // Ix_ConfigData 32 | ITEM() {} 33 | }; 34 | typedef std::list::iterator IT_ITEM; 35 | 36 | IT_ITEM Find(const std::wstring& module) 37 | { 38 | IT_ITEM it = m_groups.begin(); 39 | for (; it != m_groups.end(); ++it) 40 | { 41 | if (_wcsicmp(it->module.c_str(), module.c_str()) == 0) 42 | { 43 | break; 44 | } 45 | } 46 | 47 | return it; 48 | } 49 | 50 | private: 51 | std::list m_groups; 52 | bool m_loaded; 53 | }; 54 | 55 | #endif // _X3_CORE_STRINGTABLE_H 56 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/StringTable/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../../../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Core/Interface 5 | 6 | all: 7 | $(CC) $(CFLAGS_SO) -c Cx_StringTable.cpp 8 | $(CC) $(CFLAGS_SO) -c Module.cpp 9 | $(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libStringTable.so *.o $(LIBS) 10 | clean: 11 | rm -rf *.so 12 | rm -rf *.o 13 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/StringTable/Module.cpp: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #include 3 | #include 4 | #include 5 | 6 | #include "Cx_StringTable.h" 7 | 8 | XBEGIN_DEFINE_MODULE() 9 | XDEFINE_CLASSMAP_ENTRY_Singleton(x3::CLSID_StringTable, Cx_StringTable) 10 | XEND_DEFINE_MODULE_DLL() 11 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/StringTable/StringTable.rc: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | #include 3 | LANGUAGE 0, 0 // LANG_NEUTRAL, SUBLANG_NEUTRAL 4 | #pragma code_page(1252) 5 | #include "Version.rc2" 6 | #endif 7 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/StringTable/Version.rc2: -------------------------------------------------------------------------------- 1 | // Version.rc2 - resources Microsoft Visual C++ does not edit directly 2 | // 3 | // TODO: Change values of FILEVERSION and FileVersion 4 | // 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION 1,1,3,0 8 | FILEFLAGSMASK 0x3fL 9 | #ifdef _DEBUG 10 | FILEFLAGS 0x1L 11 | #else 12 | FILEFLAGS 0x0L 13 | #endif 14 | FILEOS 0x4L 15 | FILETYPE 0x2L 16 | FILESUBTYPE 0x0L 17 | BEGIN 18 | BLOCK "StringFileInfo" 19 | BEGIN 20 | BLOCK "000004b0" 21 | BEGIN 22 | VALUE "FileDescription", "String Table Plugin\0" 23 | VALUE "FileVersion", "1.1.3.0\0" 24 | VALUE "LegalCopyright", "(C) 2008-2011, X3 C++ PluginFramework\0" 25 | VALUE "OriginalFilename", "StringTable.plugin.dll\0" 26 | VALUE "ProductName", "X3 C++ PluginFramework\0" 27 | END 28 | END 29 | BLOCK "VarFileInfo" 30 | BEGIN 31 | VALUE "Translation", 0x0, 1200 32 | END 33 | END 34 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/TextUtility/Cx_ClipboardUtil.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #ifndef _X3_UTILITY_CLIPBOARDUTIL_H 3 | #define _X3_UTILITY_CLIPBOARDUTIL_H 4 | 5 | #include 6 | 7 | class Cx_ClipboardUtil : public Ix_ClipboardUtil 8 | { 9 | X3BEGIN_CLASS_DECLARE(Cx_ClipboardUtil) 10 | X3DEFINE_INTERFACE_ENTRY(Ix_ClipboardUtil) 11 | X3END_CLASS_DECLARE() 12 | protected: 13 | Cx_ClipboardUtil() {} 14 | virtual ~Cx_ClipboardUtil() {} 15 | 16 | private: 17 | // From Ix_ClipboardUtil 18 | virtual bool CopyText(HWND wndOwner, const std::wstring& text); 19 | virtual bool PasteText(HWND wndOwner, std::wstring& text, bool clear = false); 20 | virtual bool CanPasteText(); 21 | }; 22 | 23 | #endif // _X3_UTILITY_CLIPBOARDUTIL_H 24 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/TextUtility/Cx_GuidGenerator.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #ifndef _X3_UTILITY_GUIDGENERATOR_H 3 | #define _X3_UTILITY_GUIDGENERATOR_H 4 | 5 | #include 6 | 7 | class Cx_GuidGenerator : public Ix_GuidGenerator 8 | { 9 | X3BEGIN_CLASS_DECLARE(Cx_GuidGenerator) 10 | X3DEFINE_INTERFACE_ENTRY(Ix_GuidGenerator) 11 | X3END_CLASS_DECLARE() 12 | protected: 13 | Cx_GuidGenerator() {} 14 | virtual ~Cx_GuidGenerator() {} 15 | 16 | private: 17 | // From Ix_GuidGenerator 18 | virtual std::wstring CreateGuid(bool withBrackets = false); 19 | virtual std::wstring RemoveGuidBrackets(const std::wstring& uid); 20 | virtual std::wstring GetCurrentTimeString(bool hasYear = true); 21 | virtual ULONG CreateID(long type = 0); 22 | }; 23 | 24 | #endif // _X3_UTILITY_GUIDGENERATOR_H 25 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/TextUtility/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../../../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Core/Interface 5 | 6 | all: 7 | $(CC) $(CFLAGS_SO) -c Cx_ClipboardUtil.cpp 8 | $(CC) $(CFLAGS_SO) -c Cx_GuidGenerator.cpp 9 | $(CC) $(CFLAGS_SO) -c Cx_TextUtil.cpp 10 | $(CC) $(CFLAGS_SO) -c Module.cpp 11 | $(CC) $(CFLAGS_SO) -c base64.cpp 12 | $(CC) $(CFLAGS_SO) -c md5.cpp 13 | $(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libTextUtility.so *.o 14 | clean: 15 | rm -rf *.so 16 | rm -rf *.o 17 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/TextUtility/ManagedExt.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 4 | Copyright (C) 2007 Coolsoft Company. All rights reserved. 5 | 6 | http://www.coolsoft-sd.com/ 7 | 8 | This software is provided 'as-is', without any express or implied warranty. 9 | In no event will the authors be held liable for any damages arising from the 10 | use of this software. 11 | 12 | Permission is granted to anyone to use this software for any purpose, including 13 | commercial applications, and to alter it and redistribute it freely, subject to 14 | the following restrictions: 15 | 16 | * The origin of this software must not be misrepresented; you must not claim that 17 | you wrote the original software. If you use this software in a product, an 18 | acknowledgment in the product documentation would be appreciated but is not required. 19 | * Altered source versions must be plainly marked as such, and must not be misrepresented 20 | as being the original software. 21 | * This notice may not be removed or altered from any source distribution. 22 | 23 | */ 24 | 25 | 26 | #pragma once 27 | 28 | #ifndef _MANAGED 29 | #include 30 | using namespace std; 31 | 32 | #define CONST const 33 | #define CLASS class 34 | #define AS_PUBLIC 35 | #define NEW new 36 | #define NULLPTR NULL 37 | 38 | typedef wstring STRING; 39 | typedef const STRING& STRING_IN; 40 | typedef STRING& STRING_OUT; 41 | typedef const STRING& STRING_RET; 42 | #else 43 | using namespace System; 44 | 45 | #define CONST 46 | #define CLASS ref class 47 | #define AS_PUBLIC public 48 | 49 | typedef System::String^ STRING; 50 | typedef STRING STRING_IN; 51 | typedef STRING% STRING_OUT; 52 | typedef STRING STRING_RET; 53 | #endif -------------------------------------------------------------------------------- /code/pkg_Core/Modules/TextUtility/Module.cpp: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #include 3 | #include 4 | #include 5 | 6 | #include "Cx_TextUtil.h" 7 | #include "Cx_GuidGenerator.h" 8 | #include "Cx_ClipboardUtil.h" 9 | 10 | XBEGIN_DEFINE_MODULE() 11 | XDEFINE_CLASSMAP_ENTRY_Singleton(x3::CLSID_TextUtil, Cx_TextUtil) 12 | #if defined(_WIN32) && !defined(__GNUC__) 13 | XDEFINE_CLASSMAP_ENTRY_Singleton(x3::CLSID_GuidGenerator, Cx_GuidGenerator) 14 | XDEFINE_CLASSMAP_ENTRY_Singleton(x3::CLSID_ClipboardUtil, Cx_ClipboardUtil) 15 | #endif 16 | XEND_DEFINE_MODULE_DLL() 17 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/TextUtility/TextUtility.rc: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | #include 3 | LANGUAGE 0, 0 // LANG_NEUTRAL, SUBLANG_NEUTRAL 4 | #pragma code_page(1252) 5 | #include "Version.rc2" 6 | #endif 7 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/TextUtility/Version.rc2: -------------------------------------------------------------------------------- 1 | // Version.rc2 - resources Microsoft Visual C++ does not edit directly 2 | // 3 | // TODO: Change values of FILEVERSION and FileVersion 4 | // 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION 1,1,3,0 8 | FILEFLAGSMASK 0x3fL 9 | #ifdef _DEBUG 10 | FILEFLAGS 0x1L 11 | #else 12 | FILEFLAGS 0x0L 13 | #endif 14 | FILEOS 0x4L 15 | FILETYPE 0x2L 16 | FILESUBTYPE 0x0L 17 | BEGIN 18 | BLOCK "StringFileInfo" 19 | BEGIN 20 | BLOCK "000004b0" 21 | BEGIN 22 | VALUE "FileDescription", "Text Utility Plugin\0" 23 | VALUE "FileVersion", "1.1.3.0\0" 24 | VALUE "LegalCopyright", "(C) 2008-2011, X3 C++ PluginFramework\0" 25 | VALUE "OriginalFilename", "TextUtility.plugin.dll\0" 26 | VALUE "ProductName", "X3 C++ PluginFramework\0" 27 | END 28 | END 29 | BLOCK "VarFileInfo" 30 | BEGIN 31 | VALUE "Translation", 0x0, 1200 32 | END 33 | END 34 | -------------------------------------------------------------------------------- /code/pkg_Core/Modules/TextUtility/md5.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Core/Modules/TextUtility/md5.h -------------------------------------------------------------------------------- /code/pkg_Example/Interface/ClsID_Example.h: -------------------------------------------------------------------------------- 1 | #ifndef CLSID_EXAMPLE_H 2 | #define CLSID_EXAMPLE_H 3 | 4 | static const X3CLSID CLSID_Example("86347b32-64e4-490c-b273-ec7e010f244e"); 5 | 6 | #endif // CLSID_EXAMPLE_H 7 | -------------------------------------------------------------------------------- /code/pkg_Example/Interface/ClsID_ViewExample.h: -------------------------------------------------------------------------------- 1 | #ifndef CLSID_VIEW_EXAMPLE_H 2 | #define CLSID_VIEW_EXAMPLE_H 3 | 4 | static const X3CLSID CLSID_ExampleWndA("96b94d2e-8023-454e-a6be-e41ab07ae206"); 5 | static const X3CLSID CLSID_ExampleWndB("184c7468-526b-426b-af87-8bb10a84dc30"); 6 | 7 | #endif // CLSID_VIEW_EXAMPLE_H 8 | -------------------------------------------------------------------------------- /code/pkg_Example/Interface/HelloViewRes.h: -------------------------------------------------------------------------------- 1 | #define IDM_DEMO_INVIEW 32801 2 | #define IDM_DEMO_OBSERVER 32802 3 | -------------------------------------------------------------------------------- /code/pkg_Example/Interface/Ix_Example.h: -------------------------------------------------------------------------------- 1 | #ifndef EXAMPLE_INTERFACE_H 2 | #define EXAMPLE_INTERFACE_H 3 | 4 | #include 5 | 6 | class Ix_Example : public Ix_Object 7 | { 8 | public: 9 | X3DEFINE_IID(Ix_Example) 10 | virtual void Foo(long& value) = 0; 11 | }; 12 | 13 | class Ix_Example2 : public Ix_Object 14 | { 15 | public: 16 | X3DEFINE_IID(Ix_Example2) 17 | virtual void Foo2(long& value) = 0; 18 | }; 19 | 20 | #endif // EXAMPLE_INTERFACE_H -------------------------------------------------------------------------------- /code/pkg_Example/Interface/ObserverExample/ChainObserver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Example/Interface/ObserverExample/ChainObserver.h -------------------------------------------------------------------------------- /code/pkg_Example/Interface/ObserverExample/ChainObserverB.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Example/Interface/ObserverExample/ChainObserverB.h -------------------------------------------------------------------------------- /code/pkg_Example/Interface/ObserverExample/DocEventObserver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Example/Interface/ObserverExample/DocEventObserver.h -------------------------------------------------------------------------------- /code/pkg_Example/Interface/ObserverExample/Ix_ChangeObserverTest.h: -------------------------------------------------------------------------------- 1 | #ifndef CHANGEOBSERVERTEST_INTERFACE_H 2 | #define CHANGEOBSERVERTEST_INTERFACE_H 3 | 4 | static const X3CLSID CLSID_ChangeObserverTest("e57cc552-b227-4c2c-bf19-099083b79bf4"); 5 | 6 | class Ix_ChangeObserverTest : public Ix_Object 7 | { 8 | public: 9 | X3DEFINE_IID(Ix_ChangeObserverTest) 10 | virtual bool TestResponsibilityChain() = 0; 11 | virtual bool TestResponsibilityChain2(int value, char c) = 0; 12 | virtual bool TestEventObserver() = 0; 13 | virtual bool TestSelectionObserver() = 0; 14 | }; 15 | 16 | #endif // CHANGEOBSERVERTEST_INTERFACE_H -------------------------------------------------------------------------------- /code/pkg_Example/Interface/ObserverExample/NodeSelectionObserver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Example/Interface/ObserverExample/NodeSelectionObserver.h -------------------------------------------------------------------------------- /code/pkg_Example/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | 3 | ROOTDIR = ../.. 4 | include $(ROOTDIR)/config.mk 5 | 6 | SUBDIRS = $(filter-out Interface/, $(sort $(dir $(wildcard */)))) 7 | CLEANSUBDIRS = $(addsuffix .clean, $(SUBDIRS)) 8 | 9 | .PHONY: Modules 10 | 11 | Modules: 12 | @echo 13 | -@mkdir -p ../bin/tests 14 | @echo Making all in subdirectory $@... 15 | $(MAKE) -C Modules 16 | 17 | clean: $(CLEANSUBDIRS) 18 | 19 | $(CLEANSUBDIRS): 20 | @cd $(basename $@) ; $(MAKE) clean 21 | 22 | 23 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/ChangeObserverExample/Cx_ObserverTest.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "Cx_ObserverTest.h" 3 | #include 4 | #include "Responsibility.h" 5 | #include "ResponsibilityB.h" 6 | #include "DocObserverTest.h" 7 | #include "SelectionObserverTest.h" 8 | 9 | Cx_ObserverTest::Cx_ObserverTest() 10 | { 11 | } 12 | 13 | Cx_ObserverTest::~Cx_ObserverTest() 14 | { 15 | } 16 | 17 | bool Cx_ObserverTest::TestResponsibilityChain() 18 | { 19 | KAutoNew pExample1(new CResponsibility1); 20 | KAutoNew pExample2(new CResponsibility2); 21 | 22 | int sum = 0; 23 | ChainObserver::Data(&sum).Notify(); 24 | 25 | return sum > 0; 26 | } 27 | 28 | bool Cx_ObserverTest::TestResponsibilityChain2(int value, char c) 29 | { 30 | KAutoNew pExample1(new CResponsibilityB1); 31 | KAutoNew pExample2(new CResponsibilityB2); 32 | 33 | return ChainObserverB::Data::DoWork1(value) 34 | || ChainObserverB::Data::DoWork2(c); 35 | } 36 | 37 | bool Cx_ObserverTest::TestEventObserver() 38 | { 39 | int data = 0; 40 | CDocObserverTest test(&data); 41 | 42 | DocEventObserver::Data(kDocEvent_BeforeOpen).Notify(); 43 | DocEventObserver::Data(kDocEvent_AfterOpen).Notify(); 44 | 45 | return data > 0; 46 | } 47 | 48 | bool Cx_ObserverTest::TestSelectionObserver() 49 | { 50 | KAutoNew pExample1(new CNodeSelectionTestOnlyReceive); 51 | KAutoNew pExample2(new CNodeSelectionTestSendReceive); 52 | 53 | pExample2->OnChanged(); 54 | 55 | NodeSelectionObserver::Data(123, NULL).Notify(); 56 | 57 | return true; 58 | } 59 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/ChangeObserverExample/Cx_ObserverTest.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class Cx_ObserverTest 6 | : public Ix_ChangeObserverTest 7 | { 8 | X3BEGIN_CLASS_DECLARE(Cx_ObserverTest) 9 | X3DEFINE_INTERFACE_ENTRY(Ix_ChangeObserverTest) 10 | X3END_CLASS_DECLARE() 11 | protected: 12 | Cx_ObserverTest(); 13 | ~Cx_ObserverTest(); 14 | 15 | private: 16 | // From Ix_Example 17 | bool TestResponsibilityChain(); 18 | bool TestResponsibilityChain2(int value, char c); 19 | bool TestEventObserver(); 20 | bool TestSelectionObserver(); 21 | }; 22 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/ChangeObserverExample/DocObserverTest.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class CDocObserverTest 6 | : private DocEventObserver 7 | { 8 | NOCOPY_CONSTRUCTOR(CDocObserverTest); 9 | public: 10 | CDocObserverTest(int* data) : m_data(data) 11 | { 12 | } 13 | 14 | private: 15 | virtual bool OnDocEventAfterOpen() 16 | { 17 | (*m_data)++; 18 | return true; 19 | } 20 | 21 | private: 22 | int* m_data; 23 | }; 24 | 25 | class CDocObserverTestOnRun 26 | : private DocEventObserver 27 | { 28 | NOCOPY_CONSTRUCTOR(CDocObserverTestOnRun); 29 | public: 30 | CDocObserverTestOnRun() 31 | { 32 | } 33 | 34 | private: 35 | virtual bool OnDocEventAfterOpen() 36 | { 37 | X3LOG_INFO(L"CDocObserverTestOnRun::OnDocEventAfterOpen"); 38 | return true; 39 | } 40 | }; 41 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/ChangeObserverExample/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../../../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Core/Interface 5 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Example/Interface 6 | 7 | all: 8 | $(CC) $(CFLAGS_SO) -c Plugin.cpp 9 | $(CC) $(CFLAGS_SO) -c Cx_ObserverTest.cpp 10 | $(CC) $(CFLAGS_SO) -c Module.cpp 11 | $(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libChangeObserverExample.so *.o 12 | clean: 13 | rm -rf *.so 14 | rm -rf *.o 15 | 16 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/ChangeObserverExample/Module.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "Cx_ObserverTest.h" 6 | 7 | XBEGIN_DEFINE_MODULE() 8 | XDEFINE_CLASSMAP_ENTRY(CLSID_ChangeObserverTest, Cx_ObserverTest) 9 | XEND_DEFINE_MODULE_DLL() 10 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/ChangeObserverExample/Plugin.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "DocObserverTest.h" 3 | 4 | static CDocObserverTestOnRun* s_observer = NULL; 5 | 6 | // Optional function to initialize this plugin when loaded by the plugin manager. 7 | OUTAPI bool x3InitializePlugin() 8 | { 9 | s_observer = new CDocObserverTestOnRun; 10 | return true; 11 | } 12 | 13 | // Optional function to free this plugin when unloaded by the plugin manager. 14 | OUTAPI void x3UninitializePlugin() 15 | { 16 | x3::SafeDelete(s_observer); 17 | } 18 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/ChangeObserverExample/Responsibility.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class CResponsibility1 6 | : private ChainObserver 7 | { 8 | NOCOPY_CONSTRUCTOR(CResponsibility1); 9 | public: 10 | CResponsibility1() 11 | { 12 | } 13 | 14 | private: 15 | virtual void OnChain(int& sum) 16 | { 17 | sum += 1; 18 | } 19 | }; 20 | 21 | class CResponsibility2 22 | : private ChainObserver 23 | { 24 | NOCOPY_CONSTRUCTOR(CResponsibility2); 25 | public: 26 | CResponsibility2() 27 | { 28 | } 29 | 30 | private: 31 | virtual void OnChain(int& sum) 32 | { 33 | sum += 10; 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/ChangeObserverExample/ResponsibilityB.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class CResponsibilityB1 6 | : private ChainObserverB 7 | { 8 | NOCOPY_CONSTRUCTOR(CResponsibilityB1); 9 | public: 10 | CResponsibilityB1() 11 | { 12 | } 13 | 14 | private: 15 | virtual bool OnChainWork1(int value) 16 | { 17 | return value > 0; 18 | } 19 | }; 20 | 21 | class CResponsibilityB2 22 | : private ChainObserverB 23 | { 24 | NOCOPY_CONSTRUCTOR(CResponsibilityB2); 25 | public: 26 | CResponsibilityB2() 27 | { 28 | } 29 | 30 | private: 31 | virtual bool OnChainWork2(char c) 32 | { 33 | return c != 'x'; 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/ChangeObserverExample/SelectionObserverTest.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class CNodeSelectionTestOnlyReceive : private NodeSelectionObserver 6 | { 7 | NOCOPY_CONSTRUCTOR(CNodeSelectionTestOnlyReceive); 8 | public: 9 | CNodeSelectionTestOnlyReceive() 10 | { 11 | } 12 | 13 | private: 14 | virtual void OnNodeSelection(long objid, NodeSelectionObserver* sender) 15 | { 16 | objid; sender; 17 | } 18 | }; 19 | 20 | class CNodeSelectionTestSendReceive : private NodeSelectionObserver 21 | { 22 | NOCOPY_CONSTRUCTOR(CNodeSelectionTestSendReceive); 23 | public: 24 | CNodeSelectionTestSendReceive() 25 | { 26 | } 27 | 28 | void OnChanged() 29 | { 30 | if (!NodeSelectionObserver::IsUpdating()) 31 | { 32 | long objid = 1234; 33 | RefreshView(objid); 34 | NodeSelectionObserver::Data(objid, this).Notify(); 35 | } 36 | } 37 | 38 | private: 39 | virtual void OnNodeSelection(long objid, NodeSelectionObserver* sender) 40 | { 41 | if (this != sender) 42 | { 43 | OnChanged(); 44 | RefreshView(objid); 45 | } 46 | } 47 | 48 | void RefreshView(long objid) 49 | { 50 | objid; 51 | } 52 | }; 53 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/HelloFrame/HelloApp.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | class CHelloApp : public CFrameApp 5 | { 6 | public: 7 | CHelloApp() 8 | { 9 | } 10 | 11 | virtual LPCWSTR GetSingletonAppUID() 12 | { 13 | return L"f5352210-c5d9-4809-af72-e898107d27d8"; 14 | } 15 | 16 | private: 17 | afx_msg void OnCommands(UINT nID); 18 | DECLARE_MESSAGE_MAP() 19 | }; 20 | 21 | CHelloApp theApp; 22 | 23 | BEGIN_MESSAGE_MAP(CHelloApp, CFrameApp) 24 | ON_COMMAND_RANGE(2790, 32770, CHelloApp::OnCommands) 25 | ON_COMMAND_RANGE(ID_EDIT_CLEAR, ID_EDIT_REDO, CHelloApp::OnCommands) 26 | END_MESSAGE_MAP() 27 | 28 | void CHelloApp::OnCommands(UINT nID) 29 | { 30 | CString str, text; 31 | str.LoadString(nID); 32 | text.Format(L"OnCommands: %d\n%s", nID, str); 33 | AfxMessageBox(text); 34 | } 35 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/HelloFrame/res/GroupClipboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Example/Modules/HelloFrame/res/GroupClipboard.png -------------------------------------------------------------------------------- /code/pkg_Example/Modules/HelloFrame/res/GroupFind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Example/Modules/HelloFrame/res/GroupFind.png -------------------------------------------------------------------------------- /code/pkg_Example/Modules/HelloFrame/res/GroupFont.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Example/Modules/HelloFrame/res/GroupFont.png -------------------------------------------------------------------------------- /code/pkg_Example/Modules/HelloFrame/res/HelloFrame.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Example/Modules/HelloFrame/res/HelloFrame.ico -------------------------------------------------------------------------------- /code/pkg_Example/Modules/HelloFrame/res/LargeIcons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Example/Modules/HelloFrame/res/LargeIcons.png -------------------------------------------------------------------------------- /code/pkg_Example/Modules/HelloFrame/res/SmallIcons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Example/Modules/HelloFrame/res/SmallIcons.png -------------------------------------------------------------------------------- /code/pkg_Example/Modules/HelloView/CmdObserver.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | class CCmdObserver : private CmdMsgObserverSimple 6 | { 7 | public: 8 | CCmdObserver() {} 9 | 10 | private: 11 | void OnCmdObserver(); 12 | DECLARE_MENU_MSG_MAP() 13 | }; 14 | 15 | static CCmdObserver* s_observer = NULL; 16 | 17 | OUTAPI bool x3InitializePlugin() 18 | { 19 | s_observer = new CCmdObserver; 20 | return true; 21 | } 22 | 23 | OUTAPI void x3UninitializePlugin() 24 | { 25 | x3::SafeDelete(s_observer); 26 | } 27 | 28 | BEGIN_MENU_MSG_MAP(CCmdObserver) 29 | ON_MENU_COMMAND(IDM_DEMO_OBSERVER, OnCmdObserver) 30 | END_MENU_MSG_MAP() 31 | 32 | void CCmdObserver::OnCmdObserver() 33 | { 34 | AfxMessageBox(L"CCmdObserver::OnCmdObserver()"); 35 | } 36 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/HelloView/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../../../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Core/Interface 5 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_AppUI/Interface 6 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Example/Interface 7 | 8 | all: 9 | $(CC) $(CFLAGS_SO) -c CmdObserver.cpp 10 | $(CC) $(CFLAGS_SO) -c WndA.cpp 11 | $(CC) $(CFLAGS_SO) -c Module.cpp 12 | $(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libHelloView.so *.o 13 | clean: 14 | rm -rf *.so 15 | rm -rf *.o 16 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/HelloView/Module.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | #include 7 | #include "WndA.h" 8 | 9 | XBEGIN_DEFINE_MODULE() 10 | XDEFINE_CLASSMAP_ENTRY_Wnd(CLSID_ExampleWndA, CWndA) 11 | XDEFINE_CLASSMAP_ENTRY_Wnd(CLSID_ExampleWndB, CWndA) 12 | XEND_DEFINE_MODULE_MFCEXTDLL() 13 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/HelloView/MoveObserver.h: -------------------------------------------------------------------------------- 1 | #ifndef EXAMPLE_MOVE_OBSERVER_H_ 2 | #define EXAMPLE_MOVE_OBSERVER_H_ 3 | 4 | #include 5 | 6 | class MoveObserver : public Cx_ChangeObserver 7 | { 8 | NOCOPY_CONSTRUCTOR(MoveObserver); 9 | public: 10 | class Data : public ChangeNotifyData 11 | { 12 | NOCOPY_CONSTRUCTOR(Data); 13 | public: 14 | Data(long _x, long _y, MoveObserver* _sender) 15 | : ChangeNotifyData("MoveObserver") 16 | , x(_x), y(_y), sender(_sender) 17 | { 18 | } 19 | 20 | long x; 21 | long y; 22 | MoveObserver* sender; 23 | }; 24 | 25 | protected: 26 | MoveObserver() : Cx_ChangeObserver("MoveObserver") 27 | { 28 | } 29 | 30 | virtual void OnMove(long x, long y, MoveObserver* sender) 31 | { 32 | x; y; sender; 33 | } 34 | 35 | private: 36 | void DoUpdate(ChangeNotifyData* data) 37 | { 38 | Data* mydata = static_cast(data); 39 | ASSERT(mydata); 40 | OnMove(mydata->x, mydata->y, mydata->sender); 41 | } 42 | }; 43 | 44 | #endif // EXAMPLE_MOVE_OBSERVER_H_ 45 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/HelloView/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by HelloView.rc 4 | // 5 | 6 | // Next default values for new objects 7 | // 8 | #ifdef APSTUDIO_INVOKED 9 | #ifndef APSTUDIO_READONLY_SYMBOLS 10 | 11 | #define _APS_NEXT_RESOURCE_VALUE 100 12 | #define _APS_NEXT_CONTROL_VALUE 1000 13 | #define _APS_NEXT_SYMED_VALUE 200 14 | #define _APS_NEXT_COMMAND_VALUE 32771 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/HelloView/WndA.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "MoveObserver.h" 4 | 5 | class CWndA : public CWnd, private MoveObserver 6 | { 7 | public: 8 | CWndA(); 9 | virtual ~CWndA(); 10 | 11 | BOOL CreateWnd(CWnd* pParentWnd, UINT nID); 12 | void Refresh(); 13 | 14 | protected: 15 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 16 | afx_msg void OnPaint(); 17 | afx_msg void OnMouseMove(UINT nFlags, CPoint point); 18 | afx_msg void OnDemoInView(); 19 | DECLARE_MESSAGE_MAP() 20 | 21 | private: 22 | virtual void OnMove(long x, long y, MoveObserver* sender); 23 | 24 | private: 25 | CPoint m_point; 26 | bool m_selfmove; 27 | }; 28 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/HelloViewApp/ChildView.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class CChildView : public CWnd 6 | { 7 | public: 8 | CChildView(); 9 | virtual ~CChildView(); 10 | 11 | public: 12 | virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pInfo); 13 | virtual BOOL DestroyWindow(); 14 | 15 | protected: 16 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 17 | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 18 | afx_msg void OnSize(UINT nType, int cx, int cy); 19 | DECLARE_MESSAGE_MAP() 20 | 21 | private: 22 | CEmbedWnd m_wndLeft; 23 | CEmbedWnd m_wndRight; 24 | long m_locker; 25 | }; 26 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/HelloViewApp/HelloViewApp.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Example/Modules/HelloViewApp/HelloViewApp.ico -------------------------------------------------------------------------------- /code/pkg_Example/Modules/HelloViewApp/MainFrm.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ChildView.h" 4 | 5 | class CMainFrame : public CFrameWnd 6 | { 7 | public: 8 | CMainFrame(); 9 | virtual ~CMainFrame(); 10 | 11 | protected: 12 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 13 | virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo); 14 | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 15 | afx_msg void OnSetFocus(CWnd *pOldWnd); 16 | DECLARE_MESSAGE_MAP() 17 | 18 | private: 19 | CStatusBar m_wndStatusBar; 20 | CChildView m_wndView; 21 | class MyObserver; 22 | MyObserver* m_observer; 23 | }; 24 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/HelloViewApp/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../../../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | CFLAGS += -I$(INCLUDE_DIR)/pkg_Core/Interface 5 | CFLAGS += -I$(INCLUDE_DIR)/pkg_AppUI/Interface 6 | CFLAGS += -I$(INCLUDE_DIR)/pkg_Example/Interface 7 | 8 | all: 9 | $(CC) $(CFLAGS) -c ChildView.cpp 10 | $(CC) $(CFLAGS) -c HelloViewApp.cpp 11 | $(CC) $(CFLAGS) -c MainFrm.cpp 12 | $(CC) $(C_FLAGS) -o $(UNITTESTS_DIR)/HelloViewApp.app *.o $(LIBS) 13 | clean: 14 | rm -rf *.so 15 | rm -rf *.o 16 | 17 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/HelloViewApp/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by HelloViewApp.rc 4 | // 5 | #define IDR_MAINFRAME 128 6 | #define ID_INDICATOR_XY 32770 7 | 8 | // Next default values for new objects 9 | // 10 | #ifdef APSTUDIO_INVOKED 11 | #ifndef APSTUDIO_READONLY_SYMBOLS 12 | #define _APS_3D_CONTROLS 1 13 | #define _APS_NEXT_RESOURCE_VALUE 130 14 | #define _APS_NEXT_CONTROL_VALUE 1000 15 | #define _APS_NEXT_SYMED_VALUE 101 16 | #define _APS_NEXT_COMMAND_VALUE 32771 17 | #endif 18 | #endif 19 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/MFCExtTempl/Cx_Example2.cpp: -------------------------------------------------------------------------------- 1 | #include "StdAfx.h" 2 | #include "Cx_Example2.h" 3 | 4 | Cx_Example2::Cx_Example2() 5 | { 6 | } 7 | 8 | Cx_Example2::~Cx_Example2() 9 | { 10 | } 11 | 12 | void Cx_Example2::Foo(long& value) 13 | { 14 | value = 11; 15 | } 16 | 17 | void Cx_Example2::Foo2(long& value) 18 | { 19 | value = 12; 20 | } 21 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/MFCExtTempl/Cx_Example2.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class Cx_Example2 6 | : public Ix_Example 7 | , public Ix_Example2 8 | { 9 | X3BEGIN_CLASS_DECLARE(Cx_Example2) 10 | X3DEFINE_INTERFACE_ENTRY(Ix_Example) 11 | X3DEFINE_INTERFACE_ENTRY(Ix_Example2) 12 | X3END_CLASS_DECLARE() 13 | protected: 14 | Cx_Example2(); 15 | virtual ~Cx_Example2(); 16 | 17 | private: 18 | // From Ix_Example 19 | virtual void Foo(long& value); 20 | 21 | // From Ix_Example2 22 | virtual void Foo2(long& value); 23 | }; 24 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/MFCExtTempl/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../../../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Core/Interface 5 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Example/Interface 6 | 7 | all: 8 | $(CC) $(CFLAGS_SO) -c Cx_Example2.cpp 9 | $(CC) $(CFLAGS_SO) -c Plugin.cpp 10 | $(CC) $(CFLAGS_SO) -c Module.cpp 11 | $(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libMFCExtTempl.so *.o 12 | clean: 13 | rm -rf *.so 14 | rm -rf *.o 15 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/MFCExtTempl/Module.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include 3 | #include 4 | #include 5 | 6 | #include "Cx_Example2.h" 7 | 8 | XBEGIN_DEFINE_MODULE() 9 | XDEFINE_CLASSMAP_ENTRY(CLSID_Example, Cx_Example2) 10 | XEND_DEFINE_MODULE_MFCEXTDLL() 11 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/MFCExtTempl/Plugin.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | // Optional function to initialize this plugin when loaded by the plugin manager. 4 | OUTAPI bool x3InitializePlugin() 5 | { 6 | return true; 7 | } 8 | 9 | // Optional function to free this plugin when unloaded by the plugin manager. 10 | OUTAPI void x3UninitializePlugin() 11 | { 12 | } 13 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/MFCExtTempl/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by MFCExtTempl.rc 4 | // 5 | 6 | // Next default values for new objects 7 | // 8 | #ifdef APSTUDIO_INVOKED 9 | #ifndef APSTUDIO_READONLY_SYMBOLS 10 | 11 | #define _APS_NEXT_RESOURCE_VALUE 100 12 | #define _APS_NEXT_CONTROL_VALUE 1000 13 | #define _APS_NEXT_SYMED_VALUE 200 14 | #define _APS_NEXT_COMMAND_VALUE 32771 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/MFCExtTempl/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/MFCExtTempl/StdAfx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #define LOGHEAD L"@MFCExtTempl:" // eg: LOG_WARNING(LOGHEAD L"IDS_XXX); 5 | 6 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | 3 | ROOTDIR = ../../.. 4 | include $(ROOTDIR)/config.mk 5 | 6 | SUBDIRS = $(filter-out Interface/, $(sort $(dir $(wildcard */)))) 7 | CLEANSUBDIRS = $(addsuffix .clean, $(SUBDIRS)) 8 | 9 | .PHONY: ChangeObserverExample SimpleApp SimpleUse Win32DllTempl 10 | all: ChangeObserverExample SimpleApp SimpleUse Win32DllTempl 11 | 12 | ChangeObserverExample: 13 | @echo 14 | @echo Making all in subdirectory $@... 15 | $(MAKE) -C ChangeObserverExample 16 | 17 | HelloView: 18 | @echo 19 | @echo Making all in subdirectory $@... 20 | $(MAKE) -C HelloView 21 | 22 | HelloViewApp: 23 | @echo 24 | @echo Making all in subdirectory $@... 25 | $(MAKE) -C HelloViewApp 26 | 27 | MFCExtTempl: 28 | @echo 29 | @echo Making all in subdirectory $@... 30 | $(MAKE) -C MFCExtTempl 31 | 32 | SimpleApp: 33 | @echo 34 | @echo Making all in subdirectory $@... 35 | $(MAKE) -C SimpleApp 36 | 37 | SimpleUse: 38 | @echo 39 | @echo Making all in subdirectory $@... 40 | $(MAKE) -C SimpleUse 41 | 42 | Win32DllTempl: 43 | @echo 44 | @echo Making all in subdirectory $@... 45 | $(MAKE) -C Win32DllTempl 46 | 47 | clean: $(CLEANSUBDIRS) 48 | 49 | $(CLEANSUBDIRS): 50 | @cd $(basename $@) ; $(MAKE) clean 51 | 52 | 53 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/SimpleApp/Main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Example/Modules/SimpleApp/Main.cpp -------------------------------------------------------------------------------- /code/pkg_Example/Modules/SimpleApp/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../../../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | CFLAGS += -I$(INCLUDE_DIR)/pkg_Core/Interface 5 | CFLAGS += -I$(INCLUDE_DIR)/pkg_Example/Interface 6 | 7 | CFLAGS += -D_CONSOLE 8 | 9 | all: 10 | $(CC) $(CFLAGS) -c Main.cpp 11 | $(CC) $(C_FLAGS) -o $(UNITTESTS_DIR)/SimpleApp.app *.o $(LIBS) 12 | clean: 13 | rm -rf *.so 14 | rm -rf *.o 15 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/SimpleUse/Main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Example/Modules/SimpleUse/Main.cpp -------------------------------------------------------------------------------- /code/pkg_Example/Modules/SimpleUse/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../../../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | CFLAGS += -I$(INCLUDE_DIR)/pkg_Core/Interface 5 | CFLAGS += -I$(INCLUDE_DIR)/pkg_Example/Interface 6 | 7 | CFLAGS += -D_CONSOLE 8 | 9 | all: 10 | $(CC) $(CFLAGS) -c Main.cpp 11 | $(CC) $(C_FLAGS) -o $(UNITTESTS_DIR)/SimpleUse.app *.o $(LIBS) 12 | clean: 13 | rm -rf *.so 14 | rm -rf *.o 15 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/Win32DllTempl/Cx_Example.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "Cx_Example.h" 3 | 4 | Cx_Example::Cx_Example() 5 | { 6 | } 7 | 8 | Cx_Example::~Cx_Example() 9 | { 10 | } 11 | 12 | void Cx_Example::Foo(long& value) 13 | { 14 | value = 1; 15 | } 16 | 17 | void Cx_Example::Foo2(long& value) 18 | { 19 | value = 2; 20 | } 21 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/Win32DllTempl/Cx_Example.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class Cx_Example 6 | : public Ix_Example 7 | , public Ix_Example2 8 | { 9 | X3BEGIN_CLASS_DECLARE(Cx_Example) 10 | X3DEFINE_INTERFACE_ENTRY(Ix_Example) 11 | X3DEFINE_INTERFACE_ENTRY(Ix_Example2) 12 | X3END_CLASS_DECLARE() 13 | protected: 14 | Cx_Example(); 15 | virtual ~Cx_Example(); 16 | 17 | private: 18 | // From Ix_Example 19 | virtual void Foo(long& value); 20 | 21 | // From Ix_Example2 22 | virtual void Foo2(long& value); 23 | }; 24 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/Win32DllTempl/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../../../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Core/Interface 5 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Example/Interface 6 | 7 | all: 8 | $(CC) $(CFLAGS_SO) -c Cx_Example.cpp 9 | $(CC) $(CFLAGS_SO) -c Plugin.cpp 10 | $(CC) $(CFLAGS_SO) -c Module.cpp 11 | $(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libWin32DllTempl.so *.o 12 | clean: 13 | rm -rf *.so 14 | rm -rf *.o 15 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/Win32DllTempl/Module.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "Cx_Example.h" 6 | 7 | XBEGIN_DEFINE_MODULE() 8 | XDEFINE_CLASSMAP_ENTRY(CLSID_Example, Cx_Example) 9 | XEND_DEFINE_MODULE_DLL() 10 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/Win32DllTempl/Plugin.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // Optional function to initialize this plugin when loaded by the plugin manager. 4 | OUTAPI bool x3InitializePlugin() 5 | { 6 | return true; 7 | } 8 | 9 | // Optional function to free this plugin when unloaded by the plugin manager. 10 | OUTAPI void x3UninitializePlugin() 11 | { 12 | } 13 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/Win32DllTempl/Version.rc2: -------------------------------------------------------------------------------- 1 | // Version.rc2 - resources Microsoft Visual C++ does not edit directly 2 | // 3 | // TODO: Change values of FILEVERSION and FileVersion 4 | // 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION 1,0,0,1 8 | FILEFLAGSMASK 0x3fL 9 | #ifdef _DEBUG 10 | FILEFLAGS 0x1L 11 | #else 12 | FILEFLAGS 0x0L 13 | #endif 14 | FILEOS 0x4L 15 | FILETYPE 0x2L 16 | FILESUBTYPE 0x0L 17 | BEGIN 18 | BLOCK "StringFileInfo" 19 | BEGIN 20 | BLOCK "000004b0" 21 | BEGIN 22 | VALUE "FileDescription", "Win32DllTempl plugin\0" 23 | VALUE "FileVersion", "1.0.0.1\0" 24 | VALUE "LegalCopyright", "(C) 2008-2011, X3 C++ PluginFramework\0" 25 | VALUE "OriginalFilename", "Win32DllTempl.plugin.dll\0" 26 | VALUE "ProductName", "X3 C++ PluginFramework\0" 27 | END 28 | END 29 | BLOCK "VarFileInfo" 30 | BEGIN 31 | VALUE "Translation", 0x0, 1200 32 | END 33 | END 34 | -------------------------------------------------------------------------------- /code/pkg_Example/Modules/Win32DllTempl/Win32DllTempl.rc: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | #include 3 | LANGUAGE 0, 0 // LANG_NEUTRAL, SUBLANG_NEUTRAL 4 | #pragma code_page(1252) 5 | #include "Version.rc2" 6 | #endif 7 | -------------------------------------------------------------------------------- /code/pkg_Platform/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | 3 | ROOTDIR = ../.. 4 | include $(ROOTDIR)/config.mk 5 | 6 | SUBDIRS = $(filter-out Interface/, $(sort $(dir $(wildcard */)))) 7 | CLEANSUBDIRS = $(addsuffix .clean, $(SUBDIRS)) 8 | 9 | .PHONY: Modules 10 | 11 | Modules: 12 | @echo 13 | @echo Making all in subdirectory $@... 14 | $(MAKE) -C Modules 15 | 16 | clean: $(CLEANSUBDIRS) 17 | 18 | $(CLEANSUBDIRS): 19 | @cd $(basename $@) ; $(MAKE) clean 20 | 21 | -------------------------------------------------------------------------------- /code/pkg_Platform/Modules/ComHook/ComCreator.h: -------------------------------------------------------------------------------- 1 | #ifndef _COMHOOK_COMCREATOR_H 2 | #define _COMHOOK_COMCREATOR_H 3 | 4 | class CComCreator 5 | { 6 | public: 7 | static void Free(); 8 | static bool Hook(HMODULE hmod); 9 | static bool Unhook(HMODULE hmod); 10 | 11 | private: 12 | static HRESULT WINAPI Hook_CoCreateInstance(REFCLSID rclsid, 13 | LPUNKNOWN pUnkOuter, DWORD dwClsContext, 14 | REFIID riid, LPVOID* ppv); 15 | static HRESULT LocalCreateInstance(REFCLSID rclsid, REFIID riid, LPVOID* ppv); 16 | }; 17 | 18 | #endif // _COMHOOK_COMCREATOR_H 19 | -------------------------------------------------------------------------------- /code/pkg_Platform/Modules/ComHook/ComFileMap.h: -------------------------------------------------------------------------------- 1 | #ifndef _COMHOOK_COMFILEMAP_H 2 | #define _COMHOOK_COMFILEMAP_H 3 | 4 | class CComFileMap 5 | { 6 | public: 7 | CComFileMap(); 8 | ~CComFileMap(); 9 | 10 | void Free(); 11 | std::wstring GetComFile(const std::wstring& clsid); 12 | 13 | private: 14 | void LoadMapFile(const std::wstring& filename); 15 | 16 | bool m_loaded; 17 | std::map m_map; 18 | }; 19 | 20 | class CComModules 21 | { 22 | public: 23 | CComModules(); 24 | ~CComModules(); 25 | 26 | void Free(); 27 | HMODULE GetModule(const std::wstring& filename); 28 | 29 | private: 30 | std::vector m_modules; 31 | }; 32 | 33 | #endif // _COMHOOK_COMFILEMAP_H 34 | 35 | -------------------------------------------------------------------------------- /code/pkg_Platform/Modules/ComHook/ComHook.rc: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | #include 3 | LANGUAGE 0, 0 // LANG_NEUTRAL, SUBLANG_NEUTRAL 4 | #pragma code_page(1252) 5 | #include "Version.rc2" 6 | #endif 7 | -------------------------------------------------------------------------------- /code/pkg_Platform/Modules/ComHook/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../../../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Core/Interface 5 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Platform/Interface 6 | 7 | all: 8 | $(CC) $(CFLAGS_SO) -c ApiHook.cpp 9 | $(CC) $(CFLAGS_SO) -c ComCreator.cpp 10 | $(CC) $(CFLAGS_SO) -c ComFileMap.cpp 11 | $(CC) $(CFLAGS_SO) -c Module.cpp 12 | $(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libComHook.so *.o 13 | clean: 14 | rm -rf *.so 15 | rm -rf *.o 16 | -------------------------------------------------------------------------------- /code/pkg_Platform/Modules/ComHook/Module.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "ComCreator.h" 6 | #include 7 | 8 | XBEGIN_DEFINE_MODULE() 9 | XEND_DEFINE_MODULE_DLL() 10 | 11 | OUTAPI bool x3InitializePlugin() 12 | { 13 | Cx_Interface loader(x3GetObjectFactory()); 14 | HMODULE hmod; 15 | std::wstring file; 16 | int count = 0; 17 | 18 | for (int i = 1; loader->GetPluginFileName(i, hmod, file); i++) 19 | { 20 | if (CComCreator::Hook(hmod)) 21 | { 22 | count++; 23 | } 24 | } 25 | if (CComCreator::Hook(NULL)) 26 | { 27 | count++; 28 | } 29 | 30 | return true; 31 | } 32 | 33 | OUTAPI void x3UninitializePlugin() 34 | { 35 | Cx_Interface loader(x3GetObjectFactory()); 36 | HMODULE hmod; 37 | std::wstring file; 38 | int count = 0; 39 | 40 | for (int i = 0; loader->GetPluginFileName(i, hmod, file); i++) 41 | { 42 | count += CComCreator::Unhook(hmod) ? 1 : 0; 43 | } 44 | count += CComCreator::Unhook(NULL) ? 1 : 0; 45 | 46 | CComCreator::Free(); 47 | } 48 | -------------------------------------------------------------------------------- /code/pkg_Platform/Modules/ComHook/Version.rc2: -------------------------------------------------------------------------------- 1 | // Version.rc2 - resources Microsoft Visual C++ does not edit directly 2 | // 3 | // TODO: Change values of FILEVERSION and FileVersion 4 | // 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION 1,0,1,2 8 | FILEFLAGSMASK 0x3fL 9 | #ifdef _DEBUG 10 | FILEFLAGS 0x1L 11 | #else 12 | FILEFLAGS 0x0L 13 | #endif 14 | FILEOS 0x4L 15 | FILETYPE 0x2L 16 | FILESUBTYPE 0x0L 17 | BEGIN 18 | BLOCK "StringFileInfo" 19 | BEGIN 20 | BLOCK "000004b0" 21 | BEGIN 22 | VALUE "FileDescription", "Plugin for hooking CoCreateInstance\0" 23 | VALUE "FileVersion", "1.0.1.2\0" 24 | VALUE "LegalCopyright", "(C) 2008-2011, X3 C++ PluginFramework\0" 25 | VALUE "OriginalFilename", "ComHook.plugin.dll\0" 26 | VALUE "ProductName", "X3 C++ PluginFramework\0" 27 | END 28 | END 29 | BLOCK "VarFileInfo" 30 | BEGIN 31 | VALUE "Translation", 0x0, 1200 32 | END 33 | END 34 | -------------------------------------------------------------------------------- /code/pkg_Platform/Modules/HookManager/Cx_HookManager.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #ifndef _X3_HOOKMANAGER_IMPL_H 3 | #define _X3_HOOKMANAGER_IMPL_H 4 | 5 | #include 6 | 7 | class Cx_HookManager : public Ix_HookManager 8 | { 9 | X3BEGIN_CLASS_DECLARE(Cx_HookManager) 10 | X3DEFINE_INTERFACE_ENTRY(Ix_HookManager) 11 | X3END_CLASS_DECLARE() 12 | protected: 13 | Cx_HookManager(); 14 | ~Cx_HookManager(); 15 | 16 | private: 17 | virtual long HookPlugins(LPCWSTR dllname, LPCSTR func, PROC newproc); 18 | virtual long UnhookPlugins(PROC newproc); 19 | virtual bool HookProc(PROC oldproc, PROC newproc, HMODULE hmod = NULL); 20 | virtual bool UnhookProc(PROC newproc, HMODULE hmod = NULL); 21 | 22 | private: 23 | typedef std::pair KEY; 24 | std::map m_new2old; 25 | }; 26 | 27 | #endif // _X3_HOOKMANAGER_IMPL_H 28 | -------------------------------------------------------------------------------- /code/pkg_Platform/Modules/HookManager/HookManager.rc: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | #include 3 | LANGUAGE 0, 0 // LANG_NEUTRAL, SUBLANG_NEUTRAL 4 | #pragma code_page(1252) 5 | #include "Version.rc2" 6 | #endif 7 | -------------------------------------------------------------------------------- /code/pkg_Platform/Modules/HookManager/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../../../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Core/Interface 5 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Platform/Interface 6 | 7 | all: 8 | $(CC) $(CFLAGS_SO) -c Cx_HookManager.cpp 9 | $(CC) $(CFLAGS_SO) -c Module.cpp 10 | $(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libHookManager.so *.o 11 | clean: 12 | rm -rf *.so 13 | rm -rf *.o 14 | -------------------------------------------------------------------------------- /code/pkg_Platform/Modules/HookManager/Module.cpp: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #include 3 | #include 4 | #include 5 | 6 | #include "Cx_HookManager.h" 7 | 8 | XBEGIN_DEFINE_MODULE() 9 | XDEFINE_CLASSMAP_ENTRY_Singleton(x3::CLSID_HookManager, Cx_HookManager) 10 | XEND_DEFINE_MODULE_DLL() 11 | -------------------------------------------------------------------------------- /code/pkg_Platform/Modules/HookManager/Version.rc2: -------------------------------------------------------------------------------- 1 | // Version.rc2 - resources Microsoft Visual C++ does not edit directly 2 | // 3 | // TODO: Change values of FILEVERSION and FileVersion 4 | // 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION 1,0,0,0 8 | FILEFLAGSMASK 0x3fL 9 | #ifdef _DEBUG 10 | FILEFLAGS 0x1L 11 | #else 12 | FILEFLAGS 0x0L 13 | #endif 14 | FILEOS 0x4L 15 | FILETYPE 0x2L 16 | FILESUBTYPE 0x0L 17 | BEGIN 18 | BLOCK "StringFileInfo" 19 | BEGIN 20 | BLOCK "000004b0" 21 | BEGIN 22 | VALUE "FileDescription", "Plugin for hooking windows functions.\0" 23 | VALUE "FileVersion", "1.0.0.0\0" 24 | VALUE "LegalCopyright", "(C) 2008-2011, X3 C++ PluginFramework\0" 25 | VALUE "OriginalFilename", "HookManager.plugin.dll\0" 26 | VALUE "ProductName", "X3 C++ PluginFramework\0" 27 | END 28 | END 29 | BLOCK "VarFileInfo" 30 | BEGIN 31 | VALUE "Translation", 0x0, 1200 32 | END 33 | END 34 | -------------------------------------------------------------------------------- /code/pkg_Platform/Modules/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | 3 | ROOTDIR = ../../.. 4 | include $(ROOTDIR)/config.mk 5 | 6 | SUBDIRS = $(filter-out Public/ HookManager/ ComHook/, $(sort $(dir $(wildcard */)))) 7 | CLEANSUBDIRS = $(addsuffix .clean, $(SUBDIRS)) 8 | 9 | .PHONY: x3core 10 | all: x3core 11 | 12 | x3core: 13 | @echo 14 | @echo Making all in subdirectory $@... 15 | $(MAKE) -C x3core 16 | 17 | clean: $(CLEANSUBDIRS) 18 | 19 | $(CLEANSUBDIRS): 20 | @cd $(basename $@) ; $(MAKE) clean 21 | -------------------------------------------------------------------------------- /code/pkg_Platform/Modules/Public/ApiHook.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIN32_APIHOOK_H 2 | #define _WIN32_APIHOOK_H 3 | 4 | //! Replace a API function in the import directory of the specified module. 5 | /*! The functions and module are all in the current process. 6 | \param dllname Name of the module imported by hmod, such as 'user32.dll'. 7 | If dllname is empty or null then auto search in all modules. 8 | \param oldproc A function of the module of 'dllname'. 9 | \param newproc A function to be used. 10 | \param hmod The specified module whose import directory will be replaced. 11 | If hmod is null then use the main application module. 12 | \return true if replaced successful. 13 | */ 14 | bool HookModuleFunction(LPCSTR dllname, PROC oldproc, PROC newproc, HMODULE hmod = NULL); 15 | 16 | #endif // _WIN32_APIHOOK_H 17 | -------------------------------------------------------------------------------- /code/pkg_Platform/Modules/Public/complugin_impl.h: -------------------------------------------------------------------------------- 1 | /*! \file complugin_impl.h 2 | * \brief Implement COM plugin. 3 | * \note Include this file in dllmain.cpp instead of XModuleImpl.h or XComCreator.h . 4 | * \see complugin_inc.h 5 | */ 6 | #ifndef X3_COMPLUGIN_IMPL_H_ 7 | #define X3_COMPLUGIN_IMPL_H_ 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | XBEGIN_DEFINE_MODULE() 14 | XEND_DEFINE_MODULE() 15 | 16 | #if _MSC_VER <= 1200 17 | BEGIN_OBJECT_MAP(ObjectMap) 18 | END_OBJECT_MAP() 19 | ATL::_ATL_OBJMAP_ENTRY* GetObjectMap() { return ObjectMap; } 20 | #endif 21 | 22 | static CPluginManager* s_loader = NULL; 23 | HINSTANCE AtlPluginImpl::hInstance = NULL; 24 | 25 | bool AtlPluginImpl::IsPluginLoaded() 26 | { 27 | return x3GetObjectFactory() != NULL; 28 | } 29 | 30 | long AtlPluginImpl::LoadPlugins(bool delay, LPCWSTR subdir, LPCWSTR plugins) 31 | { 32 | ASSERT(!x3GetObjectFactory() && !s_loader); 33 | ASSERT(subdir && plugins); 34 | 35 | long count = 0; 36 | 37 | s_loader = new CPluginManager; 38 | if (s_loader->LoadCorePlugins(subdir, hInstance, delay)) 39 | { 40 | s_loader->GetPluginLoader()->RegisterPlugin(hInstance); 41 | count = s_loader->GetPluginLoader()->LoadPluginFiles( 42 | subdir, plugins, hInstance, delay); 43 | s_loader->GetPluginLoader()->InitializePlugins(); 44 | } 45 | 46 | return count; 47 | } 48 | 49 | void AtlPluginImpl::UnloadPlugins() 50 | { 51 | x3::SafeDelete(s_loader); 52 | } 53 | 54 | #endif // X3_COMPLUGIN_IMPL_H_ 55 | -------------------------------------------------------------------------------- /code/pkg_Platform/Modules/x3core/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../../../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Core/Interface 5 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Platform/Interface 6 | 7 | SWIG += -I$(INCLUDE_DIR)/pkg_Core/Interface 8 | SWIG += -outdir $(SWIGOUT_DIR) 9 | 10 | all: 11 | -@mkdir -p $(SWIGOUT_DIR) 12 | $(SWIG) x3core.i 13 | $(CC) $(CFLAGS_SO) -c Module.cpp 14 | $(CC) $(C_FLAGS_SO) -o $(SWIGOUT_DIR)/_x3core$(SWIGOUT_EXT) *.o 15 | clean: 16 | rm -rf *.so 17 | rm -rf *.o 18 | rm -rf x3core_wrap.cxx 19 | -------------------------------------------------------------------------------- /code/pkg_Platform/Modules/x3core/Version.rc2: -------------------------------------------------------------------------------- 1 | // Version.rc2 - resources Microsoft Visual C++ does not edit directly 2 | // 3 | // TODO: Change values of FILEVERSION and FileVersion 4 | // 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION 1,0,0,1 8 | FILEFLAGSMASK 0x3fL 9 | #ifdef _DEBUG 10 | FILEFLAGS 0x1L 11 | #else 12 | FILEFLAGS 0x0L 13 | #endif 14 | FILEOS 0x4L 15 | FILETYPE 0x2L 16 | FILESUBTYPE 0x0L 17 | BEGIN 18 | BLOCK "StringFileInfo" 19 | BEGIN 20 | BLOCK "000004b0" 21 | BEGIN 22 | VALUE "FileDescription", "Adaptor module for python.\0" 23 | VALUE "FileVersion", "1.0.0.1\0" 24 | VALUE "LegalCopyright", "(C) 2008-2011, X3 C++ PluginFramework\0" 25 | VALUE "OriginalFilename", "_x3core.pyd\0" 26 | VALUE "ProductName", "X3 C++ PluginFramework\0" 27 | END 28 | END 29 | BLOCK "VarFileInfo" 30 | BEGIN 31 | VALUE "Translation", 0x0, 1200 32 | END 33 | END 34 | -------------------------------------------------------------------------------- /code/pkg_Platform/Modules/x3core/testcore.py: -------------------------------------------------------------------------------- 1 | import x3core as C 2 | 3 | C.LoadPluginFiles("ChangeManager") 4 | assert(C.LoadAllPlugins() > 0) 5 | for f in C.GetPluginFiles(): print(f) 6 | 7 | C.UnloadPlugins() 8 | -------------------------------------------------------------------------------- /code/pkg_Platform/Modules/x3core/x3core.i: -------------------------------------------------------------------------------- 1 | %module x3core 2 | 3 | %{ 4 | #include 5 | #include 6 | 7 | bool LoadCorePlugins(); 8 | bool LoadAllPlugins(); 9 | bool LoadPluginFiles(const char* files); 10 | void UnloadPlugins(); 11 | std::vector GetPluginFiles(); 12 | %} 13 | 14 | %include stl.i 15 | %include std_vector.i 16 | %include std_string.i 17 | 18 | bool LoadCorePlugins(); 19 | bool LoadAllPlugins(); 20 | bool LoadPluginFiles(const char* files); 21 | void UnloadPlugins(); 22 | std::vector GetPluginFiles(); 23 | -------------------------------------------------------------------------------- /code/pkg_Platform/Modules/x3core/x3core.rc: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | #include 3 | LANGUAGE 0, 0 // LANG_NEUTRAL, SUBLANG_NEUTRAL 4 | #pragma code_page(1252) 5 | #include "Version.rc2" 6 | #endif 7 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/BriefTestProgressListener.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_BRIEFTESTPROGRESSLISTENER_H 2 | #define CPPUNIT_BRIEFTESTPROGRESSLISTENER_H 3 | 4 | #include 5 | 6 | 7 | CPPUNIT_NS_BEGIN 8 | 9 | 10 | /*! \brief TestListener that prints the name of each test before running it. 11 | * \ingroup TrackingTestExecution 12 | */ 13 | class CPPUNIT_API BriefTestProgressListener : public TestListener 14 | { 15 | public: 16 | /*! Constructs a BriefTestProgressListener object. 17 | */ 18 | BriefTestProgressListener(); 19 | 20 | /// Destructor. 21 | virtual ~BriefTestProgressListener(); 22 | 23 | void startTest( Test *test ); 24 | 25 | void addFailure( const TestFailure &failure ); 26 | 27 | void endTest( Test *test ); 28 | 29 | private: 30 | /// Prevents the use of the copy constructor. 31 | BriefTestProgressListener( const BriefTestProgressListener © ); 32 | 33 | /// Prevents the use of the copy operator. 34 | void operator =( const BriefTestProgressListener © ); 35 | 36 | private: 37 | bool m_lastTestFailed; 38 | }; 39 | 40 | 41 | CPPUNIT_NS_END 42 | 43 | #endif // CPPUNIT_BRIEFTESTPROGRESSLISTENER_H 44 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/Outputter.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_OUTPUTTER_H 2 | #define CPPUNIT_OUTPUTTER_H 3 | 4 | #include 5 | 6 | 7 | CPPUNIT_NS_BEGIN 8 | 9 | 10 | /*! \brief Abstract outputter to print test result summary. 11 | * \ingroup WritingTestResult 12 | */ 13 | class CPPUNIT_API Outputter 14 | { 15 | public: 16 | /// Destructor. 17 | virtual ~Outputter() {} 18 | 19 | virtual void write() =0; 20 | }; 21 | 22 | 23 | CPPUNIT_NS_END 24 | 25 | 26 | #endif // CPPUNIT_OUTPUTTER_H 27 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/TestCase.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_TESTCASE_H 2 | #define CPPUNIT_TESTCASE_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | 11 | CPPUNIT_NS_BEGIN 12 | 13 | 14 | class TestResult; 15 | 16 | 17 | /*! \brief A single test object. 18 | * 19 | * This class is used to implement a simple test case: define a subclass 20 | * that overrides the runTest method. 21 | * 22 | * You don't usually need to use that class, but TestFixture and TestCaller instead. 23 | * 24 | * You are expected to subclass TestCase is you need to write a class similiar 25 | * to TestCaller. 26 | */ 27 | class CPPUNIT_API TestCase : public TestLeaf, 28 | public TestFixture 29 | { 30 | public: 31 | 32 | TestCase( const std::string &name ); 33 | 34 | TestCase(); 35 | 36 | ~TestCase(); 37 | 38 | virtual void run(TestResult *result); 39 | 40 | std::string getName() const; 41 | 42 | //! FIXME: this should probably be pure virtual. 43 | virtual void runTest(); 44 | 45 | private: 46 | TestCase( const TestCase &other ); 47 | TestCase &operator=( const TestCase &other ); 48 | 49 | private: 50 | const std::string m_name; 51 | }; 52 | 53 | CPPUNIT_NS_END 54 | 55 | #endif // CPPUNIT_TESTCASE_H 56 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/TestComposite.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_TESTCOMPSITE_H // -*- C++ -*- 2 | #define CPPUNIT_TESTCOMPSITE_H 3 | 4 | #include 5 | #include 6 | 7 | CPPUNIT_NS_BEGIN 8 | 9 | 10 | /*! \brief A Composite of Tests. 11 | * 12 | * Base class for all test composites. Subclass this class if you need to implement 13 | * a custom TestSuite. 14 | * 15 | * \see Test, TestSuite. 16 | */ 17 | class CPPUNIT_API TestComposite : public Test 18 | { 19 | public: 20 | TestComposite( const std::string &name = "" ); 21 | 22 | ~TestComposite(); 23 | 24 | void run( TestResult *result ); 25 | 26 | int countTestCases() const; 27 | 28 | std::string getName() const; 29 | 30 | private: 31 | TestComposite( const TestComposite &other ); 32 | TestComposite &operator =( const TestComposite &other ); 33 | 34 | virtual void doStartSuite( TestResult *controller ); 35 | virtual void doRunChildTests( TestResult *controller ); 36 | virtual void doEndSuite( TestResult *controller ); 37 | 38 | private: 39 | const std::string m_name; 40 | }; 41 | 42 | 43 | CPPUNIT_NS_END 44 | 45 | #endif // CPPUNIT_TESTCOMPSITE_H 46 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/TestFailure.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_TESTFAILURE_H // -*- C++ -*- 2 | #define CPPUNIT_TESTFAILURE_H 3 | 4 | #include 5 | #include 6 | 7 | CPPUNIT_NS_BEGIN 8 | 9 | 10 | class Exception; 11 | class SourceLine; 12 | class Test; 13 | 14 | 15 | /*! \brief Record of a failed Test execution. 16 | * \ingroup BrowsingCollectedTestResult 17 | * 18 | * A TestFailure collects a failed test together with 19 | * the caught exception. 20 | * 21 | * TestFailure assumes lifetime control for any exception 22 | * passed to it. 23 | */ 24 | class CPPUNIT_API TestFailure 25 | { 26 | public: 27 | TestFailure( Test *failedTest, 28 | Exception *thrownException, 29 | bool isError ); 30 | 31 | virtual ~TestFailure (); 32 | 33 | virtual Test *failedTest() const; 34 | 35 | virtual Exception *thrownException() const; 36 | 37 | virtual SourceLine sourceLine() const; 38 | 39 | virtual bool isError() const; 40 | 41 | virtual std::string failedTestName() const; 42 | 43 | virtual TestFailure *clone() const; 44 | 45 | protected: 46 | Test *m_failedTest; 47 | Exception *m_thrownException; 48 | bool m_isError; 49 | 50 | private: 51 | TestFailure( const TestFailure &other ); 52 | TestFailure &operator =( const TestFailure& other ); 53 | }; 54 | 55 | 56 | CPPUNIT_NS_END 57 | 58 | #endif // CPPUNIT_TESTFAILURE_H 59 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/TestLeaf.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_TESTLEAF_H 2 | #define CPPUNIT_TESTLEAF_H 3 | 4 | #include 5 | 6 | 7 | CPPUNIT_NS_BEGIN 8 | 9 | 10 | /*! \brief A single test object. 11 | * 12 | * Base class for single test case: a test that doesn't have any children. 13 | * 14 | */ 15 | class CPPUNIT_API TestLeaf: public Test 16 | { 17 | public: 18 | /*! Returns 1 as the default number of test cases invoked by run(). 19 | * 20 | * You may override this method when many test cases are invoked (RepeatedTest 21 | * for example). 22 | * 23 | * \return 1. 24 | * \see Test::countTestCases(). 25 | */ 26 | int countTestCases() const; 27 | 28 | /*! Returns the number of child of this test case: 0. 29 | * 30 | * You should never override this method: a TestLeaf as no children by definition. 31 | * 32 | * \return 0. 33 | */ 34 | int getChildTestCount() const; 35 | 36 | /*! Always throws std::out_of_range. 37 | * \see Test::doGetChildTestAt(). 38 | */ 39 | Test *doGetChildTestAt( int index ) const; 40 | }; 41 | 42 | CPPUNIT_NS_END 43 | 44 | #endif // CPPUNIT_TESTLEAF_H 45 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/TestSuccessListener.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_TESTSUCCESSLISTENER_H 2 | #define CPPUNIT_TESTSUCCESSLISTENER_H 3 | 4 | #include 5 | #include 6 | 7 | 8 | CPPUNIT_NS_BEGIN 9 | 10 | 11 | /*! \brief TestListener that checks if any test case failed. 12 | * \ingroup TrackingTestExecution 13 | */ 14 | class CPPUNIT_API TestSuccessListener : public TestListener, 15 | public SynchronizedObject 16 | { 17 | public: 18 | /*! Constructs a TestSuccessListener object. 19 | */ 20 | TestSuccessListener( SynchronizationObject *syncObject = 0 ); 21 | 22 | /// Destructor. 23 | virtual ~TestSuccessListener(); 24 | 25 | virtual void reset(); 26 | 27 | void addFailure( const TestFailure &failure ); 28 | 29 | /// Returns whether the entire test was successful or not. 30 | virtual bool wasSuccessful() const; 31 | 32 | private: 33 | bool m_success; 34 | }; 35 | 36 | 37 | CPPUNIT_NS_END 38 | 39 | #endif // CPPUNIT_TESTSUCCESSLISTENER_H 40 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/TextOutputter.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_TEXTOUTPUTTER_H 2 | #define CPPUNIT_TEXTOUTPUTTER_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | CPPUNIT_NS_BEGIN 9 | 10 | 11 | class Exception; 12 | class SourceLine; 13 | class TestResultCollector; 14 | class TestFailure; 15 | 16 | 17 | /*! \brief Prints a TestResultCollector to a text stream. 18 | * \ingroup WritingTestResult 19 | */ 20 | class CPPUNIT_API TextOutputter : public Outputter 21 | { 22 | public: 23 | TextOutputter( TestResultCollector *result, 24 | OStream &stream ); 25 | 26 | /// Destructor. 27 | virtual ~TextOutputter(); 28 | 29 | void write(); 30 | virtual void printFailures(); 31 | virtual void printHeader(); 32 | 33 | virtual void printFailure( TestFailure *failure, 34 | int failureNumber ); 35 | virtual void printFailureListMark( int failureNumber ); 36 | virtual void printFailureTestName( TestFailure *failure ); 37 | virtual void printFailureType( TestFailure *failure ); 38 | virtual void printFailureLocation( SourceLine sourceLine ); 39 | virtual void printFailureDetail( Exception *thrownException ); 40 | virtual void printFailureWarning(); 41 | virtual void printStatistics(); 42 | 43 | protected: 44 | TestResultCollector *m_result; 45 | OStream &m_stream; 46 | 47 | private: 48 | /// Prevents the use of the copy constructor. 49 | TextOutputter( const TextOutputter © ); 50 | 51 | /// Prevents the use of the copy operator. 52 | void operator =( const TextOutputter © ); 53 | }; 54 | 55 | 56 | 57 | CPPUNIT_NS_END 58 | 59 | #endif // CPPUNIT_TEXTOUTPUTTER_H 60 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/TextTestProgressListener.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_TEXTTESTPROGRESSLISTENER_H 2 | #define CPPUNIT_TEXTTESTPROGRESSLISTENER_H 3 | 4 | #include 5 | 6 | 7 | CPPUNIT_NS_BEGIN 8 | 9 | 10 | /*! 11 | * \brief TestListener that show the status of each TestCase test result. 12 | * \ingroup TrackingTestExecution 13 | */ 14 | class CPPUNIT_API TextTestProgressListener : public TestListener 15 | { 16 | public: 17 | /*! Constructs a TextTestProgressListener object. 18 | */ 19 | TextTestProgressListener(); 20 | 21 | /// Destructor. 22 | virtual ~TextTestProgressListener(); 23 | 24 | void startTest( Test *test ); 25 | 26 | void addFailure( const TestFailure &failure ); 27 | 28 | void endTestRun( Test *test, 29 | TestResult *eventManager ); 30 | 31 | private: 32 | /// Prevents the use of the copy constructor. 33 | TextTestProgressListener( const TextTestProgressListener © ); 34 | 35 | /// Prevents the use of the copy operator. 36 | void operator =( const TextTestProgressListener © ); 37 | 38 | private: 39 | }; 40 | 41 | 42 | CPPUNIT_NS_END 43 | 44 | #endif // CPPUNIT_TEXTTESTPROGRESSLISTENER_H 45 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/TextTestResult.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_TEXTTESTRESULT_H 2 | #define CPPUNIT_TEXTTESTRESULT_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | CPPUNIT_NS_BEGIN 9 | 10 | 11 | class SourceLine; 12 | class Exception; 13 | class Test; 14 | 15 | /*! \brief Holds printable test result (DEPRECATED). 16 | * \ingroup TrackingTestExecution 17 | * 18 | * deprecated Use class TextTestProgressListener and TextOutputter instead. 19 | */ 20 | class CPPUNIT_API TextTestResult : public TestResult, 21 | public TestResultCollector 22 | { 23 | public: 24 | TextTestResult(); 25 | 26 | virtual void addFailure( const TestFailure &failure ); 27 | virtual void startTest( Test *test ); 28 | virtual void print( OStream &stream ); 29 | }; 30 | 31 | /** insertion operator for easy output */ 32 | CPPUNIT_API OStream &operator <<( OStream &stream, 33 | TextTestResult &result ); 34 | 35 | CPPUNIT_NS_END 36 | 37 | #endif // CPPUNIT_TEXTTESTRESULT_H 38 | 39 | 40 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/TextTestRunner.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_TEXTTESTRUNNER_H 2 | #define CPPUNIT_TEXTTESTRUNNER_H 3 | 4 | #include 5 | 6 | #endif // CPPUNIT_TEXTTESTRUNNER_H 7 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/config/CppUnitApi.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_CONFIG_CPPUNITAPI 2 | #define CPPUNIT_CONFIG_CPPUNITAPI 3 | 4 | #undef CPPUNIT_API 5 | 6 | #ifdef WIN32 7 | 8 | // define CPPUNIT_DLL_BUILD when building CppUnit dll. 9 | #ifdef CPPUNIT_BUILD_DLL 10 | #define CPPUNIT_API __declspec(dllexport) 11 | #endif 12 | 13 | // define CPPUNIT_DLL when linking to CppUnit dll. 14 | #ifdef CPPUNIT_DLL 15 | #define CPPUNIT_API __declspec(dllimport) 16 | #endif 17 | 18 | #ifdef CPPUNIT_API 19 | #undef CPPUNIT_NEED_DLL_DECL 20 | #define CPPUNIT_NEED_DLL_DECL 1 21 | #endif 22 | 23 | #endif 24 | 25 | 26 | #ifndef CPPUNIT_API 27 | #define CPPUNIT_API 28 | #undef CPPUNIT_NEED_DLL_DECL 29 | #define CPPUNIT_NEED_DLL_DECL 0 30 | #endif 31 | 32 | 33 | #endif // CPPUNIT_CONFIG_CPPUNITAPI 34 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/config/SourcePrefix.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_CONFIG_H_INCLUDED 2 | #define CPPUNIT_CONFIG_H_INCLUDED 3 | 4 | #include 5 | 6 | #ifdef _MSC_VER 7 | #pragma warning(disable: 4018 4284 4146) 8 | #if _MSC_VER >= 1400 9 | #pragma warning(disable: 4996) // sprintf is deprecated 10 | #endif 11 | #endif 12 | 13 | 14 | #endif // CPPUNIT_CONFIG_H_INCLUDED 15 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/config/config-bcb5.h: -------------------------------------------------------------------------------- 1 | #ifndef _INCLUDE_CPPUNIT_CONFIG_BCB5_H 2 | #define _INCLUDE_CPPUNIT_CONFIG_BCB5_H 1 3 | 4 | #define HAVE_CMATH 1 5 | 6 | /* include/cppunit/config-bcb5.h. Manually adapted from 7 | include/cppunit/config-auto.h */ 8 | 9 | /* define to 1 if the compiler implements namespaces */ 10 | #ifndef CPPUNIT_HAVE_NAMESPACES 11 | #define CPPUNIT_HAVE_NAMESPACES 1 12 | #endif 13 | 14 | /* define if library uses std::string::compare(string,pos,n) */ 15 | #ifndef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST 16 | #define CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST 0 17 | #endif 18 | 19 | /* Define if you have the header file. */ 20 | #ifdef CPPUNIT_HAVE_DLFCN_H 21 | #undef CPPUNIT_HAVE_DLFCN_H 22 | #endif 23 | 24 | /* define to 1 if the compiler implements namespaces */ 25 | #ifndef CPPUNIT_HAVE_NAMESPACES 26 | #define CPPUNIT_HAVE_NAMESPACES 1 27 | #endif 28 | 29 | /* define if the compiler supports Run-Time Type Identification */ 30 | #ifndef CPPUNIT_HAVE_RTTI 31 | #define CPPUNIT_HAVE_RTTI 1 32 | #endif 33 | 34 | /* Define to 1 to use type_info::name() for class names */ 35 | #ifndef CPPUNIT_USE_TYPEINFO_NAME 36 | #define CPPUNIT_USE_TYPEINFO_NAME CPPUNIT_HAVE_RTTI 37 | #endif 38 | 39 | #define CPPUNIT_HAVE_SSTREAM 1 40 | 41 | /* Name of package */ 42 | #ifndef CPPUNIT_PACKAGE 43 | #define CPPUNIT_PACKAGE "cppunit" 44 | #endif 45 | 46 | /* _INCLUDE_CPPUNIT_CONFIG_BCB5_H */ 47 | #endif 48 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/extensions/RepeatedTest.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_EXTENSIONS_REPEATEDTEST_H 2 | #define CPPUNIT_EXTENSIONS_REPEATEDTEST_H 3 | 4 | #include 5 | #include 6 | 7 | CPPUNIT_NS_BEGIN 8 | 9 | 10 | class Test; 11 | class TestResult; 12 | 13 | 14 | /*! \brief Decorator that runs a test repeatedly. 15 | * 16 | * Does not assume ownership of the test it decorates 17 | */ 18 | class CPPUNIT_API RepeatedTest : public TestDecorator 19 | { 20 | public: 21 | RepeatedTest( Test *test, 22 | int timesRepeat ) : 23 | TestDecorator( test ), 24 | m_timesRepeat(timesRepeat) 25 | { 26 | } 27 | 28 | void run( TestResult *result ); 29 | 30 | int countTestCases() const; 31 | 32 | private: 33 | RepeatedTest( const RepeatedTest & ); 34 | void operator=( const RepeatedTest & ); 35 | 36 | const int m_timesRepeat; 37 | }; 38 | 39 | 40 | CPPUNIT_NS_END 41 | 42 | 43 | #endif // CPPUNIT_EXTENSIONS_REPEATEDTEST_H 44 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/extensions/TestCaseDecorator.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_EXTENSIONS_TESTCASEDECORATOR_H 2 | #define CPPUNIT_EXTENSIONS_TESTCASEDECORATOR_H 3 | 4 | #include 5 | #include 6 | 7 | CPPUNIT_NS_BEGIN 8 | 9 | 10 | /*! \brief Decorator for Test cases. 11 | * 12 | * TestCaseDecorator provides an alternate means to extend functionality 13 | * of a test class without subclassing the test. Instead, one can 14 | * subclass the decorater and use it to wrap the test class. 15 | * 16 | * Does not assume ownership of the test it decorates 17 | */ 18 | class CPPUNIT_API TestCaseDecorator : public TestCase 19 | { 20 | public: 21 | TestCaseDecorator( TestCase *test ); 22 | ~TestCaseDecorator(); 23 | 24 | std::string getName() const; 25 | 26 | void setUp(); 27 | 28 | void tearDown(); 29 | 30 | void runTest(); 31 | 32 | protected: 33 | TestCase *m_test; 34 | }; 35 | 36 | 37 | CPPUNIT_NS_END 38 | 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/extensions/TestDecorator.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_EXTENSIONS_TESTDECORATOR_H 2 | #define CPPUNIT_EXTENSIONS_TESTDECORATOR_H 3 | 4 | #include 5 | #include 6 | 7 | CPPUNIT_NS_BEGIN 8 | 9 | 10 | class TestResult; 11 | 12 | 13 | /*! \brief Decorator for Tests. 14 | * 15 | * TestDecorator provides an alternate means to extend functionality 16 | * of a test class without subclassing the test. Instead, one can 17 | * subclass the decorater and use it to wrap the test class. 18 | * 19 | * Does not assume ownership of the test it decorates 20 | */ 21 | class CPPUNIT_API TestDecorator : public Test 22 | { 23 | public: 24 | TestDecorator( Test *test ); 25 | ~TestDecorator(); 26 | 27 | int countTestCases() const; 28 | 29 | std::string getName() const; 30 | 31 | void run( TestResult *result ); 32 | 33 | int getChildTestCount() const; 34 | 35 | protected: 36 | Test *doGetChildTestAt( int index ) const; 37 | 38 | Test *m_test; 39 | 40 | private: 41 | TestDecorator( const TestDecorator &); 42 | void operator =( const TestDecorator & ); 43 | }; 44 | 45 | 46 | CPPUNIT_NS_END 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/extensions/TestFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_EXTENSIONS_TESTFACTORY_H 2 | #define CPPUNIT_EXTENSIONS_TESTFACTORY_H 3 | 4 | #include 5 | 6 | CPPUNIT_NS_BEGIN 7 | 8 | 9 | class Test; 10 | 11 | /*! \brief Abstract Test factory. 12 | */ 13 | class CPPUNIT_API TestFactory 14 | { 15 | public: 16 | virtual ~TestFactory() {} 17 | 18 | /*! Makes a new test. 19 | * \return A new Test. 20 | */ 21 | virtual Test* makeTest() = 0; 22 | }; 23 | 24 | 25 | CPPUNIT_NS_END 26 | 27 | #endif // CPPUNIT_EXTENSIONS_TESTFACTORY_H 28 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/extensions/TestFixtureFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_EXTENSIONS_TESTFIXTUREFACTORY_H 2 | #define CPPUNIT_EXTENSIONS_TESTFIXTUREFACTORY_H 3 | 4 | #include 5 | 6 | 7 | CPPUNIT_NS_BEGIN 8 | 9 | 10 | class TestFixture; 11 | 12 | /*! \brief Abstract TestFixture factory (Implementation). 13 | * 14 | * Implementation detail. Use by HelperMacros to handle TestFixture hierarchy. 15 | */ 16 | class TestFixtureFactory 17 | { 18 | public: 19 | //! Creates a new TestFixture instance. 20 | virtual TestFixture *makeFixture() =0; 21 | 22 | virtual ~TestFixtureFactory() {} 23 | }; 24 | 25 | 26 | /*! \brief Concret TestFixture factory (Implementation). 27 | * 28 | * Implementation detail. Use by HelperMacros to handle TestFixture hierarchy. 29 | */ 30 | template 31 | class ConcretTestFixtureFactory : public CPPUNIT_NS::TestFixtureFactory 32 | { 33 | /*! \brief Returns a new TestFixture instance. 34 | * \return A new fixture instance. The fixture instance is returned by 35 | * the TestFixtureFactory passed on construction. The actual type 36 | * is that of the fixture on which the static method suite() 37 | * was called. 38 | */ 39 | TestFixture *makeFixture() 40 | { 41 | return new TestFixtureType(); 42 | } 43 | }; 44 | 45 | 46 | CPPUNIT_NS_END 47 | 48 | 49 | #endif // CPPUNIT_EXTENSIONS_TESTFIXTUREFACTORY_H 50 | 51 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/extensions/TestSetUp.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_EXTENSIONS_TESTSETUP_H 2 | #define CPPUNIT_EXTENSIONS_TESTSETUP_H 3 | 4 | #include 5 | 6 | CPPUNIT_NS_BEGIN 7 | 8 | 9 | class Test; 10 | class TestResult; 11 | 12 | /*! \brief Decorates a test by providing a specific setUp() and tearDown(). 13 | */ 14 | class CPPUNIT_API TestSetUp : public TestDecorator 15 | { 16 | public: 17 | TestSetUp( Test *test ); 18 | 19 | void run( TestResult *result ); 20 | 21 | protected: 22 | virtual void setUp(); 23 | virtual void tearDown(); 24 | 25 | private: 26 | TestSetUp( const TestSetUp & ); 27 | void operator =( const TestSetUp & ); 28 | }; 29 | 30 | 31 | CPPUNIT_NS_END 32 | 33 | #endif // CPPUNIT_EXTENSIONS_TESTSETUP_H 34 | 35 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/extensions/TestSuiteFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_EXTENSIONS_TESTSUITEFACTORY_H 2 | #define CPPUNIT_EXTENSIONS_TESTSUITEFACTORY_H 3 | 4 | #include 5 | 6 | CPPUNIT_NS_BEGIN 7 | 8 | 9 | class Test; 10 | 11 | /*! \brief TestFactory for TestFixture that implements a static suite() method. 12 | * \see AutoRegisterSuite. 13 | */ 14 | template 15 | class TestSuiteFactory : public TestFactory 16 | { 17 | public: 18 | virtual Test *makeTest() 19 | { 20 | return TestCaseType::suite(); 21 | } 22 | }; 23 | 24 | 25 | CPPUNIT_NS_END 26 | 27 | #endif // CPPUNIT_EXTENSIONS_TESTSUITEFACTORY_H 28 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/extensions/TypeInfoHelper.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_TYPEINFOHELPER_H 2 | #define CPPUNIT_TYPEINFOHELPER_H 3 | 4 | #include 5 | 6 | #if CPPUNIT_HAVE_RTTI 7 | 8 | #include 9 | #include 10 | 11 | CPPUNIT_NS_BEGIN 12 | 13 | 14 | /**! \brief Helper to use type_info. 15 | */ 16 | class CPPUNIT_API TypeInfoHelper 17 | { 18 | public: 19 | /*! \brief Get the class name of the specified type_info. 20 | * \param info Info which the class name is extracted from. 21 | * \return The string returned by type_info::name() without 22 | * the "class" prefix. If the name is not prefixed 23 | * by "class", it is returned as this. 24 | */ 25 | static std::string getClassName( const std::type_info &info ); 26 | }; 27 | 28 | 29 | CPPUNIT_NS_END 30 | 31 | #endif // CPPUNIT_HAVE_RTTI 32 | 33 | #endif // CPPUNIT_TYPEINFOHELPER_H 34 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/plugin/DynamicLibraryManagerException.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_PLUGIN_DYNAMICLIBRARYMANAGEREXCEPTION_H 2 | #define CPPUNIT_PLUGIN_DYNAMICLIBRARYMANAGEREXCEPTION_H 3 | 4 | #include 5 | 6 | #if !defined(CPPUNIT_NO_TESTPLUGIN) 7 | #include 8 | #include 9 | 10 | 11 | CPPUNIT_NS_BEGIN 12 | 13 | 14 | /*! \brief Exception thrown by DynamicLibraryManager when a failure occurs. 15 | * 16 | * Use getCause() to know what function caused the failure. 17 | * 18 | */ 19 | class DynamicLibraryManagerException : public std::runtime_error 20 | { 21 | public: 22 | enum Cause 23 | { 24 | /// Failed to load the dynamic library 25 | loadingFailed =0, 26 | /// Symbol not found in the dynamic library 27 | symbolNotFound 28 | }; 29 | 30 | /// Failed to load the dynamic library or Symbol not found in the dynamic library. 31 | DynamicLibraryManagerException( const std::string &libraryName, 32 | const std::string &errorDetail, 33 | Cause cause ); 34 | 35 | ~DynamicLibraryManagerException() throw() 36 | { 37 | } 38 | 39 | Cause getCause() const; 40 | 41 | const char *what() const throw(); 42 | 43 | private: 44 | std::string m_message; 45 | Cause m_cause; 46 | }; 47 | 48 | 49 | CPPUNIT_NS_END 50 | 51 | #endif // !defined(CPPUNIT_NO_TESTPLUGIN) 52 | 53 | #endif // CPPUNIT_PLUGIN_DYNAMICLIBRARYMANAGEREXCEPTION_H 54 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/plugin/PlugInParameters.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_PLUGIN_PARAMETERS 2 | #define CPPUNIT_PLUGIN_PARAMETERS 3 | 4 | #include 5 | 6 | #if !defined(CPPUNIT_NO_TESTPLUGIN) 7 | 8 | #include 9 | #include 10 | 11 | CPPUNIT_NS_BEGIN 12 | 13 | /*! \brief Test plug-ins parameters. 14 | */ 15 | class CPPUNIT_API PlugInParameters 16 | { 17 | public: 18 | /// Constructs plug-in parameters from the specified command-line. 19 | PlugInParameters( const std::string &commandLine = "" ); 20 | 21 | virtual ~PlugInParameters(); 22 | 23 | /// Returns the command line that was passed on construction. 24 | std::string getCommandLine() const; 25 | 26 | private: 27 | std::string m_commandLine; 28 | }; 29 | 30 | 31 | CPPUNIT_NS_END 32 | 33 | #endif // !defined(CPPUNIT_NO_TESTPLUGIN) 34 | 35 | 36 | #endif // CPPUNIT_PLUGIN_PARAMETERS 37 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/plugin/TestPlugInDefaultImpl.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_PLUGIN_TESTPLUGINADAPTER 2 | #define CPPUNIT_PLUGIN_TESTPLUGINADAPTER 3 | 4 | #include 5 | 6 | #if !defined(CPPUNIT_NO_TESTPLUGIN) 7 | 8 | #include 9 | 10 | CPPUNIT_NS_BEGIN 11 | 12 | 13 | class TestSuite; 14 | 15 | 16 | /*! \brief Default implementation of test plug-in interface. 17 | * \ingroup WritingTestPlugIn 18 | * 19 | * Override getSuiteName() to specify the suite name. Default is "All Tests". 20 | * 21 | * CppUnitTestPlugIn::getTestSuite() returns a suite that contains 22 | * all the test registered to the default test factory registry 23 | * ( TestFactoryRegistry::getRegistry() ). 24 | * 25 | */ 26 | class CPPUNIT_API TestPlugInDefaultImpl : public CppUnitTestPlugIn 27 | { 28 | public: 29 | TestPlugInDefaultImpl(); 30 | 31 | virtual ~TestPlugInDefaultImpl(); 32 | 33 | void initialize( TestFactoryRegistry *registry, 34 | const PlugInParameters ¶meters ); 35 | 36 | void addListener( TestResult *eventManager ); 37 | 38 | void removeListener( TestResult *eventManager ); 39 | 40 | void addXmlOutputterHooks( XmlOutputter *outputter ); 41 | 42 | void removeXmlOutputterHooks(); 43 | 44 | void uninitialize( TestFactoryRegistry *registry ); 45 | }; 46 | 47 | 48 | CPPUNIT_NS_END 49 | 50 | #endif // !defined(CPPUNIT_NO_TESTPLUGIN) 51 | 52 | #endif // CPPUNIT_PLUGIN_TESTPLUGINADAPTER 53 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/portability/CppUnitDeque.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_PORTABILITY_CPPUNITDEQUE_H 2 | #define CPPUNIT_PORTABILITY_CPPUNITDEQUE_H 3 | 4 | // The technic used is similar to the wrapper of STLPort. 5 | 6 | #include 7 | #include 8 | 9 | 10 | #if CPPUNIT_STD_NEED_ALLOCATOR 11 | 12 | template 13 | class CppUnitDeque : public std::deque 14 | { 15 | public: 16 | }; 17 | 18 | #else // CPPUNIT_STD_NEED_ALLOCATOR 19 | 20 | #define CppUnitDeque std::deque 21 | 22 | #endif 23 | 24 | #endif // CPPUNIT_PORTABILITY_CPPUNITDEQUE_H 25 | 26 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/portability/CppUnitMap.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_PORTABILITY_CPPUNITMAP_H 2 | #define CPPUNIT_PORTABILITY_CPPUNITMAP_H 3 | 4 | // The technic used is similar to the wrapper of STLPort. 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | 11 | #if CPPUNIT_STD_NEED_ALLOCATOR 12 | 13 | template 14 | class CppUnitMap : public std::map 17 | ,CPPUNIT_STD_ALLOCATOR> 18 | { 19 | public: 20 | }; 21 | 22 | #else // CPPUNIT_STD_NEED_ALLOCATOR 23 | 24 | #define CppUnitMap std::map 25 | 26 | #endif 27 | 28 | #endif // CPPUNIT_PORTABILITY_CPPUNITMAP_H 29 | 30 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/portability/CppUnitSet.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_PORTABILITY_CPPUNITSET_H 2 | #define CPPUNIT_PORTABILITY_CPPUNITSET_H 3 | 4 | // The technic used is similar to the wrapper of STLPort. 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | 11 | #if CPPUNIT_STD_NEED_ALLOCATOR 12 | 13 | template 14 | class CppUnitSet : public std::set 16 | ,CPPUNIT_STD_ALLOCATOR> 17 | { 18 | public: 19 | }; 20 | 21 | #else // CPPUNIT_STD_NEED_ALLOCATOR 22 | 23 | #define CppUnitSet std::set 24 | 25 | #endif 26 | 27 | #endif // CPPUNIT_PORTABILITY_CPPUNITSET_H 28 | 29 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/portability/CppUnitStack.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_PORTABILITY_CPPUNITSTACK_H 2 | #define CPPUNIT_PORTABILITY_CPPUNITSTACK_H 3 | 4 | // The technic used is similar to the wrapper of STLPort. 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | 11 | #if CPPUNIT_STD_NEED_ALLOCATOR 12 | 13 | template 14 | class CppUnitStack : public std::stack > 16 | { 17 | public: 18 | }; 19 | 20 | #else // CPPUNIT_STD_NEED_ALLOCATOR 21 | 22 | #define CppUnitStack std::stack 23 | 24 | #endif 25 | 26 | #endif // CPPUNIT_PORTABILITY_CPPUNITSTACK_H -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/portability/CppUnitVector.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_PORTABILITY_CPPUNITVECTOR_H 2 | #define CPPUNIT_PORTABILITY_CPPUNITVECTOR_H 3 | 4 | // The technic used is similar to the wrapper of STLPort. 5 | 6 | #include 7 | #include 8 | 9 | 10 | #if CPPUNIT_STD_NEED_ALLOCATOR 11 | 12 | template 13 | class CppUnitVector : public std::vector 14 | { 15 | public: 16 | }; 17 | 18 | #else // CPPUNIT_STD_NEED_ALLOCATOR 19 | 20 | #define CppUnitVector std::vector 21 | 22 | #endif 23 | 24 | #endif // CPPUNIT_PORTABILITY_CPPUNITVECTOR_H 25 | 26 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/tools/Algorithm.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED 2 | #define CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED 3 | 4 | #include 5 | 6 | CPPUNIT_NS_BEGIN 7 | 8 | template 9 | void 10 | removeFromSequence( SequenceType &sequence, 11 | const ValueType &valueToRemove ) 12 | { 13 | for ( unsigned int index =0; index < sequence.size(); ++index ) 14 | { 15 | if ( sequence[ index ] == valueToRemove ) 16 | sequence.erase( sequence.begin() + index ); 17 | } 18 | } 19 | 20 | CPPUNIT_NS_END 21 | 22 | 23 | #endif // CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED 24 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/tools/StringTools.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_TOOLS_STRINGTOOLS_H 2 | #define CPPUNIT_TOOLS_STRINGTOOLS_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | 9 | CPPUNIT_NS_BEGIN 10 | 11 | 12 | /*! \brief Tool functions to manipulate string. 13 | */ 14 | struct StringTools 15 | { 16 | 17 | typedef CppUnitVector Strings; 18 | 19 | static std::string CPPUNIT_API toString( int value ); 20 | 21 | static std::string CPPUNIT_API toString( double value ); 22 | 23 | static Strings CPPUNIT_API split( const std::string &text, 24 | char separator ); 25 | 26 | static std::string CPPUNIT_API wrap( const std::string &text, 27 | int wrapColumn = CPPUNIT_WRAP_COLUMN ); 28 | 29 | }; 30 | 31 | 32 | CPPUNIT_NS_END 33 | 34 | #endif // CPPUNIT_TOOLS_STRINGTOOLS_H 35 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/ui/mfc/TestRunner.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNITUI_MFC_TESTRUNNER_H 2 | #define CPPUNITUI_MFC_TESTRUNNER_H 3 | 4 | #include 5 | 6 | CPPUNIT_NS_BEGIN 7 | 8 | #if defined(CPPUNIT_HAVE_NAMESPACES) 9 | namespace MfcUi 10 | { 11 | /*! Mfc TestRunner (DEPRECATED). 12 | * \deprecated Use CppUnit::MfcTestRunner instead. 13 | */ 14 | typedef CPPUNIT_NS::MfcTestRunner TestRunner; 15 | } 16 | #endif // defined(CPPUNIT_HAVE_NAMESPACES) 17 | 18 | CPPUNIT_NS_END 19 | 20 | 21 | #endif // CPPUNITUI_MFC_TESTRUNNER_H 22 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Interface/cppunit/ui/text/TestRunner.h: -------------------------------------------------------------------------------- 1 | #ifndef CPPUNIT_UI_TEXT_TESTRUNNER_H 2 | #define CPPUNIT_UI_TEXT_TESTRUNNER_H 3 | 4 | #include 5 | 6 | 7 | #if defined(CPPUNIT_HAVE_NAMESPACES) 8 | 9 | CPPUNIT_NS_BEGIN 10 | namespace TextUi 11 | { 12 | 13 | /*! Text TestRunner (DEPRECATED). 14 | * \deprecated Use TextTestRunner instead. 15 | */ 16 | typedef TextTestRunner TestRunner; 17 | 18 | } 19 | CPPUNIT_NS_END 20 | 21 | #endif // defined(CPPUNIT_HAVE_NAMESPACES) 22 | 23 | 24 | #endif // CPPUNIT_UI_TEXT_TESTRUNNER_H 25 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | 3 | ROOTDIR = ../.. 4 | include $(ROOTDIR)/config.mk 5 | 6 | SUBDIRS = $(filter-out Interface/, $(sort $(dir $(wildcard */)))) 7 | CLEANSUBDIRS = $(addsuffix .clean, $(SUBDIRS)) 8 | 9 | .PHONY: Modules 10 | 11 | Modules: 12 | @echo 13 | @echo Making all in subdirectory $@... 14 | $(MAKE) -C Modules 15 | 16 | clean: $(CLEANSUBDIRS) 17 | 18 | $(CLEANSUBDIRS): 19 | @cd $(basename $@) ; $(MAKE) clean 20 | 21 | 22 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | 3 | ROOTDIR = ../../.. 4 | include $(ROOTDIR)/config.mk 5 | 6 | SUBDIRS = $(filter-out Public/, $(sort $(dir $(wildcard */)))) 7 | CLEANSUBDIRS = $(addsuffix .clean, $(SUBDIRS)) 8 | 9 | 10 | .PHONY: TestCore TestUtility TestPlatform 11 | all: TestCore TestUtility TestPlatform 12 | 13 | TestCore: 14 | @echo 15 | @echo Making all in subdirectory $@... 16 | $(MAKE) -C TestCore 17 | 18 | TestUtility: 19 | @echo 20 | @echo Making all in subdirectory $@... 21 | $(MAKE) -C TestUtility 22 | 23 | TestPlatform: 24 | @echo 25 | @echo Making all in subdirectory $@... 26 | $(MAKE) -C TestPlatform 27 | 28 | clean: $(CLEANSUBDIRS) 29 | 30 | $(CLEANSUBDIRS): 31 | @cd $(basename $@) ; $(MAKE) clean 32 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/Public/BaseTest.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #ifndef X3_UNITTEST_BASETEST_H_ 3 | #define X3_UNITTEST_BASETEST_H_ 4 | 5 | class BaseTest : public CppUnit::TestFixture 6 | { 7 | protected: 8 | BaseTest(); 9 | 10 | long LoadPlugins(const wchar_t* plugins, bool loadCore = true); 11 | void UnloadPlugins(); 12 | std::wstring MakeDataPath(const wchar_t* folder, const wchar_t* file); 13 | 14 | private: 15 | void MakeRootPath(wchar_t* path, const wchar_t* name); 16 | }; 17 | 18 | #endif // X3_UNITTEST_BASETEST_H_ 19 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestCore/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../../../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | CFLAGS += -I$(INCLUDE_DIR)/pkg_Core/Interface 5 | CFLAGS += -I$(INCLUDE_DIR)/pkg_Example/Interface 6 | CFLAGS += -I$(INCLUDE_DIR)/pkg_UnitTest/Interface 7 | CFLAGS += -I$(INCLUDE_DIR)/pkg_UnitTest/Modules/Public 8 | 9 | CFLAGS += -D_CONSOLE 10 | 11 | C_FLAGS += -L/usr/lib 12 | C_FLAGS += -L/usr/local/lib 13 | C_FLAGS += -L$(UNITTESTS_DIR) 14 | 15 | all: 16 | $(CC) $(CFLAGS) -c ../Public/BaseTest.cpp 17 | $(CC) $(CFLAGS) -c ../Public/UnitTests.cpp 18 | $(CC) $(CFLAGS) -c TestLogging.cpp 19 | $(CC) $(CFLAGS) -c TestChangeObserver.cpp 20 | $(CC) $(CFLAGS) -c TestLoadPlugin.cpp 21 | $(CC) $(CFLAGS) -c TestStringTable.cpp 22 | $(CC) $(CFLAGS) -c TestFileUtil.cpp 23 | $(CC) $(CFLAGS) -c TestTextUtil.cpp 24 | $(CC) $(C_FLAGS) -o $(UNITTESTS_DIR)/TestCore.app *.o $(LIBS) -lcppunit 25 | clean: 26 | rm -rf *.so 27 | rm -rf *.o 28 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestCore/TestChangeObserver.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #pragma once 3 | 4 | #include "BaseTest.h" 5 | 6 | class TestChangeObserver : public BaseTest 7 | { 8 | CPPUNIT_TEST_SUITE( TestChangeObserver ); 9 | CPPUNIT_TEST( testNotifyEvent ); 10 | CPPUNIT_TEST( testResponsibilityChain ); 11 | CPPUNIT_TEST( testResponsibilityChain2 ); 12 | CPPUNIT_TEST( testEventObserver ); 13 | CPPUNIT_TEST( testSelectionObserver ); 14 | CPPUNIT_TEST_SUITE_END(); 15 | 16 | public: 17 | TestChangeObserver(); 18 | 19 | virtual void setUp(); 20 | virtual void tearDown(); 21 | 22 | void testNotifyEvent(); 23 | void testResponsibilityChain(); 24 | void testResponsibilityChain2(); 25 | void testEventObserver(); 26 | void testSelectionObserver(); 27 | }; 28 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestCore/TestConfigDB.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #pragma once 3 | 4 | #include "BaseTest.h" 5 | 6 | class TestConfigDB : public BaseTest 7 | { 8 | CPPUNIT_TEST_SUITE( TestConfigDB ); 9 | CPPUNIT_TEST( testOpenAccessDB ); 10 | CPPUNIT_TEST( testAddRecord ); 11 | CPPUNIT_TEST( testAddRecordUseMaxID ); 12 | CPPUNIT_TEST( testAddRecordUseMaxIDAndReturnNewID ); 13 | CPPUNIT_TEST( testSelectSQL ); 14 | CPPUNIT_TEST( testSQLWithOrderBy ); 15 | CPPUNIT_TEST( testSQLWithLike ); 16 | CPPUNIT_TEST( testEditRecord ); 17 | CPPUNIT_TEST( testEditFieldDateTime ); 18 | CPPUNIT_TEST( testEditFieldDate ); 19 | CPPUNIT_TEST( testEditFieldGetCurDate ); 20 | CPPUNIT_TEST( testReadFieldDate ); 21 | CPPUNIT_TEST( testRecordsetTransaction ); 22 | CPPUNIT_TEST( testDelRecord ); 23 | CPPUNIT_TEST_SUITE_END(); 24 | 25 | public: 26 | TestConfigDB(); 27 | 28 | virtual void setUp(); 29 | virtual void tearDown(); 30 | 31 | void testOpenAccessDB(); 32 | void testAddRecord(); 33 | void testAddRecordUseMaxID(); 34 | void testAddRecordUseMaxIDAndReturnNewID(); 35 | void testSelectSQL(); 36 | void testSQLWithOrderBy(); 37 | void testSQLWithLike(); 38 | void testEditRecord(); 39 | void testEditFieldDateTime(); 40 | void testEditFieldDate(); 41 | void testEditFieldGetCurDate(); 42 | void testReadFieldDate(); 43 | void testDelRecord(); 44 | void testRecordsetTransaction(); 45 | 46 | private: 47 | Cx_Ptr GetDatabase(const wchar_t* filename = L"TestAccess.mdb"); 48 | 49 | private: 50 | std::wstring m_dbfile; 51 | }; 52 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestCore/TestConfigXml.cpp: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #include 3 | #include "TestConfigXml.h" 4 | #include 5 | #include 6 | 7 | CPPUNIT_TEST_SUITE_REGISTRATION( TestConfigXml ); 8 | 9 | TestConfigXml::TestConfigXml() 10 | { 11 | } 12 | 13 | void TestConfigXml::setUp() 14 | { 15 | VERIFY(LoadPlugins(L"ConfigXml.plugin" PLNEXT, false) >= 1); 16 | } 17 | 18 | void TestConfigXml::tearDown() 19 | { 20 | UnloadPlugins(); 21 | } 22 | 23 | void TestConfigXml::testSetXmlContent() 24 | { 25 | Cx_Interface pIFXml(x3::CLSID_ConfigXmlFile); 26 | ASSERT(pIFXml.IsNotNull()); 27 | bool ret = pIFXml->SetXmlContent(L""); 28 | VERIFY(ret); 29 | ASSERT(pIFXml->GetRootName() == L"test"); 30 | } 31 | 32 | void TestConfigXml::testNewDoc() 33 | { 34 | Cx_Interface pIFXml(x3::CLSID_ConfigXmlFile); 35 | ASSERT(pIFXml.IsNotNull()); 36 | 37 | Cx_ConfigSection root(pIFXml->GetData()->GetSection(L"")); 38 | std::wstring content; 39 | 40 | VERIFY(pIFXml->GetXmlContent(content, root.P())); 41 | ASSERT(content.find(L"<") != std::wstring::npos); 42 | } 43 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestCore/TestConfigXml.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #pragma once 3 | 4 | #include "BaseTest.h" 5 | 6 | class TestConfigXml : public BaseTest 7 | { 8 | CPPUNIT_TEST_SUITE( TestConfigXml ); 9 | CPPUNIT_TEST( testSetXmlContent ); 10 | CPPUNIT_TEST( testNewDoc ); 11 | CPPUNIT_TEST_SUITE_END(); 12 | 13 | public: 14 | TestConfigXml(); 15 | 16 | virtual void setUp(); 17 | virtual void tearDown(); 18 | 19 | void testSetXmlContent(); 20 | void testNewDoc(); 21 | }; 22 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestCore/TestFileUtil.cpp: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #include 3 | #include "TestFileUtil.h" 4 | #include 5 | 6 | CPPUNIT_TEST_SUITE_REGISTRATION( TestFileUtil ); 7 | 8 | TestFileUtil::TestFileUtil() 9 | { 10 | } 11 | 12 | void TestFileUtil::setUp() 13 | { 14 | VERIFY(LoadPlugins(L"FileUtility.plugin" PLNEXT, false) >= 1); 15 | } 16 | 17 | void TestFileUtil::tearDown() 18 | { 19 | UnloadPlugins(); 20 | } 21 | 22 | void TestFileUtil::testCopyFolder() 23 | { 24 | std::wstring path(MakeDataPath(L"", L"")); 25 | ASSERT(x3::FileUtility()->CopyPathFile(path.c_str(), L"D:\\Test\\")); 26 | } 27 | 28 | void TestFileUtil::testDelFolder() 29 | { 30 | ASSERT(x3::FileUtility()->DeletePathFile(L"D:\\Test\\")); 31 | } 32 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestCore/TestFileUtil.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #pragma once 3 | 4 | #include "BaseTest.h" 5 | 6 | class TestFileUtil : public BaseTest 7 | { 8 | CPPUNIT_TEST_SUITE( TestFileUtil ); 9 | CPPUNIT_TEST( testCopyFolder ); 10 | CPPUNIT_TEST( testDelFolder ); 11 | CPPUNIT_TEST_SUITE_END(); 12 | 13 | public: 14 | TestFileUtil(); 15 | 16 | virtual void setUp(); 17 | virtual void tearDown(); 18 | 19 | void testCopyFolder(); 20 | void testDelFolder(); 21 | }; 22 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestCore/TestLoadPlugin.cpp: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #include 3 | #include "TestLoadPlugin.h" 4 | 5 | CPPUNIT_TEST_SUITE_REGISTRATION( TestLoadPlugin ); 6 | 7 | TestLoadPlugin::TestLoadPlugin() 8 | { 9 | } 10 | 11 | void TestLoadPlugin::setUp() 12 | { 13 | VERIFY(LoadPlugins(L"", false) > 0); 14 | } 15 | 16 | void TestLoadPlugin::tearDown() 17 | { 18 | UnloadPlugins(); 19 | } 20 | 21 | void TestLoadPlugin::testLoadByNames() 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestCore/TestLoadPlugin.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #pragma once 3 | 4 | #include "BaseTest.h" 5 | 6 | class TestLoadPlugin : public BaseTest 7 | { 8 | CPPUNIT_TEST_SUITE( TestLoadPlugin ); 9 | CPPUNIT_TEST( testLoadByNames ); 10 | CPPUNIT_TEST_SUITE_END(); 11 | 12 | public: 13 | TestLoadPlugin(); 14 | 15 | virtual void setUp(); 16 | virtual void tearDown(); 17 | 18 | void testLoadByNames(); 19 | }; 20 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestCore/TestLogging.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #pragma once 3 | 4 | #include "BaseTest.h" 5 | 6 | class TestLogging : public BaseTest 7 | { 8 | CPPUNIT_TEST_SUITE( TestLogging ); 9 | CPPUNIT_TEST( testAllMacros ); 10 | CPPUNIT_TEST( testAllMacrosWithID ); 11 | CPPUNIT_TEST( testMultiTypes ); 12 | CPPUNIT_TEST( testIdFormat ); 13 | CPPUNIT_TEST( testGroup ); 14 | CPPUNIT_TEST( testObserver ); 15 | CPPUNIT_TEST_SUITE_END(); 16 | 17 | public: 18 | TestLogging(); 19 | 20 | virtual void setUp(); 21 | virtual void tearDown(); 22 | 23 | void testAllMacros(); 24 | void testAllMacrosWithID(); 25 | void testMultiTypes(); 26 | void testIdFormat(); 27 | void testGroup(); 28 | void testObserver(); 29 | }; 30 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestCore/TestPluginManager.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #pragma once 3 | #include "BaseTest.h" 4 | 5 | #include "Ix_ObjectFactory.h" 6 | #include "PluginManager/Ix_PluginLoader.h" 7 | 8 | class TestPluginManager : public BaseTest 9 | { 10 | CPPUNIT_TEST_SUITE( TestPluginManager ); 11 | CPPUNIT_TEST( testLoadUnloadPlugin ); 12 | CPPUNIT_TEST( testLoadUnloadPlugins ); 13 | CPPUNIT_TEST( testLoadPluginFiles ); 14 | CPPUNIT_TEST( testInitializePlugins ); 15 | CPPUNIT_TEST( testRegisterPlugin ); 16 | 17 | CPPUNIT_TEST( testCreateObject ); 18 | CPPUNIT_TEST( testIsCreatorRegister ); 19 | CPPUNIT_TEST_SUITE_END(); 20 | 21 | public: 22 | TestPluginManager(void); 23 | ~TestPluginManager(void); 24 | 25 | virtual void setUp(); 26 | virtual void tearDown(); 27 | 28 | public: 29 | void testLoadUnloadPlugin(); 30 | void testLoadUnloadPlugins(); 31 | void testLoadPluginFiles(); 32 | void testInitializePlugins(); 33 | void testRegisterPlugin(); 34 | 35 | void testCreateObject(); 36 | void testIsCreatorRegister(); 37 | 38 | private: 39 | Ix_PluginLoader* GetManagerLoader(void); 40 | Ix_ObjectFactory* GetManagerObjectFactory(void); 41 | }; 42 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestCore/TestStringTable.cpp: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #include 3 | #include "TestStringTable.h" 4 | #include 5 | 6 | CPPUNIT_TEST_SUITE_REGISTRATION( TestStringTable ); 7 | 8 | TestStringTable::TestStringTable() 9 | { 10 | } 11 | 12 | void TestStringTable::setUp() 13 | { 14 | VERIFY(LoadPlugins(L"StringTable.plugin" PLNEXT 15 | L",ConfigXml.plugin" PLNEXT 16 | L",LogManager.plugin" PLNEXT, false) >= 2); 17 | } 18 | 19 | void TestStringTable::tearDown() 20 | { 21 | UnloadPlugins(); 22 | } 23 | 24 | void TestStringTable::testSimple() 25 | { 26 | Cx_Interface pIFTable(x3::CLSID_StringTable); 27 | ASSERT(pIFTable); 28 | 29 | pIFTable->LoadFiles(L""); 30 | 31 | std::wstring value, module, id; 32 | 33 | ASSERT(pIFTable->GetValue(value, L"StringTable", L"IDS_LOAD_STRFILE")); 34 | ASSERT(pIFTable->GetValue(value, L"@StringTable:IDS_LOAD_STRFILE", module, id) 35 | && module == L"StringTable" && id == L"IDS_LOAD_STRFILE"); 36 | 37 | ASSERT(!pIFTable->GetValue(value, L"StringTable", L"XXX")); 38 | ASSERT(!pIFTable->GetValue(value, L"XXX", L"XXX")); 39 | } 40 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestCore/TestStringTable.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #pragma once 3 | 4 | #include "BaseTest.h" 5 | 6 | class TestStringTable : public BaseTest 7 | { 8 | CPPUNIT_TEST_SUITE( TestStringTable ); 9 | CPPUNIT_TEST( testSimple ); 10 | CPPUNIT_TEST_SUITE_END(); 11 | 12 | public: 13 | TestStringTable(); 14 | 15 | virtual void setUp(); 16 | virtual void tearDown(); 17 | 18 | void testSimple(); 19 | }; 20 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestCore/TestTextUtil.cpp: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #include 3 | #include "TestTextUtil.h" 4 | #include 5 | 6 | CPPUNIT_TEST_SUITE_REGISTRATION( TestTextUtil ); 7 | 8 | TestTextUtil::TestTextUtil() 9 | { 10 | } 11 | 12 | void TestTextUtil::setUp() 13 | { 14 | VERIFY(LoadPlugins(L"TextUtility.plugin" PLNEXT, false) >= 1); 15 | } 16 | 17 | void TestTextUtil::tearDown() 18 | { 19 | UnloadPlugins(); 20 | } 21 | 22 | void TestTextUtil::testMD5() 23 | { 24 | Cx_Interface pIFCoding(x3::CLSID_TextUtil); 25 | ASSERT(pIFCoding.IsNotNull()); 26 | 27 | ASSERT(pIFCoding->MD5(L"apple") == L"1f3870be274f6c49b3e31a0c6728957f"); 28 | ASSERT(pIFCoding->MD5(L"").size() == 32); 29 | } 30 | 31 | void TestTextUtil::testBase64() 32 | { 33 | Cx_Interface pIFCoding(x3::CLSID_TextUtil); 34 | ASSERT(pIFCoding.IsNotNull()); 35 | std::wstring text; 36 | 37 | ASSERT(pIFCoding->Base64(text, "AAwww.baidu.com/img/sslm1_logo.gifZZ") 38 | == L"QUF3d3cuYmFpZHUuY29tL2ltZy9zc2xtMV9sb2dvLmdpZlpa"); 39 | ASSERT(pIFCoding->Base64(text, "") == L""); 40 | } 41 | 42 | void TestTextUtil::testUnBase64() 43 | { 44 | Cx_Interface pIFCoding(x3::CLSID_TextUtil); 45 | ASSERT(pIFCoding.IsNotNull()); 46 | std::string data; 47 | 48 | ASSERT(pIFCoding->UnBase64(data, L"QUF3d3cuYmFpZHUuY29tL2ltZy9zc2xtMV9sb2dvLmdpZlpa") 49 | == "AAwww.baidu.com/img/sslm1_logo.gifZZ"); 50 | ASSERT(pIFCoding->UnBase64(data, L"") == ""); 51 | } 52 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestCore/TestTextUtil.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #pragma once 3 | 4 | #include "BaseTest.h" 5 | 6 | class TestTextUtil : public BaseTest 7 | { 8 | CPPUNIT_TEST_SUITE( TestTextUtil ); 9 | CPPUNIT_TEST( testMD5 ); 10 | CPPUNIT_TEST( testBase64 ); 11 | CPPUNIT_TEST( testUnBase64 ); 12 | CPPUNIT_TEST_SUITE_END(); 13 | 14 | public: 15 | TestTextUtil(); 16 | 17 | virtual void setUp(); 18 | virtual void tearDown(); 19 | 20 | void testMD5(); 21 | void testBase64(); 22 | void testUnBase64(); 23 | }; 24 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestPlatform/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../../../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | CFLAGS += -I$(INCLUDE_DIR)/pkg_Core/Interface 5 | CFLAGS += -I$(INCLUDE_DIR)/pkg_Utility/Interface 6 | CFLAGS += -I$(INCLUDE_DIR)/pkg_UnitTest/Interface 7 | CFLAGS += -I$(INCLUDE_DIR)/pkg_UnitTest/Modules/Public 8 | 9 | CFLAGS += -D_CONSOLE 10 | 11 | C_FLAGS += -L/usr/lib 12 | C_FLAGS += -L/usr/local/lib 13 | C_FLAGS += -L$(UNITTESTS_DIR) 14 | 15 | all: 16 | $(CC) $(CFLAGS) -c ../Public/BaseTest.cpp 17 | $(CC) $(CFLAGS) -c ../Public/UnitTests.cpp 18 | $(CC) $(CFLAGS) -c TestComHook.cpp 19 | $(CC) $(CFLAGS) -c TestHookManager.cpp 20 | $(CC) $(C_FLAGS) -o $(UNITTESTS_DIR)/TestPlatform.app *.o $(LIBS) -lcppunit 21 | clean: 22 | rm -rf *.so 23 | rm -rf *.o 24 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestPlatform/TestComHook.cpp: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #include 3 | #include "TestComHook.h" 4 | 5 | #ifdef _WIN32 6 | 7 | CPPUNIT_TEST_SUITE_REGISTRATION( TestComHook ); 8 | 9 | TestComHook::TestComHook() 10 | { 11 | } 12 | 13 | void TestComHook::setUp() 14 | { 15 | VERIFY(LoadPlugins(L"ComHook.plugin" PLNEXT 16 | L" LogManager.plugin" PLNEXT, false) == 2); 17 | } 18 | 19 | void TestComHook::tearDown() 20 | { 21 | UnloadPlugins(); 22 | } 23 | 24 | const IID IID_IUnknown = {0,0,0,{0xC0,0,0,0,0,0,0,0x46}}; 25 | 26 | const CLSID CLSID_ATLCOM = {0xBDE3B7B3, 0x1AA2, 0x44C1,{ 27 | 0xA0,0x2F,0xD1,0xA7,0x2D,0x3E,0xDD,0x2A}}; 28 | 29 | void TestComHook::testSimpleAtlCom() 30 | { 31 | IUnknown* pIUnknown = NULL; 32 | 33 | HRESULT hrCreate = ::CoCreateInstance(CLSID_ATLCOM, NULL, 34 | CLSCTX_INPROC_SERVER, IID_IUnknown, (void**)&pIUnknown); 35 | 36 | ASSERT(S_OK == hrCreate || REGDB_E_CLASSNOTREG == hrCreate); 37 | ASSERT(SUCCEEDED(hrCreate)); 38 | 39 | pIUnknown->Release(); 40 | } 41 | 42 | void TestComHook::testMultiCreate() 43 | { 44 | IUnknown* pIUnknown = NULL; 45 | 46 | for (int i = 0; i < 1000; i++) 47 | { 48 | if (SUCCEEDED(::CoCreateInstance(CLSID_ATLCOM, NULL, 49 | CLSCTX_INPROC_SERVER, IID_IUnknown, (void**)&pIUnknown))) 50 | { 51 | pIUnknown->Release(); 52 | } 53 | } 54 | } 55 | 56 | void TestComHook::testX3CoreCom() 57 | { 58 | VERIFY(LoadPlugins(L"x3core.com.dll", false) > 0); 59 | } 60 | 61 | #endif // _WIN32 62 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestPlatform/TestComHook.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #pragma once 3 | 4 | #include "BaseTest.h" 5 | 6 | class TestComHook : public BaseTest 7 | { 8 | CPPUNIT_TEST_SUITE( TestComHook ); 9 | CPPUNIT_TEST( testSimpleAtlCom ); 10 | CPPUNIT_TEST( testMultiCreate ); 11 | CPPUNIT_TEST( testX3CoreCom ); 12 | CPPUNIT_TEST_SUITE_END(); 13 | 14 | public: 15 | TestComHook(); 16 | 17 | virtual void setUp(); 18 | virtual void tearDown(); 19 | 20 | void testSimpleAtlCom(); 21 | void testMultiCreate(); 22 | void testX3CoreCom(); 23 | }; 24 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestPlatform/TestHookManager.cpp: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #include 3 | #include "TestHookManager.h" 4 | #include 5 | 6 | #ifdef _WIN32 7 | 8 | CPPUNIT_TEST_SUITE_REGISTRATION( TestHookManager ); 9 | 10 | TestHookManager::TestHookManager() 11 | { 12 | } 13 | 14 | void TestHookManager::setUp() 15 | { 16 | VERIFY(LoadPlugins(L"HookManager.plugin" PLNEXT 17 | L" LogManager.plugin" PLNEXT, false) == 2); 18 | } 19 | 20 | void TestHookManager::tearDown() 21 | { 22 | UnloadPlugins(); 23 | } 24 | 25 | void TestHookManager::testHookLoadString() 26 | { 27 | Cx_Interface pIFHook(x3::CLSID_HookManager); 28 | ASSERT(pIFHook.IsNotNull()); 29 | } 30 | 31 | #endif // _WIN32 32 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestPlatform/TestHookManager.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #pragma once 3 | 4 | #include "BaseTest.h" 5 | 6 | class TestHookManager : public BaseTest 7 | { 8 | CPPUNIT_TEST_SUITE( TestHookManager ); 9 | CPPUNIT_TEST( testHookLoadString ); 10 | CPPUNIT_TEST_SUITE_END(); 11 | 12 | public: 13 | TestHookManager(); 14 | 15 | virtual void setUp(); 16 | virtual void tearDown(); 17 | 18 | void testHookLoadString(); 19 | }; 20 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestPlatform/atlcom.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_UnitTest/Modules/TestPlatform/atlcom.dll -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestPlatform/test.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestUtility/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../../../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | CFLAGS += -I$(INCLUDE_DIR)/pkg_Core/Interface 5 | CFLAGS += -I$(INCLUDE_DIR)/pkg_Utility/Interface 6 | CFLAGS += -I$(INCLUDE_DIR)/pkg_UnitTest/Interface 7 | CFLAGS += -I$(INCLUDE_DIR)/pkg_UnitTest/Modules/Public 8 | 9 | CFLAGS += -D_CONSOLE 10 | 11 | C_FLAGS += -L/usr/lib 12 | C_FLAGS += -L/usr/local/lib 13 | C_FLAGS += -L$(UNITTESTS_DIR) 14 | 15 | all: 16 | $(CC) $(CFLAGS) -c ../Public/BaseTest.cpp 17 | $(CC) $(CFLAGS) -c ../Public/UnitTests.cpp 18 | $(CC) $(CFLAGS) -c TestConfigDB.cpp 19 | $(CC) $(C_FLAGS) -o $(UNITTESTS_DIR)/TestUtility.app *.o $(LIBS) -lcppunit 20 | clean: 21 | rm -rf *.so 22 | rm -rf *.o 23 | -------------------------------------------------------------------------------- /code/pkg_UnitTest/Modules/TestUtility/TestConfigDB.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #pragma once 3 | 4 | #include "BaseTest.h" 5 | 6 | class TestConfigDB : public BaseTest 7 | { 8 | CPPUNIT_TEST_SUITE( TestConfigDB ); 9 | CPPUNIT_TEST( testOpenAccessDB ); 10 | CPPUNIT_TEST( testAddRecord ); 11 | CPPUNIT_TEST( testAddRecordUseMaxID ); 12 | CPPUNIT_TEST( testAddRecordUseMaxIDAndReturnNewID ); 13 | CPPUNIT_TEST( testSelectSQL ); 14 | CPPUNIT_TEST( testSQLWithOrderBy ); 15 | CPPUNIT_TEST( testSQLWithLike ); 16 | CPPUNIT_TEST( testEditRecord ); 17 | CPPUNIT_TEST( testEditFieldDateTime ); 18 | CPPUNIT_TEST( testEditFieldDate ); 19 | CPPUNIT_TEST( testEditFieldGetCurDate ); 20 | CPPUNIT_TEST( testReadFieldDate ); 21 | CPPUNIT_TEST( testRecordsetTransaction ); 22 | CPPUNIT_TEST( testDelRecord ); 23 | CPPUNIT_TEST_SUITE_END(); 24 | 25 | public: 26 | TestConfigDB(); 27 | 28 | virtual void setUp(); 29 | virtual void tearDown(); 30 | 31 | void testOpenAccessDB(); 32 | void testAddRecord(); 33 | void testAddRecordUseMaxID(); 34 | void testAddRecordUseMaxIDAndReturnNewID(); 35 | void testSelectSQL(); 36 | void testSQLWithOrderBy(); 37 | void testSQLWithLike(); 38 | void testEditRecord(); 39 | void testEditFieldDateTime(); 40 | void testEditFieldDate(); 41 | void testEditFieldGetCurDate(); 42 | void testReadFieldDate(); 43 | void testDelRecord(); 44 | void testRecordsetTransaction(); 45 | 46 | private: 47 | Cx_Ptr GetDatabase(const wchar_t* filename = L"TestAccess.mdb"); 48 | 49 | private: 50 | std::wstring m_dbfile; 51 | }; 52 | -------------------------------------------------------------------------------- /code/pkg_Utility/Interface/Database/Ix_ConfigDBFactory.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Utility/Interface/Database/Ix_ConfigDBFactory.h -------------------------------------------------------------------------------- /code/pkg_Utility/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | 3 | ROOTDIR = ../.. 4 | include $(ROOTDIR)/config.mk 5 | 6 | SUBDIRS = $(filter-out Interface/, $(sort $(dir $(wildcard */)))) 7 | CLEANSUBDIRS = $(addsuffix .clean, $(SUBDIRS)) 8 | 9 | .PHONY: Modules 10 | 11 | Modules: 12 | @echo 13 | @echo Making all in subdirectory $@... 14 | $(MAKE) -C Modules 15 | 16 | clean: $(CLEANSUBDIRS) 17 | 18 | $(CLEANSUBDIRS): 19 | @cd $(basename $@) ; $(MAKE) clean 20 | 21 | 22 | -------------------------------------------------------------------------------- /code/pkg_Utility/Modules/ConfigDB/ClsID_Internal.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #pragma once 3 | 4 | X3CLSID_DEFINE(CLSID_CfgDatabase, "14e8e601-3189-4408-8f3c-57721e3d19db"); 5 | -------------------------------------------------------------------------------- /code/pkg_Utility/Modules/ConfigDB/ConfigDB.rc: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | #include 3 | LANGUAGE 0, 0 // LANG_NEUTRAL, SUBLANG_NEUTRAL 4 | #pragma code_page(1252) 5 | #include "Version.rc2" 6 | #endif 7 | -------------------------------------------------------------------------------- /code/pkg_Utility/Modules/ConfigDB/Cx_CfgDatabase.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Utility/Modules/ConfigDB/Cx_CfgDatabase.h -------------------------------------------------------------------------------- /code/pkg_Utility/Modules/ConfigDB/Cx_CfgRecord.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Utility/Modules/ConfigDB/Cx_CfgRecord.cpp -------------------------------------------------------------------------------- /code/pkg_Utility/Modules/ConfigDB/Cx_ConfigFactory.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #ifndef _X3_CONFIGDB_CONFIGFACTORY_H 3 | #define _X3_CONFIGDB_CONFIGFACTORY_H 4 | 5 | #include 6 | 7 | class Cx_ConfigFactory 8 | : public Ix_ConfigDBFactory 9 | { 10 | X3BEGIN_CLASS_DECLARE(Cx_ConfigFactory) 11 | X3DEFINE_INTERFACE_ENTRY(Ix_ConfigDBFactory) 12 | X3END_CLASS_DECLARE() 13 | protected: 14 | Cx_ConfigFactory(); 15 | virtual ~Cx_ConfigFactory(); 16 | 17 | private: 18 | // From Ix_ConfigDBFactory 19 | // 20 | virtual Cx_Ptr OpenAccessDB( 21 | const std::wstring& filename, 22 | const std::wstring& user = L"", 23 | const std::wstring& password = L""); 24 | virtual Cx_Ptr OpenSQLServerDB( 25 | const std::wstring& server, 26 | const std::wstring& database, 27 | const std::wstring& user = L"", 28 | const std::wstring& password = L""); 29 | }; 30 | 31 | #endif // _X3_CONFIGDB_CONFIGFACTORY_H 32 | -------------------------------------------------------------------------------- /code/pkg_Utility/Modules/ConfigDB/Cx_SQLParser.h: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #ifndef _X3_CONFIGDB_SQLPARSER_H 3 | #define _X3_CONFIGDB_SQLPARSER_H 4 | 5 | #include "Ix_SQLParser.h" 6 | 7 | class SQLParser_Access : public Ix_SQLParser 8 | { 9 | public: 10 | SQLParser_Access() 11 | { 12 | } 13 | 14 | void InterfaceRelease() 15 | { 16 | delete this; 17 | } 18 | 19 | std::wstring GetFunc_CURDATE() 20 | { 21 | return L"Date()"; 22 | } 23 | 24 | std::wstring GetFunc_CURTIME() 25 | { 26 | return L"Time()"; 27 | } 28 | 29 | std::wstring GetFunc_NOW() 30 | { 31 | return L"Now()"; 32 | } 33 | }; 34 | 35 | class SQLParser_SQLServer : public Ix_SQLParser 36 | { 37 | public: 38 | SQLParser_SQLServer() 39 | { 40 | } 41 | 42 | void InterfaceRelease() 43 | { 44 | delete this; 45 | } 46 | 47 | std::wstring GetFunc_CURDATE() 48 | { 49 | return L"GetDate()"; 50 | } 51 | 52 | std::wstring GetFunc_CURTIME() 53 | { 54 | return L"GetTime()"; 55 | } 56 | 57 | std::wstring GetFunc_NOW() 58 | { 59 | return L"GetNow()"; 60 | } 61 | }; 62 | 63 | #endif // _X3_CONFIGDB_SQLPARSER_H 64 | -------------------------------------------------------------------------------- /code/pkg_Utility/Modules/ConfigDB/DbFunc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Utility/Modules/ConfigDB/DbFunc.h -------------------------------------------------------------------------------- /code/pkg_Utility/Modules/ConfigDB/Ix_InitDatabase.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Utility/Modules/ConfigDB/Ix_InitDatabase.h -------------------------------------------------------------------------------- /code/pkg_Utility/Modules/ConfigDB/Ix_SQLParser.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/code/pkg_Utility/Modules/ConfigDB/Ix_SQLParser.h -------------------------------------------------------------------------------- /code/pkg_Utility/Modules/ConfigDB/Makefile: -------------------------------------------------------------------------------- 1 | ROOTDIR = ../../../.. 2 | include $(ROOTDIR)/config.mk 3 | 4 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Core/Interface 5 | CFLAGS_SO += -I$(INCLUDE_DIR)/pkg_Utility/Interface/Database 6 | 7 | all: 8 | $(CC) $(CFLAGS_SO) -c Cx_CfgDbSection.cpp 9 | $(CC) $(CFLAGS_SO) -c Cx_CfgRecordset.cpp 10 | $(CC) $(CFLAGS_SO) -c Cx_CfgDatabase.cpp 11 | $(CC) $(CFLAGS_SO) -c Cx_CfgRecord.cpp 12 | $(CC) $(CFLAGS_SO) -c Cx_ConfigFactory.cpp 13 | $(CC) $(CFLAGS_SO) -c Module.cpp 14 | $(CC) $(C_FLAGS_SO) -o $(PLUGINS_DIR)/libTextUtility.so *.o 15 | clean: 16 | rm -rf *.so 17 | rm -rf *.o 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /code/pkg_Utility/Modules/ConfigDB/Module.cpp: -------------------------------------------------------------------------------- 1 | // x3c - C++ PluginFramework 2 | #include 3 | #include 4 | #include 5 | 6 | #include "ClsID_Internal.h" 7 | #include "Cx_ConfigFactory.h" 8 | #include "Cx_CfgDatabase.h" 9 | #include "Cx_CfgRecordset.h" 10 | #include "Cx_CfgRecord.h" 11 | 12 | XBEGIN_DEFINE_MODULE() 13 | XDEFINE_CLASSMAP_ENTRY_Singleton(x3::CLSID_ConfigDBFactory, Cx_ConfigFactory) 14 | XDEFINE_CLASSMAP_ENTRY(x3::CLSID_CfgDatabase, Cx_CfgDatabase) 15 | XDEFINE_CLASSMAP_ENTRY(CLSID_NullObject, Cx_CfgDbSection) 16 | XDEFINE_CLASSMAP_ENTRY(CLSID_CfgRecord, Cx_CfgRecord) 17 | XDEFINE_CLASSMAP_ENTRY(CLSID_CfgRecordset, Cx_CfgRecordset) 18 | XEND_DEFINE_MODULE_MFCEXTDLL() 19 | -------------------------------------------------------------------------------- /code/pkg_Utility/Modules/ConfigDB/Version.rc2: -------------------------------------------------------------------------------- 1 | // Version.rc2 - resources Microsoft Visual C++ does not edit directly 2 | // 3 | // TODO: Change values of FILEVERSION and FileVersion 4 | // 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION 1,1,3,0 8 | FILEFLAGSMASK 0x3fL 9 | #ifdef _DEBUG 10 | FILEFLAGS 0x1L 11 | #else 12 | FILEFLAGS 0x0L 13 | #endif 14 | FILEOS 0x4L 15 | FILETYPE 0x2L 16 | FILESUBTYPE 0x0L 17 | BEGIN 18 | BLOCK "StringFileInfo" 19 | BEGIN 20 | BLOCK "000004b0" 21 | BEGIN 22 | VALUE "FileDescription", "Database IO Functions Plugin\0" 23 | VALUE "FileVersion", "1.1.3.0\0" 24 | VALUE "LegalCopyright", "(C) 2008-2011, X3 C++ PluginFramework\0" 25 | VALUE "OriginalFilename", "ConfigDB.plugin.dll\0" 26 | VALUE "ProductName", "X3 C++ PluginFramework\0" 27 | END 28 | END 29 | BLOCK "VarFileInfo" 30 | BEGIN 31 | VALUE "Translation", 0x0, 1200 32 | END 33 | END 34 | -------------------------------------------------------------------------------- /code/pkg_Utility/Modules/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | 3 | ROOTDIR = ../../.. 4 | include $(ROOTDIR)/config.mk 5 | 6 | SUBDIRS = $(sort $(dir $(wildcard */))) 7 | CLEANSUBDIRS = $(addsuffix .clean, $(SUBDIRS)) 8 | 9 | .PHONY: ConfigDB 10 | 11 | ConfigDB: 12 | @echo 13 | @echo Making all in subdirectory $@... 14 | $(MAKE) -C ConfigDB 15 | 16 | 17 | clean: $(CLEANSUBDIRS) 18 | 19 | $(CLEANSUBDIRS): 20 | @cd $(basename $@) ; $(MAKE) clean 21 | 22 | 23 | -------------------------------------------------------------------------------- /config.mk: -------------------------------------------------------------------------------- 1 | # Included by Makefile 2 | 3 | INCLUDE_DIR =$(ROOTDIR)/code 4 | 5 | INSTALL_DIR =$(ROOTDIR)/code/bin 6 | PLUGINS_DIR =$(INSTALL_DIR)/plugins 7 | UNITTESTS_DIR =$(INSTALL_DIR)/tests 8 | SWIGOUT_DIR =$(INSTALL_DIR)/python 9 | SWIGOUT_EXT =.pyc 10 | 11 | OS ?=$(shell uname -s) 12 | IS_WIN :=$(shell echo $(OS)|grep -i Windows) 13 | 14 | CC = g++ 15 | CFLAGS += -g 16 | C_FLAGS += -Wall -g 17 | CFLAGS_SO = $(CFLAGS) -fPIC 18 | C_FLAGS_SO = $(C_FLAGS) -shared -fPIC 19 | SWIG = swig -c++ -python 20 | 21 | ifdef IS_WIN 22 | LIBS += -lshlwapi 23 | else 24 | LIBS += -ldl 25 | endif 26 | -------------------------------------------------------------------------------- /doc/Doxygen/Readme.txt: -------------------------------------------------------------------------------- 1 | Use doxywizard.exe (doxygen-1.7.1) to open Interface.doxyfile or Modules.doxyfile file. 2 | 3 | Interface.doxyfile: Generates html and chm file from interface files. 4 | Modules.doxyfile: Generates html and chm file from interface and implement files. 5 | 6 | You may need install these softwares: 7 | 1 doxygen-1.7.1 8 | 2 graphviz-2.26.3 (see DOT_PATH, install to C:\Tools\Graphviz\ ) 9 | 3 mscgen-w32-0.17 (see MSCGEN_PATH, install to C:\Tools\mscgen\ ) 10 | 4 htmlhelp-1.3 (see HHC_LOCATION, install to C:\Program Files\HTML Help Workshop\ ) 11 | 12 | You may need change INCLUDE_PATH in Interface.doxyfile with the actual location. 13 | -------------------------------------------------------------------------------- /doc/Doxygen/html_footer.txt: -------------------------------------------------------------------------------- 1 |
2 | X3 C++ PluginFramework, Author: Zhang Yungui, Website: http://github.com/rhcad/x3c 3 |
4 | -------------------------------------------------------------------------------- /doc/uml/Images/ClassCache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/doc/uml/Images/ClassCache.png -------------------------------------------------------------------------------- /doc/uml/Images/ComHook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/doc/uml/Images/ComHook.png -------------------------------------------------------------------------------- /doc/uml/Images/CreateObject.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/doc/uml/Images/CreateObject.png -------------------------------------------------------------------------------- /doc/uml/Images/DelayLoading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/doc/uml/Images/DelayLoading.png -------------------------------------------------------------------------------- /doc/uml/Images/EventDriven.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/doc/uml/Images/EventDriven.png -------------------------------------------------------------------------------- /doc/uml/Images/FrameXtpClasses.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/doc/uml/Images/FrameXtpClasses.png -------------------------------------------------------------------------------- /doc/uml/Images/InterfaceStruct.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/doc/uml/Images/InterfaceStruct.png -------------------------------------------------------------------------------- /doc/uml/Images/Modules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/doc/uml/Images/Modules.png -------------------------------------------------------------------------------- /doc/uml/Images/PluginLoading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/doc/uml/Images/PluginLoading.png -------------------------------------------------------------------------------- /doc/uml/Images/PluginUnloading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/doc/uml/Images/PluginUnloading.png -------------------------------------------------------------------------------- /doc/uml/uml_ea.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/doc/uml/uml_ea.xml -------------------------------------------------------------------------------- /projects/CodeBlocks/x3c-unix.workspace: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /projects/CodeBlocks/x3c-win32.workspace: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /projects/msvc/vcproj/swig.rule: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tools/MakePluginPerl/Interface/ClsID_Example.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | const XCLSID CLSID_Example("86347b32-64e4-490c-b273-ec7e010f244e"); 4 | -------------------------------------------------------------------------------- /tools/MakePluginPerl/Interface/Ix_Example.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | interface Ix_Example 6 | { 7 | virtual void Foo() = 0; 8 | }; 9 | 10 | interface Ix_Example2 11 | { 12 | virtual void Foo2() = 0; 13 | }; 14 | -------------------------------------------------------------------------------- /tools/MakePluginPerl/MFCExtTempl/Cx_Example.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "Cx_Example.h" 3 | 4 | Cx_Example::Cx_Example() 5 | { 6 | } 7 | 8 | Cx_Example::~Cx_Example() 9 | { 10 | } 11 | 12 | void Cx_Example::Foo() 13 | { 14 | AfxMessageBox(L"Cx_Example::Foo"); 15 | } 16 | 17 | void Cx_Example::Foo2() 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /tools/MakePluginPerl/MFCExtTempl/Cx_Example.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class Cx_Example 6 | : public Ix_Example 7 | , public Ix_Example2 8 | { 9 | protected: 10 | Cx_Example(); 11 | ~Cx_Example(); 12 | 13 | protected: 14 | // From Ix_Example 15 | virtual void Foo(); 16 | 17 | // From Ix_Example2 18 | virtual void Foo2(); 19 | }; 20 | -------------------------------------------------------------------------------- /tools/MakePluginPerl/MFCExtTempl/Dll.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef _DEBUG 5 | #define new DEBUG_NEW 6 | #undef THIS_FILE 7 | static char THIS_FILE[] = __FILE__; 8 | #endif 9 | 10 | 11 | static AFX_EXTENSION_MODULE MFCExtTemplDLL = { NULL, NULL }; 12 | 13 | extern "C" int APIENTRY 14 | DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) 15 | { 16 | UNREFERENCED_PARAMETER(lpReserved); 17 | 18 | if (dwReason == DLL_PROCESS_ATTACH) 19 | { 20 | if (!AfxInitExtensionModule(MFCExtTemplDLL, hInstance)) 21 | return 0; 22 | 23 | new CDynLinkLibrary(MFCExtTemplDLL); 24 | } 25 | else if (dwReason == DLL_PROCESS_DETACH) 26 | { 27 | AfxTermExtensionModule(MFCExtTemplDLL); 28 | } 29 | 30 | return 1; 31 | } 32 | -------------------------------------------------------------------------------- /tools/MakePluginPerl/MFCExtTempl/MFCExtTempl.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/tools/MakePluginPerl/MFCExtTempl/MFCExtTempl.rc -------------------------------------------------------------------------------- /tools/MakePluginPerl/MFCExtTempl/Module.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "Cx_Example.h" 6 | 7 | XBEGIN_DEFINE_MODULE() 8 | XDEFINE_CLASSMAP_ENTRY(CLSID_Example, Cx_Example) 9 | XEND_DEFINE_MODULE() 10 | -------------------------------------------------------------------------------- /tools/MakePluginPerl/MFCExtTempl/Plugin.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/tools/MakePluginPerl/MFCExtTempl/Plugin.cpp -------------------------------------------------------------------------------- /tools/MakePluginPerl/MFCExtTempl/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by MFCExtTempl.rc 4 | // 5 | 6 | // Next default values for new objects 7 | // 8 | #ifdef APSTUDIO_INVOKED 9 | #ifndef APSTUDIO_READONLY_SYMBOLS 10 | 11 | #define _APS_NEXT_RESOURCE_VALUE 100 12 | #define _APS_NEXT_CONTROL_VALUE 1000 13 | #define _APS_NEXT_SYMED_VALUE 200 14 | #define _APS_NEXT_COMMAND_VALUE 32771 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /tools/MakePluginPerl/Readme.txt: -------------------------------------------------------------------------------- 1 | MakePluginPerl: a tool for automatic generation of X3C plugin 2 | 3 | makePlugin_v0.3.pl: Perl script 4 | config.ini: configuration file 5 | MFCExtTempl: template of MFC VC++ project 6 | Interface: directory for storing interface files(*.h) 7 | 8 | 9 | **Usage 10 | 1. Open the configuration file config.ini. Change some options in the section of newplugin. the "name" option is the name of the plugin that will be generated, and "project" is the name of the new VC++ project. Configuration file format is as follows: 11 | [newplugin] 12 | ; Plugin name 13 | name=Test 14 | 15 | ; VC++ project name 16 | project=Test 17 | 18 | 2. Run the script makePlugin_v0.3.pl or makePlugin_v0.3.exe. The exe file could be run independently without Perl runtime Environment. The new plugin will be generated in the current directory,the head files of interface will generated in the directory of Interface. 19 | 20 | 3. Copy the new plugin directory and interface files to your module directory, you 'll be happy to use it. Thanks to CPAN. 21 | 22 | 23 | **Things related to Perl 24 | Perl Win32 Runtime Enviroment(Active Perl): http://www.activestate.com/activeperl 25 | Perl2EXE convertor(ActiveState PDK): http://www.activestate.com/perl-dev-kit 26 | Dependent packages(All packages come from CPAN): File::Copy,Data::GUID,Config::IniFiles 27 | 28 | 29 | 30 | Bug reports and suggestions are welcome. Please use the SourceForge bug tracking 31 | system at http://sourceforge.net/projects/x3c/develop. 32 | 33 | Email to the current maintainers of MakePluginPerl may be sent to . 34 | 35 | -------------------------------------------------------------------------------- /tools/MakePluginPerl/Readme_cn.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/tools/MakePluginPerl/Readme_cn.txt -------------------------------------------------------------------------------- /tools/MakePluginPerl/config.ini: -------------------------------------------------------------------------------- 1 | ; Configuration for new plugin(need to change) 2 | [newplugin] 3 | ; new plugin name 4 | name=newPlugin 5 | 6 | ; VC++ project name 7 | project=newPlugin 8 | 9 | ; Version information, which come from resource file(*.rc). 10 | FileDescription=File description 11 | InternalName=Internal name 12 | OriginalFilename=Original filename 13 | ProductName=X3C 14 | 15 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 16 | ; Configuration for plugin template(no need to change in general) 17 | [exampleplugin] 18 | ; Plugin name 19 | name=Example 20 | 21 | ; VC++ project name 22 | project=MFCExtTempl 23 | 24 | ; Plugin directory 25 | plugindir=./MFCExtTempl 26 | 27 | ; Interface directory 28 | interfacedir=./Interface 29 | 30 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /tools/MakePluginPerl/makePlugin_v0.3.pl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rhcad/x3c/cca3f750f50521faae24ee22fb53c7e15636e9d0/tools/MakePluginPerl/makePlugin_v0.3.pl -------------------------------------------------------------------------------- /tools/deltemp.bat: -------------------------------------------------------------------------------- 1 | cd ..\projects 2 | attrib -R -H *.suo /S 3 | del /F/S/Q *.ncb,*.opt,*.suo,*.user,*.plg,*.aps,*.ilk,*.depend,*.layout,*.cbtemp,*.a,*.o 4 | del /F/S/Q ..\code\bin\*.def 5 | cd ..\tools 6 | --------------------------------------------------------------------------------