]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Re-factoring: interfaces removed from "XGUI", "GeomModule" renamed to "PartSet"
authorSergey Belash <sergey.belash@opencascade.com>
Thu, 20 Mar 2014 08:46:49 +0000 (12:46 +0400)
committerSergey Belash <sergey.belash@opencascade.com>
Thu, 20 Mar 2014 08:46:49 +0000 (12:46 +0400)
46 files changed:
CMakeLists.txt
src/GeomModule/CMakeLists.txt [deleted file]
src/GeomModule/GeomModule.cpp [deleted file]
src/GeomModule/GeomModule.h [deleted file]
src/GeomModule/GeomModule_Defs.h [deleted file]
src/GeomModule/GeomModule_icons.qrc [deleted file]
src/GeomModule/GeomModule_msg_en.ts [deleted file]
src/GeomModule/icons/axis.png [deleted file]
src/GeomModule/icons/common.png [deleted file]
src/GeomModule/icons/cut.png [deleted file]
src/GeomModule/icons/duplicate.png [deleted file]
src/GeomModule/icons/extrusion.png [deleted file]
src/GeomModule/icons/fusion.png [deleted file]
src/GeomModule/icons/import.png [deleted file]
src/GeomModule/icons/plane.png [deleted file]
src/GeomModule/icons/point.png [deleted file]
src/GeomModule/icons/remove.png [deleted file]
src/GeomModule/icons/revol.png [deleted file]
src/PartSet/CMakeLists.txt [new file with mode: 0644]
src/PartSet/PartSet.h [new file with mode: 0644]
src/PartSet/PartSet_Module.cpp [new file with mode: 0644]
src/PartSet/PartSet_Module.h [new file with mode: 0644]
src/PartSet/PartSet_icons.qrc [new file with mode: 0644]
src/PartSet/PartSet_msg_en.ts [new file with mode: 0644]
src/PartSet/icons/axis.png [new file with mode: 0644]
src/PartSet/icons/common.png [new file with mode: 0644]
src/PartSet/icons/cut.png [new file with mode: 0644]
src/PartSet/icons/duplicate.png [new file with mode: 0644]
src/PartSet/icons/extrusion.png [new file with mode: 0644]
src/PartSet/icons/fusion.png [new file with mode: 0644]
src/PartSet/icons/import.png [new file with mode: 0644]
src/PartSet/icons/plane.png [new file with mode: 0644]
src/PartSet/icons/point.png [new file with mode: 0644]
src/PartSet/icons/remove.png [new file with mode: 0644]
src/PartSet/icons/revol.png [new file with mode: 0644]
src/XGUI/XGUI_Command.h
src/XGUI/XGUI_Interfaces.h [deleted file]
src/XGUI/XGUI_MainMenu.cpp
src/XGUI/XGUI_MainMenu.h
src/XGUI/XGUI_MenuGroupPanel.cpp
src/XGUI/XGUI_MenuGroupPanel.h
src/XGUI/XGUI_Module.h [new file with mode: 0644]
src/XGUI/XGUI_Workbench.cpp
src/XGUI/XGUI_Workbench.h
src/XGUI/XGUI_Workshop.cpp
src/XGUI/XGUI_Workshop.h

index 248e6f91af64cc77e471c1623916b75906759bb5..bc48f8c8c011115478d9a376c15280b59bde26db 100644 (file)
@@ -11,5 +11,5 @@ ADD_SUBDIRECTORY (src/Event)
 ADD_SUBDIRECTORY (src/Config)
 #ADD_SUBDIRECTORY (src/ModelAPI)
 #ADD_SUBDIRECTORY (src/Model)
-ADD_SUBDIRECTORY (src/GeomModule)
+ADD_SUBDIRECTORY (src/PartSet)
 ADD_SUBDIRECTORY (src/XGUI)
