]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
WIP
authorAnthony GEAY <anthony.geay@edf.fr>
Fri, 19 Feb 2021 23:45:35 +0000 (00:45 +0100)
committerAnthony GEAY <anthony.geay@edf.fr>
Fri, 19 Feb 2021 23:45:35 +0000 (00:45 +0100)
12 files changed:
CMakeLists.txt
SalomeGUIConfig.cmake.in
src/SalomeApp/CMakeLists.txt
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h
src/SalomeApp/SalomeApp_Application_Entry.cxx [new file with mode: 0644]
src/SalomeApp/SalomeApp_Application_SL.cxx [new file with mode: 0644]
src/SalomeApp/SalomeApp_Application_SL.h [new file with mode: 0644]
src/SalomeApp/SalomeApp_Application_SL_Entry.cxx [new file with mode: 0644]
src/Session/SALOME_Session_Server.cxx
src/Session/Session_NS_wrapper.cxx
src/Session/Session_NS_wrapper.hxx

index 9d401f948cd3db80f383795d99a865c6022d7137..8f67a2d97cd2f98fafe42ab2147343722b8aa5c8 100644 (file)
@@ -407,7 +407,7 @@ ENDIF(SALOME_USE_PYCONSOLE)
 # CORBA specific targets:
 IF(NOT SALOME_LIGHT_ONLY)
   LIST(APPEND _${PROJECT_NAME}_exposed_targets
-       SalomeIDLGUI SalomeSession SalomeApp SalomeGuiHelpers SalomeTreeData ToolsGUI)
+       SalomeIDLGUI SalomeSession SalomeApp SalomeAppSL SalomeAppImpl SalomeGuiHelpers SalomeTreeData ToolsGUI)
 ENDIF(NOT SALOME_LIGHT_ONLY)
 
 # Add all targets to the build-tree export set
index d24b44d3b00d1b2e1474e69cef9a7d90c6210a8d..925c10c243f82410d6dd3b873e63a2a9d1ed5707 100644 (file)
@@ -201,6 +201,8 @@ SET(GUI_QDS QDS)
 SET(GUI_qtx qtx)
 SET(GUI_QxScene QxScene)
 SET(GUI_SalomeApp SalomeApp)
+SET(GUI_SalomeAppSL SalomeAppSL)
+SET(GUI_SalomeAppImpl SalomeAppImpl)
 SET(GUI_SalomeIDLGUI SalomeIDLGUI)
 SET(GUI_SalomeObject SalomeObject)
 SET(GUI_SalomePrs SalomePrs)
index 10ae94a8101b5aa2c2677218d61d196ffe10c570..22e69a90d95f3ee69ddeeff4f7cab7429bfe63c2 100644 (file)
@@ -124,7 +124,8 @@ ENDIF()
 # --- headers ---
 
 # header files / to be processed by moc
