From: abd Date: Fri, 3 Oct 2008 10:55:50 +0000 (+0000) Subject: Win32 Porting. X-Git-Tag: RELIQUAT_4x_25102008~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b43d14a9967e1bdbb500577b1d7fcc44eba04b8e;p=modules%2Fgui.git Win32 Porting. Correction of Export/Import defines for Win32 platform. Using WIN32 standard define instead WNT define of OpenCascade library. Removed "using namespace std" from header files. --- diff --git a/src/RegistryDisplay/IntervalWindow.hxx b/src/RegistryDisplay/IntervalWindow.hxx index 420ce5a0a..b78685f02 100755 --- a/src/RegistryDisplay/IntervalWindow.hxx +++ b/src/RegistryDisplay/IntervalWindow.hxx @@ -30,10 +30,6 @@ # include # include -#ifndef WNT -using namespace std; -#endif - class IntervalWindow : public QDialog { Q_OBJECT diff --git a/src/SVTK/SALOME_Actor.h b/src/SVTK/SALOME_Actor.h index a44acc9fd..c849f123d 100644 --- a/src/SVTK/SALOME_Actor.h +++ b/src/SVTK/SALOME_Actor.h @@ -54,8 +54,12 @@ class SVTK_Actor; class SVTK_RectPicker; class SVTK_InteractorStyle; -extern int SALOME_POINT_SIZE; -extern int SALOME_LINE_WIDTH; +SVTK_EXPORT extern int SALOME_POINT_SIZE; +SVTK_EXPORT extern int SALOME_LINE_WIDTH; + +#ifdef WIN32 +#pragma warning ( disable:4251 ) +#endif #ifdef WIN32 #pragma warning ( disable:4251 ) diff --git a/src/SalomeApp/SalomeApp_Study.cxx b/src/SalomeApp/SalomeApp_Study.cxx index aeee814b6..4f080baa9 100644 --- a/src/SalomeApp/SalomeApp_Study.cxx +++ b/src/SalomeApp/SalomeApp_Study.cxx @@ -43,6 +43,8 @@ #include #include "SALOMEDS_Tool.hxx" +#include "utilities.h" +#include "Basics_DirUtils.hxx" #include "SALOMEDSClient_ClientFactory.hxx" #include "SALOMEDSClient_IParameters.hxx" @@ -565,7 +567,7 @@ void SalomeApp_Study::SetListOfFiles ( const char* theModuleName, std::string SalomeApp_Study::GetTmpDir ( const char* theURL, const bool isMultiFile ) { std::string anURLDir = SALOMEDS_Tool::GetDirFromPath(theURL); - std::string aTmpDir = isMultiFile ? anURLDir : SALOMEDS_Tool::GetTmpDir(); + std::string aTmpDir = isMultiFile ? anURLDir : Kernel_Utils::GetTmpDirByEnv("SALOME_TMP_DIR"); return aTmpDir; } diff --git a/src/Session/InquireServersQThread.cxx b/src/Session/InquireServersQThread.cxx index 61fdc3eff..e6bd3d763 100755 --- a/src/Session/InquireServersQThread.cxx +++ b/src/Session/InquireServersQThread.cxx @@ -510,7 +510,7 @@ bool InquireServersQThread::pingServer(int iteration, QString& errMessage) break; case 6: { - string hostname = GetHostname(); + string hostname = Kernel_Utils::GetHostname(); string containerName = "/Containers/"; containerName += hostname; containerName += "/FactoryServer"; @@ -528,7 +528,7 @@ bool InquireServersQThread::pingServer(int iteration, QString& errMessage) break; case 7: { - string hostname = GetHostname(); + string hostname = Kernel_Utils::GetHostname(); string containerName = "/Containers/"; containerName += hostname; containerName += "/FactoryServerPy"; @@ -546,7 +546,7 @@ bool InquireServersQThread::pingServer(int iteration, QString& errMessage) break; case 8: { - string hostname = GetHostname(); + string hostname = Kernel_Utils::GetHostname(); string containerName = "/Containers/"; containerName += hostname; containerName += "/SuperVisionContainer"; diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index 40218b506..d566b60e6 100755 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -72,6 +72,8 @@ #include "SUIT_ResourceMgr.h" #include "SUIT_ExceptionHandler.h" +using namespace std; + /*! - read arguments, define list of server to launch with their arguments. * - wait for naming service * - create and run a thread for launch of all servers diff --git a/src/Session/SalomeApp_Engine_i.cxx b/src/Session/SalomeApp_Engine_i.cxx index 813270515..a4abb0f67 100644 --- a/src/Session/SalomeApp_Engine_i.cxx +++ b/src/Session/SalomeApp_Engine_i.cxx @@ -29,6 +29,7 @@ #include "SalomeApp_Engine_i.hxx" #include "SALOMEDS_Tool.hxx" +#include "Basics_DirUtils.hxx" #include "utilities.h" @@ -113,7 +114,7 @@ CORBA::Boolean SalomeApp_Engine_i::Load (SALOMEDS::SComponent_ptr theComponent, const int studyId = theComponent->GetStudy()->StudyId(); // Create a temporary directory for the component's data files - std::string aTmpDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir(); + std::string aTmpDir = isMultiFile ? theURL : Kernel_Utils::GetTmpDirByEnv("SALOME_TMP_DIR"); // Convert the byte stream theStream to a files and place them in the tmp directory. // The files and temporary directory must be deleted by the component loading procedure. diff --git a/src/Session/Session_ServerCheck.cxx b/src/Session/Session_ServerCheck.cxx index 3642f0407..68eb2ffbe 100644 --- a/src/Session/Session_ServerCheck.cxx +++ b/src/Session/Session_ServerCheck.cxx @@ -33,7 +33,7 @@ #include "Utils_SINGLETON.hxx" #include "SALOME_NamingService.hxx" #include "utilities.h" -#include "OpUtil.hxx" +#include "Basics_Utils.hxx" // Default settings const int __DEFAULT__ATTEMPTS__ = 300; // number of checks attemtps @@ -362,7 +362,7 @@ void Session_ServerCheck::run() SALOME_NamingService &NS = *SINGLETON_::Instance(); ASSERT( SINGLETON_::IsAlreadyExisting() ); NS.init_orb( orb ); - QString containerName = QString( "/Containers/%1/FactoryServer" ).arg( GetHostname().c_str() ); + QString containerName = QString( "/Containers/%1/FactoryServer" ).arg( Kernel_Utils::GetHostname().c_str() ); CORBA::Object_var obj = NS.Resolve( containerName.latin1() ); Engines::Container_var FScontainer = Engines::Container::_narrow( obj ); if ( !CORBA::is_nil( FScontainer ) ) { @@ -413,7 +413,7 @@ void Session_ServerCheck::run() SALOME_NamingService &NS = *SINGLETON_::Instance(); ASSERT( SINGLETON_::IsAlreadyExisting() ); NS.init_orb( orb ); - QString containerName = QString( "/Containers/%1/FactoryServerPy" ).arg( GetHostname().c_str() ); + QString containerName = QString( "/Containers/%1/FactoryServerPy" ).arg( Kernel_Utils::GetHostname().c_str() ); CORBA::Object_var obj = NS.Resolve( containerName.latin1() ); Engines::Container_var FSPcontainer = Engines::Container::_narrow( obj ); if ( !CORBA::is_nil( FSPcontainer ) ) { @@ -464,7 +464,7 @@ void Session_ServerCheck::run() SALOME_NamingService &NS = *SINGLETON_::Instance(); ASSERT( SINGLETON_::IsAlreadyExisting() ); NS.init_orb( orb ); - QString containerName = QString( "/Containers/%1/SuperVisionContainer" ).arg( GetHostname().c_str() ); + QString containerName = QString( "/Containers/%1/SuperVisionContainer" ).arg( Kernel_Utils::GetHostname().c_str() ); CORBA::Object_var obj = NS.Resolve( containerName.latin1() ); Engines::Container_var SVcontainer = Engines::Container::_narrow( obj ); if ( !CORBA::is_nil( SVcontainer ) ) { diff --git a/src/Session/Session_ServerLauncher.hxx b/src/Session/Session_ServerLauncher.hxx index b3773adf1..3264ef318 100755 --- a/src/Session/Session_ServerLauncher.hxx +++ b/src/Session/Session_ServerLauncher.hxx @@ -40,8 +40,6 @@ #include #include -using namespace std; - class SESSION_EXPORT ServArg { public: @@ -78,16 +76,15 @@ protected: private: int _argc; char ** _argv; - CORBA::ORB_var _orb; - PortableServer::POA_var _root_poa; - QMutex* _GUIMutex; - QWaitCondition* _ServerLaunch; - QMutex* _SessionMutex; - QWaitCondition* _SessionStarted; - list _argServToLaunch; - vector _argCopy; - list _serverThreads; + CORBA::ORB_var _orb; + PortableServer::POA_var _root_poa; + QMutex* _GUIMutex; + QWaitCondition* _ServerLaunch; + QMutex* _SessionMutex; + QWaitCondition* _SessionStarted; + std::list _argServToLaunch; + std::vector _argCopy; + std::list _serverThreads; }; #endif - diff --git a/src/Session/Session_ServerThread.cxx b/src/Session/Session_ServerThread.cxx index c29a4807d..ad3b6e22f 100755 --- a/src/Session/Session_ServerThread.cxx +++ b/src/Session/Session_ServerThread.cxx @@ -44,7 +44,7 @@ #include "Utils_ORB_INIT.hxx" #include "Utils_SINGLETON.hxx" #include "Utils_SALOME_Exception.hxx" -#include "OpUtil.hxx" +#include "Basics_Utils.hxx" #include "NamingService_WaitForServerReadiness.hxx" #include "utilities.h" @@ -153,7 +153,7 @@ void Session_ServerThread::Init() { NamingService_WaitForServerReadiness(_NS,"/myStudyManager"); string containerName = "/Containers/"; - containerName = containerName + GetHostname(); + containerName = containerName + Kernel_Utils::GetHostname(); containerName = containerName + "/FactoryServer"; NamingService_WaitForServerReadiness(_NS,containerName); ActivateSession(_argc, _argv); diff --git a/src/Session/Session_ServerThread.hxx b/src/Session/Session_ServerThread.hxx index 04ded4d2e..145568286 100755 --- a/src/Session/Session_ServerThread.hxx +++ b/src/Session/Session_ServerThread.hxx @@ -37,9 +37,7 @@ #include "SALOME_NamingService.hxx" #include -using namespace std; - -void WaitForServerReadiness(string serverName); +void WaitForServerReadiness(std::string serverName); class SESSION_EXPORT Session_ServerThread diff --git a/src/Session/Session_Session_i.cxx b/src/Session/Session_Session_i.cxx index 92da744bc..def398b6c 100755 --- a/src/Session/Session_Session_i.cxx +++ b/src/Session/Session_Session_i.cxx @@ -44,6 +44,11 @@ #include #include +#ifdef WNT +# include +#endif + + using namespace std; /*! @@ -201,6 +206,15 @@ CORBA::Long SALOME_Session_i::GetActiveStudyId() return aStudyId; } +CORBA::Long SALOME_Session_i::getPID() { + return (CORBA::Long) +#ifndef WNT + getpid(); +#else + _getpid(); +#endif +} + bool SALOME_Session_i::restoreVisualState(CORBA::Long theSavePoint) { class TEvent: public SALOME_Event { diff --git a/src/Session/Session_Session_i.hxx b/src/Session/Session_Session_i.hxx index 58f5fdb31..64f031cfb 100755 --- a/src/Session/Session_Session_i.hxx +++ b/src/Session/Session_Session_i.hxx @@ -68,7 +68,7 @@ public: CORBA::Long GetActiveStudyId(); void ping(){}; - CORBA::Long getPID() { return (CORBA::Long)getpid(); }; + CORBA::Long getPID(); //! Restors a visual state of the study at theSavePoint bool restoreVisualState(CORBA::Long theSavePoint); diff --git a/src/TOOLSGUI/ToolsGUI_IntervalWindow.h b/src/TOOLSGUI/ToolsGUI_IntervalWindow.h index 242373657..14b505a86 100755 --- a/src/TOOLSGUI/ToolsGUI_IntervalWindow.h +++ b/src/TOOLSGUI/ToolsGUI_IntervalWindow.h @@ -28,10 +28,6 @@ # include # include -#ifndef WNT -using namespace std; -#endif - class ToolsGUI_IntervalWindow : public QDialog { Q_OBJECT