-// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+#include <ArgvKeeper.hxx>
#include <Container_init_python.hxx> // this include must be the first one as it includes Python.h
#include <Basics_Utils.hxx>
-#include <ConnectionManager_i.hxx>
#include <OpUtil.hxx>
#include <RegistryService.hxx>
#include <SALOME_LifeCycleCORBA.hxx>
#include <Utils_SALOME_Exception.hxx>
#include <Utils_SINGLETON.hxx>
#include <utilities.h>
+#include "KernelBasis.hxx"
#include "Session_Session_i.hxx"
#include "Session_ServerCheck.hxx"
#include <QTextStream>
#include <QWaitCondition>
+#ifdef WIN32
+extern "C" {
+// For DWORD (see end of file)
+#include "windef.h"
+// Force high-performance graphics on dual-GPU systems
+ // http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf
+ __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
+ // https://community.amd.com/thread/169965
+ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
+}
+#endif
+
//! CORBA server for SALOME GUI session
/*!
* SALOME_Session_Server launches a SALOME session servant.
class GUIAppOldStyle
{
public:
+ static constexpr bool SSL_MODE = false;
using NamingServiceImplementation = OldStyleNS;
void connectToNSIfNeeded(CORBA::ORB_ptr orb) { _NS.reset(new SALOME_NamingService(orb)); }
void shutdownCORBAStufIfNeeded(bool shutdownAll, CORBA::ORB_ptr orb);
class GUIAppNewStyle
{
public:
+ static constexpr bool SSL_MODE = true;
using NamingServiceImplementation = NewStyleNS;
void connectToNSIfNeeded(CORBA::ORB_ptr orb) { /*! nothing */ }
void shutdownCORBAStufIfNeeded(bool shutdownAll, CORBA::ORB_ptr orb) { /*! nothing */ }
int AbstractGUIAppMain(int argc, char **argv)
{
using NamingServiceImplementation = typename GUI_APP_STYLE::NamingServiceImplementation;
+ setSSLMode(GUI_APP_STYLE::SSL_MODE);
+ setGUIMode(true);
GUI_APP_STYLE self;
// Set-up application settings configuration (as for QSettings)
// Note: these are default settings which can be customized (see below)
// Create Qt application instance: this should be done as early as possible!
// Note: QApplication forces setting locale LC_ALL to system one: setlocale(LC_ALL, "").
+ SetArgcArgv(argc,argv);
Application app(argc, argv);
// Initialize Python (only once)
QLocale::setDefault(QLocale::c());
resMgr.setWorkingMode(ResourceMgr::IgnoreUserValues);
+#if defined(GLOBAL_DOUBLE_CONVERSION)
+ // VSR 30/03/2021: moved here from QtxDoubleSpinBox/QtxIntSpinBox because of crash on Qt 5.12.
+ // Disable thousands separator for spin box
+ // see issue 14540 (old id 21219)
+ QLocale locale;
+ locale.setNumberOptions(locale.numberOptions() | QLocale::OmitGroupSeparator | QLocale::RejectGroupSeparator);
+ QLocale::setDefault(locale);
+#endif
+
bool isGUI = boolCmdOption("--show-desktop", "--hide-desktop", true); // true by default
bool isSplash = boolCmdOption("--show-splash", "--hide-splash", true); // true by default
try
{
// ...create ORB, get RootPOA object, NamingService, etc.
- ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance();
- ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
int orbArgc = 1;
if (std::string(argv[1]).find("-ORBInitRef") != std::string::npos)
{
orbArgc = 3;
remoteLauncher = true;
}
- orb = init(orbArgc, argv);
+ SetArgcArgv(orbArgc, argv);
+ orb = KERNEL::GetRefToORB();
CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
poa = PortableServer::POA::_narrow(obj);