diff --git a/src/GeomModule/CMakeLists.txt b/src/GeomModule/CMakeLists.txt
deleted file mode 100644 (file)
index 540798c..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
-
-INCLUDE(Common)
-
-SET(PROJECT_HEADERS
-       GeomModule_Defs.h
-       GeomModule.h
-)
-
-SET(PROJECT_SOURCES
-       GeomModule.cpp
-)
-
-SET(PROJECT_RESOURCES 
-    GeomModule_icons.qrc
-)
-
-SET(TEXT_RESOURCES
-       GeomModule_msg_en.ts
-)
-
-SET(PROJECT_LIBRARIES
-    Config
-    ${Qt5Widgets_LIBRARIES}
-)
-
-QT5_ADD_RESOURCES(PROJECT_COMPILED_RESOURCES ${PROJECT_RESOURCES})
-QT5_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES})
-
-SOURCE_GROUP ("Generated Files" FILES ${PROJECT_COMPILED_RESOURCES} ${QM_RESOURCES})
-SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES} ${PROJECT_RESOURCES})
-
-ADD_LIBRARY(GeomModule SHARED 
-       ${PROJECT_SOURCES} 
-       ${PROJECT_HEADERS} 
-       ${PROJECT_COMPILED_RESOURCES} 
-       ${TEXT_RESOURCES} 
-       ${QM_RESOURCES}
-)
-
-ADD_DEPENDENCIES(GeomModule XGUI)
-
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/XGUI)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/Config)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/Event)
-
-# The Qt5Widgets_LIBRARIES variable also includes QtGui and QtCore
-TARGET_LINK_LIBRARIES(GeomModule ${PROJECT_LIBRARIES})
-
-INSTALL(TARGETS GeomModule DESTINATION bin)
diff --git a/src/GeomModule/GeomModule.cpp b/src/GeomModule/GeomModule.cpp
deleted file mode 100644 (file)
index f3bc0fd..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#include "GeomModule.h"
-
-#include <Config_XMLReader.h>
-
-#include <QFile>
-#include <QDir>
-#include <QApplication>
-#include <QTextStream>
-
-/*!Create and return new instance of XGUI_Module*/
-extern "C" GM_EXPORT IModule* createModule(IWorkshop* theWshop)
-{
-  return new GeomModule(theWshop);
-}
-
-
-GeomModule::GeomModule(IWorkshop* theWshop)
-{
-    myWorkshop = theWshop;
-}
-
-
-GeomModule::~GeomModule()
-{
-}
-
-
-void GeomModule::createFeatures()
-{
-  Config_XMLReader* aReader =
-          new Config_XMLReader("plugin-PartSet.xml");
-  aReader->readAll();
-}
diff --git a/src/GeomModule/GeomModule.h b/src/GeomModule/GeomModule.h
deleted file mode 100644 (file)
index e190a23..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-
-#ifndef GeomModule_H
-#define GeomModule_H
-
-#include "GeomModule_Defs.h"
-
-#include <XGUI_Interfaces.h>
-
-class Config_XMLReader;
-
-class GM_EXPORT GeomModule : public IModule
-{
-public:
-    GeomModule(IWorkshop* theWshop);
-    virtual ~GeomModule();
-
-    virtual void createFeatures();
-
-private:
-    QString myMenuXML;
-
-    IWorkshop* myWorkshop;
-};
-
-#endif
diff --git a/src/GeomModule/GeomModule_Defs.h b/src/GeomModule/GeomModule_Defs.h
deleted file mode 100644 (file)
index faa6972..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef GeomModule_Defs_H
-#define GeomModule_Defs_H
-
-
-#if defined WIN32
-#  if defined GeomModule_EXPORTS
-#    define GM_EXPORT __declspec( dllexport )
-#  else
-#    define GM_EXPORT __declspec( dllimport )
-#  endif
-#else
-#  define GM_EXPORT
-#endif
-
-
-#endif
\ No newline at end of file
diff --git a/src/GeomModule/GeomModule_icons.qrc b/src/GeomModule/GeomModule_icons.qrc
deleted file mode 100644 (file)
index 571e1cd..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
- <!DOCTYPE RCC><RCC version="1.0">
- <qresource>
-     <file>icons/point.png</file>
-     <file>icons/plane.png</file>
-     <file>icons/axis.png</file>
-     <file>icons/duplicate.png</file>
-     <file>icons/remove.png</file>
-     <file>icons/extrusion.png</file>
-     <file>icons/cut.png</file>
-     <file>icons/fusion.png</file>
-     <file>icons/revol.png</file>
-     <file>icons/common.png</file>
-     <file>icons/import.png</file>
- </qresource>
- </RCC>
diff --git a/src/GeomModule/GeomModule_msg_en.ts b/src/GeomModule/GeomModule_msg_en.ts
deleted file mode 100644 (file)
index 4270bb8..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="en_US">
-<context>
-    <name>@default</name>
-</context>
-<context>
-    <name>XGUI_Workshop</name>
-    <message>
-        <source>HOME_MENU_TITLE</source>
-        <translation>Home</translation>
-    </message>
-    <message>
-        <source>NEW_MENU</source>
-        <translation>New</translation>
-    </message>
-</context>
-</TS>
diff --git a/src/GeomModule/icons/axis.png b/src/GeomModule/icons/axis.png
deleted file mode 100644 (file)
index 5f5bfff..0000000
Binary files a/src/GeomModule/icons/axis.png and /dev/null differ
diff --git a/src/GeomModule/icons/common.png b/src/GeomModule/icons/common.png
deleted file mode 100644 (file)
index 7deab35..0000000
Binary files a/src/GeomModule/icons/common.png and /dev/null differ
diff --git a/src/GeomModule/icons/cut.png b/src/GeomModule/icons/cut.png
deleted file mode 100644 (file)
index 0d43adb..0000000
Binary files a/src/GeomModule/icons/cut.png and /dev/null differ
diff --git a/src/GeomModule/icons/duplicate.png b/src/GeomModule/icons/duplicate.png
deleted file mode 100644 (file)
index 1a5de9b..0000000
Binary files a/src/GeomModule/icons/duplicate.png and /dev/null differ
diff --git a/src/GeomModule/icons/extrusion.png b/src/GeomModule/icons/extrusion.png
deleted file mode 100644 (file)
index 12bbe45..0000000
Binary files a/src/GeomModule/icons/extrusion.png and /dev/null differ
diff --git a/src/GeomModule/icons/fusion.png b/src/GeomModule/icons/fusion.png
deleted file mode 100644 (file)
index 7fca3fe..0000000
Binary files a/src/GeomModule/icons/fusion.png and /dev/null differ
diff --git a/src/GeomModule/icons/import.png b/src/GeomModule/icons/import.png
deleted file mode 100644 (file)
index 2a6ba81..0000000
Binary files a/src/GeomModule/icons/import.png and /dev/null differ
diff --git a/src/GeomModule/icons/plane.png b/src/GeomModule/icons/plane.png
deleted file mode 100644 (file)
index 3075a34..0000000
Binary files a/src/GeomModule/icons/plane.png and /dev/null differ
diff --git a/src/GeomModule/icons/point.png b/src/GeomModule/icons/point.png
deleted file mode 100644 (file)
index de84d96..0000000
Binary files a/src/GeomModule/icons/point.png and /dev/null differ
diff --git a/src/GeomModule/icons/remove.png b/src/GeomModule/icons/remove.png
deleted file mode 100644 (file)
index 6c64527..0000000
Binary files a/src/GeomModule/icons/remove.png and /dev/null differ
diff --git a/src/GeomModule/icons/revol.png b/src/GeomModule/icons/revol.png
deleted file mode 100644 (file)
index 3400b62..0000000
Binary files a/src/GeomModule/icons/revol.png and /dev/null differ
diff --git a/src/PartSet/CMakeLists.txt b/src/PartSet/CMakeLists.txt
new file mode 100644 (file)
index 0000000..b8c89c4
--- /dev/null
@@ -0,0 +1,49 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
+
+INCLUDE(Common)
+
+SET(PROJECT_HEADERS
+       PartSet.h
+       PartSet_Module.h
+)
+
+SET(PROJECT_SOURCES
+       PartSet_Module.cpp
+)
+
+SET(PROJECT_RESOURCES 
+    PartSet_icons.qrc
+)
+
+SET(TEXT_RESOURCES
+       PartSet_msg_en.ts
+)
+
+SET(PROJECT_LIBRARIES
+    Config
+    ${Qt5Widgets_LIBRARIES}
+)
+
+QT5_ADD_RESOURCES(PROJECT_COMPILED_RESOURCES ${PROJECT_RESOURCES})
+QT5_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES})
+
+SOURCE_GROUP ("Generated Files" FILES ${PROJECT_COMPILED_RESOURCES} ${QM_RESOURCES})
+SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES} ${PROJECT_RESOURCES})
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/XGUI)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/Config)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/Event)
+
+ADD_DEFINITIONS(-DPARTSET_EXPORTS)
+ADD_LIBRARY(PartSet SHARED 
+       ${PROJECT_SOURCES} 
+       ${PROJECT_HEADERS} 
+       ${PROJECT_COMPILED_RESOURCES} 
+       ${TEXT_RESOURCES} 
+       ${QM_RESOURCES}
+)
+
+# The Qt5Widgets_LIBRARIES variable also includes QtGui and QtCore
+TARGET_LINK_LIBRARIES(PartSet ${PROJECT_LIBRARIES})
+
+INSTALL(TARGETS PartSet DESTINATION bin)
diff --git a/src/PartSet/PartSet.h b/src/PartSet/PartSet.h
new file mode 100644 (file)
index 0000000..6579536
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef PARTSET_H
+#define PARTSET_H
+
+#if defined PARTSET_EXPORTS
+#if defined WIN32
+#define PARTSET_EXPORT              __declspec( dllexport )
+#else
+#define PARTSET_EXPORT
+#endif
+#else
+#if defined WIN32
+#define PARTSET_EXPORT              __declspec( dllimport )
+#else
+#define PARTSET_EXPORT
+#endif
+#endif
+
+#endif //PARTSET_H
diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp
new file mode 100644 (file)
index 0000000..2121a26
--- /dev/null
@@ -0,0 +1,33 @@
+#include "PartSet_Module.h"
+
+#include <Config_XMLReader.h>
+
+#include <QFile>
+#include <QDir>
+#include <QApplication>
+#include <QTextStream>
+
+/*!Create and return new instance of XGUI_Module*/
+extern "C" PARTSET_EXPORT XGUI_Module* createModule(XGUI_Workshop* theWshop)
+{
+  return new PartSet_Module(theWshop);
+}
+
+
+PartSet_Module::PartSet_Module(XGUI_Workshop* theWshop)
+{
+    myWorkshop = theWshop;
+}
+
+
+PartSet_Module::~PartSet_Module()
+{
+}
+
+
+void PartSet_Module::createFeatures()
+{
+  Config_XMLReader* aReader =
+          new Config_XMLReader("plugin-PartSet.xml");
+  aReader->readAll();
+}
diff --git a/src/PartSet/PartSet_Module.h b/src/PartSet/PartSet_Module.h
new file mode 100644 (file)
index 0000000..b9f6ee9
--- /dev/null
@@ -0,0 +1,25 @@
+
+#ifndef PartSet_Module_H
+#define PartSet_Module_H
+
+#include "PartSet.h"
+
+#include <XGUI_Module.h>
+
+class Config_XMLReader;
+
+class PARTSET_EXPORT PartSet_Module : public XGUI_Module
+{
+public:
+    PartSet_Module(XGUI_Workshop* theWshop);
+    virtual ~PartSet_Module();
+
+    virtual void createFeatures();
+
+private:
+    QString myMenuXML;
+
+    XGUI_Workshop* myWorkshop;
+};
+
+#endif
diff --git a/src/PartSet/PartSet_icons.qrc b/src/PartSet/PartSet_icons.qrc
new file mode 100644 (file)
index 0000000..571e1cd
--- /dev/null
@@ -0,0 +1,15 @@
+ <!DOCTYPE RCC><RCC version="1.0">
+ <qresource>
+     <file>icons/point.png</file>
+     <file>icons/plane.png</file>
+     <file>icons/axis.png</file>
+     <file>icons/duplicate.png</file>
+     <file>icons/remove.png</file>
+     <file>icons/extrusion.png</file>
+     <file>icons/cut.png</file>
+     <file>icons/fusion.png</file>
+     <file>icons/revol.png</file>
+     <file>icons/common.png</file>
+     <file>icons/import.png</file>
+ </qresource>
+ </RCC>
diff --git a/src/PartSet/PartSet_msg_en.ts b/src/PartSet/PartSet_msg_en.ts
new file mode 100644 (file)
index 0000000..4270bb8
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
+<context>
+    <name>@default</name>
+</context>
+<context>
+    <name>XGUI_Workshop</name>
+    <message>
+        <source>HOME_MENU_TITLE</source>
+        <translation>Home</translation>
+    </message>
+    <message>
+        <source>NEW_MENU</source>
+        <translation>New</translation>
+    </message>
+</context>
+</TS>
diff --git a/src/PartSet/icons/axis.png b/src/PartSet/icons/axis.png
new file mode 100644 (file)
index 0000000..5f5bfff
Binary files /dev/null and b/src/PartSet/icons/axis.png differ
diff --git a/src/PartSet/icons/common.png b/src/PartSet/icons/common.png
new file mode 100644 (file)
index 0000000..7deab35
Binary files /dev/null and b/src/PartSet/icons/common.png differ
diff --git a/src/PartSet/icons/cut.png b/src/PartSet/icons/cut.png
new file mode 100644 (file)
index 0000000..0d43adb
Binary files /dev/null and b/src/PartSet/icons/cut.png differ
diff --git a/src/PartSet/icons/duplicate.png b/src/PartSet/icons/duplicate.png
new file mode 100644 (file)
index 0000000..1a5de9b
Binary files /dev/null and b/src/PartSet/icons/duplicate.png differ
diff --git a/src/PartSet/icons/extrusion.png b/src/PartSet/icons/extrusion.png
new file mode 100644 (file)
index 0000000..12bbe45
Binary files /dev/null and b/src/PartSet/icons/extrusion.png differ
diff --git a/src/PartSet/icons/fusion.png b/src/PartSet/icons/fusion.png
new file mode 100644 (file)
index 0000000..7fca3fe
Binary files /dev/null and b/src/PartSet/icons/fusion.png differ
diff --git a/src/PartSet/icons/import.png b/src/PartSet/icons/import.png
new file mode 100644 (file)
index 0000000..2a6ba81
Binary files /dev/null and b/src/PartSet/icons/import.png differ
diff --git a/src/PartSet/icons/plane.png b/src/PartSet/icons/plane.png
new file mode 100644 (file)
index 0000000..3075a34
Binary files /dev/null and b/src/PartSet/icons/plane.png differ
diff --git a/src/PartSet/icons/point.png b/src/PartSet/icons/point.png
new file mode 100644 (file)
index 0000000..de84d96
Binary files /dev/null and b/src/PartSet/icons/point.png differ
diff --git a/src/PartSet/icons/remove.png b/src/PartSet/icons/remove.png
new file mode 100644 (file)
index 0000000..6c64527
Binary files /dev/null and b/src/PartSet/icons/remove.png differ
diff --git a/src/PartSet/icons/revol.png b/src/PartSet/icons/revol.png
new file mode 100644 (file)
index 0000000..3400b62
Binary files /dev/null and b/src/PartSet/icons/revol.png differ
index e3759a4aa922644f588a1d1c61d465f7fcd99137..180395501b2b1afe56098f3fab2415ca14c3e44e 100644 (file)
@@ -1,15 +1,13 @@
 #ifndef XGUI_Command_H
 #define XGUI_Command_H
 
