From: abd Date: Thu, 17 Jul 2008 06:38:49 +0000 (+0000) Subject: Executable version on Windows Platform X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d341af5fa350b3173edb90a32375e51ca049fe94;p=modules%2Fgui.git Executable version on Windows Platform --- diff --git a/src/OCCViewer/OCCViewer_ViewPort.cxx b/src/OCCViewer/OCCViewer_ViewPort.cxx index 166a7bb34..d21fb39f3 100755 --- a/src/OCCViewer/OCCViewer_ViewPort.cxx +++ b/src/OCCViewer/OCCViewer_ViewPort.cxx @@ -34,11 +34,11 @@ #include #include #include -#include #include #if !defined WNT +#include #include #include #include diff --git a/src/PyConsole/PyConsole_Editor.cxx b/src/PyConsole/PyConsole_Editor.cxx index fea5d6804..af69ea1fb 100644 --- a/src/PyConsole/PyConsole_Editor.cxx +++ b/src/PyConsole/PyConsole_Editor.cxx @@ -138,7 +138,7 @@ public: PyConsole_Editor* theListener, bool sync = false ) : PyInterp_LockRequest( theInterp, theListener, sync ), - myCommand( theCommand ), myState( PyInterp_Event::OK ) + myCommand( theCommand ), myState( PyInterp_Event::ES_OK ) {} protected: @@ -152,9 +152,9 @@ protected: { int ret = getInterp()->run( myCommand.toLatin1() ); if ( ret < 0 ) - myState = PyInterp_Event::ERROR; + myState = PyInterp_Event::ES_ERROR; else if ( ret > 0 ) - myState = PyInterp_Event::INCOMPLETE; + myState = PyInterp_Event::ES_INCOMPLETE; } } @@ -906,8 +906,8 @@ void PyConsole_Editor::customEvent( QEvent* event ) addText( pe->text() ); return; } - case PyInterp_Event::OK: - case PyInterp_Event::ERROR: + case PyInterp_Event::ES_OK: + case PyInterp_Event::ES_ERROR: { // clear command buffer myCommandBuffer.truncate( 0 ); @@ -928,7 +928,7 @@ void PyConsole_Editor::customEvent( QEvent* event ) myEventLoop->exit(); break; } - case PyInterp_Event::INCOMPLETE: + case PyInterp_Event::ES_INCOMPLETE: { // extend command buffer (multi-line command) myCommandBuffer.append( "\n" ); @@ -958,7 +958,7 @@ void PyConsole_Editor::customEvent( QEvent* event ) // unset history browsing mode myCmdInHistory = -1; - if ( (int)event->type() == (int)PyInterp_Event::OK && myQueue.count() > 0 ) + if ( (int)event->type() == (int)PyInterp_Event::ES_OK && myQueue.count() > 0 ) { // process the next sheduled command from the queue (if there is any) QString nextcmd = myQueue[0]; diff --git a/src/PyInterp/PyInterp_Dispatcher.cxx b/src/PyInterp/PyInterp_Dispatcher.cxx index e3adb001d..052ccbf19 100755 --- a/src/PyInterp/PyInterp_Dispatcher.cxx +++ b/src/PyInterp/PyInterp_Dispatcher.cxx @@ -62,7 +62,7 @@ void PyInterp_Request::Destroy( PyInterp_Request* request ) QEvent* PyInterp_Request::createEvent() const { - return new PyInterp_Event( PyInterp_Event::NOTIFY, (PyInterp_Request*)this ); + return new PyInterp_Event( PyInterp_Event::ES_NOTIFY, (PyInterp_Request*)this ); } void PyInterp_Request::processEvent( QObject* o ) diff --git a/src/PyInterp/PyInterp_Dispatcher.h b/src/PyInterp/PyInterp_Dispatcher.h index cf46694e4..66cd2c0a2 100755 --- a/src/PyInterp/PyInterp_Dispatcher.h +++ b/src/PyInterp/PyInterp_Dispatcher.h @@ -102,7 +102,8 @@ class PYINTERP_EXPORT PyInterp_Event : public QEvent PyInterp_Event( const PyInterp_Event& ); public: - enum { NOTIFY = QEvent::User + 5000, OK, ERROR, INCOMPLETE, LAST }; + //Execution status + enum { ES_NOTIFY = QEvent::User + 5000, ES_OK, ES_ERROR, ES_INCOMPLETE, ES_LAST }; PyInterp_Event( int type, PyInterp_Request* request ) : QEvent( (QEvent::Type)type ), myRequest( request ) {} diff --git a/src/SVTK/SALOME_Actor.h b/src/SVTK/SALOME_Actor.h index db4e2e56e..4316ef3dc 100644 --- a/src/SVTK/SALOME_Actor.h +++ b/src/SVTK/SALOME_Actor.h @@ -54,8 +54,8 @@ 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 ) diff --git a/src/SVTK/SVTK_RenderWindowInteractor.cxx b/src/SVTK/SVTK_RenderWindowInteractor.cxx index 56236ad89..66287bf79 100644 --- a/src/SVTK/SVTK_RenderWindowInteractor.cxx +++ b/src/SVTK/SVTK_RenderWindowInteractor.cxx @@ -37,7 +37,9 @@ // QT Includes // Put Qt includes before the X11 includes which #define the symbol None // (see SVTK_SpaceMouse.h) to avoid the compilation error. -#include +#ifndef WIN32 +# include +#endif #include #include "SVTK_SpaceMouse.h" @@ -414,10 +416,10 @@ QVTK_RenderWindowInteractor /*! To handle native Win32 events (from such devices as SpaceMouse) */ -bool QVTK_RenderWindowInteractor::winEvent( MSG* msg ) +bool QVTK_RenderWindowInteractor::winEvent( MSG* msg, long* result ) { // TODO: Implement event handling for SpaceMouse - return QWidget::winEvent( msg ); + return QWidget::winEvent( msg, result); } #else diff --git a/src/SVTK/SVTK_RenderWindowInteractor.h b/src/SVTK/SVTK_RenderWindowInteractor.h index 51aa1ec59..ab5f9c182 100644 --- a/src/SVTK/SVTK_RenderWindowInteractor.h +++ b/src/SVTK/SVTK_RenderWindowInteractor.h @@ -122,7 +122,7 @@ class SVTK_EXPORT QVTK_RenderWindowInteractor: public QWidget //! To handle native events (from such devices as SpaceMouse) #ifdef WIN32 - virtual bool winEvent( MSG* ); + virtual bool winEvent( MSG*, long* ); #else virtual bool x11Event( XEvent *e ); #endif diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index 72a74fd3e..dc322b679 100755 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -64,6 +64,8 @@ #include #include +#include + /*! - 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/Session_Session_i.cxx b/src/Session/Session_Session_i.cxx index 88d2b3fad..089c223f0 100755 --- a/src/Session/Session_Session_i.cxx +++ b/src/Session/Session_Session_i.cxx @@ -34,11 +34,9 @@ #include "SALOME_Event.h" #include "SUIT_Session.h" -//#include "SUIT_Application.h" #include "SUIT_Desktop.h" #include "SUIT_Study.h" -//#include #include #include @@ -46,6 +44,11 @@ #include #include +#ifdef WNT +# include +#endif + + using namespace std; /*! @@ -203,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 efef52f60..fc7a1e56e 100755 --- a/src/Session/Session_Session_i.hxx +++ b/src/Session/Session_Session_i.hxx @@ -69,7 +69,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);