├── MainWindow ├── MANIFEST.MF ├── mainwindow.qrc ├── form.cpp ├── imainwindow.h ├── form.ui ├── mainwindowactivator.cpp ├── mainwindowactivator.h ├── mainwindowdlg.h ├── MainWindow.pro ├── mainwindow1.ui ├── mainwindowplugin.h ├── mainwindowdlg.ui ├── mainwindowplugin.cpp └── mainwindowdlg.cpp ├── bin ├── console.exe ├── configuration │ └── plugins.db └── plugins │ ├── Client1 │ ├── Client1.dll │ ├── Client1.exp │ └── Client1.lib │ └── MainWindow │ ├── MainWindow.dll │ ├── MainWindow.exp │ └── MainWindow.lib ├── libs └── ctk-0.1 │ ├── CMake │ ├── ctkLinkerAsNeededFlagCheck │ │ ├── B.cpp │ │ ├── A.cpp │ │ ├── C.cpp │ │ └── CMakeLists.txt │ ├── ctkFunctionAddExecutableUtf8.cmake │ ├── ctkExport.h.in │ ├── ctkMacroParseArguments.cmake │ ├── ctkFunctionExtractOptimizedLibrary.cmake │ ├── ctkMacroSetPaths.cmake │ ├── ctkMacroGeneratePluginResourceFile.cmake │ ├── ctkFunctionGetGccVersion.cmake │ ├── ctkMacroGenerateMocs.cmake │ ├── ctkMacroAddCtkLibraryOptions.cmake │ ├── ctkFunctionCheckoutRepo.cmake │ ├── ctkFunctionExtractOptionNameAndValue.cmake │ ├── ctkFunctionCheckCompilerFlags.cmake │ ├── ctkFunctionGetLibraryDirs.cmake │ ├── UseCTK.cmake │ └── ctkFunctionAddPluginRepo.cmake │ ├── CTKCore.dll │ ├── CTKCore.lib │ ├── CTKWidgets.dll │ ├── CTKWidgets.lib │ ├── CTKPluginFramework.dll │ ├── CTKPluginFramework.lib │ ├── plugins │ ├── org_commontk_log.lib │ ├── liborg_commontk_log.dll │ ├── org_commontk_metatype.lib │ ├── liborg_commontk_metatype.dll │ ├── org_commontk_configadmin.lib │ ├── org_commontk_eventadmin.lib │ ├── liborg_commontk_configadmin.dll │ └── liborg_commontk_eventadmin.dll │ └── designer │ └── CTKWidgetsPlugins.dll ├── Client1 ├── Client1.qrc ├── MANIFEST.MF ├── client1dlg.cpp ├── client1dlg.h ├── client1activator.cpp ├── client1activator.h ├── client1plugin.h ├── Client1.pro ├── client1plugin.cpp └── client1dlg.ui ├── ctkExample.pro ├── includes └── ctk-0.1 │ ├── ctkConfig.h │ ├── ctkCoreExport.h │ ├── ctkWidgetsExport.h │ ├── ctkPluginFrameworkExport.h │ ├── org.commontk.log │ ├── org_commontk_log_Export.h │ ├── ctkLogPlugin_p.h │ └── ctkLogQDebug_p.h │ ├── org.commontk.metatype │ ├── org_commontk_metatype_Export.h │ ├── ctkMTLocalizationElement_p.h │ ├── ctkMTMsg_p.h │ ├── ctkMTIcon_p.h │ └── ctkMetaTypeServiceImpl_p.h │ ├── org.commontk.eventadmin │ └── org_commontk_eventadmin_Export.h │ ├── service │ ├── debug │ │ └── ctkDebugOptions.cpp │ ├── metatype │ │ ├── ctkMetaTypeService.cpp │ │ ├── ctkAttributeDefinition.cpp │ │ ├── ctkMetaTypeProvider.cpp │ │ └── ctkMetaTypeInformation.h │ ├── cm │ │ ├── ctkConfigurationPlugin.cpp │ │ ├── ctkConfigurationAdmin.cpp │ │ └── ctkConfiguration.cpp │ ├── application │ │ ├── ctkApplicationHandle.cpp │ │ └── ctkApplicationDescriptor.cpp │ ├── log │ │ ├── ctkLogStream.cpp │ │ └── ctkLogStream.h │ ├── datalocation │ │ └── ctkLocation.cpp │ └── event │ │ └── ctkEventConstants.cpp │ ├── org.commontk.configadmin │ ├── org_commontk_configadmin_Export.h │ ├── ctkCMPluginManager_p.h │ └── ctkCMSerializedTaskQueue_p.h │ ├── ctkCompatibility_p.h │ ├── ctkCompilerDetections_p.h │ ├── ctkDictionary.h │ ├── ctkIconEnginePlugin.h │ ├── ctkPluginContext_p.h │ ├── ctkWidgetsTestingUtilities.h │ ├── ctkErrorLogContext.h │ ├── ctkPushButton_p.h │ ├── ctkRequirePlugin_p.h │ ├── ctkAxesWidgetEventTranslator.h │ ├── ctkConsoleEventPlayer.h │ ├── ctkServiceProperties_p.h │ ├── ctkAxesWidgetEventPlayer.h │ ├── ctkFontButtonEventPlayer.h │ ├── ctkPopupWidgetEventPlayer.h │ ├── ctkRangeSliderEventPlayer.h │ ├── ctkMatrixWidgetEventPlayer.h │ ├── ctkMenuComboBoxEventPlayer.h │ ├── ctkPathLineEditEventPlayer.h │ ├── ctkTreeComboBoxEventPlayer.h │ ├── ctkCheckableComboBoxEventPlayer.h │ ├── ctkDoubleRangeSliderEventPlayer.h │ ├── ctkPluginManifest_p.h │ ├── ctkCheckableHeaderViewEventPlayer.h │ ├── ctkFileDialogEventPlayer.h │ ├── ctkTrackedPluginListener_p.h │ ├── ctkCheckableHeaderViewEventTranslator.h │ ├── ctkErrorLogStatusMessageHandler.h │ ├── ctkMatrixWidgetEventTranslator.h │ ├── ctkTrackedServiceListener_p.h │ ├── ctkPopupWidgetEventTranslator.h │ ├── ctkTransferFunctionScene.h │ ├── ctkErrorLogQtMessageHandler.h │ ├── ctkRangeSliderEventTranslator.h │ ├── ctkFontButtonEventTranslator.h │ ├── ctkConsoleEventTranslator.h │ ├── ctkPluginFrameworkProperties_p.h │ ├── ctkErrorLogFDMessageHandler.h │ ├── ctkErrorLogLevel.h │ ├── ctkPathLineEditEventTranslator.h │ ├── ctkDoubleRangeSliderEventTranslator.h │ ├── ctkTemplateWidget.h │ ├── ctkThumbnailListWidget_p.h │ ├── ctkWidgetsUtils.h │ ├── ctkErrorLogStreamMessageHandler.h │ ├── ctkLogger.h │ ├── ctkTreeComboBoxEventTranslator.h │ ├── ctkCheckableComboBoxEventTranslator.h │ ├── ctkFileDialogEventTranslator.h │ ├── ctkErrorLogModel.h │ ├── ctkTransferFunctionView.h │ ├── ctkWorkflowTabWidget.h │ ├── ctkAbstractPluginFactory.h │ ├── ctkTransferFunctionNativeItem.h │ ├── ctkPluginTracker_p.tpp │ ├── ctkWorkflowStackedWidget.h │ ├── ctkMenuComboBoxEventTranslator.h │ ├── ctkFileLogger.h │ ├── ctkApplicationRunnable.h │ ├── ctkPopupWidget_p.h │ ├── ctkTransferFunctionGradientItem.h │ ├── ctkAbstractQObjectFactory.h │ ├── ctkFittedTextBrowser_p.h │ ├── ctkCheckBox.h │ ├── ctkErrorLogTerminalOutput.h │ └── ctkLayoutManager_p.h ├── README.md └── console └── console.pro /MainWindow/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Plugin-SymbolicName:MainWindow 2 | Plugin-Version:1.0.0 3 | -------------------------------------------------------------------------------- /bin/console.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/bin/console.exe -------------------------------------------------------------------------------- /libs/ctk-0.1/CMake/ctkLinkerAsNeededFlagCheck/B.cpp: -------------------------------------------------------------------------------- 1 | int B() 2 | { 3 | return 10; 4 | } 5 | -------------------------------------------------------------------------------- /libs/ctk-0.1/CTKCore.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/libs/ctk-0.1/CTKCore.dll -------------------------------------------------------------------------------- /libs/ctk-0.1/CTKCore.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/libs/ctk-0.1/CTKCore.lib -------------------------------------------------------------------------------- /libs/ctk-0.1/CMake/ctkLinkerAsNeededFlagCheck/A.cpp: -------------------------------------------------------------------------------- 1 | int B(); 2 | int A() 3 | { 4 | return B(); 5 | } 6 | -------------------------------------------------------------------------------- /libs/ctk-0.1/CTKWidgets.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/libs/ctk-0.1/CTKWidgets.dll -------------------------------------------------------------------------------- /libs/ctk-0.1/CTKWidgets.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/libs/ctk-0.1/CTKWidgets.lib -------------------------------------------------------------------------------- /bin/configuration/plugins.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/bin/configuration/plugins.db -------------------------------------------------------------------------------- /libs/ctk-0.1/CMake/ctkLinkerAsNeededFlagCheck/C.cpp: -------------------------------------------------------------------------------- 1 | int A(); 2 | int main() 3 | { 4 | return A(); 5 | } 6 | -------------------------------------------------------------------------------- /bin/plugins/Client1/Client1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/bin/plugins/Client1/Client1.dll -------------------------------------------------------------------------------- /bin/plugins/Client1/Client1.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/bin/plugins/Client1/Client1.exp -------------------------------------------------------------------------------- /bin/plugins/Client1/Client1.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/bin/plugins/Client1/Client1.lib -------------------------------------------------------------------------------- /libs/ctk-0.1/CTKPluginFramework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/libs/ctk-0.1/CTKPluginFramework.dll -------------------------------------------------------------------------------- /libs/ctk-0.1/CTKPluginFramework.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/libs/ctk-0.1/CTKPluginFramework.lib -------------------------------------------------------------------------------- /bin/plugins/MainWindow/MainWindow.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/bin/plugins/MainWindow/MainWindow.dll -------------------------------------------------------------------------------- /bin/plugins/MainWindow/MainWindow.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/bin/plugins/MainWindow/MainWindow.exp -------------------------------------------------------------------------------- /bin/plugins/MainWindow/MainWindow.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/bin/plugins/MainWindow/MainWindow.lib -------------------------------------------------------------------------------- /libs/ctk-0.1/plugins/org_commontk_log.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/libs/ctk-0.1/plugins/org_commontk_log.lib -------------------------------------------------------------------------------- /libs/ctk-0.1/designer/CTKWidgetsPlugins.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/libs/ctk-0.1/designer/CTKWidgetsPlugins.dll -------------------------------------------------------------------------------- /libs/ctk-0.1/plugins/liborg_commontk_log.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/libs/ctk-0.1/plugins/liborg_commontk_log.dll -------------------------------------------------------------------------------- /Client1/Client1.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | MANIFEST.MF 4 | 5 | 6 | -------------------------------------------------------------------------------- /ctkExample.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS += \ 4 | Client1 \ 5 | console \ 6 | MainWindow 7 | 8 | #windeployqt console.exe 9 | -------------------------------------------------------------------------------- /libs/ctk-0.1/plugins/org_commontk_metatype.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/libs/ctk-0.1/plugins/org_commontk_metatype.lib -------------------------------------------------------------------------------- /libs/ctk-0.1/plugins/liborg_commontk_metatype.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/libs/ctk-0.1/plugins/liborg_commontk_metatype.dll -------------------------------------------------------------------------------- /libs/ctk-0.1/plugins/org_commontk_configadmin.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/libs/ctk-0.1/plugins/org_commontk_configadmin.lib -------------------------------------------------------------------------------- /libs/ctk-0.1/plugins/org_commontk_eventadmin.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/libs/ctk-0.1/plugins/org_commontk_eventadmin.lib -------------------------------------------------------------------------------- /MainWindow/mainwindow.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | MANIFEST.MF 4 | 5 | 6 | -------------------------------------------------------------------------------- /libs/ctk-0.1/plugins/liborg_commontk_configadmin.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/libs/ctk-0.1/plugins/liborg_commontk_configadmin.dll -------------------------------------------------------------------------------- /libs/ctk-0.1/plugins/liborg_commontk_eventadmin.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myhhub/ctkExample/HEAD/libs/ctk-0.1/plugins/liborg_commontk_eventadmin.dll -------------------------------------------------------------------------------- /Client1/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Plugin-SymbolicName:Client1 2 | Plugin-Version:1.0.0 3 | Require-Plugin:MainWindow; plugin-version="[1.0,2.0)"; resolution:="mandatory" 4 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkConfig.h: -------------------------------------------------------------------------------- 1 | #ifndef __ctkConfig_h 2 | #define __ctkConfig_h 3 | 4 | #define CTK_PLUGIN_DIR "C:/d/mmm/qt/build-CTK-master-cmake-Release/CTK-build/bin/" 5 | #define CTK_SOURCE_DIR "C:/d/mmm/qt/CTK-master" 6 | 7 | #endif 8 | 9 | -------------------------------------------------------------------------------- /MainWindow/form.cpp: -------------------------------------------------------------------------------- 1 | #include "form.h" 2 | #include "ui_form.h" 3 | 4 | Form::Form(QWidget *parent) : 5 | QWidget(parent), 6 | ui(new Ui::Form) 7 | { 8 | ui->setupUi(this); 9 | } 10 | 11 | Form::~Form() 12 | { 13 | delete ui; 14 | } 15 | -------------------------------------------------------------------------------- /libs/ctk-0.1/CMake/ctkLinkerAsNeededFlagCheck/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(A SHARED A.cpp) 2 | add_library(B SHARED B.cpp) 3 | # No need to use ctk_add_executable_utf8 since there are 4 | # no special characters are involved in this test. 5 | add_executable(C C.cpp) 6 | target_link_libraries(C B A) 7 | -------------------------------------------------------------------------------- /Client1/client1dlg.cpp: -------------------------------------------------------------------------------- 1 | #include "client1dlg.h" 2 | #include "ui_client1dlg.h" 3 | 4 | Client1Dlg::Client1Dlg(QWidget *parent) : 5 | QDialog(parent), 6 | ui(new Ui::Client1Dlg) 7 | { 8 | ui->setupUi(this); 9 | } 10 | 11 | Client1Dlg::~Client1Dlg() 12 | { 13 | delete ui; 14 | } 15 | -------------------------------------------------------------------------------- /MainWindow/imainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef IMAINWINDOW_H 2 | #define IMAINWINDOW_H 3 | 4 | #include 5 | 6 | class iMainWindow 7 | { 8 | public: 9 | virtual void popMainWindow() = 0; 10 | }; 11 | 12 | Q_DECLARE_INTERFACE(iMainWindow, "interface_mainwindow") 13 | 14 | #endif // IMAINWINDOW_H 15 | -------------------------------------------------------------------------------- /Client1/client1dlg.h: -------------------------------------------------------------------------------- 1 | #ifndef CLIENT1DLG_H 2 | #define CLIENT1DLG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class Client1Dlg; 8 | } 9 | 10 | class Client1Dlg : public QDialog 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit Client1Dlg(QWidget *parent = nullptr); 16 | ~Client1Dlg(); 17 | 18 | private: 19 | Ui::Client1Dlg *ui; 20 | }; 21 | 22 | #endif // CLIENT1DLG_H 23 | -------------------------------------------------------------------------------- /Client1/client1activator.cpp: -------------------------------------------------------------------------------- 1 | #include "client1activator.h" 2 | #include 3 | Client1Activator::Client1Activator() 4 | :m_plugin(NULL) 5 | { 6 | 7 | } 8 | void Client1Activator::start(ctkPluginContext *context) 9 | { 10 | qDebug() << "client1 start"; 11 | m_plugin = new Client1Plugin(context); 12 | } 13 | void Client1Activator::stop(ctkPluginContext *context) 14 | { 15 | if(m_plugin) 16 | delete(m_plugin); 17 | m_plugin = NULL; 18 | } 19 | -------------------------------------------------------------------------------- /MainWindow/form.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /MainWindow/mainwindowactivator.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindowactivator.h" 2 | #include 3 | #include 4 | MainWindowActivator::MainWindowActivator() 5 | { 6 | } 7 | void MainWindowActivator::start(ctkPluginContext *context) 8 | { 9 | qDebug() << "mainwindow start"; 10 | m_plugin = new MainWindowPlugin(context); 11 | ctkDictionary dic; 12 | context->registerService(m_plugin, dic); 13 | 14 | 15 | } 16 | void MainWindowActivator::stop(ctkPluginContext *context) 17 | { 18 | } 19 | -------------------------------------------------------------------------------- /Client1/client1activator.h: -------------------------------------------------------------------------------- 1 | #ifndef CLIENT1ACTIVATOR_H 2 | #define CLIENT1ACTIVATOR_H 3 | #include 4 | #include "ctkPluginActivator.h" 5 | #include "client1plugin.h" 6 | class Client1Activator : public QObject, public ctkPluginActivator 7 | { 8 | Q_OBJECT 9 | Q_PLUGIN_METADATA(IID "Client1") 10 | Q_INTERFACES(ctkPluginActivator) 11 | public: 12 | Client1Activator(); 13 | void start(ctkPluginContext *context); 14 | void stop(ctkPluginContext *context); 15 | private: 16 | Client1Plugin* m_plugin; 17 | }; 18 | 19 | #endif // CLIENT1ACTIVATOR_H 20 | -------------------------------------------------------------------------------- /libs/ctk-0.1/CMake/ctkFunctionAddExecutableUtf8.cmake: -------------------------------------------------------------------------------- 1 | #! Usage: 2 | #! \code 3 | #! ctk_add_executable_utf8(args) 4 | #! \endcode 5 | #! 6 | #! This macro adds an executable that uses UTF-8 code page. 7 | #! 8 | #! Linux and Mac OSX already uses this code page by default but on Windows 9 | #! it has to be set explicitly, by using a manifest file. 10 | #! 11 | #! \ingroup CMakeUtilities 12 | 13 | function(ctk_add_executable_utf8) 14 | 15 | if(WIN32) 16 | add_executable(${ARGN} ${CTK_CMAKE_DIR}/WindowsApplicationUseUtf8.manifest) 17 | else() 18 | add_executable(${ARGN}) 19 | endif() 20 | 21 | endfunction() 22 | -------------------------------------------------------------------------------- /MainWindow/mainwindowactivator.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOWACTIVATOR_H 2 | #define MAINWINDOWACTIVATOR_H 3 | #include 4 | #include "ctkPluginActivator.h" 5 | #include "mainwindowplugin.h" 6 | class MainWindowActivator : public QObject, public ctkPluginActivator 7 | { 8 | public: 9 | Q_OBJECT 10 | Q_PLUGIN_METADATA(IID "MainWindow") 11 | Q_INTERFACES(ctkPluginActivator) 12 | 13 | public: 14 | MainWindowActivator(); 15 | 16 | void start(ctkPluginContext *context); 17 | void stop(ctkPluginContext *context); 18 | private: 19 | MainWindowPlugin* m_plugin; 20 | }; 21 | 22 | #endif // MAINWINDOWACTIVATOR_H 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 本文不是最新版本,CTK系列新版本是[《CTK完整教程(OSGI for C++ 实现 C++ Qt 模块化)》](https://github.com/myhhub/CTK-project) 4 | 5 | 6 | --------------- 7 | 8 | CTK简明框架使用教程 9 | 10 | # 简介 11 | 12 | CTK框架实际应用上来说框架还比较可靠,但网上资料很少。而刚接触时项目已经有了相当大的体量,与业务等其他逻辑混淆,现在单独把ctk框架部分抽离出来做个总结分享,避免后来的人走弯路。 13 | 14 | CTK使用教程,介绍CTK编译、CTK框架构建的方法,具体架构可根据自身项目设计。 15 | 16 | # CTK编译 17 | 18 | 使用cmake编译出与系统版本相应的动态库。参见[CTK编译教程(64位环境 Windows + Qt + MinGW或MSVC + CMake)](https://www.ljjyy.com/archives/2021/02/100643.html)。 19 | 20 | # CTK框架搭建 21 | 22 | 介绍简单的CTK框架构建的方法,具体架构可根据自身项目设计。 23 | 24 | 参见[CTK框架使用教程](https://www.ljjyy.com/archives/2021/03/100644.html)。 25 | -------------------------------------------------------------------------------- /MainWindow/mainwindowdlg.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOWDLG_H 2 | #define MAINWINDOWDLG_H 3 | 4 | #include 5 | #include "ctkPluginContext.h" 6 | 7 | namespace Ui { 8 | class MainWindowDlg; 9 | } 10 | 11 | class MainWindowDlg : public QMainWindow 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit MainWindowDlg(ctkPluginContext *context,QWidget *parent = 0); 17 | ~MainWindowDlg(); 18 | void registAction(QString id, QString name, QString topic); 19 | 20 | public slots: 21 | void action_clicked(); 22 | 23 | private: 24 | Ui::MainWindowDlg *ui; 25 | ctkPluginContext *m_context; 26 | }; 27 | 28 | #endif // MAINWINDOWDLG_H 29 | -------------------------------------------------------------------------------- /Client1/client1plugin.h: -------------------------------------------------------------------------------- 1 | #ifndef CLIENT1PLUGIN_H 2 | #define CLIENT1PLUGIN_H 3 | #include 4 | #include "ctkPluginContext.h" 5 | #include "service/event/ctkEventAdmin.h" 6 | #include "service/event/ctkEventHandler.h" 7 | #include "client1dlg.h" 8 | class Client1Plugin : public QObject, public ctkEventHandler 9 | { 10 | Q_OBJECT 11 | Q_INTERFACES(ctkEventHandler) 12 | public: 13 | Client1Plugin(ctkPluginContext *context); 14 | 15 | protected: 16 | void handleEvent(const ctkEvent& event); 17 | 18 | signals: 19 | void openDlg(); 20 | 21 | public slots: 22 | void onOpenDlg(); 23 | 24 | private: 25 | void registToMainWindow(); 26 | ctkPluginContext *m_context; 27 | Client1Dlg* m_clientDlg; 28 | }; 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /Client1/Client1.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = lib 2 | TARGET = Client1 3 | DESTDIR = $$PWD/../bin/plugins/$$TARGET 4 | QT += core gui 5 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 6 | 7 | #加载ctk库 8 | LIBS += -L$$PWD/../libs/ctk-0.1 -lCTKCore 9 | LIBS += -L$$PWD/../libs/ctk-0.1/ -lCTKPluginFramework 10 | 11 | INCLUDEPATH += $$PWD/../includes/ctk-0.1 12 | 13 | DEPENDPATH += $$PWD/../libs/ctk-0.1 14 | 15 | HEADERS += \ 16 | client1activator.h \ 17 | client1dlg.h \ 18 | client1plugin.h 19 | 20 | SOURCES += \ 21 | client1activator.cpp \ 22 | client1dlg.cpp \ 23 | client1plugin.cpp 24 | 25 | FORMS += \ 26 | client1dlg.ui 27 | 28 | RESOURCES += \ 29 | Client1.qrc 30 | 31 | file.path = $$DESTDIR 32 | file.files = MANIFEST.MF 33 | 34 | INSTALLS += file 35 | -------------------------------------------------------------------------------- /MainWindow/MainWindow.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = lib 2 | TARGET = MainWindow 3 | DESTDIR = $$PWD/../bin/plugins/$$TARGET 4 | QT += core gui 5 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 6 | 7 | #加载ctk库 8 | LIBS += -L$$PWD/../libs/ctk-0.1 -lCTKCore 9 | LIBS += -L$$PWD/../libs/ctk-0.1/ -lCTKPluginFramework 10 | 11 | INCLUDEPATH += $$PWD/../includes/ctk-0.1 12 | 13 | DEPENDPATH += $$PWD/../libs/ctk-0.1 14 | 15 | HEADERS += \ 16 | imainwindow.h \ 17 | mainwindowactivator.h \ 18 | mainwindowdlg.h \ 19 | mainwindowplugin.h 20 | 21 | SOURCES += \ 22 | mainwindowactivator.cpp \ 23 | mainwindowdlg.cpp \ 24 | mainwindowplugin.cpp 25 | 26 | RESOURCES += \ 27 | mainwindow.qrc 28 | 29 | FORMS += \ 30 | mainwindowdlg.ui 31 | 32 | file.path = $$DESTDIR 33 | file.files = MANIFEST.MF 34 | 35 | INSTALLS += file 36 | -------------------------------------------------------------------------------- /MainWindow/mainwindow1.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow1 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 600 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 0 21 | 0 22 | 800 23 | 24 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkCoreExport.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // .NAME __ctkCoreExport - manage Windows system differences 4 | // .SECTION Description 5 | // The __ctkCoreExport captures some system differences between Unix 6 | // and Windows operating systems. 7 | 8 | #ifndef __ctkCoreExport_h 9 | #define __ctkCoreExport_h 10 | 11 | #include "ctkCompatibility_p.h" 12 | #include "ctkCompilerDetections_p.h" 13 | 14 | #include 15 | 16 | #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) 17 | # if defined(CTKCore_EXPORTS) 18 | # define CTK_CORE_EXPORT Q_DECL_EXPORT 19 | # else 20 | # define CTK_CORE_EXPORT Q_DECL_IMPORT 21 | # endif 22 | #endif 23 | 24 | #if !defined(CTK_CORE_EXPORT) 25 | //# if defined(CTK_SHARED) 26 | # define CTK_CORE_EXPORT Q_DECL_EXPORT 27 | //# else 28 | //# define CTK_CORE_EXPORT 29 | //# endif 30 | #endif 31 | 32 | 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkWidgetsExport.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // .NAME __ctkWidgetsExport - manage Windows system differences 4 | // .SECTION Description 5 | // The __ctkWidgetsExport captures some system differences between Unix 6 | // and Windows operating systems. 7 | 8 | #ifndef __ctkWidgetsExport_h 9 | #define __ctkWidgetsExport_h 10 | 11 | #include "ctkCompatibility_p.h" 12 | #include "ctkCompilerDetections_p.h" 13 | 14 | #include 15 | 16 | #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) 17 | # if defined(CTKWidgets_EXPORTS) 18 | # define CTK_WIDGETS_EXPORT Q_DECL_EXPORT 19 | # else 20 | # define CTK_WIDGETS_EXPORT Q_DECL_IMPORT 21 | # endif 22 | #endif 23 | 24 | #if !defined(CTK_WIDGETS_EXPORT) 25 | //# if defined(CTK_SHARED) 26 | # define CTK_WIDGETS_EXPORT Q_DECL_EXPORT 27 | //# else 28 | //# define CTK_WIDGETS_EXPORT 29 | //# endif 30 | #endif 31 | 32 | 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /MainWindow/mainwindowplugin.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOWPLUGIN_H 2 | #define MAINWINDOWPLUGIN_H 3 | #include 4 | #include "../MainWindow/imainwindow.h" 5 | #include "ctkPluginContext.h" 6 | #include "mainwindowdlg.h" 7 | #include "service/event/ctkEventHandler.h" 8 | 9 | class MainWindowPlugin : public QObject, public iMainWindow, public ctkEventHandler 10 | { 11 | Q_OBJECT 12 | Q_INTERFACES(iMainWindow ctkEventHandler) 13 | public: 14 | MainWindowPlugin(ctkPluginContext *context); 15 | ~MainWindowPlugin(); 16 | virtual void popMainWindow(); 17 | signals: 18 | void registAction(const ctkEvent& event); 19 | public slots: 20 | void onRegistAction(const ctkEvent& event); 21 | 22 | protected: 23 | virtual void handleEvent(const ctkEvent& event); 24 | 25 | private: 26 | ctkPluginContext *m_context; 27 | MainWindowDlg* m_windowDlg; 28 | }; 29 | 30 | #endif // MAINWINDOWPLUGIN_H 31 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkPluginFrameworkExport.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // .NAME __ctkPluginFrameworkExport - manage Windows system differences 4 | // .SECTION Description 5 | // The __ctkPluginFrameworkExport captures some system differences between Unix 6 | // and Windows operating systems. 7 | 8 | #ifndef __ctkPluginFrameworkExport_h 9 | #define __ctkPluginFrameworkExport_h 10 | 11 | #include "ctkCompatibility_p.h" 12 | #include "ctkCompilerDetections_p.h" 13 | 14 | #include 15 | 16 | #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) 17 | # if defined(CTKPluginFramework_EXPORTS) 18 | # define CTK_PLUGINFW_EXPORT Q_DECL_EXPORT 19 | # else 20 | # define CTK_PLUGINFW_EXPORT Q_DECL_IMPORT 21 | # endif 22 | #endif 23 | 24 | #if !defined(CTK_PLUGINFW_EXPORT) 25 | //# if defined(CTK_SHARED) 26 | # define CTK_PLUGINFW_EXPORT Q_DECL_EXPORT 27 | //# else 28 | //# define CTK_PLUGINFW_EXPORT 29 | //# endif 30 | #endif 31 | 32 | 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /includes/ctk-0.1/org.commontk.log/org_commontk_log_Export.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // .NAME __org_commontk_log_Export - manage Windows system differences 4 | // .SECTION Description 5 | // The __org_commontk_log_Export captures some system differences between Unix 6 | // and Windows operating systems. 7 | 8 | #ifndef __org_commontk_log_Export_h 9 | #define __org_commontk_log_Export_h 10 | 11 | #include "ctkCompatibility_p.h" 12 | #include "ctkCompilerDetections_p.h" 13 | 14 | #include 15 | 16 | #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) 17 | # if defined(org_commontk_log_EXPORTS) 18 | # define org_commontk_log_EXPORT Q_DECL_EXPORT 19 | # else 20 | # define org_commontk_log_EXPORT Q_DECL_IMPORT 21 | # endif 22 | #endif 23 | 24 | #if !defined(org_commontk_log_EXPORT) 25 | //# if defined(CTK_SHARED) 26 | # define org_commontk_log_EXPORT Q_DECL_EXPORT 27 | //# else 28 | //# define org_commontk_log_EXPORT 29 | //# endif 30 | #endif 31 | 32 | 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /includes/ctk-0.1/org.commontk.metatype/org_commontk_metatype_Export.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // .NAME __org_commontk_metatype_Export - manage Windows system differences 4 | // .SECTION Description 5 | // The __org_commontk_metatype_Export captures some system differences between Unix 6 | // and Windows operating systems. 7 | 8 | #ifndef __org_commontk_metatype_Export_h 9 | #define __org_commontk_metatype_Export_h 10 | 11 | #include "ctkCompatibility_p.h" 12 | #include "ctkCompilerDetections_p.h" 13 | 14 | #include 15 | 16 | #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) 17 | # if defined(org_commontk_metatype_EXPORTS) 18 | # define org_commontk_metatype_EXPORT Q_DECL_EXPORT 19 | # else 20 | # define org_commontk_metatype_EXPORT Q_DECL_IMPORT 21 | # endif 22 | #endif 23 | 24 | #if !defined(org_commontk_metatype_EXPORT) 25 | //# if defined(CTK_SHARED) 26 | # define org_commontk_metatype_EXPORT Q_DECL_EXPORT 27 | //# else 28 | //# define org_commontk_metatype_EXPORT 29 | //# endif 30 | #endif 31 | 32 | 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /libs/ctk-0.1/CMake/ctkExport.h.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | // .NAME __@MY_EXPORT_HEADER_PREFIX@Export - manage Windows system differences 4 | // .SECTION Description 5 | // The __@MY_EXPORT_HEADER_PREFIX@Export captures some system differences between Unix 6 | // and Windows operating systems. 7 | 8 | #ifndef __@MY_EXPORT_HEADER_PREFIX@Export_h 9 | #define __@MY_EXPORT_HEADER_PREFIX@Export_h 10 | 11 | #include "ctkCompatibility_p.h" 12 | #include "ctkCompilerDetections_p.h" 13 | 14 | #include 15 | 16 | #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) 17 | # if defined(@MY_LIBNAME@_EXPORTS) 18 | # define @MY_LIBRARY_EXPORT_DIRECTIVE@ Q_DECL_EXPORT 19 | # else 20 | # define @MY_LIBRARY_EXPORT_DIRECTIVE@ Q_DECL_IMPORT 21 | # endif 22 | #endif 23 | 24 | #if !defined(@MY_LIBRARY_EXPORT_DIRECTIVE@) 25 | //# if defined(CTK_SHARED) 26 | # define @MY_LIBRARY_EXPORT_DIRECTIVE@ Q_DECL_EXPORT 27 | //# else 28 | //# define @MY_LIBRARY_EXPORT_DIRECTIVE@ 29 | //# endif 30 | #endif 31 | 32 | @CTK_EXPORT_CUSTOM_CONTENT@ 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /console/console.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 3 | 4 | 5 | CONFIG += c++11 console 6 | CONFIG -= app_bundle 7 | 8 | # The following define makes your compiler emit warnings if you use 9 | # any feature of Qt which as been marked deprecated (the exact warnings 10 | # depend on your compiler). Please consult the documentation of the 11 | # deprecated API in order to know how to port your code away from it. 12 | DEFINES += QT_DEPRECATED_WARNINGS 13 | 14 | # You can make your code fail to compile if it uses deprecated APIs. 15 | # In order to do so, uncomment the following line. 16 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 17 | DESTDIR = $$PWD/../bin 18 | 19 | LIBS += -L$$PWD/../libs/ctk-0.1 -lCTKCore 20 | LIBS += -L$$PWD/../libs/ctk-0.1/ -lCTKPluginFramework 21 | 22 | INCLUDEPATH += $$PWD/../includes/ctk-0.1 23 | #INCLUDEPATH += $$PWD/../libs/ctk-0.1 24 | 25 | DEPENDPATH += $$PWD/../libs/ctk-0.1 26 | 27 | SOURCES += \ 28 | main.cpp 29 | -------------------------------------------------------------------------------- /includes/ctk-0.1/org.commontk.eventadmin/org_commontk_eventadmin_Export.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // .NAME __org_commontk_eventadmin_Export - manage Windows system differences 4 | // .SECTION Description 5 | // The __org_commontk_eventadmin_Export captures some system differences between Unix 6 | // and Windows operating systems. 7 | 8 | #ifndef __org_commontk_eventadmin_Export_h 9 | #define __org_commontk_eventadmin_Export_h 10 | 11 | #include "ctkCompatibility_p.h" 12 | #include "ctkCompilerDetections_p.h" 13 | 14 | #include 15 | 16 | #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) 17 | # if defined(org_commontk_eventadmin_EXPORTS) 18 | # define org_commontk_eventadmin_EXPORT Q_DECL_EXPORT 19 | # else 20 | # define org_commontk_eventadmin_EXPORT Q_DECL_IMPORT 21 | # endif 22 | #endif 23 | 24 | #if !defined(org_commontk_eventadmin_EXPORT) 25 | //# if defined(CTK_SHARED) 26 | # define org_commontk_eventadmin_EXPORT Q_DECL_EXPORT 27 | //# else 28 | //# define org_commontk_eventadmin_EXPORT 29 | //# endif 30 | #endif 31 | 32 | 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /includes/ctk-0.1/service/debug/ctkDebugOptions.cpp: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | #include "ctkDebugOptions.h" 23 | 24 | const QString ctkDebugOptions::LISTENER_SYMBOLICNAME = "listener.symbolic.name"; 25 | -------------------------------------------------------------------------------- /includes/ctk-0.1/org.commontk.configadmin/org_commontk_configadmin_Export.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // .NAME __org_commontk_configadmin_Export - manage Windows system differences 4 | // .SECTION Description 5 | // The __org_commontk_configadmin_Export captures some system differences between Unix 6 | // and Windows operating systems. 7 | 8 | #ifndef __org_commontk_configadmin_Export_h 9 | #define __org_commontk_configadmin_Export_h 10 | 11 | #include "ctkCompatibility_p.h" 12 | #include "ctkCompilerDetections_p.h" 13 | 14 | #include 15 | 16 | #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) 17 | # if defined(org_commontk_configadmin_EXPORTS) 18 | # define org_commontk_configadmin_EXPORT Q_DECL_EXPORT 19 | # else 20 | # define org_commontk_configadmin_EXPORT Q_DECL_IMPORT 21 | # endif 22 | #endif 23 | 24 | #if !defined(org_commontk_configadmin_EXPORT) 25 | //# if defined(CTK_SHARED) 26 | # define org_commontk_configadmin_EXPORT Q_DECL_EXPORT 27 | //# else 28 | //# define org_commontk_configadmin_EXPORT 29 | //# endif 30 | #endif 31 | 32 | 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /includes/ctk-0.1/service/metatype/ctkMetaTypeService.cpp: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | #include "ctkMetaTypeService.h" 23 | 24 | const QString ctkMetaTypeService::METATYPE_DOCUMENTS_LOCATION = "CTK-INF/metatype"; 25 | 26 | -------------------------------------------------------------------------------- /includes/ctk-0.1/service/metatype/ctkAttributeDefinition.cpp: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | #include "ctkAttributeDefinition.h" 23 | 24 | const int ctkAttributeDefinition::PASSWORD = qRegisterMetaType("PASSWORD"); 25 | 26 | -------------------------------------------------------------------------------- /includes/ctk-0.1/service/cm/ctkConfigurationPlugin.cpp: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | 23 | #include "ctkConfigurationPlugin.h" 24 | 25 | const QString ctkConfigurationPlugin::CM_TARGET = "cm.target"; 26 | const QString ctkConfigurationPlugin::CM_RANKING = "service.cmRanking"; 27 | -------------------------------------------------------------------------------- /includes/ctk-0.1/service/metatype/ctkMetaTypeProvider.cpp: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | #include "ctkMetaTypeProvider.h" 23 | 24 | const QString ctkMetaTypeProvider::METATYPE_PID = "metatype.pid"; 25 | const QString ctkMetaTypeProvider::METATYPE_FACTORY_PID = "metatype.factory.pid"; 26 | 27 | -------------------------------------------------------------------------------- /includes/ctk-0.1/service/cm/ctkConfigurationAdmin.cpp: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) 2010 German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | 23 | #include "ctkConfigurationAdmin.h" 24 | 25 | const QString ctkConfigurationAdmin::SERVICE_FACTORYPID = "service.factoryPid"; 26 | const QString ctkConfigurationAdmin::SERVICE_PLUGINLOCATION = "service.pluginLocation"; 27 | 28 | -------------------------------------------------------------------------------- /MainWindow/mainwindowdlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindowDlg 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 600 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 100 21 | 70 22 | 181 23 | 81 24 | 25 | 26 | 27 | PushButton 28 | 29 | 30 | 31 | 32 | 33 | 34 | 0 35 | 0 36 | 800 37 | 24 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /libs/ctk-0.1/CMake/ctkMacroParseArguments.cmake: -------------------------------------------------------------------------------- 1 | 2 | #! 3 | #! See http://www.cmake.org/Wiki/CMakeMacroParseArguments 4 | #! 5 | #! \ingroup CMakeUtilities 6 | macro(CtkMacroParseArguments prefix arg_names option_names) 7 | set(DEFAULT_ARGS) 8 | foreach(arg_name ${arg_names}) 9 | set(${prefix}_${arg_name}) 10 | endforeach() 11 | foreach(option ${option_names}) 12 | set(${prefix}_${option} FALSE) 13 | endforeach() 14 | 15 | set(current_arg_name DEFAULT_ARGS) 16 | set(current_arg_list) 17 | foreach(arg ${ARGN}) 18 | set(larg_names ${arg_names}) 19 | list(FIND larg_names "${arg}" is_arg_name) 20 | IF (is_arg_name GREATER -1) 21 | set(${prefix}_${current_arg_name} ${current_arg_list}) 22 | set(current_arg_name ${arg}) 23 | set(current_arg_list) 24 | ELSE (is_arg_name GREATER -1) 25 | set(loption_names ${option_names}) 26 | list(FIND loption_names "${arg}" is_option) 27 | IF (is_option GREATER -1) 28 | set(${prefix}_${arg} TRUE) 29 | ELSE (is_option GREATER -1) 30 | set(current_arg_list ${current_arg_list} ${arg}) 31 | ENDIF (is_option GREATER -1) 32 | ENDIF (is_arg_name GREATER -1) 33 | endforeach() 34 | set(${prefix}_${current_arg_name} ${current_arg_list}) 35 | endmacro() 36 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkCompatibility_p.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkCompatibility_p_h 22 | #define __ctkCompatibility_p_h 23 | 24 | // 25 | // This file is not part of the CTK API. It exists purely as an 26 | // implementation detail. This header file may change from version to 27 | // version without notice, or even be removed. 28 | // 29 | // We mean it. 30 | // 31 | 32 | #include 33 | 34 | #if (QT_VERSION < QT_VERSION_CHECK(5, 4, 0)) 35 | #define qUtf8Printable(string) QString(string).toUtf8().constData() 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /libs/ctk-0.1/CMake/ctkFunctionExtractOptimizedLibrary.cmake: -------------------------------------------------------------------------------- 1 | #! 2 | #! Extracts the optimized library filepath from a list in the target_link_libraries() 3 | #! format, e. g. "optimized;release.lib;debug;debug.lib". 4 | #! 5 | #! If the list is a single filepath, return it instead. 6 | #! 7 | #! \param lib_list A target_link_libraries() library list or a single filepath. 8 | #! \param var_optimized_lib A variable name containing the output. 9 | #! 10 | function(ctkFunctionExtractOptimizedLibrary lib_list var_optimized_lib) 11 | 12 | list(LENGTH ${lib_list} lib_list_length) 13 | if(lib_list_length EQUAL 1) 14 | set(${var_optimized_lib} "${${lib_list}}" PARENT_SCOPE) 15 | return() 16 | endif() 17 | 18 | list(FIND ${lib_list} "optimized" optimized_keyword_index) 19 | if(optimized_keyword_index EQUAL -1) 20 | message(FATAL_ERROR "List \"${${lib_list}}\" does not contain \"optimized\" keyword") 21 | endif() 22 | 23 | math(EXPR last_lib_list_index "${lib_list_length} - 1") 24 | if(NOT optimized_keyword_index LESS last_lib_list_index) 25 | message(FATAL_ERROR "List \"${${lib_list}}\" ended unexpectedly") 26 | endif() 27 | 28 | math(EXPR optimized_lib_index "${optimized_keyword_index} + 1") 29 | list(GET ${lib_list} ${optimized_lib_index} optimized_lib) 30 | set(${var_optimized_lib} "${optimized_lib}" PARENT_SCOPE) 31 | 32 | endfunction() 33 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkCompilerDetections_p.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkCompilerDetections_p_h 22 | #define __ctkCompilerDetections_p_h 23 | 24 | // 25 | // This file is not part of the CTK API. It exists purely as an 26 | // implementation detail. This header file may change from version to 27 | // version without notice, or even be removed. 28 | // 29 | // We mean it. 30 | // 31 | 32 | /* 33 | * C++11 keywords and expressions 34 | */ 35 | #ifdef Q_NULLPTR 36 | # define CTK_NULLPTR Q_NULLPTR 37 | #else 38 | # define CTK_NULLPTR NULL 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkDictionary.h: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | 23 | #ifndef CTKDICTIONARY_H 24 | #define CTKDICTIONARY_H 25 | 26 | #include 27 | 28 | #include "ctkPluginFramework_global.h" 29 | 30 | /** 31 | * \ingroup PluginFramework 32 | * 33 | * A typedef for a QString to QVariant hash map. Typically used for service properties. 34 | * 35 | * \note This is equivalent to using ctkProperties. 36 | */ 37 | typedef QHash ctkDictionary; 38 | 39 | #endif // CTKDICTIONARY_H 40 | -------------------------------------------------------------------------------- /libs/ctk-0.1/CMake/ctkMacroSetPaths.cmake: -------------------------------------------------------------------------------- 1 | ########################################################################### 2 | # 3 | # Library: CTK 4 | # 5 | # Copyright (c) Kitware Inc. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0.txt 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | ########################################################################### 20 | 21 | #! 22 | #! Depending on the platform, either PATH, LD_LIBRARY_PATH or DYLD_LIBRARY_PATH 23 | #! will be updated using the paths specified using PATH_LIST 24 | #! 25 | #! \ingroup CMakeUtilities 26 | macro(ctkMacroSetPaths PATH_LIST) 27 | foreach(p ${PATH_LIST}) 28 | if(WIN32) 29 | set(ENV{PATH} "${p};$ENV{PATH}") 30 | elseif(APPLE) 31 | set(ENV{DYLD_LIBRARY_PATH} "${p}:$ENV{DYLD_LIBRARY_PATH}") 32 | else() 33 | set(ENV{LD_LIBRARY_PATH} "${p}:$ENV{LD_LIBRARY_PATH}") 34 | endif() 35 | endforeach() 36 | endmacro() 37 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkIconEnginePlugin.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkIconEnginePlugin_h 22 | #define __ctkIconEnginePlugin_h 23 | 24 | #include 25 | 26 | // The MOC is not able to parse "#if QT_VERSION >= 0x..." in Qt 5 and 27 | // "#if QT_VERSION >= QT_VERSION_CHECK(...)" in Qt4. As a workaround, 28 | // we check for the Qt version here (not parsed by MOC) and provide two 29 | // versions of the actual header file according to the used Qt version. 30 | #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) 31 | # include 32 | #else 33 | # include 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /libs/ctk-0.1/CMake/ctkMacroGeneratePluginResourceFile.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Depends on: 3 | # CTK/CMake/ctkMacroParseArguments.cmake 4 | # 5 | 6 | #! \ingroup CMakeUtilities 7 | macro(ctkMacroGeneratePluginResourceFile QRC_SRCS) 8 | 9 | CtkMacroParseArguments(MY 10 | "NAME;PREFIX;RESOURCES;BINARY_RESOURCES" 11 | "" 12 | ${ARGN} 13 | ) 14 | 15 | set(_qrc_filepath "${CMAKE_CURRENT_BINARY_DIR}/${MY_NAME}") 16 | 17 | set(_qrc_content 18 | " 19 | 20 | ") 21 | 22 | if(MY_RESOURCES) 23 | foreach(_resource_file ${MY_RESOURCES}) 24 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${_resource_file}" "${CMAKE_CURRENT_BINARY_DIR}/${_resource_file}" COPYONLY) 25 | set(_qrc_content "${_qrc_content}${_resource_file} 26 | ") 27 | endforeach() 28 | endif() 29 | 30 | if(MY_BINARY_RESOURCES) 31 | foreach(_resource_file ${MY_BINARY_RESOURCES}) 32 | set(_qrc_content "${_qrc_content}${_resource_file} 33 | ") 34 | endforeach() 35 | endif() 36 | 37 | set(_qrc_content "${_qrc_content} 38 | 39 | ") 40 | configure_file("${CTK_CMAKE_DIR}/plugin_resources_cached.qrc.in" "${_qrc_filepath}" @ONLY) 41 | 42 | if (CTK_QT_VERSION VERSION_GREATER "4") 43 | QT5_ADD_RESOURCES(${QRC_SRCS} ${_qrc_filepath}) 44 | else() 45 | QT4_ADD_RESOURCES(${QRC_SRCS} ${_qrc_filepath}) 46 | endif() 47 | 48 | endmacro() 49 | -------------------------------------------------------------------------------- /MainWindow/mainwindowplugin.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindowplugin.h" 2 | #include 3 | #include 4 | 5 | MainWindowPlugin::MainWindowPlugin(ctkPluginContext *context) 6 | :m_context(context) 7 | { 8 | m_windowDlg = new MainWindowDlg(context); 9 | // ctkDictionary dic; 10 | // dic.insert(ctkEventConstants::EVENT_TOPIC, "event/registAction"); 11 | // qDebug() << "event/registAction111"; 12 | // context->registerService(this, dic); 13 | // qDebug() << "event/registAction222"; 14 | // connect(this, SIGNAL(registAction(ctkEvent)), this, SLOT(onRegistAction(ctkEvent))); 15 | 16 | } 17 | 18 | void MainWindowPlugin::popMainWindow() 19 | { 20 | m_windowDlg->show(); 21 | } 22 | void MainWindowPlugin::handleEvent(const ctkEvent& event) 23 | { 24 | // if(event.getTopic() == "event/registAction") 25 | // qDebug() << "event/registAction8888"; 26 | // emit registAction(event); 27 | 28 | } 29 | 30 | void MainWindowPlugin::onRegistAction(const ctkEvent& event) 31 | { 32 | qDebug() << "event/registAction9999"; 33 | QString name, id, topic; 34 | name = event.getProperty("name").toString(); 35 | id = event.getProperty("id").toString(); 36 | topic = event.getProperty("topic").toString(); 37 | m_windowDlg->registAction(id, name, topic); 38 | } 39 | 40 | MainWindowPlugin::~MainWindowPlugin() 41 | { 42 | delete m_windowDlg; 43 | } 44 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkPluginContext_p.h: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | #ifndef CTKPLUGINCONTEXTPRIVATE_H 23 | #define CTKPLUGINCONTEXTPRIVATE_H 24 | 25 | class ctkPluginPrivate; 26 | 27 | /** 28 | * \ingroup PluginFramework 29 | */ 30 | class ctkPluginContextPrivate 31 | { 32 | 33 | public: 34 | 35 | ctkPluginPrivate* plugin; 36 | 37 | ctkPluginContextPrivate(ctkPluginPrivate* plugin); 38 | 39 | /** 40 | * Check that the plugin is still valid. 41 | */ 42 | void isPluginContextValid() const; 43 | 44 | void invalidate(); 45 | 46 | }; 47 | 48 | #endif // CTKPLUGINCONTEXTPRIVATE_H 49 | -------------------------------------------------------------------------------- /Client1/client1plugin.cpp: -------------------------------------------------------------------------------- 1 | #include "client1plugin.h" 2 | #include 3 | 4 | Client1Plugin::Client1Plugin(ctkPluginContext *context) 5 | :m_context(context) 6 | { 7 | m_clientDlg = new Client1Dlg; 8 | connect(this, SIGNAL(openDlg()), this, SLOT(onOpenDlg()),Qt::QueuedConnection); 9 | //注册监听信号"zhimakaimen" 10 | ctkDictionary dic; 11 | dic.insert(ctkEventConstants::EVENT_TOPIC, "zhimakaimen"); 12 | context->registerService(this, dic); 13 | 14 | //注册窗口 15 | //registToMainWindow(); 16 | 17 | } 18 | 19 | void Client1Plugin::handleEvent(const ctkEvent& event) 20 | { 21 | //接收监听事件接口 22 | if(event.getTopic() == "zhimakaimen") 23 | { 24 | emit openDlg(); 25 | //这里用了信号槽异步,因为线程中不能调用界面元素 26 | } 27 | 28 | } 29 | void Client1Plugin::onOpenDlg() 30 | { 31 | m_clientDlg->show(); 32 | } 33 | void Client1Plugin::registToMainWindow() 34 | { 35 | ctkServiceReference ref; 36 | ctkEventAdmin* eventAdmin; 37 | 38 | ref = m_context->getServiceReference(); 39 | 40 | if(ref) 41 | { 42 | eventAdmin = m_context->getService(ref); 43 | m_context->ungetService(ref); 44 | } 45 | 46 | ctkDictionary message; 47 | message.insert("id", "00"); 48 | message.insert("name", "用户1"); 49 | message.insert("topic","zhimakaimen"); 50 | if(eventAdmin) 51 | eventAdmin->postEvent(ctkEvent("event/registAction", message)); 52 | 53 | } 54 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkWidgetsTestingUtilities.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkWidgetsTestingUtilities_h 22 | #define __ctkWidgetsTestingUtilities_h 23 | 24 | // CTK includes 25 | #include 26 | 27 | class QImage; 28 | 29 | /// This module provides functions to facilitate writing tests. 30 | 31 | namespace ctkWidgetsTestingUtilities 32 | { 33 | 34 | /// Check that two images are equal. Allow for the specified percentage of 35 | /// pixels to be different. 36 | CTK_WIDGETS_EXPORT 37 | bool CheckImagesEqual(const QImage& current, const QImage& expected, 38 | float percentThreshold=0.f); 39 | 40 | } // namespace ctkWidgetsTestingUtilities 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /libs/ctk-0.1/CMake/ctkFunctionGetGccVersion.cmake: -------------------------------------------------------------------------------- 1 | ########################################################################### 2 | # 3 | # Library: CTK 4 | # 5 | # Copyright (c) Kitware Inc. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0.txt 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | ########################################################################### 20 | 21 | #! \ingroup CMakeUtilities 22 | function(ctkFunctionGetGccVersion path_to_gcc output_var) 23 | if(CMAKE_COMPILER_IS_GNUCXX) 24 | execute_process( 25 | COMMAND ${path_to_gcc} -dumpversion 26 | RESULT_VARIABLE result 27 | OUTPUT_VARIABLE output 28 | ERROR_VARIABLE error 29 | OUTPUT_STRIP_TRAILING_WHITESPACE 30 | ERROR_STRIP_TRAILING_WHITESPACE 31 | ) 32 | if(result) 33 | message(FATAL_ERROR "Failed to obtain compiler version running [${path_to_gcc} -dumpversion]: ${error}") 34 | endif() 35 | set(${output_var} ${output} PARENT_SCOPE) 36 | endif() 37 | endfunction() 38 | -------------------------------------------------------------------------------- /libs/ctk-0.1/CMake/ctkMacroGenerateMocs.cmake: -------------------------------------------------------------------------------- 1 | 2 | # QT4_GENERATE_MOCS(inputfile1 [inputfile2 ...]) 3 | 4 | include(MacroAddFileDependencies) 5 | 6 | function(QT4_GENERATE_MOCS) 7 | if(CTK_QT_VERSION VERSION_GREATER "4") 8 | QT5_GET_MOC_FLAGS(_moc_flags) 9 | else() 10 | QT4_GET_MOC_FLAGS(_moc_flags) 11 | endif() 12 | foreach(file ${ARGN}) 13 | 14 | get_filename_component(abs_file ${file} ABSOLUTE) 15 | 16 | get_filename_component(source_name ${file} NAME_WE) 17 | get_filename_component(source_ext ${file} EXT) 18 | if(${source_ext} MATCHES "\\.[hH]") 19 | if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${source_name}.cpp) 20 | set(source_ext .cpp) 21 | elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${source_name}.cxx) 22 | set(source_ext .cxx) 23 | endif() 24 | endif() 25 | 26 | set(moc_file ${CMAKE_CURRENT_BINARY_DIR}/moc_${source_name}${source_ext}) 27 | 28 | if(CTK_QT_VERSION VERSION_GREATER "4") 29 | if(Qt5_VERSION VERSION_LESS "5.6") 30 | QT5_CREATE_MOC_COMMAND(${abs_file} ${moc_file} "${_moc_flags}" "" "") 31 | else() 32 | QT5_CREATE_MOC_COMMAND(${abs_file} ${moc_file} "${_moc_flags}" "" "" "") 33 | endif() 34 | else() 35 | QT4_CREATE_MOC_COMMAND(${abs_file} ${moc_file} "${_moc_flags}" "" "") 36 | endif() 37 | MACRO_ADD_FILE_DEPENDENCIES(${abs_file} ${moc_file}) 38 | endforeach() 39 | endfunction() 40 | 41 | # create a Qt5 alias 42 | macro(QT5_GENERATE_MOCS) 43 | QT4_GENERATE_MOCS(${ARGN}) 44 | endmacro() 45 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkErrorLogContext.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkErrorLogContext_h 22 | #define __ctkErrorLogContext_h 23 | 24 | // Qt includes 25 | #include 26 | 27 | // CTK includes 28 | #include "ctkCoreExport.h" 29 | 30 | //------------------------------------------------------------------------------ 31 | /// \ingroup Core 32 | struct CTK_CORE_EXPORT ctkErrorLogContext 33 | { 34 | ctkErrorLogContext():Line(0),File("unknown"), Function("unknown"), Message(""){} 35 | ctkErrorLogContext(const QString& msg): 36 | Line(0),File("unknown"), Function("unknown"), Message(msg){} 37 | QString Category; 38 | int Line; 39 | QString File; 40 | QString Function; 41 | QString Message; 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /includes/ctk-0.1/service/application/ctkApplicationHandle.cpp: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | #include "ctkApplicationHandle.h" 23 | 24 | #include 25 | 26 | const QString ctkApplicationHandle::APPLICATION_PID = ctkPluginConstants::SERVICE_PID; 27 | const QString ctkApplicationHandle::APPLICATION_DESCRIPTOR = "application.descriptor"; 28 | const QString ctkApplicationHandle::APPLICATION_STATE = "application.state"; 29 | const QString ctkApplicationHandle::APPLICATION_SUPPORTS_EXITVALUE = "application.supports.exitvalue"; 30 | 31 | const QString ctkApplicationHandle::RUNNING = "RUNNING"; 32 | const QString ctkApplicationHandle::STOPPING = "STOPPING"; 33 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkPushButton_p.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | // CTK includes 22 | #include "ctkPushButton.h" 23 | 24 | //----------------------------------------------------------------------------- 25 | class ctkPushButtonPrivate 26 | { 27 | Q_DECLARE_PUBLIC(ctkPushButton); 28 | protected: 29 | ctkPushButton* const q_ptr; 30 | public: 31 | 32 | virtual ~ctkPushButtonPrivate(); 33 | 34 | ctkPushButtonPrivate(ctkPushButton& object); 35 | void init(); 36 | 37 | virtual QRect iconRect() const; 38 | virtual QSize buttonSizeHint()const; 39 | virtual QStyleOptionButton drawIcon(QPainter* p); 40 | 41 | // Tuning of the button look&feel 42 | Qt::Alignment ButtonTextAlignment; 43 | Qt::Alignment IconAlignment; 44 | int IconSpacing; 45 | }; 46 | -------------------------------------------------------------------------------- /includes/ctk-0.1/org.commontk.log/ctkLogPlugin_p.h: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | 23 | #ifndef CTKLOGPLUGIN_P_H 24 | #define CTKLOGPLUGIN_P_H 25 | 26 | #include 27 | 28 | class ctkLogQDebug; 29 | 30 | class ctkLogPlugin : 31 | public QObject, public ctkPluginActivator 32 | { 33 | Q_OBJECT 34 | Q_INTERFACES(ctkPluginActivator) 35 | #ifdef HAVE_QT5 36 | Q_PLUGIN_METADATA(IID "org_commontk_log") 37 | #endif 38 | 39 | public: 40 | 41 | ctkLogPlugin(); 42 | 43 | void start(ctkPluginContext* context); 44 | void stop(ctkPluginContext* context); 45 | 46 | private: 47 | 48 | ctkLogQDebug* logService; 49 | 50 | }; // ctkLogPlugin 51 | 52 | #endif // CTKLOGPLUGIN_P_H 53 | -------------------------------------------------------------------------------- /MainWindow/mainwindowdlg.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindowdlg.h" 2 | #include "ui_mainwindowdlg.h" 3 | #include "service/event/ctkEvent.h" 4 | #include "service/event/ctkEventAdmin.h" 5 | #include "service/event/ctkEventHandler.h" 6 | 7 | MainWindowDlg::MainWindowDlg(ctkPluginContext *context,QWidget *parent) : 8 | QMainWindow(parent), 9 | ui(new Ui::MainWindowDlg), 10 | m_context(context) 11 | { 12 | ui->setupUi(this); 13 | 14 | QAction* action = new QAction("用户1"); 15 | ui->menubar->addAction(action); 16 | connect(action, SIGNAL(triggered(bool)), this, SLOT(action_clicked())); 17 | } 18 | 19 | MainWindowDlg::~MainWindowDlg() 20 | { 21 | delete ui; 22 | } 23 | 24 | void MainWindowDlg::registAction(QString id, QString name, QString topic) 25 | { 26 | // qDebug() << "event/registAction name"; 27 | // QAction* action = new QAction(name); 28 | // action->setObjectName(id); 29 | // action->setStatusTip(topic); 30 | // ui->menubar->addAction(action); 31 | 32 | // connect(action, SIGNAL(triggered(bool)), this, SLOT(action_clicked())); 33 | } 34 | 35 | void MainWindowDlg::action_clicked() 36 | { 37 | //获取事件服务接口 38 | ctkServiceReference ref; 39 | ctkEventAdmin* eventAdmin; 40 | ref = m_context->getServiceReference(); 41 | if(ref) 42 | { 43 | eventAdmin = m_context->getService(ref); 44 | m_context->ungetService(ref); 45 | } 46 | //发送事件 47 | ctkDictionary message; 48 | if(eventAdmin) 49 | eventAdmin->postEvent(ctkEvent("zhimakaimen", message)); 50 | } 51 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkRequirePlugin_p.h: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | #ifndef CTKREQUIREPLUGIN_P_H 23 | #define CTKREQUIREPLUGIN_P_H 24 | 25 | #include 26 | 27 | 28 | class ctkPluginPrivate; 29 | 30 | /** 31 | * \ingroup PluginFramework 32 | */ 33 | class ctkRequirePlugin 34 | { 35 | 36 | public: 37 | 38 | const QString name; 39 | const QString resolution; 40 | const ctkVersionRange pluginRange; 41 | 42 | ctkRequirePlugin(ctkPluginPrivate* requestor, 43 | const QString& name, const QString& res, 44 | const QString& range); 45 | 46 | bool overlap(const ctkRequirePlugin& rp) const; 47 | 48 | }; 49 | 50 | 51 | #endif // CTKREQUIREPLUGIN_P_H 52 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkAxesWidgetEventTranslator.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkAxesWidgetEventTranslator_h 22 | #define __ctkAxesWidgetEventTranslator_h 23 | 24 | // QtTesting inlcudes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | class CTK_WIDGETS_EXPORT ctkAxesWidgetEventTranslator : 32 | public pqWidgetEventTranslator 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | typedef pqWidgetEventTranslator Superclass; 38 | ctkAxesWidgetEventTranslator(QObject* parent = 0); 39 | 40 | using Superclass::translateEvent; 41 | virtual bool translateEvent(QObject *Object, QEvent *Event, bool &Error); 42 | 43 | private: 44 | Q_DISABLE_COPY(ctkAxesWidgetEventTranslator); 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkConsoleEventPlayer.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | #ifndef __ctkConsoleEventPlayer_h 21 | #define __ctkConsoleEventPlayer_h 22 | 23 | // QtTesting includes 24 | #include 25 | 26 | // CTK include 27 | #include 28 | #include "ctkWidgetsExport.h" 29 | 30 | class CTK_WIDGETS_EXPORT ctkConsoleEventPlayer : public pqWidgetEventPlayer 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | typedef pqWidgetEventPlayer Superclass; 36 | ctkConsoleEventPlayer(QObject* parent = 0); 37 | 38 | using Superclass::playEvent; 39 | bool playEvent(QObject *Object, const QString &Command, 40 | const QString &Arguments, bool &Error); 41 | 42 | private: 43 | Q_DISABLE_COPY(ctkConsoleEventPlayer); 44 | }; 45 | 46 | #endif // __ctkConsoleEventPlayer_h 47 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkServiceProperties_p.h: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | #ifndef CTKSERVICEPROPERTIES_P_H 23 | #define CTKSERVICEPROPERTIES_P_H 24 | 25 | #include 26 | #include 27 | 28 | #include "ctkPluginFramework_global.h" 29 | 30 | class ctkServiceProperties 31 | { 32 | 33 | private: 34 | 35 | QVarLengthArray ks; 36 | QVarLengthArray vs; 37 | 38 | QMap map; 39 | 40 | public: 41 | 42 | ctkServiceProperties(const ctkProperties& props); 43 | 44 | QVariant value(const QString& key) const; 45 | QVariant value(int index) const; 46 | 47 | int find(const QString& key) const; 48 | int findCaseSensitive(const QString& key) const; 49 | 50 | QStringList keys() const; 51 | 52 | }; 53 | 54 | #endif // CTKSERVICEPROPERTIES_P_H 55 | -------------------------------------------------------------------------------- /includes/ctk-0.1/org.commontk.configadmin/ctkCMPluginManager_p.h: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | 23 | #ifndef CTKCMPLUGINMANAGER_P_H 24 | #define CTKCMPLUGINMANAGER_P_H 25 | 26 | #include 27 | #include 28 | 29 | class _PluginTracker; 30 | 31 | 32 | /** 33 | * PluginManager tracks and allows customization via ConfigurationPlugin 34 | */ 35 | class ctkCMPluginManager 36 | { 37 | 38 | public: 39 | 40 | ctkCMPluginManager(ctkPluginContext* context); 41 | ~ctkCMPluginManager(); 42 | 43 | void start(); 44 | void stop(); 45 | 46 | void modifyConfiguration(const ctkServiceReference& managedReference, ctkDictionary& properties); 47 | 48 | private: 49 | 50 | QScopedPointer<_PluginTracker> pluginTracker; 51 | 52 | }; 53 | 54 | #endif // CTKCMPLUGINMANAGER_P_H 55 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkAxesWidgetEventPlayer.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkAxesWidgetEventPlayer_h 22 | #define __ctkAxesWidgetEventPlayer_h 23 | 24 | // QtTesting includes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | /// Concrete implementation of pqWidgetEventPlayer that translates 32 | /// high-level events into low-level Qt events. 33 | 34 | class CTK_WIDGETS_EXPORT ctkAxesWidgetEventPlayer : 35 | public pqWidgetEventPlayer 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | typedef pqWidgetEventPlayer Superclass; 41 | ctkAxesWidgetEventPlayer(QObject* parent = 0); 42 | 43 | using Superclass::playEvent; 44 | bool playEvent(QObject *Object, const QString &Command, const QString &Arguments, bool &Error); 45 | 46 | private: 47 | Q_DISABLE_COPY(ctkAxesWidgetEventPlayer); 48 | 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkFontButtonEventPlayer.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkFontButtonEventPlayer_h 22 | #define __ctkFontButtonEventPlayer_h 23 | 24 | // QtTesting includes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | /// Concrete implementation of pqWidgetEventPlayer that translates 32 | /// high-level events into low-level Qt events. 33 | 34 | class CTK_WIDGETS_EXPORT ctkFontButtonEventPlayer : 35 | public pqWidgetEventPlayer 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | typedef pqWidgetEventPlayer Superclass; 41 | ctkFontButtonEventPlayer(QObject* parent = 0); 42 | 43 | using Superclass::playEvent; 44 | bool playEvent(QObject *Object, const QString &Command, const QString &Arguments, bool &Error); 45 | 46 | private: 47 | Q_DISABLE_COPY(ctkFontButtonEventPlayer); 48 | 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkPopupWidgetEventPlayer.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkPopupWidgetEventPlayer_h 22 | #define __ctkPopupWidgetEventPlayer_h 23 | 24 | // QtTesting includes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | /// Concrete implementation of pqWidgetEventPlayer that translates 32 | /// high-level events into low-level Qt events. 33 | 34 | class CTK_WIDGETS_EXPORT ctkPopupWidgetEventPlayer : 35 | public pqWidgetEventPlayer 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | typedef pqWidgetEventPlayer Superclass; 41 | ctkPopupWidgetEventPlayer(QObject* parent = 0); 42 | 43 | using Superclass::playEvent; 44 | bool playEvent(QObject *Object, const QString &Command, const QString &Arguments, bool &Error); 45 | 46 | private: 47 | Q_DISABLE_COPY(ctkPopupWidgetEventPlayer); 48 | 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkRangeSliderEventPlayer.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkRangeSliderEventPlayer_h 22 | #define __ctkRangeSliderEventPlayer_h 23 | 24 | // QtTesting includes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | /// Concrete implementation of pqWidgetEventPlayer that translates 32 | /// high-level events into low-level Qt events. 33 | 34 | class CTK_WIDGETS_EXPORT ctkRangeSliderEventPlayer : 35 | public pqWidgetEventPlayer 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | typedef pqWidgetEventPlayer Superclass; 41 | ctkRangeSliderEventPlayer(QObject* parent = 0); 42 | 43 | using Superclass::playEvent; 44 | bool playEvent(QObject *Object, const QString &Command, const QString &Arguments, bool &Error); 45 | 46 | private: 47 | Q_DISABLE_COPY(ctkRangeSliderEventPlayer); 48 | 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /libs/ctk-0.1/CMake/ctkMacroAddCtkLibraryOptions.cmake: -------------------------------------------------------------------------------- 1 | ########################################################################### 2 | # 3 | # Library: CTK 4 | # 5 | # Copyright (c) Kitware Inc. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0.txt 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | ########################################################################### 20 | 21 | #! \ingroup CMakeUtilities 22 | macro(ctkMacroAddCtkLibraryOptions lib) 23 | 24 | set(filepath ${CMAKE_CURRENT_SOURCE_DIR}/Libs/${lib}/ctk_library_options.cmake) 25 | 26 | # Add options only if "ctk_library_option.cmake" file exists 27 | if(EXISTS ${filepath}) 28 | 29 | # Make sure the variable is cleared 30 | set(ctk_library_options ) 31 | 32 | include(${filepath}) 33 | 34 | foreach(option ${ctk_library_options}) 35 | ctkFunctionExtractOptionNameAndValue(${option} option_name option_value) 36 | option(CTK_LIB_${lib}_${option_name} "Enable ${lib} Library ${option_name} option." ${option_value}) 37 | mark_as_advanced(CTK_LIB_${lib}_${option_name}) 38 | mark_as_superbuild(CTK_LIB_${lib}_${option_name}) 39 | endforeach() 40 | 41 | endif() 42 | 43 | endmacro() 44 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkMatrixWidgetEventPlayer.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkMatrixWidgetEventPlayer_h 22 | #define __ctkMatrixWidgetEventPlayer_h 23 | 24 | // QtTesting includes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | /// Concrete implementation of pqWidgetEventPlayer that translates 32 | /// high-level events into low-level Qt events. 33 | 34 | class CTK_WIDGETS_EXPORT ctkMatrixWidgetEventPlayer : 35 | public pqWidgetEventPlayer 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | typedef pqWidgetEventPlayer Superclass; 41 | ctkMatrixWidgetEventPlayer(QObject* parent = 0); 42 | 43 | using Superclass::playEvent; 44 | bool playEvent(QObject *Object, const QString &Command, const QString &Arguments, bool &Error); 45 | 46 | private: 47 | Q_DISABLE_COPY(ctkMatrixWidgetEventPlayer); 48 | 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkMenuComboBoxEventPlayer.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkMenuComboBoxEventPlayer_h 22 | #define __ctkMenuComboBoxEventPlayer_h 23 | 24 | // QtTesting includes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | /// Concrete implementation of pqWidgetEventPlayer that translates 32 | /// high-level events into low-level Qt events. 33 | 34 | class CTK_WIDGETS_EXPORT ctkMenuComboBoxEventPlayer : 35 | public pqWidgetEventPlayer 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | typedef pqWidgetEventPlayer Superclass; 41 | ctkMenuComboBoxEventPlayer(QObject* parent = 0); 42 | 43 | using Superclass::playEvent; 44 | bool playEvent(QObject *Object, const QString &Command, const QString &Arguments, bool &Error); 45 | 46 | private: 47 | Q_DISABLE_COPY(ctkMenuComboBoxEventPlayer); 48 | 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkPathLineEditEventPlayer.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkPathLineEditEventPlayer_h 22 | #define __ctkPathLineEditEventPlayer_h 23 | 24 | // QtTesting includes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | /// Concrete implementation of pqWidgetEventPlayer that translates 32 | /// high-level events into low-level Qt events. 33 | 34 | class CTK_WIDGETS_EXPORT ctkPathLineEditEventPlayer : 35 | public pqWidgetEventPlayer 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | typedef pqWidgetEventPlayer Superclass; 41 | ctkPathLineEditEventPlayer(QObject* parent = 0); 42 | 43 | using Superclass::playEvent; 44 | bool playEvent(QObject *Object, const QString &Command, const QString &Arguments, bool &Error); 45 | 46 | private: 47 | Q_DISABLE_COPY(ctkPathLineEditEventPlayer); 48 | 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkTreeComboBoxEventPlayer.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkTreeComboBoxEventPlayer_h 22 | #define __ctkTreeComboBoxEventPlayer_h 23 | 24 | // QtTesting includes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | /// Concrete implementation of pqWidgetEventPlayer that translates 32 | /// high-level events into low-level Qt events. 33 | 34 | class CTK_WIDGETS_EXPORT ctkTreeComboBoxEventPlayer : 35 | public pqWidgetEventPlayer 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | typedef pqWidgetEventPlayer Superclass; 41 | ctkTreeComboBoxEventPlayer(QObject* parent = 0); 42 | 43 | using Superclass::playEvent; 44 | bool playEvent(QObject *Object, const QString &Command, const QString &Arguments, bool &Error); 45 | 46 | private: 47 | Q_DISABLE_COPY(ctkTreeComboBoxEventPlayer); 48 | 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkCheckableComboBoxEventPlayer.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkCheckableComboBoxEventPlayer_h 22 | #define __ctkCheckableComboBoxEventPlayer_h 23 | 24 | // QtTesting includes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | /// Concrete implementation of pqWidgetEventPlayer that translates 32 | /// high-level events into low-level Qt events. 33 | 34 | class CTK_WIDGETS_EXPORT ctkCheckableComboBoxEventPlayer : 35 | public pqWidgetEventPlayer 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | typedef pqWidgetEventPlayer Superclass; 41 | ctkCheckableComboBoxEventPlayer(QObject* parent = 0); 42 | 43 | using Superclass::playEvent; 44 | bool playEvent(QObject *Object, const QString &Command, const QString &Arguments, bool &Error); 45 | 46 | private: 47 | Q_DISABLE_COPY(ctkCheckableComboBoxEventPlayer); 48 | 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkDoubleRangeSliderEventPlayer.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkDoubleRangeSliderEventPlayer_h 22 | #define __ctkDoubleRangeSliderEventPlayer_h 23 | 24 | // QtTesting includes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | /// Concrete implementation of pqWidgetEventPlayer that translates 32 | /// high-level events into low-level Qt events. 33 | 34 | class CTK_WIDGETS_EXPORT ctkDoubleRangeSliderEventPlayer : 35 | public pqWidgetEventPlayer 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | typedef pqWidgetEventPlayer Superclass; 41 | ctkDoubleRangeSliderEventPlayer(QObject* parent = 0); 42 | 43 | using Superclass::playEvent; 44 | bool playEvent(QObject *Object, const QString &Command, const QString &Arguments, bool &Error); 45 | 46 | private: 47 | Q_DISABLE_COPY(ctkDoubleRangeSliderEventPlayer); 48 | 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkPluginManifest_p.h: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | #ifndef CTKPLUGINMANIFEST_P_H 23 | #define CTKPLUGINMANIFEST_P_H 24 | 25 | #include 26 | #include 27 | 28 | class QIODevice; 29 | 30 | /** 31 | * \ingroup PluginFramework 32 | */ 33 | class ctkPluginManifest 34 | { 35 | 36 | public: 37 | 38 | typedef QHash Attributes; 39 | 40 | ctkPluginManifest(); 41 | ctkPluginManifest(const QByteArray& in); 42 | 43 | void read(const QByteArray& in); 44 | 45 | Attributes getMainAttributes() const; 46 | QString getAttribute(const QString& key) const; 47 | Attributes getAttributes(const QString& section) const; 48 | 49 | QStringList getSections() const; 50 | 51 | private: 52 | 53 | Attributes mainAttributes; 54 | QHash sections; 55 | 56 | }; 57 | 58 | 59 | #endif // CTKPLUGINMANIFEST_P_H 60 | -------------------------------------------------------------------------------- /includes/ctk-0.1/org.commontk.metatype/ctkMTLocalizationElement_p.h: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | 23 | #ifndef CTKMTLOCALIZATIONELEMENT_P_H 24 | #define CTKMTLOCALIZATIONELEMENT_P_H 25 | 26 | #include 27 | 28 | #include 29 | 30 | class ctkMTLocalizationElement 31 | { 32 | 33 | const QString _localization; 34 | const QString _context; 35 | ctkPluginLocalization _pl; 36 | 37 | public: 38 | 39 | ctkMTLocalizationElement(const QString& localization, const QString& context); 40 | 41 | /** 42 | * Internal method 43 | */ 44 | void setPluginLocalization(const ctkPluginLocalization& pl); 45 | 46 | /** 47 | * Method to get the localized text of inputed String. 48 | */ 49 | QString getLocalized(const QString& key) const; 50 | 51 | QString getLocalizationBase() const; 52 | }; 53 | 54 | #endif // CTKMTLOCALIZATIONELEMENT_P_H 55 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkCheckableHeaderViewEventPlayer.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkCheckableHeaderViewEventPlayer_h 22 | #define __ctkCheckableHeaderViewEventPlayer_h 23 | 24 | // QtTesting includes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | /// Concrete implementation of pqWidgetEventPlayer that translates 32 | /// high-level events into low-level Qt events. 33 | 34 | class CTK_WIDGETS_EXPORT ctkCheckableHeaderViewEventPlayer : 35 | public pqWidgetEventPlayer 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | typedef pqWidgetEventPlayer Superclass; 41 | ctkCheckableHeaderViewEventPlayer(QObject* parent = 0); 42 | 43 | using Superclass::playEvent; 44 | bool playEvent(QObject *Object, const QString &Command, const QString &Arguments, bool &Error); 45 | 46 | private: 47 | Q_DISABLE_COPY(ctkCheckableHeaderViewEventPlayer); 48 | 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkFileDialogEventPlayer.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkFileDialogEventPlayer_h 22 | #define __ctkFileDialogEventPlayer_h 23 | 24 | // QtTesting includes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | /// Concrete implementation of pqWidgetEventPlayer that translates 32 | /// high-level events into low-level Qt events. 33 | 34 | class CTK_WIDGETS_EXPORT ctkFileDialogEventPlayer : 35 | public pqNativeFileDialogEventPlayer 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | typedef pqNativeFileDialogEventPlayer Superclass; 41 | ctkFileDialogEventPlayer(pqTestUtility* util, QObject* parent = 0); 42 | 43 | using Superclass::playEvent; 44 | bool playEvent(QObject *Object, const QString &Command, const QString &Arguments, bool &Error); 45 | 46 | private: 47 | Q_DISABLE_COPY(ctkFileDialogEventPlayer); 48 | 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkTrackedPluginListener_p.h: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | 23 | #ifndef CTKTRACKEDPLUGINLISTENER_P_H 24 | #define CTKTRACKEDPLUGINLISTENER_P_H 25 | 26 | #include 27 | 28 | #include "ctkPluginEvent.h" 29 | 30 | /** 31 | * \ingroup PluginFramework 32 | */ 33 | class CTK_PLUGINFW_EXPORT ctkTrackedPluginListener : public QObject 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | ctkTrackedPluginListener(QObject *parent = 0) 39 | : QObject(parent) 40 | {} 41 | 42 | public Q_SLOTS: 43 | 44 | /** 45 | * Slot for the ctkPluginTracker 46 | * class. This method must NOT be synchronized to avoid deadlock 47 | * potential. 48 | * 49 | * @param event ctkPluginEvent object from the framework. 50 | */ 51 | virtual void pluginChanged(const ctkPluginEvent& event) = 0; 52 | 53 | }; 54 | 55 | #endif // CTKTRACKEDPLUGINLISTENER_P_H 56 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkCheckableHeaderViewEventTranslator.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkCheckableHeaderEventTranslator_h 22 | #define __ctkCheckableHeaderEventTranslator_h 23 | 24 | // QtTesting inlcudes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | 32 | class CTK_WIDGETS_EXPORT ctkCheckableHeaderViewEventTranslator : 33 | public pqWidgetEventTranslator 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | typedef pqWidgetEventTranslator Superclass; 39 | ctkCheckableHeaderViewEventTranslator(QObject* parent = 0); 40 | 41 | using Superclass::translateEvent; 42 | virtual bool translateEvent(QObject *Object, QEvent *Event, bool &Error); 43 | 44 | private: 45 | Q_DISABLE_COPY(ctkCheckableHeaderViewEventTranslator); 46 | 47 | QObject* CurrentObject; 48 | 49 | private slots: 50 | void onHeaderDataChanged(Qt::Orientation,int,int); 51 | 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /includes/ctk-0.1/org.commontk.log/ctkLogQDebug_p.h: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | 23 | #ifndef CTKLOGQDEBUG_P_H 24 | #define CTKLOGQDEBUG_P_H 25 | 26 | #include 27 | 28 | #include 29 | 30 | class ctkLogQDebug : public QObject, public ctkLogService 31 | { 32 | 33 | Q_OBJECT 34 | Q_INTERFACES(ctkLogService) 35 | 36 | public: 37 | 38 | ctkLogQDebug(); 39 | 40 | void log(int level, const QString& message, const std::exception* exception = 0, 41 | const char* file = 0, const char* function = 0, int line = -1); 42 | void log(const ctkServiceReference& sr, int level, const QString& message, 43 | const std::exception* exception = 0, 44 | const char* file = 0, const char* function = 0, int line = -1); 45 | int getLogLevel() const; 46 | 47 | private: 48 | 49 | int logLevel; 50 | }; 51 | 52 | #endif // CTKLOGQDEBUG_P_H 53 | -------------------------------------------------------------------------------- /includes/ctk-0.1/service/cm/ctkConfiguration.cpp: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | 23 | #include "ctkConfiguration.h" 24 | 25 | //---------------------------------------------------------------------------- 26 | ctkConfiguration::~ctkConfiguration() 27 | { 28 | } 29 | 30 | //---------------------------------------------------------------------------- 31 | bool ctkConfiguration::operator==(const ctkConfiguration& other) const 32 | { 33 | return this->getPid() == other.getPid(); 34 | } 35 | 36 | //---------------------------------------------------------------------------- 37 | uint qHash(ctkConfigurationPtr configuration) 38 | { 39 | return qHash(configuration->getPid()); 40 | } 41 | 42 | //---------------------------------------------------------------------------- 43 | bool operator==(const ctkConfigurationPtr& c1, const ctkConfigurationPtr c2) 44 | { 45 | return (*c1.data()) == (*c2.data()); 46 | } 47 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkErrorLogStatusMessageHandler.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkErrorLogStatusMessageHandler_h 22 | #define __ctkErrorLogStatusMessageHandler_h 23 | 24 | // CTK includes 25 | #include 26 | #include "ctkWidgetsExport.h" 27 | 28 | // Qt includes 29 | #include 30 | 31 | class QMainWindow; 32 | 33 | //------------------------------------------------------------------------------ 34 | /// \ingroup Widgets 35 | class CTK_WIDGETS_EXPORT ctkErrorLogStatusMessageHandler : 36 | public ctkErrorLogAbstractMessageHandler 37 | { 38 | Q_OBJECT 39 | public: 40 | ctkErrorLogStatusMessageHandler(QMainWindow * mainWindow); 41 | 42 | static QString HandlerName; 43 | 44 | virtual QString handlerName()const; 45 | virtual void setEnabledInternal(bool value); 46 | 47 | public Q_SLOTS: 48 | void statusBarMessageChanged(const QString& text); 49 | 50 | private: 51 | QPointer MainWindow; 52 | }; 53 | 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkMatrixWidgetEventTranslator.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkMatrixWidgetEventTranslator_h 22 | #define __ctkMatrixWidgetEventTranslator_h 23 | 24 | // QtTesting includes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | /// Translate low-level Qt events into high-level events for QtTesting 32 | 33 | class CTK_WIDGETS_EXPORT ctkMatrixWidgetEventTranslator : 34 | public pqWidgetEventTranslator 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | typedef pqWidgetEventTranslator Superclass; 40 | ctkMatrixWidgetEventTranslator(QObject* parent = 0); 41 | 42 | using Superclass::translateEvent; 43 | virtual bool translateEvent(QObject *Object, QEvent *Event, bool &Error); 44 | 45 | private: 46 | Q_DISABLE_COPY(ctkMatrixWidgetEventTranslator); 47 | 48 | QObject* CurrentObject; 49 | 50 | private slots: 51 | void onDestroyed(); 52 | void onMatrixChanged(); 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkTrackedServiceListener_p.h: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | 23 | #ifndef CTKTRACKEDSERVICELISTENER_P_H 24 | #define CTKTRACKEDSERVICELISTENER_P_H 25 | 26 | #include 27 | 28 | #include "ctkServiceEvent.h" 29 | 30 | /** 31 | * \ingroup PluginFramework 32 | */ 33 | class CTK_PLUGINFW_EXPORT ctkTrackedServiceListener : public QObject 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | ctkTrackedServiceListener(QObject *parent = 0) 39 | : QObject(parent) 40 | {} 41 | 42 | public Q_SLOTS: 43 | 44 | /** 45 | * Slot connected to service events for the 46 | * ctkServiceTracker class. This method must NOT be 47 | * synchronized to avoid deadlock potential. 48 | * 49 | * @param event ctkServiceEvent object from the framework. 50 | */ 51 | virtual void serviceChanged(const ctkServiceEvent& event) = 0; 52 | 53 | }; 54 | 55 | #endif // CTKTRACKEDSERVICELISTENER_P_H 56 | -------------------------------------------------------------------------------- /Client1/client1dlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Client1Dlg 6 | 7 | 8 | 9 | 0 10 | 0 11 | 400 12 | 300 13 | 14 | 15 | 16 | Dialog 17 | 18 | 19 | 20 | 21 | 30 22 | 240 23 | 341 24 | 32 25 | 26 | 27 | 28 | Qt::Horizontal 29 | 30 | 31 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | buttonBox 40 | accepted() 41 | Client1Dlg 42 | accept() 43 | 44 | 45 | 248 46 | 254 47 | 48 | 49 | 157 50 | 274 51 | 52 | 53 | 54 | 55 | buttonBox 56 | rejected() 57 | Client1Dlg 58 | reject() 59 | 60 | 61 | 316 62 | 260 63 | 64 | 65 | 286 66 | 274 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkPopupWidgetEventTranslator.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkPopupWidgetEventTranslator_h 22 | #define __ctkPopupWidgetEventTranslator_h 23 | 24 | // QtTesting includes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | /// Translate low-level Qt events into high-level events for QtTesting 32 | 33 | class CTK_WIDGETS_EXPORT ctkPopupWidgetEventTranslator : 34 | public pqWidgetEventTranslator 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | typedef pqWidgetEventTranslator Superclass; 40 | ctkPopupWidgetEventTranslator(QObject* parent = 0); 41 | 42 | using Superclass::translateEvent; 43 | virtual bool translateEvent(QObject *Object, QEvent *Event, bool &Error); 44 | 45 | private: 46 | Q_DISABLE_COPY(ctkPopupWidgetEventTranslator); 47 | 48 | QObject* CurrentObject; 49 | 50 | private slots: 51 | void onDestroyed(); 52 | void onPopupOpened(const bool&); 53 | 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkTransferFunctionScene.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkTransferFunctionScene_h 22 | #define __ctkTransferFunctionScene_h 23 | 24 | /// Qt includes 25 | #include 26 | 27 | /// CTK includes 28 | #include "ctkPimpl.h" 29 | #include "ctkTransferFunction.h" 30 | #include "ctkWidgetsExport.h" 31 | 32 | //class ctkTransferFunction; 33 | class ctkTransferFunctionScenePrivate; 34 | //class ctkControlPoint; 35 | //class ctkPoint; 36 | 37 | //----------------------------------------------------------------------------- 38 | /// \ingroup Widgets 39 | class CTK_WIDGETS_EXPORT ctkTransferFunctionScene: public QGraphicsScene 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | ctkTransferFunctionScene(QObject* parent = 0); 45 | virtual ~ctkTransferFunctionScene(); 46 | 47 | protected: 48 | QScopedPointer d_ptr; 49 | 50 | private: 51 | Q_DECLARE_PRIVATE(ctkTransferFunctionScene); 52 | Q_DISABLE_COPY(ctkTransferFunctionScene); 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /libs/ctk-0.1/CMake/ctkFunctionCheckoutRepo.cmake: -------------------------------------------------------------------------------- 1 | function(ctkFunctionCheckoutRepo) 2 | 3 | ctkMacroParseArguments("" "NAME;GIT_URL;GIT_TAG;GIT_PROTOCOL;CHECKOUT_DIR" "" ${ARGN}) 4 | 5 | if(${_NAME}_DIR) 6 | # if a *_DIR variable is supplied, the repository is not cloned. 7 | return() 8 | endif() 9 | 10 | foreach(_required_arg NAME GIT_URL) 11 | if(NOT _${_required_arg}) 12 | message(FATAL_ERROR "${_required_arg} is empty") 13 | endif() 14 | endforeach() 15 | 16 | if(NOT _GIT_PROTOCOL) 17 | set(_GIT_PROTOCOL ${EP_GIT_PROTOCOL}) 18 | endif() 19 | if(NOT _CHECKOUT_DIR) 20 | set(_CHECKOUT_DIR ${CMAKE_CURRENT_BINARY_DIR}) 21 | endif() 22 | if(NOT IS_ABSOLUTE "${_CHECKOUT_DIR}") 23 | message(FATAL_ERROR "The value of the CHECKOUT_DIR argument must be an absolute path.") 24 | endif() 25 | 26 | if(NOT _GIT_TAG) 27 | set(_GIT_TAG origin/master) 28 | endif() 29 | 30 | set(_repo_build_dir ${CMAKE_CURRENT_BINARY_DIR}/${_NAME}-proj) 31 | configure_file(${CTK_CMAKE_DIR}/ctkCheckoutRepo.cmake.in 32 | ${_repo_build_dir}/CMakeLists.txt) 33 | 34 | execute_process( 35 | COMMAND ${CMAKE_COMMAND} . 36 | WORKING_DIRECTORY ${_repo_build_dir} 37 | RESULT_VARIABLE _result_code 38 | ERROR_VARIABLE _err_msg 39 | ) 40 | if(_result_code) 41 | message(FATAL_ERROR "Configuring directory ${_repo_build_dir} failed: ${_err_msg}") 42 | endif() 43 | 44 | execute_process( 45 | COMMAND ${CMAKE_COMMAND} --build ${_repo_build_dir} 46 | RESULT_VARIABLE _result_code 47 | ERROR_VARIABLE _err_msg 48 | ) 49 | if(_result_code) 50 | message(FATAL_ERROR "Building directory ${_repo_build_dir} failed: ${_err_msg}") 51 | endif() 52 | 53 | set(${_NAME}_DIR ${_CHECKOUT_DIR}/${_NAME} PARENT_SCOPE) 54 | 55 | endfunction() 56 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkErrorLogQtMessageHandler.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkErrorLogQtMessageHandler_h 22 | #define __ctkErrorLogQtMessageHandler_h 23 | 24 | // CTK includes 25 | #include "ctkErrorLogAbstractMessageHandler.h" 26 | #include "ctkCoreExport.h" 27 | 28 | // Qt includes 29 | #if QT_VERSION >= 0x50000 30 | #include 31 | #endif 32 | 33 | //------------------------------------------------------------------------------ 34 | /// \ingroup Core 35 | class CTK_CORE_EXPORT ctkErrorLogQtMessageHandler : public ctkErrorLogAbstractMessageHandler 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | typedef ctkErrorLogAbstractMessageHandler Superclass; 41 | 42 | ctkErrorLogQtMessageHandler(); 43 | 44 | static QString HandlerName; 45 | 46 | virtual QString handlerName()const; 47 | virtual void setEnabledInternal(bool value); 48 | 49 | #if QT_VERSION >= 0x50000 50 | QtMessageHandler SavedQtMessageHandler; 51 | #else 52 | QtMsgHandler SavedQtMessageHandler; 53 | #endif 54 | }; 55 | 56 | #endif 57 | 58 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkRangeSliderEventTranslator.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkRangeSliderEventTranslator_h 22 | #define __ctkRangeSliderEventTranslator_h 23 | 24 | // QtTesting includes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | /// Translate low-level Qt events into high-level events for QtTesting 32 | 33 | class CTK_WIDGETS_EXPORT ctkRangeSliderEventTranslator : 34 | public pqWidgetEventTranslator 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | typedef pqWidgetEventTranslator Superclass; 40 | ctkRangeSliderEventTranslator(QObject* parent = 0); 41 | 42 | using Superclass::translateEvent; 43 | virtual bool translateEvent(QObject *Object, QEvent *Event, bool &Error); 44 | 45 | private: 46 | Q_DISABLE_COPY(ctkRangeSliderEventTranslator); 47 | 48 | QObject* CurrentObject; 49 | 50 | private slots: 51 | void onMinimumPositionChanged(const int& min); 52 | void onMaximumPositionChanged(const int& max); 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkFontButtonEventTranslator.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkFontButtonEventTranslator_h 22 | #define __ctkFontButtonEventTranslator_h 23 | 24 | // QtTesting includes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | class QFont; 32 | 33 | /// Translate low-level Qt events into high-level events for QtTesting 34 | 35 | class CTK_WIDGETS_EXPORT ctkFontButtonEventTranslator : 36 | public pqWidgetEventTranslator 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | typedef pqWidgetEventTranslator Superclass; 42 | ctkFontButtonEventTranslator(QObject* parent = 0); 43 | 44 | using Superclass::translateEvent; 45 | virtual bool translateEvent(QObject *Object, QEvent *Event, bool &Error); 46 | 47 | private: 48 | Q_DISABLE_COPY(ctkFontButtonEventTranslator); 49 | 50 | QObject* CurrentObject; 51 | 52 | private slots: 53 | void onDestroyed(const QObject&); 54 | void onCurrentFontChanged(const QFont&); 55 | 56 | }; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkConsoleEventTranslator.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | #ifndef __ctkConsoleEventTranslator_h 21 | #define __ctkConsoleEventTranslator_h 22 | 23 | // Qt includes 24 | #include 25 | 26 | // QtTesting includes 27 | #include 28 | 29 | // CTK includes 30 | #include 31 | #include "ctkWidgetsExport.h" 32 | 33 | class CTK_WIDGETS_EXPORT ctkConsoleEventTranslator :public pqWidgetEventTranslator 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | typedef pqWidgetEventTranslator Superclass; 39 | ctkConsoleEventTranslator(QObject* = 0); 40 | 41 | using Superclass::translateEvent; 42 | virtual bool translateEvent(QObject *Object, QEvent *Event, bool &Error); 43 | 44 | private: 45 | Q_DISABLE_COPY(ctkConsoleEventTranslator); 46 | 47 | QObject* CurrentObject; 48 | QObject* CurrentCompleter; 49 | QAbstractItemView* CurrentPopup; 50 | 51 | private slots: 52 | void onDestroyed(QObject*); 53 | void onAboutToExecute(const QString&); 54 | }; 55 | 56 | #endif // __ctkConsoleEventTranslator_h 57 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkPluginFrameworkProperties_p.h: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | #ifndef CTKPLUGINFRAMEWORKPROPERTIES_H 23 | #define CTKPLUGINFRAMEWORKPROPERTIES_H 24 | 25 | #include 26 | 27 | #include 28 | #include 29 | 30 | class ctkPluginFrameworkProperties 31 | { 32 | 33 | private: 34 | 35 | static QMutex lock; 36 | 37 | /**@GuardedBy lock*/ 38 | static ctkProperties properties; 39 | 40 | public: 41 | 42 | static ctkProperties& getProperties(); 43 | 44 | static QVariant getProperty(const QString& key); 45 | 46 | static QVariant getProperty(const QString& key, const QVariant& defaultValue); 47 | 48 | static QVariant setProperty(const QString& key, const QVariant& value); 49 | 50 | static QVariant clearProperty(const QString& key); 51 | 52 | static void setProperties(const ctkProperties& input); 53 | 54 | static void initializeProperties(); 55 | 56 | }; 57 | 58 | #endif // CTKPLUGINFRAMEWORKPROPERTIES_H 59 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkErrorLogFDMessageHandler.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkErrorLogFDMessageHandler_h 22 | #define __ctkErrorLogFDMessageHandler_h 23 | 24 | // CTK includes 25 | #include 26 | #include "ctkCoreExport.h" 27 | 28 | class ctkErrorLogFDMessageHandlerPrivate; 29 | 30 | //------------------------------------------------------------------------------ 31 | /// \ingroup Core 32 | class CTK_CORE_EXPORT ctkErrorLogFDMessageHandler : public ctkErrorLogAbstractMessageHandler 33 | { 34 | public: 35 | typedef ctkErrorLogAbstractMessageHandler Superclass; 36 | 37 | ctkErrorLogFDMessageHandler(); 38 | virtual ~ctkErrorLogFDMessageHandler(); 39 | 40 | static QString HandlerName; 41 | 42 | virtual QString handlerName()const; 43 | virtual void setEnabledInternal(bool value); 44 | 45 | protected: 46 | QScopedPointer d_ptr; 47 | 48 | private: 49 | Q_DECLARE_PRIVATE(ctkErrorLogFDMessageHandler); 50 | Q_DISABLE_COPY(ctkErrorLogFDMessageHandler); 51 | }; 52 | 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkErrorLogLevel.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef CTKERRORLOGLEVEL_H 22 | #define CTKERRORLOGLEVEL_H 23 | 24 | // Qt includes 25 | #include 26 | 27 | // CTK includes 28 | #include "ctkCoreExport.h" 29 | 30 | //------------------------------------------------------------------------------ 31 | /// \ingroup Core 32 | class CTK_CORE_EXPORT ctkErrorLogLevel : public QObject 33 | { 34 | Q_OBJECT 35 | Q_FLAGS(LogLevel) 36 | public: 37 | ctkErrorLogLevel(); 38 | 39 | enum LogLevel 40 | { 41 | None = 0x0, 42 | Unknown = 0x1, 43 | Status = 0x2, 44 | Trace = 0x4, 45 | Debug = 0x8, 46 | Info = 0x10, 47 | Warning = 0x20, 48 | Error = 0x40, 49 | Critical = 0x80, 50 | Fatal = 0x100 51 | }; 52 | Q_DECLARE_FLAGS(LogLevels, LogLevel) 53 | 54 | QString operator ()(LogLevel logLevel); 55 | 56 | static QString logLevelAsString(ctkErrorLogLevel::LogLevel logLevel); 57 | }; 58 | Q_DECLARE_OPERATORS_FOR_FLAGS(ctkErrorLogLevel::LogLevels) 59 | 60 | 61 | #endif // CTKERRORLOGLEVEL_H 62 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkPathLineEditEventTranslator.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkPathLineEditEventTranslator_h 22 | #define __ctkPathLineEditEventTranslator_h 23 | 24 | // QtTesting includes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | /// Translate low-level Qt events into high-level events for QtTesting 32 | 33 | class CTK_WIDGETS_EXPORT ctkPathLineEditEventTranslator : 34 | public pqWidgetEventTranslator 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | typedef pqWidgetEventTranslator Superclass; 40 | ctkPathLineEditEventTranslator(QObject* parent = 0); 41 | 42 | using Superclass::translateEvent; 43 | virtual bool translateEvent(QObject *Object, QEvent *Event, bool &Error); 44 | 45 | private: 46 | Q_DISABLE_COPY(ctkPathLineEditEventTranslator); 47 | 48 | QObject* CurrentObject; 49 | 50 | private slots: 51 | void onDestroyed(); 52 | void onCurrentPathChanged(const QString& text); 53 | void onEditTextChanged(const QString& text); 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkDoubleRangeSliderEventTranslator.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkDoubleRangeSliderEventTranslator_h 22 | #define __ctkDoubleRangeSliderEventTranslator_h 23 | 24 | // QtTesting includes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | /// Translate low-level Qt events into high-level events for QtTesting 32 | 33 | class CTK_WIDGETS_EXPORT ctkDoubleRangeSliderEventTranslator : 34 | public pqWidgetEventTranslator 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | typedef pqWidgetEventTranslator Superclass; 40 | ctkDoubleRangeSliderEventTranslator(QObject* parent = 0); 41 | 42 | using Superclass::translateEvent; 43 | virtual bool translateEvent(QObject *Object, QEvent *Event, bool &Error); 44 | 45 | private: 46 | Q_DISABLE_COPY(ctkDoubleRangeSliderEventTranslator); 47 | 48 | QObject* CurrentObject; 49 | 50 | private slots: 51 | void onMinimumPositionChanged(const double& min); 52 | void onMaximumPositionChanged(const double& max); 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkTemplateWidget.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkTemplateWidget_h 22 | #define __ctkTemplateWidget_h 23 | 24 | // Qt includes 25 | #include 26 | 27 | // CTK includes 28 | #include "ctkWidgetsExport.h" 29 | class ctkTemplateWidgetPrivate; 30 | 31 | /// \ingroup Widgets 32 | /// 33 | /// ctkTemplateWidget allows the user to ... 34 | class CTK_WIDGETS_EXPORT ctkTemplateWidget : public QWidget 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | /// Superclass typedef 40 | typedef QWidget Superclass; 41 | 42 | /// Constructor 43 | /// If \li parent is null, ctkTemplateWidget will be a top-level widget 44 | /// \note The \li parent can be set later using QWidget::setParent() 45 | explicit ctkTemplateWidget(QWidget* parent = 0); 46 | 47 | /// Destructor 48 | virtual ~ctkTemplateWidget(); 49 | 50 | public Q_SLOTS: 51 | 52 | Q_SIGNALS: 53 | 54 | protected: 55 | QScopedPointer d_ptr; 56 | 57 | private: 58 | Q_DECLARE_PRIVATE(ctkTemplateWidget); 59 | Q_DISABLE_COPY(ctkTemplateWidget); 60 | }; 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkThumbnailListWidget_p.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkThumbnailListWidget_p_h 22 | #define __ctkThumbnailListWidget_p_h 23 | 24 | #include "ctkWidgetsExport.h" 25 | #include "ui_ctkThumbnailListWidget.h" 26 | 27 | class ctkThumbnailLabel; 28 | class ctkThumbnailListWidget; 29 | 30 | //---------------------------------------------------------------------------- 31 | /// \ingroup Widgets 32 | class CTK_WIDGETS_EXPORT ctkThumbnailListWidgetPrivate 33 | : public Ui_ctkThumbnailListWidget 34 | { 35 | Q_DECLARE_PUBLIC(ctkThumbnailListWidget); 36 | public: 37 | ctkThumbnailListWidgetPrivate(ctkThumbnailListWidget* parent); 38 | 39 | /// Initialize 40 | void init(); 41 | 42 | void clearAllThumbnails(); 43 | void addThumbnail(ctkThumbnailLabel* thumbnail); 44 | void updateScrollAreaContentWidgetSize(QSize size); 45 | 46 | protected: 47 | ctkThumbnailListWidget* const q_ptr; 48 | 49 | int CurrentThumbnail; 50 | QSize ThumbnailSize; 51 | bool RequestRelayout; 52 | 53 | private: 54 | Q_DISABLE_COPY( ctkThumbnailListWidgetPrivate ); 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkWidgetsUtils.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkWidgetsUtils_h 22 | #define __ctkWidgetsUtils_h 23 | 24 | // Qt includes 25 | #include 26 | #include 27 | class QImage; 28 | 29 | #include "ctkWidgetsExport.h" 30 | 31 | namespace ctk { 32 | /// 33 | /// \ingroup Widgets 34 | /// Create a base 64 image tag. Can be used that way: 35 | /// QString("").arg(base64HTMLImageTagSrc(myImage); 36 | QString CTK_WIDGETS_EXPORT base64HTMLImageTagSrc(const QImage& image); 37 | 38 | /// 39 | /// \ingroup Widgets 40 | /// Grab the contents of a QWidget and all its children. 41 | /// Handle correctly the case of QGLWidgets. 42 | /// \sa QWidget::grab 43 | QImage CTK_WIDGETS_EXPORT grabWidget(QWidget* widget, QRect rectangle = QRect()); 44 | 45 | /// 46 | /// \ingroup Widgets 47 | /// Convert an KWidget encoded image into a QImage 48 | /// The data can be base64 encoded and/or zlib compressed. 49 | QImage CTK_WIDGETS_EXPORT kwIconToQImage(const unsigned char *data, int width, int height, int pixelSize, unsigned int bufferLength, int options = 0); 50 | 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /includes/ctk-0.1/org.commontk.configadmin/ctkCMSerializedTaskQueue_p.h: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | 23 | #ifndef CTKCMSERIALIZEDTASKQUEUE_P_H 24 | #define CTKCMSERIALIZEDTASKQUEUE_P_H 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | class QRunnable; 32 | 33 | /** 34 | * ctkCMSerializedTaskQueue is a utility class that will allow asynchronous but serialized execution of tasks 35 | */ 36 | class ctkCMSerializedTaskQueue : public QObject 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | 42 | ctkCMSerializedTaskQueue(const QString& queueName); 43 | ~ctkCMSerializedTaskQueue(); 44 | 45 | void put(QRunnable* newTask); 46 | 47 | protected Q_SLOTS: 48 | 49 | void runTasks(); 50 | 51 | protected: 52 | 53 | QRunnable* nextTask(int maxWait); 54 | 55 | private: 56 | 57 | static const int MAX_WAIT; // = 5000 58 | QList tasks; 59 | QThread thread; 60 | QMutex mutex; 61 | QWaitCondition waitForTask; 62 | }; 63 | 64 | #endif // CTKCMSERIALIZEDTASKQUEUE_P_H 65 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkErrorLogStreamMessageHandler.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkErrorLogStreamMessageHandler_h 22 | #define __ctkErrorLogStreamMessageHandler_h 23 | 24 | // CTK includes 25 | #include 26 | #include "ctkCoreExport.h" 27 | 28 | class ctkErrorLogStreamMessageHandlerPrivate; 29 | 30 | //------------------------------------------------------------------------------ 31 | /// \ingroup Core 32 | class CTK_CORE_EXPORT ctkErrorLogStreamMessageHandler 33 | : public ctkErrorLogAbstractMessageHandler 34 | { 35 | public: 36 | typedef ctkErrorLogAbstractMessageHandler Superclass; 37 | 38 | ctkErrorLogStreamMessageHandler(); 39 | virtual ~ctkErrorLogStreamMessageHandler(); 40 | 41 | static QString HandlerName; 42 | 43 | virtual QString handlerName()const; 44 | virtual void setEnabledInternal(bool value); 45 | 46 | protected: 47 | QScopedPointer d_ptr; 48 | 49 | private: 50 | Q_DECLARE_PRIVATE(ctkErrorLogStreamMessageHandler); 51 | Q_DISABLE_COPY(ctkErrorLogStreamMessageHandler); 52 | }; 53 | 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkLogger.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkLogger_h 22 | #define __ctkLogger_h 23 | 24 | // Qt includes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkCoreExport.h" 30 | 31 | class ctkLoggerPrivate; 32 | 33 | /// \deprecated This class was a wrapper around Log4Qt. Since Log4Qt dependency has been 34 | /// removed, it is advised to use qDebug(), qWarning() and qCritical() instead. 35 | /// \ingroup Core 36 | class CTK_CORE_EXPORT ctkLogger : public QObject 37 | { 38 | Q_OBJECT 39 | public: 40 | typedef QObject Superclass; 41 | /// Default mode is Off 42 | explicit ctkLogger(QString name, QObject* parent = 0); 43 | virtual ~ctkLogger (); 44 | 45 | void debug(const QString& s); 46 | void info(const QString& s); 47 | void trace(const QString& s); 48 | void warn(const QString& s); 49 | void error(const QString& s); 50 | void fatal(const QString& s); 51 | 52 | protected: 53 | QScopedPointer d_ptr; 54 | 55 | private: 56 | Q_DECLARE_PRIVATE(ctkLogger); 57 | Q_DISABLE_COPY(ctkLogger); 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkTreeComboBoxEventTranslator.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkTreeComboBoxEventTranslator_h 22 | #define __ctkTreeComboBoxEventTranslator_h 23 | 24 | // QtTesting includes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | class QModelIndex; 32 | 33 | /// Translate low-level Qt events into high-level events for QtTesting 34 | 35 | class CTK_WIDGETS_EXPORT ctkTreeComboBoxEventTranslator : 36 | public pqWidgetEventTranslator 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | typedef pqWidgetEventTranslator Superclass; 42 | ctkTreeComboBoxEventTranslator(QObject* parent = 0); 43 | 44 | using Superclass::translateEvent; 45 | virtual bool translateEvent(QObject *Object, QEvent *Event, bool &Error); 46 | 47 | private: 48 | Q_DISABLE_COPY(ctkTreeComboBoxEventTranslator); 49 | 50 | QObject* CurrentObject; 51 | 52 | private slots: 53 | void onCurrentIndexChanged(const QString&); 54 | void onDestroyed(QObject*); 55 | // void onPopupShow(); 56 | // void onPopupHide(); 57 | 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /libs/ctk-0.1/CMake/ctkFunctionExtractOptionNameAndValue.cmake: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # 4 | # 5 | 6 | #! \ingroup CMakeUtilities 7 | function(ctkFunctionExtractOptionNameAndValue my_opt var_opt_name var_opt_value) 8 | 9 | # Make sure option is correctly formated 10 | if(NOT "${my_opt}" MATCHES "^[- :/A-Za-z0-9._]+:(ON|OFF)$") 11 | message(FATAL_ERROR "Option ${my_opt} is incorrect. Options should be specified using the following format OPT1:[ON|OFF]. For example OPT1:OFF or OPT2:ON") 12 | endif() 13 | 14 | # Extract option name and option default value 15 | string(REGEX REPLACE ":(ON|OFF)$" "\\\\;\\1" my_opt_list ${my_opt}) 16 | set(my_opt_list ${my_opt_list}) 17 | list(GET my_opt_list 0 opt_name) 18 | list(GET my_opt_list 1 opt_value) 19 | 20 | set(${var_opt_name} ${opt_name} PARENT_SCOPE) 21 | set(${var_opt_value} ${opt_value} PARENT_SCOPE) 22 | endfunction() 23 | 24 | # 25 | # Test - Use cmake -DMACRO_TESTING:BOOL=ON -P ctkFunctionExtractOptionNameAndValue.cmake 26 | # 27 | if(MACRO_TESTING) 28 | 29 | message("Testing ctkFunctionExtractOptionNameAndValue ...") 30 | # 31 | # Test1 32 | # 33 | set(test1 "john:ON") 34 | ctkFunctionExtractOptionNameAndValue(${test1} test1_name test1_value) 35 | 36 | if(NOT test1_name STREQUAL "john") 37 | message(FATAL_ERROR "test1_name:${test1_name} - Expected:john") 38 | endif() 39 | 40 | if(NOT test1_value STREQUAL "ON") 41 | message(FATAL_ERROR "test1_value:${test1_value} - Expected:ON") 42 | endif() 43 | 44 | # 45 | # Test2 46 | # 47 | set(test2 "doe/john:OFF") 48 | ctkFunctionExtractOptionNameAndValue(${test2} test2_name test2_value) 49 | 50 | if(NOT test2_name STREQUAL "doe/john") 51 | message(FATAL_ERROR "test1_name:${test2_name} - Expected:doe/john") 52 | endif() 53 | 54 | if(NOT test2_value STREQUAL "OFF") 55 | message(FATAL_ERROR "test2_value:${test2_value} - Expected:OFF") 56 | endif() 57 | 58 | endif() 59 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkCheckableComboBoxEventTranslator.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkCheckableComboBoxEventTranslator_h 22 | #define __ctkCheckableComboBoxEventTranslator_h 23 | 24 | // QT includes 25 | #include "QModelIndexList" 26 | 27 | // QtTesting inlcudes 28 | #include 29 | 30 | // CTK includes 31 | #include 32 | #include "ctkWidgetsExport.h" 33 | 34 | 35 | class CTK_WIDGETS_EXPORT ctkCheckableComboBoxEventTranslator : 36 | public pqWidgetEventTranslator 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | typedef pqWidgetEventTranslator Superclass; 42 | ctkCheckableComboBoxEventTranslator(QObject* parent = 0); 43 | 44 | using Superclass::translateEvent; 45 | virtual bool translateEvent(QObject *Object, QEvent *Event, bool &Error); 46 | 47 | private: 48 | Q_DISABLE_COPY(ctkCheckableComboBoxEventTranslator); 49 | 50 | QObject* CurrentObject; 51 | QModelIndexList OldIndexList; 52 | 53 | private slots: 54 | void onDestroyed(QObject*); 55 | void onStateChanged(const QString& State); 56 | void onDataChanged(const QModelIndex&, const QModelIndex&); 57 | }; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkFileDialogEventTranslator.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkFileDialogEventTranslator_h 22 | #define __ctkFileDialogEventTranslator_h 23 | 24 | // QtTesting includes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | class pqTestUtility; 32 | class QFont; 33 | 34 | /// Translate low-level Qt events into high-level events for QtTesting 35 | 36 | class CTK_WIDGETS_EXPORT ctkFileDialogEventTranslator : 37 | public pqNativeFileDialogEventTranslator 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | typedef pqNativeFileDialogEventTranslator Superclass; 43 | ctkFileDialogEventTranslator(pqTestUtility* util, QObject* parent = 0); 44 | 45 | using Superclass::translateEvent; 46 | virtual bool translateEvent(QObject *Object, QEvent *Event, bool &Error); 47 | 48 | private: 49 | Q_DISABLE_COPY(ctkFileDialogEventTranslator); 50 | 51 | QObject* CurrentObject; 52 | 53 | private slots: 54 | void onDestroyed(QObject*); 55 | void onFileSelectionChanged(const QStringList&); 56 | void onRejected(); 57 | }; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkErrorLogModel.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkErrorLogModel_h 22 | #define __ctkErrorLogModel_h 23 | 24 | // CTK includes 25 | #include "ctkWidgetsExport.h" 26 | #include "ctkErrorLogAbstractModel.h" 27 | 28 | //------------------------------------------------------------------------------ 29 | class ctkErrorLogModelPrivate; 30 | 31 | //------------------------------------------------------------------------------ 32 | /// \ingroup Widgets 33 | class CTK_WIDGETS_EXPORT ctkErrorLogModel : public ctkErrorLogAbstractModel 34 | { 35 | Q_OBJECT 36 | public: 37 | typedef ctkErrorLogAbstractModel Superclass; 38 | typedef ctkErrorLogModel Self; 39 | explicit ctkErrorLogModel(QObject* parentObject = 0); 40 | virtual ~ctkErrorLogModel(); 41 | 42 | protected: 43 | QScopedPointer d_ptr; 44 | 45 | virtual void addModelEntry(const QString& currentDateTime, const QString& threadId, 46 | const QString& logLevel, const QString& origin, const QString& text); 47 | 48 | private: 49 | Q_DECLARE_PRIVATE(ctkErrorLogModel) 50 | Q_DISABLE_COPY(ctkErrorLogModel) 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkTransferFunctionView.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkTransferFunctionView_h 22 | #define __ctkTransferFunctionView_h 23 | 24 | /// Qt includes 25 | #include 26 | 27 | /// CTK includes 28 | #include "ctkWidgetsExport.h" 29 | #include "ctkPimpl.h" 30 | 31 | class ctkTransferFunction; 32 | class ctkTransferFunctionViewPrivate; 33 | 34 | //----------------------------------------------------------------------------- 35 | /// \ingroup Widgets 36 | class CTK_WIDGETS_EXPORT ctkTransferFunctionView: public QGraphicsView 37 | { 38 | Q_OBJECT; 39 | public: 40 | ctkTransferFunctionView(QWidget* parent = 0); 41 | virtual ~ctkTransferFunctionView(); 42 | protected: 43 | virtual void resizeEvent(QResizeEvent * event); 44 | /* 45 | virtual void dragEnterEvent ( QDragEnterEvent * event ); 46 | virtual void mousePressEvent ( QMouseEvent * event ); 47 | virtual void mouseReleaseEvent ( QMouseEvent * event );*/ 48 | 49 | protected: 50 | QScopedPointer d_ptr; 51 | 52 | private: 53 | Q_DECLARE_PRIVATE(ctkTransferFunctionView); 54 | Q_DISABLE_COPY(ctkTransferFunctionView); 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /libs/ctk-0.1/CMake/ctkFunctionCheckCompilerFlags.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | # 4 | # Helper macro allowing to check if the given flags are supported 5 | # by the underlying build tool 6 | # 7 | # If the flag(s) is/are supported, they will be appended to the string identified by RESULT_VAR 8 | # 9 | # Usage: 10 | # ctkFunctionCheckCompilerFlags(FLAGS_TO_CHECK VALID_FLAGS_VAR) 11 | # 12 | # Example: 13 | # 14 | # set(myflags) 15 | # ctkFunctionCheckCompilerFlags("-fprofile-arcs" myflags) 16 | # message(1-myflags:${myflags}) 17 | # ctkFunctionCheckCompilerFlags("-fauto-bugfix" myflags) 18 | # message(2-myflags:${myflags}) 19 | # ctkFunctionCheckCompilerFlags("-Wall" myflags) 20 | # message(1-myflags:${myflags}) 21 | # 22 | # The output will be: 23 | # 1-myflags: -fprofile-arcs 24 | # 2-myflags: -fprofile-arcs 25 | # 3-myflags: -fprofile-arcs -Wall 26 | 27 | include(TestCXXAcceptsFlag) 28 | 29 | #! \ingroup CMakeUtilities 30 | function(ctkFunctionCheckCompilerFlags CXX_FLAG_TO_TEST RESULT_VAR) 31 | 32 | if(CXX_FLAG_TO_TEST STREQUAL "") 33 | message(FATAL_ERROR "CXX_FLAG_TO_TEST shouldn't be empty") 34 | endif() 35 | 36 | # Internally, the macro CMAKE_CXX_ACCEPTS_FLAG calls TRY_COMPILE. To avoid 37 | # the cost of compiling the test each time the project is configured, the variable set by 38 | # the macro is added to the cache so that following invocation of the macro with 39 | # the same variable name skip the compilation step. 40 | # For that same reason, ctkFunctionCheckCompilerFlags function appends a unique suffix to 41 | # the HAS_FLAG variable. This suffix is created using a 'clean version' of the flag to test. 42 | string(REGEX REPLACE "-\\s\\$\\+\\*\\{\\}\\(\\)\\#" "" suffix ${CXX_FLAG_TO_TEST}) 43 | CHECK_CXX_ACCEPTS_FLAG(${CXX_FLAG_TO_TEST} HAS_FLAG_${suffix}) 44 | 45 | if(HAS_FLAG_${suffix}) 46 | set(${RESULT_VAR} "${${RESULT_VAR}} ${CXX_FLAG_TO_TEST}" PARENT_SCOPE) 47 | endif() 48 | 49 | endfunction() 50 | 51 | -------------------------------------------------------------------------------- /libs/ctk-0.1/CMake/ctkFunctionGetLibraryDirs.cmake: -------------------------------------------------------------------------------- 1 | ########################################################################### 2 | # 3 | # Library: CTK 4 | # 5 | # Copyright (c) German Cancer Research Center, 6 | # Division of Medical and Biological Informatics 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); 9 | # you may not use this file except in compliance with the License. 10 | # You may obtain a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, 16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | # See the License for the specific language governing permissions and 18 | # limitations under the License. 19 | # 20 | ########################################################################### 21 | 22 | #! \ingroup CMakeUtilities 23 | function(ctkFunctionGetLibraryDirs var_library_dirs) 24 | 25 | if(NOT ARGN) 26 | message(FATAL_ERROR "No targets given") 27 | endif() 28 | 29 | set(_library_dirs ${${var_library_dirs}}) 30 | foreach(_target ${ARGN}) 31 | 32 | # Add the library directories from the external project 33 | # The variable ${_target}_DEPENDENCIES is set in the 34 | # macro ctkMacroValidateBuildOptions 35 | 36 | set(ext_deps ) 37 | 38 | ctkMacroGetAllNonProjectTargetLibraries("${${_target}_DEPENDENCIES}" ext_deps) 39 | 40 | foreach(dep ${ext_deps}) 41 | 42 | if(${dep}_LIBRARY_DIRS) 43 | string(REPLACE "^" ";" _ext_library_dirs "${${dep}_LIBRARY_DIRS}") 44 | list(APPEND _library_dirs ${_ext_library_dirs}) 45 | endif() 46 | 47 | endforeach() 48 | 49 | endforeach() 50 | 51 | if(_library_dirs) 52 | list(REMOVE_DUPLICATES _library_dirs) 53 | endif() 54 | set(${var_library_dirs} ${_library_dirs} PARENT_SCOPE) 55 | 56 | endfunction() 57 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkWorkflowTabWidget.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkWorkflowTabWidget_h 22 | #define __ctkWorkflowTabWidget_h 23 | 24 | // Qt includes 25 | class QWidget; 26 | class QString; 27 | 28 | // CTK includes 29 | #include "ctkWorkflowAbstractPagedWidget.h" 30 | #include "ctkPimpl.h" 31 | #include "ctkWidgetsExport.h" 32 | 33 | class ctkWorkflowTabWidgetPrivate; 34 | 35 | /// \ingroup Widgets 36 | /// 37 | /// \brief ctkWorkflowTabWidget is the basis for a workflow with a user 38 | class CTK_WIDGETS_EXPORT ctkWorkflowTabWidget : public ctkWorkflowAbstractPagedWidget 39 | { 40 | Q_OBJECT 41 | 42 | public: 43 | typedef ctkWorkflowAbstractPagedWidget Superclass; 44 | 45 | explicit ctkWorkflowTabWidget(QWidget* parent = 0); 46 | virtual ~ctkWorkflowTabWidget(); 47 | 48 | virtual void createNewPage(QWidget* widget); 49 | 50 | virtual void showPage(QWidget* widget, const QString& label); 51 | 52 | virtual void initClientArea(); 53 | 54 | virtual QWidget* clientArea(); 55 | 56 | protected: 57 | QScopedPointer d_ptr; 58 | 59 | private: 60 | Q_DECLARE_PRIVATE(ctkWorkflowTabWidget); 61 | Q_DISABLE_COPY(ctkWorkflowTabWidget); 62 | }; 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkAbstractPluginFactory.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkAbstractPluginFactory_h 22 | #define __ctkAbstractPluginFactory_h 23 | 24 | // Qt includes 25 | #include 26 | #include 27 | 28 | // CTK includes 29 | #include "ctkAbstractFileBasedFactory.h" 30 | 31 | //---------------------------------------------------------------------------- 32 | /// \ingroup Core 33 | template 34 | class ctkFactoryPluginItem : public ctkAbstractFactoryFileBasedItem 35 | { 36 | public: 37 | virtual bool load(); 38 | virtual QString loadErrorString()const; 39 | 40 | protected: 41 | virtual BaseClassType* instanciator(); 42 | 43 | private: 44 | QPluginLoader Loader; 45 | }; 46 | 47 | //---------------------------------------------------------------------------- 48 | /// \ingroup Core 49 | template 50 | class ctkAbstractPluginFactory : public ctkAbstractFileBasedFactory 51 | { 52 | protected: 53 | virtual bool isValidFile(const QFileInfo& file)const; 54 | virtual ctkAbstractFactoryItem* createFactoryFileBasedItem(); 55 | }; 56 | 57 | #include "ctkAbstractPluginFactory.tpp" 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /includes/ctk-0.1/org.commontk.metatype/ctkMTMsg_p.h: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | 23 | #ifndef CTKMTMSG_P_H 24 | #define CTKMTMSG_P_H 25 | 26 | struct ctkMTMsg 27 | { 28 | static const char* CONTEXT; 29 | 30 | static const char* SERVICE_DESCRIPTION; 31 | 32 | static const char* UNEXPECTED_ELEMENT; 33 | static const char* UNEXPECTED_TEXT; 34 | static const char* MISSING_ATTRIBUTE; 35 | static const char* OCD_ID_NOT_FOUND; 36 | static const char* NULL_DEFAULTS; 37 | static const char* MISSING_ELEMENT; 38 | 39 | static const char* EXCEPTION_MESSAGE; 40 | static const char* NULL_IS_INVALID; 41 | static const char* VALUE_OUT_OF_RANGE; 42 | static const char* VALUE_OUT_OF_OPTION; 43 | static const char* TOO_MANY_VALUES; 44 | static const char* NULL_OPTIONS; 45 | static const char* INCONSISTENT_OPTIONS; 46 | static const char* INVALID_OPTIONS; 47 | static const char* INVALID_DEFAULTS; 48 | 49 | static const char* METADATA_NOT_FOUND; 50 | static const char* ASK_INVALID_LOCALE; 51 | static const char* TOKENIZER_GOT_INVALID_DATA; 52 | static const char* INVALID_PID_METATYPE_PROVIDER_IGNORED; 53 | }; 54 | 55 | #endif // CTKMTMSG_P_H 56 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkTransferFunctionNativeItem.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkTransferFunctionNativeItem_h 22 | #define __ctkTransferFunctionNativeItem_h 23 | 24 | /// Qt includes 25 | #include 26 | #include 27 | 28 | /// CTK includes 29 | #include "ctkWidgetsExport.h" 30 | #include "ctkTransferFunctionItem.h" 31 | 32 | class ctkTransferFunctionNativeItemPrivate; 33 | 34 | //----------------------------------------------------------------------------- 35 | /// \ingroup Widgets 36 | class CTK_WIDGETS_EXPORT ctkTransferFunctionNativeItem: public ctkTransferFunctionItem 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | ctkTransferFunctionNativeItem(QGraphicsItem* parent = 0); 42 | ctkTransferFunctionNativeItem(ctkTransferFunction* transferFunction, 43 | QGraphicsItem* parent = 0); 44 | virtual ~ctkTransferFunctionNativeItem(); 45 | 46 | virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0); 47 | 48 | protected: 49 | QScopedPointer d_ptr; 50 | 51 | private: 52 | Q_DECLARE_PRIVATE(ctkTransferFunctionNativeItem); 53 | Q_DISABLE_COPY(ctkTransferFunctionNativeItem); 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /includes/ctk-0.1/service/log/ctkLogStream.cpp: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | 23 | #include "ctkLogStream.h" 24 | #include "ctkLogService.h" 25 | 26 | //---------------------------------------------------------------------------- 27 | ctkLogStream::ctkLogStream(ctkLogService* logService, int level, const std::exception* exc, 28 | const char* file, const char* function, int line) 29 | : logged(false), logService(logService), level(level), exc(exc), 30 | file(file), function(function), line(line) 31 | { 32 | ts.setString(&msg); 33 | } 34 | 35 | //---------------------------------------------------------------------------- 36 | ctkLogStream::ctkLogStream(const ctkLogStream& logStream) 37 | : msg(logStream.msg), logged(false), 38 | logService(logStream.logService), level(logStream.level), 39 | exc(logStream.exc), file(logStream.file), function(logStream.function), 40 | line(logStream.line) 41 | { 42 | ts.setString(&msg); 43 | } 44 | 45 | //---------------------------------------------------------------------------- 46 | ctkLogStream::~ctkLogStream() 47 | { 48 | if (!logged && logService) 49 | { 50 | logService->log(level, msg, exc, file, function, line); 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkPluginTracker_p.tpp: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | 23 | #include "ctkTrackedPlugin_p.h" 24 | 25 | //---------------------------------------------------------------------------- 26 | template 27 | const bool ctkPluginTrackerPrivate::DEBUG_FLAG = false; 28 | 29 | //---------------------------------------------------------------------------- 30 | template 31 | ctkPluginTrackerPrivate::ctkPluginTrackerPrivate( 32 | ctkPluginTracker* pt, ctkPluginContext* context, 33 | ctkPlugin::States stateMask, ctkPluginTrackerCustomizer* customizer) 34 | : context(context), customizer(customizer), mask(stateMask), q_ptr(pt) 35 | { 36 | this->customizer = customizer ? customizer : q_func(); 37 | } 38 | 39 | //---------------------------------------------------------------------------- 40 | template 41 | ctkPluginTrackerPrivate::~ctkPluginTrackerPrivate() 42 | { 43 | if (customizer != q_func()) 44 | { 45 | delete customizer; 46 | } 47 | } 48 | 49 | //---------------------------------------------------------------------------- 50 | template 51 | QSharedPointer > ctkPluginTrackerPrivate::tracked() const 52 | { 53 | return trackedPlugin; 54 | } 55 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkWorkflowStackedWidget.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkWorkflowStackedWidget_h 22 | #define __ctkWorkflowStackedWidget_h 23 | 24 | // Qt includes 25 | class QWidget; 26 | class QString; 27 | 28 | // CTK includes 29 | #include "ctkWorkflowAbstractPagedWidget.h" 30 | #include "ctkPimpl.h" 31 | #include "ctkWidgetsExport.h" 32 | 33 | class ctkWorkflowStackedWidgetPrivate; 34 | 35 | /// \ingroup Widgets 36 | /// 37 | /// \brief ctkWorkflowStackedWidget is the basis for a workflow with a user 38 | /// interface containing a QStackedWidget. 39 | class CTK_WIDGETS_EXPORT ctkWorkflowStackedWidget : public ctkWorkflowAbstractPagedWidget 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | 45 | typedef ctkWorkflowAbstractPagedWidget Superclass; 46 | explicit ctkWorkflowStackedWidget(QWidget* newParent = 0); 47 | virtual ~ctkWorkflowStackedWidget(); 48 | 49 | virtual void createNewPage(QWidget* widget); 50 | 51 | virtual void showPage(QWidget* widget, const QString& label); 52 | 53 | virtual void initClientArea(); 54 | 55 | virtual QWidget* clientArea(); 56 | 57 | protected: 58 | QScopedPointer d_ptr; 59 | 60 | private: 61 | Q_DECLARE_PRIVATE(ctkWorkflowStackedWidget); 62 | Q_DISABLE_COPY(ctkWorkflowStackedWidget); 63 | 64 | }; 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /libs/ctk-0.1/CMake/UseCTK.cmake: -------------------------------------------------------------------------------- 1 | ########################################################################### 2 | # 3 | # Library: CTK 4 | # 5 | # Copyright (c) Kitware Inc. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0.txt 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | ########################################################################### 20 | 21 | # 22 | # This module is provided as CTK_USE_FILE by CTKConfig.cmake. It can 23 | # be INCLUDED in a project to load the needed compiler and linker 24 | # settings to use CTK. 25 | # 26 | 27 | if(NOT CTK_USE_FILE_INCLUDED) 28 | set(CTK_USE_FILE_INCLUDED 1) 29 | 30 | # Add include directories needed to use CTK. 31 | get_directory_property(existing_include_directories INCLUDE_DIRECTORIES) 32 | set(new_include_directories ${CTK_INCLUDE_DIRS}) 33 | if(existing_include_directories) 34 | list(REMOVE_ITEM new_include_directories ${existing_include_directories}) 35 | endif() 36 | include_directories(${new_include_directories}) 37 | 38 | if(NOT DEFINED QT_QMAKE_EXECUTABLE AND CTK_QT_VERSION STREQUAL "4") 39 | set(QT_QMAKE_EXECUTABLE ${CTK_QT_QMAKE_EXECUTABLE}) 40 | endif() 41 | 42 | if(CTK_QT_VERSION STREQUAL "5") 43 | if(NOT DEFINED Qt5_DIR AND DEFINED CTK_Qt5_DIR) 44 | # Setting "Qt5_DIR" is the preferred approach 45 | set(Qt5_DIR ${CTK_Qt5_DIR}) 46 | elseif(NOT DEFINED CMAKE_PREFIX_PATH AND DEFINED CTK_CMAKE_PREFIX_PATH) 47 | # Support for "CMAKE_PREFIX_PATH" is here for backward compatibility 48 | set(CMAKE_PREFIX_PATH ${CTK_CMAKE_PREFIX_PATH}) 49 | endif() 50 | endif() 51 | 52 | endif() 53 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkMenuComboBoxEventTranslator.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkMenuComboBoxEventTranslator_h 22 | #define __ctkMenuComboBoxEventTranslator_h 23 | 24 | // QtTesting includes 25 | #include 26 | 27 | // CTK includes 28 | #include 29 | #include "ctkWidgetsExport.h" 30 | 31 | class QAction; 32 | class QAbstractItemView; 33 | class QMenu; 34 | 35 | /// Translate low-level Qt events into high-level events for QtTesting 36 | 37 | class CTK_WIDGETS_EXPORT ctkMenuComboBoxEventTranslator : 38 | public pqWidgetEventTranslator 39 | { 40 | Q_OBJECT 41 | 42 | public: 43 | typedef pqWidgetEventTranslator Superclass; 44 | ctkMenuComboBoxEventTranslator(QObject* parent = 0); 45 | 46 | using Superclass::translateEvent; 47 | virtual bool translateEvent(QObject *Object, QEvent *Event, bool &Error); 48 | 49 | private: 50 | Q_DISABLE_COPY(ctkMenuComboBoxEventTranslator); 51 | 52 | QObject* CurrentObject; 53 | QAbstractItemView* CurrentView; 54 | 55 | void connectAllMenu(QMenu* menu); 56 | 57 | private slots: 58 | void onDestroyed(); 59 | void onAboutToShow(); 60 | void onAboutToHide(); 61 | void onEditTextChanged(const QString&); 62 | void onToolButtonClicked(bool state); 63 | void onActionTriggered(QAction* action); 64 | }; 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkFileLogger.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkFileLogger_h 22 | #define __ctkFileLogger_h 23 | 24 | // Qt includes 25 | #include 26 | 27 | // CTK includes 28 | #include "ctkCoreExport.h" 29 | 30 | //------------------------------------------------------------------------------ 31 | class ctkFileLoggerPrivate; 32 | 33 | //------------------------------------------------------------------------------ 34 | /// \ingroup Core 35 | class CTK_CORE_EXPORT ctkFileLogger : public QObject 36 | { 37 | Q_OBJECT 38 | Q_PROPERTY(bool enabled READ enabled WRITE setEnabled) 39 | Q_PROPERTY(QString filePath READ filePath WRITE setFilePath) 40 | 41 | public: 42 | typedef QObject Superclass; 43 | typedef ctkFileLogger Self; 44 | explicit ctkFileLogger(QObject* parentObject = 0); 45 | virtual ~ctkFileLogger(); 46 | 47 | bool enabled()const; 48 | void setEnabled(bool value); 49 | 50 | QString filePath()const; 51 | void setFilePath(const QString& filePath); 52 | 53 | int numberOfFilesToKeep()const; 54 | void setNumberOfFilesToKeep(int value); 55 | 56 | public Q_SLOTS: 57 | void logMessage(const QString& msg); 58 | 59 | protected: 60 | QScopedPointer d_ptr; 61 | 62 | private: 63 | Q_DECLARE_PRIVATE(ctkFileLogger); 64 | Q_DISABLE_COPY(ctkFileLogger); 65 | }; 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /includes/ctk-0.1/org.commontk.metatype/ctkMTIcon_p.h: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | 23 | #ifndef CTKMTICON_P_H 24 | #define CTKMTICON_P_H 25 | 26 | #include 27 | #include 28 | 29 | class ctkPlugin; 30 | 31 | /** 32 | * Represents an Icon with a name and a size 33 | */ 34 | class ctkMTIcon 35 | { 36 | 37 | private: 38 | 39 | QString _fileName; 40 | int _size; 41 | QSharedPointer _plugin; 42 | 43 | public: 44 | 45 | ctkMTIcon(); 46 | 47 | /** 48 | * Constructor of class ctkMTIcon. 49 | */ 50 | ctkMTIcon(const QString& fileName, int size, const QSharedPointer& plugin); 51 | 52 | /** 53 | * Constructor of class ctkMTIcon. 54 | */ 55 | ctkMTIcon(const QString& fileName, const QSharedPointer& plugin); 56 | 57 | /** 58 | * Method to get the icon's file name. 59 | */ 60 | QString getIconName() const; 61 | 62 | /** 63 | * returns the size specified when the icon was created 64 | * 65 | * @return size or -1 if no size was specified 66 | */ 67 | int getIconSize() const; 68 | 69 | /** 70 | * Method to get the plugin having this Icon. 71 | */ 72 | QSharedPointer getIconPlugin() const; 73 | 74 | operator bool () const; 75 | }; 76 | 77 | #endif // CTKMTICON_P_H 78 | -------------------------------------------------------------------------------- /includes/ctk-0.1/service/log/ctkLogStream.h: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | 23 | #ifndef CTKLOGSTREAM_H 24 | #define CTKLOGSTREAM_H 25 | 26 | #include 27 | 28 | #include 29 | 30 | struct ctkLogService; 31 | 32 | /** 33 | * \ingroup LogService 34 | */ 35 | class CTK_PLUGINFW_EXPORT ctkLogStream 36 | { 37 | public: 38 | 39 | ctkLogStream(ctkLogService* logService, int level, const std::exception* exc = 0, 40 | const char* file = 0, const char* function = 0, int line = -1); 41 | ctkLogStream(const ctkLogStream& logStream); 42 | 43 | virtual ~ctkLogStream(); 44 | 45 | template 46 | ctkLogStream& operator <<(const T& t) 47 | { 48 | ts << t; 49 | return *this; 50 | } 51 | 52 | ctkLogStream& operator <<(const char* c) 53 | { 54 | ts << c; 55 | return *this; 56 | } 57 | 58 | ctkLogStream& operator <<(bool b) 59 | { 60 | ts << (b ? "true" : "false"); 61 | return *this; 62 | } 63 | 64 | protected: 65 | 66 | QString msg; 67 | QTextStream ts; 68 | bool logged; 69 | 70 | ctkLogService* logService; 71 | int level; 72 | const std::exception* exc; 73 | 74 | const char* file; 75 | const char* function; 76 | const int line; 77 | }; 78 | 79 | #endif // CTKLOGSTREAM_H 80 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkApplicationRunnable.h: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | #ifndef CTKAPPLICATIONRUNNABLE_H 23 | #define CTKAPPLICATIONRUNNABLE_H 24 | 25 | #include 26 | 27 | class QVariant; 28 | 29 | /** 30 | * Like a QRunnable, an object which captures a block of code which can 31 | * be passed around and executed as well as stopped. Unlike standard runnables, 32 | * paramaterized runnables allow an arbitrary QVariant to be passed in when the 33 | * block is evaluated. 34 | *