-#include "XGUI_Interfaces.h"
-
 #include <QWidgetAction>
 
 #define MIN_BUTTON_HEIGHT 18
 #define MIN_BUTTON_WIDTH 40
 
 
-class XGUI_Command : public QWidgetAction, public IFeatureMenu
+class XGUI_Command : public QWidgetAction
 {
     Q_OBJECT
 public:
@@ -31,4 +29,4 @@ private:
     QString myId;
 };
 
-#endif
\ No newline at end of file
+#endif
diff --git a/src/XGUI/XGUI_Interfaces.h b/src/XGUI/XGUI_Interfaces.h
deleted file mode 100644 (file)
index 24b53dc..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-
-#ifndef XGUI_Interfaces_H
-#define XGUI_Interfaces_H
-
-#include <QString>
-#include <QIcon>
-#include <QKeySequence>
-
-
-class IFeatureMenu
-{
-public:
-    virtual bool enabled() const = 0;
-    virtual void enable() = 0;
-    virtual void disable() = 0;
-    virtual QString getId() const = 0;
-    virtual void connectTo(const QObject* theResiver, const char* theSlot) = 0;
-};
-
-
-class IMenuGroup
-{
-public:
-    virtual IFeatureMenu* addFeature(const QString& theId, 
-                                     const QString& theTitle, 
-                                     const QString& theTip, 
-                                     const QIcon& theIcon, 
-                                     const QKeySequence& theKeys = QKeySequence()) = 0;
-};
-
-
-class IWorkbench
-{
-public:
-    virtual IMenuGroup* addGroup(const QString& theName = "") = 0;
-    virtual IMenuGroup* findGroup(const QString& theName) = 0;
-};
-
-
-class IWorkshop
-{
-public:
-    virtual IWorkbench* addWorkbench(const QString& theName) = 0;
-};
-
-
-class IModule
-{
-public:
-    virtual void createFeatures() = 0;
-};
-
-
-//! This function must return a new module instance.
-extern "C"
-{
-   typedef IModule* (*CREATE_FUNC)(IWorkshop*);
-}
-
-#define CREATE_MODULE "createModule"
-
-
-#endif
index a19731deaf2bb9201ab6279096dd7ad6a4ae7166..f1926acf0ca3cc204cefc561985ba9bbb2521287 100644 (file)
@@ -18,7 +18,7 @@ XGUI_MainMenu::~XGUI_MainMenu(void)
 {
 }
 
