]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Porting to win32 system.
authornds <nds@opencascade.com>
Wed, 28 May 2008 08:13:37 +0000 (08:13 +0000)
committernds <nds@opencascade.com>
Wed, 28 May 2008 08:13:37 +0000 (08:13 +0000)
src/Plot2d/Plot2d.pro
src/Plot2d/Plot2d_Object.h
src/Plot2d/Plot2d_ViewFrame.h
src/Prs/Prs.pro
src/PyConsole/PyConsole.pro
src/PyConsole/PyConsole_Editor.cxx
src/PyInterp/PyInterp.h
src/PyInterp/PyInterp.pro
src/PyInterp/PyInterp_Dispatcher.h
src/Qtx/Qtx.pro

index 9a06a130f1fefc409ef620efef077ec59fa26cdf..df3ea535afd664b89d6f3107e71dbca93438e868 100644 (file)
@@ -1,4 +1,5 @@
-TEMPLATE = lib
+unix:TEMPLATE = lib
+win32:TEMPLATE = vclib
 
 DESTDIR = ../../$(CONFIG_ID)/lib
 MOC_DIR = ../../moc
@@ -7,13 +8,13 @@ OBJECTS_DIR = ../../$(CONFIG_ID)/obj/$$TARGET
 INCLUDEPATH += ../../include $$(QWTINC) $$(PYTHONINC)
 INCLUDEPATH += ../Qtx ../SUIT
 unix:LIBS  += -L$$(QWTLIB) -lqwt
-win32:LIBS += /LIBPATH:$$(QWTLIB)
+win32:LIBS += /LIBPATH:$$(QWTLIB) -lqwt5
 LIBS += -L../../$(CONFIG_ID)/lib -lQtx -lSUIT
 
 CONFIG -= debug release debug_and_release
 CONFIG += qt thread debug dll shared
 
-win32:DEFINES += WIN32
+win32:DEFINES += WNT WIN32 QWT_DLL
 DEFINES += PLOT2D_EXPORTS
 
 HEADERS  = *.h
@@ -26,9 +27,15 @@ TRANSLATIONS = resources/Plot2d_msg_en.ts \
 unix:GUIResources = ../../resources
 win32:GUIResources = ..\\..\\resources
 
+win32:copy_hdr.name = Install headers ${QMAKE_FILE_IN}
+win32:copy_hdr.commands = type ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT}
+win32:copy_hdr.output = ../../include/${QMAKE_FILE_BASE}.h
+win32:copy_hdr.input = HEADERS
+win32:QMAKE_EXTRA_COMPILERS += copy_hdr
+
 lrelease.name = LRELASE ${QMAKE_FILE_IN}
-unix:lrelease.commands = $(QTDIR)/bin/lrelease ${QMAKE_FILE_NAME} -qm $${GUIResources}/${QMAKE_FILE_BASE}.qm
-win32:lrelease.commands = $(QTDIR)\\bin\\lrelease ${QMAKE_FILE_NAME} -qm $${GUIResources}\\${QMAKE_FILE_BASE}.qm
+unix:lrelease.commands = $(QTDIR)/bin/lrelease ${QMAKE_FILE_NAME} -qm ${QMAKE_FILE_OUT}
+win32:lrelease.commands = $(QTDIR)\\bin\\lrelease ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT}
 unix:lrelease.output = $${GUIResources}/${QMAKE_FILE_BASE}.qm
 win32:lrelease.output = $${GUIResources}\\${QMAKE_FILE_BASE}.qm
 lrelease.input = TRANSLATIONS