35 | * Clients may implement this interface. 36 | *

37 | */ 38 | struct CTK_PLUGINFW_EXPORT ctkApplicationRunnable 39 | { 40 | 41 | virtual ~ctkApplicationRunnable(); 42 | 43 | /** 44 | * Executes the block of code encapsulated by this runnable in the context of 45 | * the given object and returns the result. The result may be an invalid QVariant. 46 | * 47 | * @param context the context for evaluating the runnable 48 | * @return the result of evaluating the runnable in the given context 49 | * @throws std::exception if there is a problem running this runnable 50 | */ 51 | virtual QVariant run(const QVariant& context) = 0; 52 | 53 | /** 54 | * Forces this runnable to stop. 55 | */ 56 | virtual void stop() = 0; 57 | 58 | }; 59 | 60 | #endif // CTKAPPLICATIONRUNNABLE_H 61 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkPopupWidget_p.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkPopupWidget_p_h 22 | #define __ctkPopupWidget_p_h 23 | 24 | // CTK includes 25 | #include "ctkBasePopupWidget_p.h" 26 | #include "ctkPopupWidget.h" 27 | 28 | // ------------------------------------------------------------------------- 29 | /// \ingroup Widgets 30 | class CTK_WIDGETS_EXPORT ctkPopupWidgetPrivate 31 | : public ctkBasePopupWidgetPrivate 32 | { 33 | Q_OBJECT 34 | Q_DECLARE_PUBLIC(ctkPopupWidget); 35 | public: 36 | typedef ctkBasePopupWidgetPrivate Superclass; 37 | ctkPopupWidgetPrivate(ctkPopupWidget& object); 38 | ~ctkPopupWidgetPrivate(); 39 | 40 | virtual void init(); 41 | 42 | // Return the widget if the mouse cursor is above any of the focus widgets or their 43 | // children. 44 | // If the cursor is above a child widget, install the event filter to listen 45 | // when the cursor leaves the widget. 46 | virtual QWidget* mouseOver(); 47 | 48 | virtual bool eventFilter(QObject* obj, QEvent* event); 49 | 50 | void temporarilyHiddenOn(); 51 | void temporarilyHiddenOff(); 52 | 53 | bool isHidingCandidate(QWidget* widget)const; 54 | 55 | public Q_SLOTS: 56 | void updateVisibility(); 57 | void onApplicationDeactivate(); 58 | 59 | protected: 60 | bool Active; 61 | bool AutoShow; 62 | int ShowDelay; 63 | bool AutoHide; 64 | int HideDelay; 65 | }; 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkTransferFunctionGradientItem.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkTransferFunctionGradientItem_h 22 | #define __ctkTransferFunctionGradientItem_h 23 | 24 | /// Qt includes 25 | #include 26 | #include 27 | 28 | /// CTK includes 29 | #include "ctkWidgetsExport.h" 30 | #include "ctkPimpl.h" 31 | #include "ctkTransferFunctionItem.h" 32 | 33 | class ctkTransferFunctionGradientItemPrivate; 34 | 35 | //----------------------------------------------------------------------------- 36 | /// \ingroup Widgets 37 | class CTK_WIDGETS_EXPORT ctkTransferFunctionGradientItem: public ctkTransferFunctionItem 38 | { 39 | Q_OBJECT 40 | Q_PROPERTY(bool mask READ mask WRITE setMask) 41 | 42 | public: 43 | ctkTransferFunctionGradientItem(QGraphicsItem* parent = 0); 44 | ctkTransferFunctionGradientItem(ctkTransferFunction* transferFunction, 45 | QGraphicsItem* parent = 0); 46 | virtual ~ctkTransferFunctionGradientItem(); 47 | 48 | virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0); 49 | 50 | bool mask()const; 51 | void setMask(bool mask); 52 | 53 | protected: 54 | QScopedPointer d_ptr; 55 | 56 | private: 57 | Q_DECLARE_PRIVATE(ctkTransferFunctionGradientItem); 58 | Q_DISABLE_COPY(ctkTransferFunctionGradientItem); 59 | }; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /includes/ctk-0.1/service/datalocation/ctkLocation.cpp: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | #include "ctkLocation.h" 23 | 24 | const QString ctkLocation::INSTANCE_FILTER = QString("(&(objectClass=") + 25 | qobject_interface_iid() + 26 | ")(type=ctk.instance.area))"; 27 | 28 | const QString ctkLocation::INSTALL_FILTER = QString("(&(objectClass=") + 29 | qobject_interface_iid() + 30 | ")(type=ctk.install.area))"; 31 | 32 | const QString ctkLocation::CONFIGURATION_FILTER = QString("(&(objectClass=") + 33 | qobject_interface_iid() + 34 | ")(type=ctk.configuration.area))"; 35 | 36 | const QString ctkLocation::USER_FILTER = QString("(&(objectClass=") + 37 | qobject_interface_iid() + 38 | ")(type=ctk.user.area))"; 39 | 40 | const QString ctkLocation::CTK_HOME_FILTER = QString("(&(objectClass=") + 41 | qobject_interface_iid() + 42 | ")(type=ctk.home.location))"; 43 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkAbstractQObjectFactory.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkAbstractQObjectFactory_h 22 | #define __ctkAbstractQObjectFactory_h 23 | 24 | // Qt includes 25 | #include 26 | 27 | // CTK includes 28 | #include "ctkAbstractObjectFactory.h" 29 | 30 | //---------------------------------------------------------------------------- 31 | /// \ingroup Core 32 | template 33 | class ctkAbstractQObjectFactory : public ctkAbstractObjectFactory 34 | { 35 | public: 36 | 37 | /// Constructor/Desctructor 38 | explicit ctkAbstractQObjectFactory(); 39 | virtual ~ctkAbstractQObjectFactory(); 40 | 41 | /// \brief Return a name allowing to uniquely identify the QObject 42 | /// By default, it return \a objectName obtained using staticMetaObject.className() 43 | virtual QString objectNameToKey(const QString& objectName); 44 | 45 | /// \brief Register an object in the factory 46 | /// The parameter \a key passed by reference will be updated with the 47 | /// associated object name obtained using objectNameToKey(const QString&) 48 | template 49 | bool registerQObject(QString& key); 50 | 51 | private: 52 | ctkAbstractQObjectFactory(const ctkAbstractQObjectFactory &); /// Not implemented 53 | void operator=(const ctkAbstractQObjectFactory&); /// Not implemented 54 | }; 55 | 56 | #include "ctkAbstractQObjectFactory.tpp" 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkFittedTextBrowser_p.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkFittedTextBrowser_p_h 22 | #define __ctkFittedTextBrowser_p_h 23 | 24 | // CTK includes 25 | #include "ctkFittedTextBrowser.h" 26 | 27 | //----------------------------------------------------------------------------- 28 | /// \ingroup Widgets 29 | class CTK_WIDGETS_EXPORT ctkFittedTextBrowserPrivate 30 | { 31 | Q_DECLARE_PUBLIC(ctkFittedTextBrowser); 32 | 33 | protected: 34 | ctkFittedTextBrowser* const q_ptr; 35 | 36 | public: 37 | ctkFittedTextBrowserPrivate(ctkFittedTextBrowser& object); 38 | virtual ~ctkFittedTextBrowserPrivate(); 39 | 40 | // Update collapsed/expanded text in the widget. 41 | void updateCollapsedText(); 42 | 43 | // Get collapsed/expanded text in html format from plain text. 44 | QString collapsedTextFromPlainText() const; 45 | // Get collapsed/expanded text in html format from html. 46 | QString collapsedTextFromHtml() const; 47 | 48 | // Get more/less link in html format 49 | QString collapseLinkText() const; 50 | 51 | bool Collapsed; 52 | 53 | QString ShowDetailsText; 54 | QString HideDetailsText; 55 | 56 | // Stores the text that the user originally set. 57 | QString CollapsibleText; 58 | 59 | enum CollapsibleTextSetMethod 60 | { 61 | Text, 62 | PlainText, 63 | Html 64 | }; 65 | 66 | // Stores what method the user called to set text 67 | CollapsibleTextSetMethod CollapsibleTextSetter; 68 | }; 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /includes/ctk-0.1/org.commontk.metatype/ctkMetaTypeServiceImpl_p.h: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | 23 | #ifndef CTKMETATYPESERVICEIMPL_P_H 24 | #define CTKMETATYPESERVICEIMPL_P_H 25 | 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | /** 32 | * Implementation of ctkMetaTypeService 33 | */ 34 | class ctkMetaTypeServiceImpl : public QObject, public ctkMetaTypeService 35 | { 36 | Q_OBJECT 37 | Q_INTERFACES(ctkMetaTypeService) 38 | 39 | private: 40 | 41 | QMutex _mtpsMutex; 42 | QHash _mtps; 43 | 44 | ctkLogService* const logger; 45 | ctkServiceTracker<>* metaTypeProviderTracker; 46 | 47 | public: 48 | 49 | /** 50 | * Constructor of class ctkMetaTypeServiceImpl. 51 | */ 52 | ctkMetaTypeServiceImpl(ctkLogService* logger, ctkServiceTracker<>* metaTypeProviderTracker); 53 | 54 | /* 55 | * @see ctkMetaTypeService#getMetaTypeInformation() 56 | */ 57 | ctkMetaTypeInformationPtr getMetaTypeInformation(const QSharedPointer& plugin); 58 | 59 | public Q_SLOTS: 60 | 61 | void pluginChanged(const ctkPluginEvent& event); 62 | 63 | private: 64 | 65 | /** 66 | * Internal Method - to get ctkMetaTypeProvider object. 67 | */ 68 | ctkMetaTypeInformationPtr getMetaTypeProvider(const QSharedPointer& p); 69 | 70 | }; 71 | 72 | #endif // CTKMETATYPESERVICEIMPL_P_H 73 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkCheckBox.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkCheckBox_h 22 | #define __ctkCheckBox_h 23 | 24 | // QT includes 25 | #include 26 | 27 | // CTK includes 28 | #include "ctkWidgetsExport.h" 29 | 30 | class ctkCheckBoxPrivate; 31 | 32 | /// \ingroup Widgets 33 | /// ctkCheckBox is an advanced QCheckBox that gives more control 34 | /// over its look and feel. 35 | /// We can change the indicator check box by a new QIcon, with two mode On/Off. 36 | /// The indicator icon size can be controled. see setIndicatorIconSize() 37 | 38 | class CTK_WIDGETS_EXPORT ctkCheckBox : public QCheckBox 39 | { 40 | Q_OBJECT 41 | Q_PROPERTY(QIcon indicatorIcon READ indicatorIcon WRITE setIndicatorIcon) 42 | Q_PROPERTY(QSize indicatorIconSize READ indicatorIconSize WRITE setIndicatorIconSize) 43 | 44 | public: 45 | typedef QCheckBox Superclass; 46 | 47 | ctkCheckBox(QWidget *_parent = 0); 48 | virtual ~ctkCheckBox(); 49 | 50 | void setIndicatorIcon(const QIcon& newIcon); 51 | QIcon indicatorIcon() const; 52 | 53 | /// Resize the indicator icon to Qsize. 54 | /// If newSize is bigger than the indicator icon's maximum size, 55 | /// The icon will get the icon's maximum size and not newSize. 56 | void setIndicatorIconSize(const QSize& newSize); 57 | QSize indicatorIconSize() const; 58 | 59 | protected: 60 | QScopedPointer d_ptr; 61 | 62 | private: 63 | Q_DECLARE_PRIVATE(ctkCheckBox); 64 | Q_DISABLE_COPY(ctkCheckBox); 65 | }; 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /includes/ctk-0.1/service/event/ctkEventConstants.cpp: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | #include "ctkEventConstants.h" 23 | 24 | 25 | const QString ctkEventConstants::EVENT_TOPIC = "event.topics"; 26 | const QString ctkEventConstants::EVENT_FILTER = "event.filter"; 27 | 28 | const QString ctkEventConstants::EVENT_DELIVERY = "event.delivery"; 29 | const QString ctkEventConstants::DELIVERY_ASYNC_ORDERED = "async.ordered"; 30 | const QString ctkEventConstants::DELIVERY_ASYNC_UNORDERED = "async.unordered"; 31 | 32 | const QString ctkEventConstants::PLUGIN_SYMBOLICNAME = "plugin.symbolicName"; 33 | const QString ctkEventConstants::PLUGIN_ID = "plugin.id"; 34 | const QString ctkEventConstants::PLUGIN = "plugin"; 35 | const QString ctkEventConstants::PLUGIN_VERSION = "plugin.version"; 36 | 37 | const QString ctkEventConstants::EVENT = "event"; 38 | const QString ctkEventConstants::EXCEPTION = "exception"; 39 | const QString ctkEventConstants::EXCEPTION_CLASS = "exception.class"; 40 | const QString ctkEventConstants::EXCEPTION_MESSAGE = "exception.message"; 41 | const QString ctkEventConstants::MESSAGE = "message"; 42 | const QString ctkEventConstants::SERVICE = "service"; 43 | const QString ctkEventConstants::SERVICE_ID = "service.id"; 44 | const QString ctkEventConstants::SERVICE_OBJECTCLASS = "service.objectClass"; 45 | const QString ctkEventConstants::SERVICE_PID = "service.pid"; 46 | const QString ctkEventConstants::TIMESTAMP = "timestamp"; 47 | -------------------------------------------------------------------------------- /libs/ctk-0.1/CMake/ctkFunctionAddPluginRepo.cmake: -------------------------------------------------------------------------------- 1 | function(ctkFunctionAddPluginRepo) 2 | 3 | ctkMacroParseArguments("" "NAME;GIT_URL;GIT_TAG;GIT_PROTOCOL" "" ${ARGN}) 4 | 5 | foreach(_required_arg NAME) 6 | if(NOT _${_required_arg}) 7 | message(FATAL_ERROR "${_required_arg} is empty") 8 | endif() 9 | endforeach() 10 | 11 | if(NOT _GIT_URL AND NOT ${_NAME}_DIR) 12 | message(FATAL_ERROR "Either ${_NAME}_DIR or GIT_URL must be set") 13 | endif() 14 | 15 | if(NOT ${_NAME}_DIR) 16 | ctkFunctionCheckoutRepo( 17 | NAME ${_NAME} 18 | GIT_URL ${_GIT_URL} 19 | GIT_TAG ${_GIT_TAG} 20 | GIT_PROTOCOL ${_GIT_PROTOCOL} 21 | ) 22 | endif() 23 | 24 | set(_gitmodules_files ${${_NAME}_DIR}/.gitmodules) 25 | if(NOT EXISTS ${_gitmodules_files}) 26 | message(FATAL_ERROR "The repository at ${${_NAME}_DIR} does not contain a .gitmodules file") 27 | endif() 28 | 29 | # Parse the .gitmodules file and add the submodules as contributed plugins 30 | file(STRINGS "${_gitmodules_files}" _plugin_paths REGEX "path =.*") 31 | foreach(_plugin_path ${_plugin_paths}) 32 | string(REPLACE " = " ";" _plugin_path_list ${_plugin_path}) 33 | list(GET _plugin_path_list 1 _plugin_name) 34 | ctk_plugin_option(${_plugin_name} "Build the ${_plugin_name} plugin." OFF) 35 | 36 | # Push the value which might have been changed in ctk_plugin_option to the parent scope 37 | set(CTK_PLUGIN_${_plugin_name} ${CTK_PLUGIN_${_plugin_name}} PARENT_SCOPE) 38 | 39 | set(${_plugin_name}_SOURCE_DIR ${${_NAME}_DIR}/${_plugin_name}) 40 | set(${_plugin_name}_SOURCE_DIR ${${_plugin_name}_SOURCE_DIR} PARENT_SCOPE) 41 | 42 | if(CTK_PLUGIN_${_plugin_name} AND NOT EXISTS ${${_plugin_name}_SOURCE_DIR}) 43 | execute_process( 44 | COMMAND ${GIT_EXECUTABLE} submodule update ${_plugin_name} 45 | WORKING_DIRECTORY ${${_NAME}_DIR} 46 | RESULT_VARIABLE return_code 47 | ERROR_VARIABLE error_msg 48 | ) 49 | if(return_code) 50 | message(FATAL_ERROR "Could not invoke git submodule update for ${${_plugin_name}_SOURCE_DIR}") 51 | endif() 52 | endif() 53 | endforeach() 54 | 55 | set(CTK_PLUGINS ${CTK_PLUGINS} PARENT_SCOPE) 56 | set(${_NAME}_DIR ${${_NAME}_DIR} PARENT_SCOPE) 57 | 58 | endfunction() 59 | -------------------------------------------------------------------------------- /includes/ctk-0.1/service/application/ctkApplicationDescriptor.cpp: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | #include "ctkApplicationDescriptor.h" 23 | 24 | #include 25 | 26 | const QString ctkApplicationDescriptor::APPLICATION_NAME = "application.name"; 27 | const QString ctkApplicationDescriptor::APPLICATION_ICON = "application.icon"; 28 | const QString ctkApplicationDescriptor::APPLICATION_PID = ctkPluginConstants::SERVICE_PID; 29 | const QString ctkApplicationDescriptor::APPLICATION_VERSION = "application.version"; 30 | const QString ctkApplicationDescriptor::APPLICATION_VENDOR = ctkPluginConstants::SERVICE_VENDOR; 31 | const QString ctkApplicationDescriptor::APPLICATION_VISIBLE = "application.visible"; 32 | const QString ctkApplicationDescriptor::APPLICATION_LAUNCHABLE = "application.launchable"; 33 | const QString ctkApplicationDescriptor::APPLICATION_LOCKED = "application.locked"; 34 | const QString ctkApplicationDescriptor::APPLICATION_DESCRIPTION = "application.description"; 35 | const QString ctkApplicationDescriptor::APPLICATION_DOCUMENTATION = "application.documentation"; 36 | const QString ctkApplicationDescriptor::APPLICATION_COPYRIGHT = "application.copyright"; 37 | const QString ctkApplicationDescriptor::APPLICATION_LICENSE = "application.license"; 38 | const QString ctkApplicationDescriptor::APPLICATION_CONTAINER = "application.container"; 39 | const QString ctkApplicationDescriptor::APPLICATION_LOCATION = "application.location"; 40 | -------------------------------------------------------------------------------- /includes/ctk-0.1/service/metatype/ctkMetaTypeInformation.h: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | 20 | =============================================================================*/ 21 | 22 | 23 | #ifndef CTKMETATYPEINFORMATION_H 24 | #define CTKMETATYPEINFORMATION_H 25 | 26 | #include "ctkMetaTypeProvider.h" 27 | 28 | #include 29 | 30 | class ctkPlugin; 31 | 32 | /** 33 | * \ingroup Metatype 34 | * 35 | * A MetaType Information object is created by the ctkMetaTypeService to return 36 | * meta type information for a specific plugin. 37 | */ 38 | struct ctkMetaTypeInformation : public ctkMetaTypeProvider 39 | { 40 | /** 41 | * Return the PIDs (for ManagedServices) for which ctkObjectClassDefinition 42 | * information is available. 43 | * 44 | * @return List of PIDs. 45 | */ 46 | virtual QStringList getPids() const = 0; 47 | 48 | /** 49 | * Return the Factory PIDs (for ManagedServiceFactories) for which 50 | * ctkObjectClassDefinition information is available. 51 | * 52 | * @return List of Factory PIDs. 53 | */ 54 | virtual QStringList getFactoryPids() const = 0; 55 | 56 | /** 57 | * Return the plugin for which this object provides meta type information. 58 | * 59 | * @return Plugin for which this object provides meta type information. 60 | */ 61 | virtual QSharedPointer getPlugin() const = 0; 62 | }; 63 | 64 | /** 65 | * \ingroup Metatype 66 | */ 67 | typedef QSharedPointer ctkMetaTypeInformationPtr; 68 | 69 | #endif // CTKMETATYPEINFORMATION_H 70 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkErrorLogTerminalOutput.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef CTKERRORLOGTERMINALOUTPUT_H 22 | #define CTKERRORLOGTERMINALOUTPUT_H 23 | 24 | // Qt includes 25 | #include 26 | #include 27 | 28 | // CTK includes 29 | #include 30 | 31 | //------------------------------------------------------------------------------ 32 | class ctkErrorLogTerminalOutputPrivate; 33 | 34 | //------------------------------------------------------------------------------ 35 | /// \ingroup Core 36 | class CTK_CORE_EXPORT ctkErrorLogTerminalOutput : public QObject 37 | { 38 | Q_OBJECT 39 | Q_FLAGS(TerminalOutputs) 40 | 41 | public: 42 | ctkErrorLogTerminalOutput(); 43 | virtual ~ctkErrorLogTerminalOutput(); 44 | 45 | enum TerminalOutput 46 | { 47 | None = 0x0, 48 | StandardError = 0x1, 49 | StandardOutput = 0x2, 50 | All = StandardError | StandardOutput 51 | }; 52 | Q_DECLARE_FLAGS(TerminalOutputs, TerminalOutput) 53 | 54 | bool enabled()const; 55 | void setEnabled(bool value); 56 | 57 | int fileDescriptor()const; 58 | void setFileDescriptor(int fd); 59 | 60 | void output(const QString& text); 61 | 62 | protected: 63 | QScopedPointer d_ptr; 64 | 65 | private: 66 | Q_DECLARE_PRIVATE(ctkErrorLogTerminalOutput) 67 | Q_DISABLE_COPY(ctkErrorLogTerminalOutput) 68 | }; 69 | 70 | Q_DECLARE_OPERATORS_FOR_FLAGS(ctkErrorLogTerminalOutput::TerminalOutputs) 71 | 72 | #endif // CTKERRORLOGTERMINALOUTPUT_H 73 | -------------------------------------------------------------------------------- /includes/ctk-0.1/ctkLayoutManager_p.h: -------------------------------------------------------------------------------- 1 | /*========================================================================= 2 | 3 | Library: CTK 4 | 5 | Copyright (c) Kitware Inc. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0.txt 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | =========================================================================*/ 20 | 21 | #ifndef __ctkLayoutManager_p_h 22 | #define __ctkLayoutManager_p_h 23 | 24 | // Qt includes 25 | #include 26 | #include 27 | #include 28 | 29 | class QLayout; 30 | class QWidget; 31 | 32 | // CTK includes 33 | #include "ctkLayoutManager.h" 34 | 35 | //----------------------------------------------------------------------------- 36 | /// \ingroup Widgets 37 | class CTK_WIDGETS_EXPORT ctkLayoutManagerPrivate 38 | { 39 | Q_DECLARE_PUBLIC(ctkLayoutManager); 40 | 41 | protected: 42 | ctkLayoutManager* const q_ptr; 43 | 44 | public: 45 | ctkLayoutManagerPrivate(ctkLayoutManager& object); 46 | virtual ~ctkLayoutManagerPrivate(); 47 | 48 | virtual void init(); 49 | void clearLayout(QLayout* layout); 50 | void clearWidget(QWidget* widget, QLayout* parentLayout = 0); 51 | 52 | /// The widget where the layout is populated into. 53 | QWidget* Viewport; 54 | /// The XML description of the current layout. 55 | QDomDocument Layout; 56 | /// All the QWidgets in the Viewports. The list contains the 57 | /// LayoutWidgets as well as the "items" of the layout. 58 | QSet Views; 59 | /// All the widgets created by ctkLayoutManager. 60 | /// Those widgets are "layout" widgets in a sense that they are simple 61 | /// containers or spacers to layout the "views" of the layout. 62 | QSet LayoutWidgets; 63 | /// Unique spacing used by all the inner layouts. 64 | int Spacing; 65 | }; 66 | 67 | #endif 68 | --------------------------------------------------------------------------------