-SET(_moc_HEADERS   
+SET(_moc_HEADERS
+  SalomeApp_Application_SL.h
   SalomeApp_Application.h
   SalomeApp_CheckFileDlg.h
   SalomeApp_DataModel.h
@@ -184,6 +185,7 @@ QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 # sources / static
 SET(_other_SOURCES
+  SalomeApp_Application_SL.cxx
   SalomeApp_Application.cxx
   SalomeApp_CheckFileDlg.cxx
   SalomeApp_DataModel.cxx
@@ -226,9 +228,16 @@ SET(_py_SCRIPTS
 
 # --- rules ---
 
-ADD_LIBRARY(SalomeApp ${SalomeApp_SOURCES})
-TARGET_LINK_LIBRARIES(SalomeApp ${_link_LIBRARIES})
-INSTALL(TARGETS SalomeApp EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+ADD_LIBRARY(SalomeAppImpl ${SalomeApp_SOURCES})
+TARGET_LINK_LIBRARIES(SalomeAppImpl ${_link_LIBRARIES})
+
+ADD_LIBRARY(SalomeApp SalomeApp_Application_Entry.cxx)
+TARGET_LINK_LIBRARIES(SalomeApp SalomeAppImpl)
+
+ADD_LIBRARY(SalomeAppSL SalomeApp_Application_SL_Entry.cxx)
+TARGET_LINK_LIBRARIES(SalomeAppSL SalomeAppImpl)
+
+INSTALL(TARGETS SalomeAppImpl SalomeApp SalomeAppSL EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 INSTALL(FILES ${SalomeApp_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
 QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
index bfb209efa370c4ea8660a88c7c3e3346e2f661ac..b02c12a7aa15f057466e19f24117e896a74e2876 100644 (file)
 
 #include <SALOMEDS_Tool.hxx>
 
+std::unique_ptr<SALOME_NamingService_Abstract> SalomeApp_Application::_ns;
+
 /*!Internal class that updates object browser item properties */
 // temporary commented
 /*class SalomeApp_Updater : public OB_Updater
@@ -173,18 +175,13 @@ namespace
   };
 }
 
-/*!Create new instance of SalomeApp_Application.*/
-extern "C" SALOMEAPP_EXPORT SUIT_Application* createApplication()
-{
-  return new SalomeApp_Application();
-}
-
 /*!Constructor.*/
 SalomeApp_Application::SalomeApp_Application()
   : LightApp_Application(),
     myIsCloseFromExit( false ),
     myToIgnoreMessages( false )
 {
+  _ns.reset(new SALOME_NamingService(orb()));
 }
 
 /*!Destructor.
@@ -1368,10 +1365,9 @@ _PTR(Study) SalomeApp_Application::getStudy()
 }
 
 /*!Create and return SALOME_NamingService.*/
-SALOME_NamingServiceSalomeApp_Application::namingService()
+SALOME_NamingService_Abstract *SalomeApp_Application::namingService()
 {
-  static SALOME_NamingService _ns(orb());
-  return &_ns;
+  return _ns.get();
 }
 
 /*!Create and return SALOME_LifeCycleCORBA.*/
index 5f4da65f06bd9b21f1a77be96a8107dc6b64948d..165c6fb3b78cbe052950bb0bdc4db3ad4152513e 100644 (file)
@@ -44,6 +44,8 @@
 
 #include <QPointer>
 
+#include <memory>
+
 class LightApp_Preferences;
 class SalomeApp_Study;
 #ifndef DISABLE_PYCONSOLE
@@ -97,7 +99,7 @@ public:
 
   static CORBA::ORB_var               orb();
   static _PTR(Study)                  getStudy();
-  static SALOME_NamingService*        namingService();
+  static SALOME_NamingService_Abstract* namingService();
   static SALOME_LifeCycleCORBA*       lcc();
 
   SUIT_ViewManager*                   newViewManager(const QString&);
@@ -210,6 +212,8 @@ signals:
                                                          bool theIsStudySaved );
   void                                notebookVarUpdated( QString theVarName );
   void                                objectDoubleClicked( SUIT_DataObject* );
+protected:
+  static std::unique_ptr<SALOME_NamingService_Abstract> _ns;
 };
 
 #ifdef WIN32
diff --git a/src/SalomeApp/SalomeApp_Application_Entry.cxx b/src/SalomeApp/SalomeApp_Application_Entry.cxx
new file mode 100644 (file)
index 0000000..4af758f
--- /dev/null
@@ -0,0 +1,26 @@
+// Copyright (C) 2021  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "SalomeApp_Application.h"
+
+/*!Create new instance of SalomeApp_Application.*/
+extern "C" SALOMEAPP_EXPORT SUIT_Application* createApplication()
+{
+  return new SalomeApp_Application;
+}
diff --git a/src/SalomeApp/SalomeApp_Application_SL.cxx b/src/SalomeApp/SalomeApp_Application_SL.cxx
new file mode 100644 (file)
index 0000000..eebf34b
--- /dev/null
@@ -0,0 +1,27 @@
+// Copyright (C) 2021  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "SalomeApp_Application_SL.h"
+
+#include "SALOME_Fake_NamingService.hxx"
+
+SalomeApp_Application_SL::SalomeApp_Application_SL()
+{
+  _ns.reset( new SALOME_Fake_NamingService );
+}
diff --git a/src/SalomeApp/SalomeApp_Application_SL.h b/src/SalomeApp/SalomeApp_Application_SL.h
new file mode 100644 (file)
index 0000000..9d9b735
--- /dev/null
@@ -0,0 +1,28 @@
+// Copyright (C) 2021  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#pragma once
+
+#include "SalomeApp_Application.h"
+
+class SALOMEAPP_EXPORT SalomeApp_Application_SL : public SalomeApp_Application
+{
+public:
+  SalomeApp_Application_SL();
+};
diff --git a/src/SalomeApp/SalomeApp_Application_SL_Entry.cxx b/src/SalomeApp/SalomeApp_Application_SL_Entry.cxx
new file mode 100644 (file)
index 0000000..9094003
--- /dev/null
@@ -0,0 +1,26 @@
+// Copyright (C) 2021  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "SalomeApp_Application_SL.h"
+
+/*!Create new instance of SalomeApp_Application.*/
+extern "C" SALOMEAPP_EXPORT SUIT_Application* createApplication()
+{
+  return new SalomeApp_Application_SL;
+}
index 1c2dbd3edf4abe581f6be6821a2fc252861fe8dc..b5d97f6723b48d11a8cba32287925ba0c271155c 100644 (file)
@@ -722,7 +722,7 @@ int AbstractGUIApp::main(int argc, char **argv)
 
       // Load SalomeApp dynamic library
       MESSAGE("creation SUIT_Application");
-      SUIT_Application *aGUIApp = aGUISession->startApplication("SalomeApp", 0, 0);
+      SUIT_Application *aGUIApp = aGUISession->startApplication(NamingServiceImplementation::LibName, 0, 0);
       if (aGUIApp)
       {
 #ifdef USE_SALOME_STYLE
index 0b3c545ad2de4a602aac977818902b0342e2f6b8..cbd4b5974df2314b0e3107110881d410eec81739 100644 (file)
@@ -28,6 +28,9 @@
 #include "Session_Promises.hxx"
 #include "utilities.h"
 
+const char OldStyleNS::LibName[]="SalomeApp";
+const char NewStyleNS::LibName[]="SalomeAppSL";
+
 void CommonActivateSession(CORBA::ORB_var orb, PortableServer::POA_var poa, QMutex *GUIMutex, QWaitCondition *GUILauncher, SALOME_NamingService_Abstract *ns, int argc, char ** argv)
 {
   try {
index 83581412933f15f21b9df081d51ccddb8b2beae7..96c929b4e8ce6db1be160feb30cf099406aa17e5 100644 (file)
@@ -43,6 +43,7 @@ public:
   static void activateSALOMEDS(CORBA::ORB_var orb, PortableServer::POA_var poa);
   static CORBA::Object_var forServerChecker(const char *NSName, int argc, char **argv);
   static CosNaming::NamingContext_var checkTrueNamingServiceIfExpected(int argc, char **argv, bool& forceOK);
+  static const char LibName[];
 private:
   RealNS _NS;
 };
@@ -64,6 +65,7 @@ public:
   static void activateSALOMEDS(CORBA::ORB_var orb, PortableServer::POA_var poa);
   static CORBA::Object_var forServerChecker(const char *NSName, int argc, char **argv);
   static CosNaming::NamingContext_var checkTrueNamingServiceIfExpected(int argc, char **argv, bool& forceOK);
+  static const char LibName[];
 private:
   RealNS _NS;
 };