@@ -39,6 +46,13 @@ QMAKE_EXTRA_COMPILERS += lrelease
 
 ICONS = resources/*.png
 
+win32:Resource=$$ICONS
+win32:copy_res.name = Install resources ${QMAKE_FILE_IN}
+win32:copy_res.commands = type ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT}
+win32:copy_res.output = $${GUIResources}\\${QMAKE_FILE_BASE}.png
+win32:copy_res.input = Resource
+win32:QMAKE_EXTRA_COMPILERS += copy_res
+
 includes.files = $$HEADERS
 includes.path = ../../include
 
index 3db5b1b915f518c9e5efd0ce836a18f3d87c4224..da2ea362d227fa4569393dade761f9115e7b4548 100755 (executable)
 #include <QList>
 #include <qwt_plot.h>
 
-typedef struct
+struct PLOT2D_EXPORT Plot2d_Point
 {
   double x;
   double y;
   QString text;
-} Plot2d_Point;
+};
 
 typedef QList<Plot2d_Point> pointList;
 
index 2637a16ab4980208bd2184d39eda672795dbc2cf..ced090ea868eec15e1699a767c0cedf4663588ab 100755 (executable)
@@ -225,6 +225,7 @@ class Plot2d_Plot2d : public QwtPlot
   Q_OBJECT
 public:
   Plot2d_Plot2d( QWidget* parent );
+  virtual ~Plot2d_Plot2d() {};
 
   void       setLogScale( int axisId, bool log10 );
 
index 06b1455390ea28863d323aa1ffccaeff1f335413..e853290cb59be96b3317f1d22dc7656ae2435ff5 100644 (file)
@@ -1,4 +1,5 @@
-TEMPLATE = lib
+unix:TEMPLATE = lib
+win32:TEMPLATE = vclib
 
 DESTDIR = ../../$(CONFIG_ID)/lib
 MOC_DIR = ../../moc
@@ -7,13 +8,19 @@ OBJECTS_DIR = ../../$(CONFIG_ID)/obj/$$TARGET
 CONFIG -= debug release debug_and_release
 CONFIG += qt thread debug dll shared
 
-win32:DEFINES += WIN32
+win32:DEFINES += WNT WIN32
 DEFINES += PRS_EXPORTS
 
 HEADERS  = *.h
 
 SOURCES  = *.cxx
 
+win32:copy_hdr.name = Install ${QMAKE_FILE_IN}
+win32:copy_hdr.commands = type ${QMAKE_FILE_IN} > ../../include/${QMAKE_FILE_BASE}.h
+win32:copy_hdr.output = ../../include/${QMAKE_FILE_BASE}.h
+win32:copy_hdr.input = HEADERS
+win32:QMAKE_EXTRA_COMPILERS += copy_hdr
+
 includes.files = $$HEADERS
 includes.path = ../../include
 
index a4fd5061b3a257fb23bf2cb20acdf317ea5b0d6b..f71cae6985e3349f7ad4df6d4c588540b3646f99 100644 (file)
@@ -1,4 +1,5 @@
-TEMPLATE = lib
+unix:TEMPLATE = lib
+win32:TEMPLATE = vclib
 
 DESTDIR = ../../$(CONFIG_ID)/lib
 MOC_DIR = ../../moc
@@ -6,12 +7,12 @@ OBJECTS_DIR = ../../$(CONFIG_ID)/obj/$$TARGET
 
 INCLUDEPATH += ../../include $$(PYTHONINC)
 unix:LIBS  += -L../../$(CONFIG_ID)/lib -L$$(PYTHONLIB) -lpython2.5 -lSUIT -lPyInterp
-win32:LIBS += /LIBPATH:$$(PYTHONLIB) ../../lib/pyinterp.lib ../../lib/suit.lib
+win32:LIBS  += -L../../$(CONFIG_ID)/lib -L$$(PYTHONLIB) -lpython25_d -lSUIT -lPyInterp
 
 CONFIG -= debug release debug_and_release
 CONFIG += qt thread debug dll shared
 
-win32:DEFINES += WIN32
+win32:DEFINES += WNT WIN32
 DEFINES += PYCONSOLE_EXPORTS
 
 HEADERS = *.h
@@ -25,7 +26,7 @@ win32:GUIResources = ..\\..\\resources
 
 lrelease.name = LRELASE ${QMAKE_FILE_IN}
 unix:lrelease.commands = $(QTDIR)/bin/lrelease ${QMAKE_FILE_NAME} -qm $${GUIResources}/${QMAKE_FILE_BASE}.qm
-win32:lrelease.commands = $(QTDIR)\\bin\\lrelease ${QMAKE_FILE_NAME} -qm $${GUIResources}\\${QMAKE_FILE_BASE}.qm
+win32:lrelease.commands = $(QTDIR)\\bin\\lrelease ${QMAKE_FILE_IN} ${QMAKE_FILE_NAME} -qm $${GUIResources}\\${QMAKE_FILE_BASE}.qm
 unix:lrelease.output = $${GUIResources}/${QMAKE_FILE_BASE}.qm
 win32:lrelease.output = $${GUIResources}\\${QMAKE_FILE_BASE}.qm
 lrelease.input = TRANSLATIONS
@@ -34,6 +35,12 @@ win32:lrelease.clean = $${GUIResources}\\${QMAKE_FILE_BASE}.qm
 lrelease.CONFIG += no_link target_predeps
 QMAKE_EXTRA_COMPILERS += lrelease
 
+win32:copy_hdr.name = Install ${QMAKE_FILE_IN}
+win32:copy_hdr.commands = type ${QMAKE_FILE_IN} > ../../include/${QMAKE_FILE_BASE}.h
+win32:copy_hdr.output = ../../include/${QMAKE_FILE_BASE}.h
+win32:copy_hdr.input = HEADERS
+win32:QMAKE_EXTRA_COMPILERS += copy_hdr
+
 includes.files = $$HEADERS
 includes.path = ../../include
 
index 23268097ea5860b5ca0f44fef5ef7f1e7c455865..f85a5f4449a4abdb49100c6039e67d4c2043e7ea 100644 (file)
@@ -150,8 +150,14 @@ protected:
 //      SUIT_Session::SetPythonExecuted( true ); // disable GUI user actions
       int ret = getInterp()->run( myCommand.toLatin1() );
 //      SUIT_Session::SetPythonExecuted(false); // enable GUI user actions
-      if ( ret < 0 )
-             myState = PyInterp_Event::ERROR;
+         if ( ret < 0 ) {
+        myState = 
+#ifdef WIN32
+        PyInterp_Event::EV_ERROR;
+#else
+        PyInterp_Event::ERROR;
+#endif
+         }
       else if ( ret > 0 )
              myState = PyInterp_Event::INCOMPLETE;
       myError  = getInterp()->getverr().c_str();
@@ -851,8 +857,11 @@ void PyConsole_Editor::customEvent( QEvent* event )
 {
   switch( event->type() )
   {
-  case PyInterp_Event::OK:
+#ifdef WIN32
+  case PyInterp_Event::EV_ERROR:
+#else
   case PyInterp_Event::ERROR:
+#endif
   {
     PyInterp_Event* pe = dynamic_cast<PyInterp_Event*>( event );
     if ( pe )
index 86772a12415394961be117a6497dca4ad45ba100..51f699f6ba76a569fa925b1cf417115a6b118153 100755 (executable)
@@ -37,6 +37,7 @@
 
 // ========================================================
 // little trick - we do not have debug python libraries
+#ifndef WIN32
 #ifdef _DEBUG
 
 #undef _DEBUG
@@ -49,6 +50,7 @@
 
 #endif // _DEBUG
 
+#endif  // WIN32
 // ========================================================
 // avoid warning messages
 #ifdef WIN32
index 8ee7c1f25e8663d5475642ee2889e2aabc0c1be5..d6949e05a9833f6f3b1919e5d230d06145f21223 100644 (file)
@@ -1,4 +1,5 @@
-TEMPLATE = lib
+unix:TEMPLATE = lib
+win32:TEMPLATE = vclib
 
 DESTDIR = ../../$(CONFIG_ID)/lib
 MOC_DIR = ../../moc
@@ -6,18 +7,24 @@ OBJECTS_DIR = ../../$(CONFIG_ID)/obj/$$TARGET
 
 INCLUDEPATH += ../../include $$(PYTHONINC)
 unix:LIBS  += -L$$(PYTHONLIB) -lpython2.5
-win32:LIBS += /LIBPATH:$$(PYTHONLIB)
+win32:LIBS  += -L$$(PYTHONLIB) -lpython25_d
 
 CONFIG -= debug release debug_and_release
 CONFIG += qt thread debug dll shared
 
-win32:DEFINES += WIN32
+win32:DEFINES += WNT WIN32
 DEFINES += PYINTERP_EXPORTS
 
 HEADERS = *.h
 
 SOURCES = *.cxx
 
+win32:copy_hdr.name = Install ${QMAKE_FILE_IN}
+win32:copy_hdr.commands = type ${QMAKE_FILE_IN} > ../../include/${QMAKE_FILE_BASE}.h
+win32:copy_hdr.output = ../../include/${QMAKE_FILE_BASE}.h
+win32:copy_hdr.input = HEADERS
+win32:QMAKE_EXTRA_COMPILERS += copy_hdr
+
 includes.files = $$HEADERS
 includes.path = ../../include
 
index 6f6240794dc8e66fdc8bfc3eb3ec270eac37af68..4fec5b746ac23547e42495f3b22eb9e334fa19af 100755 (executable)
@@ -105,7 +105,13 @@ class PYINTERP_EXPORT PyInterp_Event : public QEvent
   PyInterp_Event( const PyInterp_Event& );
 
 public:
-  enum { NOTIFY = QEvent::User + 5000, OK, ERROR, INCOMPLETE, LAST };
+  enum { NOTIFY = QEvent::User + 5000, OK,
+#ifdef WIN32
+         EV_ERROR,
+#else
+         ERROR,
+#endif
+         INCOMPLETE, LAST };
 
   PyInterp_Event( int type, PyInterp_Request* request )
     : QEvent( (QEvent::Type)type ), myRequest( request ) {}
index 2d1eaeee6def78046834d908f63d6ef28a0ff91a..f676fff3fba931b63ca9de74be13bde59473bfec 100644 (file)
@@ -1,4 +1,7 @@
-TEMPLATE = lib
+win32:TEMPLATE = vclib
+unix:TEMPLATE = lib
+
+CONFIG += embed_manifest_exe
 
 DESTDIR = ../../$(CONFIG_ID)/lib
 MOC_DIR = ../../moc
@@ -8,13 +11,19 @@ QT += xml
 CONFIG -= debug release debug_and_release
 CONFIG += qt thread debug dll shared
 
-win32:DEFINES += WIN32
+win32:DEFINES += WNT WIN32
 DEFINES += QTX_EXPORTS
 
 HEADERS     = *.h
 
 SOURCES     = *.cxx
 
+win32:copy_hdr.name = Install ${QMAKE_FILE_IN}
+win32:copy_hdr.commands = type ${QMAKE_FILE_IN} > ../../include/${QMAKE_FILE_BASE}.h
+win32:copy_hdr.output = ../../include/${QMAKE_FILE_BASE}.h
+win32:copy_hdr.input = HEADERS
+win32:QMAKE_EXTRA_COMPILERS += copy_hdr
+
 includes.files = $$HEADERS
 includes.path = ../../include