]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Win32 Porting.
authorabd <abd@opencascade.com>
Fri, 3 Oct 2008 10:55:50 +0000 (10:55 +0000)
committerabd <abd@opencascade.com>
Fri, 3 Oct 2008 10:55:50 +0000 (10:55 +0000)
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.

13 files changed:
src/RegistryDisplay/IntervalWindow.hxx
src/SVTK/SALOME_Actor.h
src/SalomeApp/SalomeApp_Study.cxx
src/Session/InquireServersQThread.cxx
src/Session/SALOME_Session_Server.cxx
src/Session/SalomeApp_Engine_i.cxx
src/Session/Session_ServerCheck.cxx
src/Session/Session_ServerLauncher.hxx
src/Session/Session_ServerThread.cxx
src/Session/Session_ServerThread.hxx
src/Session/Session_Session_i.cxx
src/Session/Session_Session_i.hxx
src/TOOLSGUI/ToolsGUI_IntervalWindow.h

index 420ce5a0af14e3826f854a1e186fb37797ed740e..b78685f0252ed346994de01ce4151f9e3a5d4157 100755 (executable)
 # include <qpushbutton.h>
 # include <qspinbox.h>
 
-#ifndef WNT
-using namespace std;
-#endif
-
 class IntervalWindow : public QDialog
 {
   Q_OBJECT
index a44acc9fd35a369ded98aec4110e9889dc4572a3..c849f123d34ec45be3ab79a9ac3b7acda8ac59b0 100644 (file)
@@ -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 )
index aeee814b63b4515a6ba051db89f3559a2dcd25bc..4f080baa9b62ba7e5178efe443ab9fc29ed878e4 100644 (file)
@@ -43,6 +43,8 @@
 #include <SUIT_Session.h>
 
 #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;
 }
 
index 61fdc3eff02c0241d0193ac0b9b3980e5855e4bd..e6bd3d76321db907d0611d361fa31afc8a70a984 100755 (executable)
@@ -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";
index 40218b506b695f644d68a65dca988805d1bf9dcf..d566b60e612646922575ce4bfcc3052260fd3270 100755 (executable)
@@ -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
index 813270515dd0f660de88055b41baefb33e0d44ba..a4abb0f67c685fbc3cbec440acc9c833e73888d9 100644 (file)
@@ -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.
index 3642f040728cdb411eca65ea4d869de5abd6e26d..68eb2ffbe6abe13a8fcc5ff047d4692245ed7f25 100644 (file)
@@ -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_<SALOME_NamingService>::Instance();
        ASSERT( SINGLETON_<SALOME_NamingService>::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_<SALOME_NamingService>::Instance();
        ASSERT( SINGLETON_<SALOME_NamingService>::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_<SALOME_NamingService>::Instance();
        ASSERT( SINGLETON_<SALOME_NamingService>::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 ) ) {
index b3773adf10f1116230dc266b3f85a6188ddd54c4..3264ef3189d7e338746426fd2a0fb13011f5fe83 100755 (executable)
@@ -40,8 +40,6 @@
 #include <qthread.h>
 #include <qwaitcondition.h>
 
-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<ServArg>               _argServToLaunch;
-  vector<string>              _argCopy;
-  list<Session_ServerThread*> _serverThreads;
+  CORBA::ORB_var                       _orb;
+  PortableServer::POA_var              _root_poa;
+  QMutex*                              _GUIMutex;
+  QWaitCondition*                      _ServerLaunch;
+  QMutex*                              _SessionMutex;
+  QWaitCondition*                      _SessionStarted;
+  std::list<ServArg>                   _argServToLaunch;
+  std::vector<std::string>             _argCopy;
+  std::list<Session_ServerThread*>     _serverThreads;
 };
 
 #endif
-
index c29a4807dd94e90a3fa8aafa67891514331a41ac..ad3b6e22f53b660b5fe158e479a36131e57011b5 100755 (executable)
@@ -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);
index 04ded4d2ead238a241f946aae311d6e68869d168..145568286c6ff350d8ea0e54ebbcc620a73ce89d 100755 (executable)
@@ -37,9 +37,7 @@
 #include "SALOME_NamingService.hxx"
 #include <qthread.h>
 
-using namespace std;
-
-void WaitForServerReadiness(string serverName);
+void WaitForServerReadiness(std::string serverName);
 
 
 class SESSION_EXPORT Session_ServerThread
index 92da744bc6199d5f110926b58b8e4afde38ba8bf..def398b6ccb1a560838aa06722286e4995244b22 100755 (executable)
 #include <OSD_LoadMode.hxx>
 #include <OSD_Function.hxx>
 
+#ifdef WNT
+# include <process.h>
+#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 {
index 58f5fdb3126b02665c6e9910147124672fb37964..64f031cfbd4a2eb344b1689e9e2c5f312f50bb0f 100755 (executable)
@@ -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);
index 2423736575e315d0d0e7caffd724b514954410ea..14b505a86a5e5669c660c270d36727d02e8ebb84 100755 (executable)
 # include <qpushbutton.h>
 # include <qspinbox.h>
 
-#ifndef WNT
-using namespace std;
-#endif
-
 class ToolsGUI_IntervalWindow : public QDialog
 {
   Q_OBJECT