From: nds Date: Fri, 29 Aug 2008 10:47:17 +0000 (+0000) Subject: Win32 porting. X-Git-Tag: TG_mergeto_BR_V5_DEV_finished~29 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=204b01f35a2eb9e79daecbae56414f2a8fcbed47;p=modules%2Fgui.git Win32 porting. --- diff --git a/src/SUIT/SUIT.pro b/src/SUIT/SUIT.pro index 63f66e07a..61c6078e6 100644 --- a/src/SUIT/SUIT.pro +++ b/src/SUIT/SUIT.pro @@ -1,4 +1,7 @@ -TEMPLATE = lib +unix:TEMPLATE = lib +win32:TEMPLATE = vclib + +win32:QMAKE_MOC=$(QTDIR)\bin\moc.exe DESTDIR = ../../$(CONFIG_ID)/lib MOC_DIR = ../../moc @@ -6,11 +9,13 @@ OBJECTS_DIR = ../../$(CONFIG_ID)/obj/$$TARGET INCLUDEPATH = ../../include LIBS += -L../../$(CONFIG_ID)/lib -lQtx -lObjBrowser +win32:LIBS *= -L$(QTLIB) +win32:INCLUDEPATH *= $(QTINC) $(QTINC)\QtCore $(QTINC)\QtGui $(QTINC)\QtXml CONFIG -= debug release debug_and_release CONFIG += qt thread debug dll shared -win32:DEFINES += WIN32 +win32:DEFINES += WNT WIN32 DEFINES += SUIT_EXPORTS HEADERS = *.h @@ -25,7 +30,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} -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,8 +39,22 @@ 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 + ICONS = resources/*.png +win32:SOURCES+=$$ICONS +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/SUITApp/SUITApp.pro b/src/SUITApp/SUITApp.pro index 97654e140..e5edddab5 100644 --- a/src/SUITApp/SUITApp.pro +++ b/src/SUITApp/SUITApp.pro @@ -1,4 +1,9 @@ -TEMPLATE = app +unix:TEMPLATE = app +win32:TEMPLATE = vcapp + +CONFIG -= embed_manifest_exe + +win32:QMAKE_MOC=$(QTDIR)\bin\moc.exe DESTDIR = ../../$(CONFIG_ID)/bin MOC_DIR = ../../moc @@ -6,12 +11,20 @@ OBJECTS_DIR = ../../$(CONFIG_ID)/obj/$$TARGET INCLUDEPATH = ../../include LIBS += -L../../$(CONFIG_ID)/lib -lSUIT -lQtx -lStyle -lObjBrowser +win32:LIBS *= -L$(QTLIB) +win32:INCLUDEPATH *= $(QTINC) $(QTINC)\QtCore $(QTINC)\QtGui $(QTINC)\QtXml CONFIG -= debug release debug_and_release CONFIG += qt thread debug dll shared -win32:DEFINES += WIN32 +win32:DEFINES += WNT WIN32 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 diff --git a/src/SVTK/SVTK.pro b/src/SVTK/SVTK.pro index 1f68c9030..b51c7481e 100644 --- a/src/SVTK/SVTK.pro +++ b/src/SVTK/SVTK.pro @@ -1,22 +1,30 @@ -TEMPLATE = lib +unix:TEMPLATE = lib +win32:TEMPLATE = vclib + +win32:QMAKE_MOC=$(QTDIR)\bin\moc.exe DESTDIR = ../../$(CONFIG_ID)/lib MOC_DIR = ../../moc OBJECTS_DIR = ../../$(CONFIG_ID)/obj/$$TARGET -VTK_LIBS = -L$$(VTKLIB) -lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets -lGL -L/usr/X11R6/lib -lGLU -L/usr/X11R6/lib -lX11 -lXt +unix:VTK_LIBS = -L$$(VTKLIB) -lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets -lGL -L/usr/X11R6/lib -lGLU -L/usr/X11R6/lib -lX11 -lXt +win32:VTK_LIBS = -L$$(VTKLIB) -lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets -lopengl32 CAS_CPPFLAGS = $(CASINC) -OCC_LIBS = +unix:OCC_LIBS = +win32:OCC_LIBS = -L$(CASLIB) -lTKernel INCLUDEPATH += ../../include $${CAS_CPPFLAGS} $$(VTKINC) $$(BOOSTINC) ../Qtx ../SUIT ../OBJECT ../Prs ../VTKViewer LIBS += -L../../$(CONFIG_ID)/lib -lQtx -lSUIT -lOBJECT -lPrs -lVTKViewer $${OCC_LIBS} $${VTK_LIBS} +win32: LIBS += -lTKernel +win32:LIBS *= -L$(QTLIB) +win32:INCLUDEPATH *= $(QTINC) $(QTINC)\QtCore $(QTINC)\QtGui $(QTINC)\QtXml CONFIG -= debug release debug_and_release CONFIG += qt thread debug dll shared -win32:DEFINES += WIN32 +win32:DEFINES += WNT WIN32 DEFINES += SVTK_EXPORTS $(CASDEFINES) OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS HEADERS = SVTK.h @@ -91,7 +99,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} -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 @@ -100,6 +108,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 + ICONS = resources/*.png includes.files = $$HEADERS diff --git a/src/SVTK/SVTK_CubeAxesActor2D.cxx b/src/SVTK/SVTK_CubeAxesActor2D.cxx index 4f109801c..eb14e3379 100644 --- a/src/SVTK/SVTK_CubeAxesActor2D.cxx +++ b/src/SVTK/SVTK_CubeAxesActor2D.cxx @@ -208,7 +208,7 @@ static void ChangeValues(vtkFloatingPointType* aArray1, #ifndef WIN32 for(int i=0;i<2; i++){ #else - for(i=0;i<2; i++){ + for(int i=0;i<2; i++){ #endif tmp = aRange1[i]; aRange1[i] = aRange2[i]; aRange2[i] = tmp; } diff --git a/src/SVTK/SVTK_RenderWindowInteractor.cxx b/src/SVTK/SVTK_RenderWindowInteractor.cxx index 56236ad89..439837e68 100644 --- a/src/SVTK/SVTK_RenderWindowInteractor.cxx +++ b/src/SVTK/SVTK_RenderWindowInteractor.cxx @@ -37,7 +37,10 @@ // QT Includes // Put Qt includes before the X11 includes which #define the symbol None // (see SVTK_SpaceMouse.h) to avoid the compilation error. +#ifndef WIN32 #include +#endif + #include #include "SVTK_SpaceMouse.h" @@ -414,10 +417,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 @@ -435,7 +438,7 @@ QVTK_RenderWindowInteractor if ( aSpaceMouse->isSpaceMouseOn() && xEvent->type == ClientMessage ) { SVTK_SpaceMouse::MoveEvent anEvent; - int type = aSpaceMouse->translateEvent( QX11Info::display(), xEvent, &anEvent, 1.0, 1.0 ); + int type = aSpaceMouse->translateEvent( QX11Info::display(), xEvent, &anEvent, 1.0, 1.0 ); switch ( type ) { case SVTK_SpaceMouse::SpaceMouseMove: 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/Style/Style.pro b/src/Style/Style.pro index 87c7e2476..6464ee83e 100644 --- a/src/Style/Style.pro +++ b/src/Style/Style.pro @@ -1,22 +1,33 @@ -TEMPLATE = lib +unix:TEMPLATE = lib +win32:TEMPLATE = vclib + +win32:QMAKE_MOC=$(QTDIR)\bin\moc.exe DESTDIR = ../../$(CONFIG_ID)/lib MOC_DIR = ../../moc OBJECTS_DIR = ../../$(CONFIG_ID)/obj/$$TARGET INCLUDEPATH = ../../include -LIBS += -L ../../$(CONFIG_ID)/lib -lQtx +LIBS += -L../../$(CONFIG_ID)/lib -lQtx +win32:LIBS *= -L$(QTLIB) +win32:INCLUDEPATH *= $(QTINC) $(QTINC)\QtCore $(QTINC)\QtGui $(QTINC)\QtXml CONFIG -= debug release debug_and_release CONFIG += qt thread debug dll shared -win32:DEFINES += WIN32 +win32:DEFINES += WNT WIN32 DEFINES += STYLE_SALOME_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/TableViewer/TableViewer.pro b/src/TableViewer/TableViewer.pro index 8e9746fb2..8c0d63320 100644 --- a/src/TableViewer/TableViewer.pro +++ b/src/TableViewer/TableViewer.pro @@ -1,4 +1,7 @@ -TEMPLATE = lib +unix:TEMPLATE = lib +win32:TEMPLATE = vclib + +win32:QMAKE_MOC=$(QTDIR)\bin\moc.exe DESTDIR = ../../$(CONFIG_ID)/lib MOC_DIR = ../../moc @@ -8,13 +11,15 @@ CAS_CPPFLAGS = $(CASINC) CAS_KERNEL = -L$(CASLIB) -lTKernel INCLUDEPATH = ../../include $${CAS_CPPFLAGS} -LIBS += -L../../$(CONFIG_ID)/lib -lSUIT $${CAS_KERNEL} -lHTMLService +LIBS += -L../../$(CONFIG_ID)/lib -lQtx -lSUIT $${CAS_KERNEL} -lHTMLService +win32:LIBS *= -L$(QTLIB) +win32:INCLUDEPATH *= $(QTINC) $(QTINC)\QtCore $(QTINC)\QtGui $(QTINC)\QtXml CONFIG -= debug release debug_and_release CONFIG += qt thread debug dll shared -win32:DEFINES += WIN32 -DEFINES += TABLE_VIEWER_EXPORTS $(CASDEFINES) OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS +win32:DEFINES += WNT WIN32 +DEFINES += TABLEVIEWER_EXPORTS $(CASDEFINES) OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS HEADERS = *.h @@ -28,7 +33,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} -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 @@ -37,8 +42,22 @@ 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 + ICONS = resources/*.png +win32:Resource=$$ICONS +win32:SOURCES+=$$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/TableViewer/TableViewer_ViewWindow.cxx b/src/TableViewer/TableViewer_ViewWindow.cxx index ee9b442fc..9e9305ed1 100755 --- a/src/TableViewer/TableViewer_ViewWindow.cxx +++ b/src/TableViewer/TableViewer_ViewWindow.cxx @@ -329,7 +329,7 @@ void TableViewer_ViewWindow::selectionChanged() { bool anEnable = myTable->getSelectedIndexes().count() > 0; myActionsMap[CopyId]->setEnabled( anEnable ); - myActionsMap[PasteId]->setEnabled( anEnable & myCopyLst.count() > 0 ); + myActionsMap[PasteId]->setEnabled( anEnable && myCopyLst.count() > 0 ); } void TableViewer_ViewWindow::onActivated() diff --git a/src/VTKViewer/VTKViewer.pro b/src/VTKViewer/VTKViewer.pro index 04b2493c7..1a8b2bab8 100644 --- a/src/VTKViewer/VTKViewer.pro +++ b/src/VTKViewer/VTKViewer.pro @@ -1,10 +1,14 @@ -TEMPLATE = lib +unix:TEMPLATE = lib +win32:TEMPLATE = vclib + +win32:QMAKE_MOC=$(QTDIR)\bin\moc.exe DESTDIR = ../../$(CONFIG_ID)/lib MOC_DIR = ../../moc OBJECTS_DIR = ../../$(CONFIG_ID)/obj/$$TARGET -VTK_LIBS = -L$$(VTKLIB) -lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets -lGL -L/usr/X11R6/lib -lGLU -L/usr/X11R6/lib -lX11 -lXt +unix:VTK_LIBS = -L$$(VTKLIB) -lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets -lGL -L/usr/X11R6/lib -lGLU -L/usr/X11R6/lib -lX11 -lXt +win32:VTK_LIBS = -L$$(VTKLIB) -lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets CAS_CPPFLAGS = $(CASINC) @@ -12,11 +16,13 @@ CAS_KERNEL = -L$(CASLIB) -lTKernel INCLUDEPATH += ../../include $$(VTKINC) $${CAS_CPPFLAGS} ../Qtx ../SUIT LIBS += -L../../$(CONFIG_ID)/lib -lQtx -lSUIT $${VTK_LIBS} $${CAS_KERNEL} +win32:LIBS *= -L$(QTLIB) +win32:INCLUDEPATH *= $(QTINC) $(QTINC)\QtCore $(QTINC)\QtGui $(QTINC)\QtXml CONFIG -= debug release debug_and_release CONFIG += qt thread debug dll shared -win32:DEFINES += WIN32 +win32:DEFINES += WNT WIN32 DEFINES += VTKVIEWER_EXPORTS $(CASDEFINES) OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS HEADERS = VTKViewer.h @@ -60,7 +66,7 @@ SOURCES += VTKViewer_ViewModel.cxx SOURCES += VTKViewer_ConvexTool.cxx SOURCES += VTKViewer_ViewWindow.cxx -message ( "Sources: $$SOURCES " ) +unix:message ( "Sources: $$SOURCES " ) TRANSLATIONS = resources/VTKViewer_images.ts \ resources/VTKViewer_msg_en.ts @@ -70,7 +76,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} -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 @@ -79,8 +85,22 @@ 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 + ICONS = resources/*.png +win32:SOURCES+=$$ICONS +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