From: nds Date: Wed, 28 May 2008 08:13:37 +0000 (+0000) Subject: Porting to win32 system. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5e2ca8065a7794c086e52af0bb4b9dcabda9c623;p=modules%2Fgui.git Porting to win32 system. --- diff --git a/src/Plot2d/Plot2d.pro b/src/Plot2d/Plot2d.pro index 9a06a130f..df3ea535a 100644 --- a/src/Plot2d/Plot2d.pro +++ b/src/Plot2d/Plot2d.pro @@ -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 diff --git a/src/Plot2d/Plot2d_Object.h b/src/Plot2d/Plot2d_Object.h index 3db5b1b91..da2ea362d 100755 --- a/src/Plot2d/Plot2d_Object.h +++ b/src/Plot2d/Plot2d_Object.h @@ -28,12 +28,12 @@ #include #include -typedef struct +struct PLOT2D_EXPORT Plot2d_Point { double x; double y; QString text; -} Plot2d_Point; +}; typedef QList pointList; diff --git a/src/Plot2d/Plot2d_ViewFrame.h b/src/Plot2d/Plot2d_ViewFrame.h index 2637a16ab..ced090ea8 100755 --- a/src/Plot2d/Plot2d_ViewFrame.h +++ b/src/Plot2d/Plot2d_ViewFrame.h @@ -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 ); diff --git a/src/Prs/Prs.pro b/src/Prs/Prs.pro index 06b145539..e853290cb 100644 --- a/src/Prs/Prs.pro +++ b/src/Prs/Prs.pro @@ -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 diff --git a/src/PyConsole/PyConsole.pro b/src/PyConsole/PyConsole.pro index a4fd5061b..f71cae698 100644 --- a/src/PyConsole/PyConsole.pro +++ b/src/PyConsole/PyConsole.pro @@ -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 diff --git a/src/PyConsole/PyConsole_Editor.cxx b/src/PyConsole/PyConsole_Editor.cxx index 23268097e..f85a5f444 100644 --- a/src/PyConsole/PyConsole_Editor.cxx +++ b/src/PyConsole/PyConsole_Editor.cxx @@ -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( event ); if ( pe ) diff --git a/src/PyInterp/PyInterp.h b/src/PyInterp/PyInterp.h index 86772a124..51f699f6b 100755 --- a/src/PyInterp/PyInterp.h +++ b/src/PyInterp/PyInterp.h @@ -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 diff --git a/src/PyInterp/PyInterp.pro b/src/PyInterp/PyInterp.pro index 8ee7c1f25..d6949e05a 100644 --- a/src/PyInterp/PyInterp.pro +++ b/src/PyInterp/PyInterp.pro @@ -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 diff --git a/src/PyInterp/PyInterp_Dispatcher.h b/src/PyInterp/PyInterp_Dispatcher.h index 6f6240794..4fec5b746 100755 --- a/src/PyInterp/PyInterp_Dispatcher.h +++ b/src/PyInterp/PyInterp_Dispatcher.h @@ -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 ) {} diff --git a/src/Qtx/Qtx.pro b/src/Qtx/Qtx.pro index 2d1eaeee6..f676fff3f 100644 --- a/src/Qtx/Qtx.pro +++ b/src/Qtx/Qtx.pro @@ -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