-IWorkbench* XGUI_MainMenu::addWorkbench(const QString& theTitle)
+XGUI_Workbench* XGUI_MainMenu::addWorkbench(const QString& theTitle)
 {
     QDockWidget* aDoc = new QDockWidget(myDesktop);
     QString workbenchObjName = theTitle + "_Workbench";
@@ -44,17 +44,17 @@ IWorkbench* XGUI_MainMenu::addWorkbench(const QString& theTitle)
 /*
  * Searches for already created workbench with given name.
  */
-IWorkbench* XGUI_MainMenu::findWorkbench(const QString& theObjName)
+XGUI_Workbench* XGUI_MainMenu::findWorkbench(const QString& theObjName)
 {
   QDockWidget* aDoc = myDesktop->findChild<QDockWidget*>(theObjName);
   if(aDoc) {
-    return dynamic_cast<IWorkbench*>(aDoc->widget());
+    return dynamic_cast<XGUI_Workbench*>(aDoc->widget());
   }
   return NULL;
 }
 
 
-IMenuGroup* XGUI_MainMenu::addGroup(int thePageId)
+XGUI_MenuGroupPanel* XGUI_MainMenu::addGroup(int thePageId)
 {
     XGUI_Workbench* aPage = dynamic_cast<XGUI_Workbench*>(myMenuTabs[thePageId]->widget());
     return aPage->addGroup();
index 3addcdb6f3d202782c3bbcebb8edc4b936448ddf..ca45fe030f7a8f2ffa60243b2f087c2bda07455e 100644 (file)
@@ -1,19 +1,21 @@
 #ifndef XGUI_MainMenu_H
 #define XGUI_MainMenu_H
 
-#include "XGUI_Interfaces.h"
-
 #include <QObject>
 #include <QList>
 
+class XGUI_Command;
+class XGUI_MainWindow;
+class XGUI_Workbench;
+class XGUI_MenuGroupPanel;
+
 class QTabWidget;
 class QLabel;
 class QAction;
-class XGUI_Command;
-class XGUI_MainWindow;
 class QDockWidget;
 
 
+
 class XGUI_MainMenu : public QObject
 {
     Q_OBJECT
@@ -21,10 +23,10 @@ public:
     XGUI_MainMenu(XGUI_MainWindow *parent);
     virtual ~XGUI_MainMenu();
 
-    IWorkbench* addWorkbench(const QString& theTitle);
-    IWorkbench* findWorkbench(const QString& theObjName);
+    XGUI_Workbench* addWorkbench(const QString& theTitle);
+    XGUI_Workbench* findWorkbench(const QString& theObjName);
 
-    IMenuGroup* addGroup(int thePageId);
+    XGUI_MenuGroupPanel* addGroup(int thePageId);
 
 private:
     XGUI_MainWindow* myDesktop;
index 0753625d5c476f1615c896e5173f30f2fc389206..3173f97aa8b67f932904b4b136d4baba693dfc35 100644 (file)
@@ -60,7 +60,7 @@ void XGUI_MenuGroupPanel::resizeEvent(QResizeEvent* theEvent)
     }
 }
 
-IFeatureMenu* XGUI_MenuGroupPanel::addFeature(const QString& theId, const QString& theTitle, 
+XGUI_Command* XGUI_MenuGroupPanel::addFeature(const QString& theId, const QString& theTitle, 
                                               const QString& theTip, 
                                               const QIcon& theIcon, 
                                               const QKeySequence& theKeys)
index cda62888c6104459074158d7255f42b3deac481b..9c72384d19d6c25dde6999eda0418cd3bf646d74 100644 (file)
@@ -2,25 +2,23 @@
 #ifndef XGUI_MenuGroupPanel_H
 #define XGUI_MenuGroupPanel_H
 
-#include "XGUI_Interfaces.h"
-
 #include <QWidget>
 #include <QMap>
 
-class QGridLayout;
 class XGUI_Command;
+class QGridLayout;
 
-class XGUI_MenuGroupPanel : public QWidget, public IMenuGroup
+class XGUI_MenuGroupPanel : public QWidget
 {
     Q_OBJECT
 public:
     explicit XGUI_MenuGroupPanel(QWidget *parent = 0);
 
-    virtual IFeatureMenu* addFeature(const QString& theId, 
-                                     const QString& theTitle, 
-                                     const QString& theTip, 
-                                     const QIcon& theIcon, 
-                                     const QKeySequence& theKeys = QKeySequence());
+    XGUI_Command* addFeature(const QString& theId,
+                             const QString& theTitle,
+                             const QString& theTip,
+                             const QIcon& theIcon,
+                             const QKeySequence& theKeys = QKeySequence());
 
 protected:
     virtual void resizeEvent(QResizeEvent *theEvent);
@@ -37,4 +35,4 @@ private:
     int myMaxRow;
 };
 
-#endif
\ No newline at end of file
+#endif
diff --git a/src/XGUI/XGUI_Module.h b/src/XGUI/XGUI_Module.h
new file mode 100644 (file)
index 0000000..e270667
--- /dev/null
@@ -0,0 +1,26 @@
+
+#ifndef XGUI_Module_H
+#define XGUI_Module_H
+
+#include <QString>
+#include <QIcon>
+#include <QKeySequence>
+
+#include <XGUI_Workshop.h>
+
+class XGUI_Module
+{
+public:
+    virtual void createFeatures() = 0;
+};
+
+//! This function must return a new module instance.
+extern "C"
+{
+   typedef XGUI_Module* (*CREATE_FUNC)(XGUI_Workshop*);
+}
+
+#define CREATE_MODULE "createModule"
+
+
+#endif //XGUI_Module
index ac930f0766af0f12799eb2c7d892aac24c6a1aa0..4661f5791fd73c2baf829e907b5bd7c319bdeac9 100644 (file)
@@ -73,7 +73,7 @@ XGUI_Workbench::XGUI_Workbench(QWidget *theParent) :
  * Creates a new group in the workbench with given name.
  * If no name provided it would be defined as {workbench_name}_Group_N.
  */
-IMenuGroup* XGUI_Workbench::addGroup(const QString& theName)
+XGUI_MenuGroupPanel* XGUI_Workbench::addGroup(const QString& theName)
 {
     QString aGroupName = theName;
     //Generate a group name.
@@ -99,7 +99,7 @@ IMenuGroup* XGUI_Workbench::addGroup(const QString& theName)
 /*
  * Searches for already created group with given name.
  */
-IMenuGroup* XGUI_Workbench::findGroup(const QString& theName)
+XGUI_MenuGroupPanel* XGUI_Workbench::findGroup(const QString& theName)
 {
   QString aGroupName = theName;
   XGUI_MenuGroupPanel* aPanel;
index e44b60b87d8f461eb88fcb82410595d75f091733..26d7d6918bb486860d3b69eecd5a82521a46d00f 100644 (file)
@@ -2,27 +2,27 @@
 #ifndef XGUI_Workbench_H
 #define XGUI_Workbench_H
 
-#include "XGUI_Interfaces.h"
-
 #include <QWidget>
 #include <QScrollArea>
 #include <QList>
 
-class QHBoxLayout;
+class XGUI_Command;
 class XGUI_MenuGroupPanel;
-class QPushButton;
 class CommandsArea;
-class XGUI_Command;
+
+class QHBoxLayout;
+class QPushButton;
+
 
 
-class XGUI_Workbench : public QWidget, public IWorkbench
+class XGUI_Workbench : public QWidget
 {
     Q_OBJECT
 public:
     XGUI_Workbench(QWidget* theParent);
 
-    virtual IMenuGroup* addGroup(const QString& theName = "");
-    virtual IMenuGroup* findGroup(const QString& theName);
+    XGUI_MenuGroupPanel* addGroup(const QString& theName = "");
+    XGUI_MenuGroupPanel* findGroup(const QString& theName);
 
 private slots:
     void onLeftScroll();
index b7cd63a16e03c65de8fcc7faa5e32e2f589e9780..7b857b5afa1df0e896cb2baa9302600788b6c6c0 100644 (file)
@@ -1,8 +1,11 @@
-#include "XGUI_Workshop.h"
-#include "XGUI_MainWindow.h"
-#include "XGUI_MainMenu.h"
+#include "XGUI_Module.h"
 #include "XGUI_Command.h"
+#include "XGUI_MainMenu.h"
+#include "XGUI_MainWindow.h"
+#include "XGUI_MenuGroupPanel.h"
 #include "XGUI_Tools.h"
+#include "XGUI_Workbench.h"
+#include "XGUI_Workshop.h"
 
 #include <Config_Message.h>
 #include <Event_Loop.hxx>
 #ifdef _DEBUG
 #include <QDebug>
 #endif
-
-
-#include <cstdio>
-
 #ifdef WIN32
 #include <windows.h>
 #else
@@ -50,12 +49,12 @@ void XGUI_Workshop::startApplication()
 //******************************************************
 void XGUI_Workshop::initMenu()
 {
-    IWorkbench* aPage = addWorkbench(tr("GEN_MENU_TITLE"));
+    XGUI_Workbench* aPage = addWorkbench(tr("GEN_MENU_TITLE"));
 
     // File commands group
-    IMenuGroup* aGroup = aPage->addGroup();
+    XGUI_MenuGroupPanel* aGroup = aPage->addGroup();
 
-    IFeatureMenu* aCommand;
+    XGUI_Command* aCommand;
 
     aCommand = aGroup->addFeature("SAVE_CMD", tr("SAVE_MENU"), tr("SAVE_MENU_TIP"),
                                   QIcon(":pictures/save.png"), QKeySequence::Save);
@@ -92,7 +91,7 @@ void XGUI_Workshop::initMenu()
 }
 
 //******************************************************
-IWorkbench* XGUI_Workshop::addWorkbench(const QString& theName)
+XGUI_Workbench* XGUI_Workshop::addWorkbench(const QString& theName)
 {
     XGUI_MainMenu* aMenuBar = myMainWindow->menuObject();
     return aMenuBar->addWorkbench(theName);
@@ -109,15 +108,18 @@ void XGUI_Workshop::ProcessEvent(const Event_Message* theMessage)
   }
   #ifdef _DEBUG
   qDebug() << "XGUI_Workshop::ProcessEvent: "
-      << "Got message, but it's not a Config_FeatureMessage";
+           << "Catch message, but it can not be processed.";
   #endif
 
 }
 
+/*
+ *
+ */
 void XGUI_Workshop::addFeature(const Config_FeatureMessage* theMessage)
 {
   XGUI_MainMenu* aMenuBar = myMainWindow->menuObject();
-  IWorkbench* aPage = aMenuBar->findWorkbench(tr( "GEN_MENU_TITLE" ) + "_Workbench");
+  XGUI_Workbench* aPage = aMenuBar->findWorkbench(tr( "GEN_MENU_TITLE" ) + "_Workbench");
   if(!aPage) {
     #ifdef _DEBUG
     qDebug() << "XGUI_Workshop::ProcessEvent: "
@@ -126,13 +128,12 @@ void XGUI_Workshop::addFeature(const Config_FeatureMessage* theMessage)
     aPage = addWorkbench(tr( "GEN_MENU_TITLE" ));
   }
   QString aGroupName = QString::fromStdString(theMessage->m_group);
-  IMenuGroup* aGroup = aPage->findGroup(aGroupName);
+  QString aFeatureId = QString::fromStdString(theMessage->m_id);
+  XGUI_MenuGroupPanel* aGroup = aPage->findGroup(aGroupName);
   if(!aGroup) {
     aGroup = aPage->addGroup(aGroupName);
   }
-  IFeatureMenu* aCommand;
-  aCommand = aGroup->addFeature(
-    QString::fromStdString(theMessage->m_id),
+  XGUI_Command* aCommand = aGroup->addFeature(aFeatureId,
     QString::fromStdString(theMessage->m_text),
     QString::fromStdString(theMessage->m_tooltip),
     QIcon(theMessage->m_icon.c_str())
@@ -170,7 +171,7 @@ void XGUI_Workshop::onSaveAs()
 }
 
 //******************************************************
-IModule* XGUI_Workshop::loadModule(const QString& theModule)
+XGUI_Module* XGUI_Workshop::loadModule(const QString& theModule)
 {
   QString libName = library( theModule );
   if ( libName.isEmpty() )
@@ -219,7 +220,7 @@ IModule* XGUI_Workshop::loadModule(const QString& theModule)
   }
 #endif
 
-  IModule* aModule = crtInst ? crtInst(this) : 0;
+  XGUI_Module* aModule = crtInst ? crtInst(this) : 0;
 
   if ( !err.isEmpty() ) {
     if ( mainWindow() && mainWindow()->isVisible() )
@@ -234,7 +235,7 @@ IModule* XGUI_Workshop::loadModule(const QString& theModule)
 bool XGUI_Workshop::activateModule()
 {
     // Test of modules loading
-    IModule* aModule = loadModule("GeomModule");
+    XGUI_Module* aModule = loadModule("PartSet");
     if (!aModule)
         return false;
     aModule->createFeatures();
index b0471732fc003889e8e4d3ebbe0ed6a8eddba9e5..e6aa9970758c5918f38437c2c8ddaa97b9c1bae9 100644 (file)
@@ -2,8 +2,6 @@
 #ifndef XGUI_WORKSHOP_H
 #define XGUI_WORKSHOP_H
 
-#include "XGUI_Interfaces.h"
-
 #include <Event_Message.hxx>
 #include <Event_Listener.hxx>
 
 class XGUI_MainWindow;
 class XGUI_Command;
 class XGUI_Module;
+class XGUI_Workbench;
 
 class Config_FeatureMessage;
 
-class XGUI_Workshop: public QObject, public Event_Listener, public IWorkshop
+class XGUI_Workshop: public QObject, public Event_Listener
 {
        Q_OBJECT
 public:
@@ -30,7 +29,7 @@ public:
 
     XGUI_MainWindow* mainWindow() const { return myMainWindow; }
 
-    virtual IWorkbench* addWorkbench(const QString& theName);
+    XGUI_Workbench* addWorkbench(const QString& theName);
 
     virtual void ProcessEvent(const Event_Message* theMessage);
 
@@ -48,7 +47,7 @@ protected:
 private:
     void initMenu();
 
-    IModule* loadModule(const QString& theModule);
+    XGUI_Module* loadModule(const QString& theModule);
     bool activateModule();
 
     XGUI_MainWindow* myMainWindow;