# 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
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)
# --- 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
# sources / static
SET(_other_SOURCES
+ SalomeApp_Application_SL.cxx
SalomeApp_Application.cxx
SalomeApp_CheckFileDlg.cxx
SalomeApp_DataModel.cxx
# --- 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}")
#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
};
}
-/*!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.
}
/*!Create and return SALOME_NamingService.*/
-SALOME_NamingService* SalomeApp_Application::namingService()
+SALOME_NamingService_Abstract *SalomeApp_Application::namingService()
{
- static SALOME_NamingService _ns(orb());
- return &_ns;
+ return _ns.get();
}
/*!Create and return SALOME_LifeCycleCORBA.*/
#include <QPointer>
+#include <memory>
+
class LightApp_Preferences;
class SalomeApp_Study;
#ifndef DISABLE_PYCONSOLE
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&);
bool theIsStudySaved );
void notebookVarUpdated( QString theVarName );
void objectDoubleClicked( SUIT_DataObject* );
+protected:
+ static std::unique_ptr<SALOME_NamingService_Abstract> _ns;
};
#ifdef WIN32
--- /dev/null
+// 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;
+}
--- /dev/null
+// 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 );
+}
--- /dev/null
+// 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();
+};
--- /dev/null
+// 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;
+}
// 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
#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 {
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;
};
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;
};