From 79c2eda1036d9bd398f65f1c22a9fafc83435fae Mon Sep 17 00:00:00 2001 From: rnv Date: Wed, 29 Aug 2018 14:23:41 +0300 Subject: [PATCH] SALOME 9.1.0 Windows version --- src/CAM/CAM_Application.cxx | 26 +++++++++++--- src/CAM/CAM_Module.cxx | 4 ++- src/CASCatch/CASCatch_CatchSignals.cxx | 2 +- src/GLViewer/GLViewer_BaseObjects.cxx | 9 +++-- src/GLViewer/GLViewer_Viewer2d.cxx | 11 +++++- src/LightApp/LightApp_OCCSelector.h | 2 +- src/LightApp/LightApp_SelectionMgr.h | 4 +-- src/OCCViewer/OCCViewer_ClippingDlg.cxx | 4 +-- src/OpenGLUtils/OpenGLUtils_FrameBuffer.cxx | 3 +- .../ServiceLoader/CMakeLists.txt | 8 ++++- src/Qtx/Qtx.cxx | 4 +++ src/Qtx/QtxNotify.h | 4 ++- src/SALOME_SWIG/CMakeLists.txt | 8 ++++- src/SUIT/SUIT_LicenseDlg.cxx | 9 +++-- src/SUIT/SUIT_Session.cxx | 4 +++ src/SUITApp/SUITApp.cxx | 11 ++++-- src/VTKViewer/VTKViewer_OpenGLHelper.cxx | 22 ++++++++---- src/VTKViewer/VTKViewer_OpenGLHelper.h | 35 ++++++++++++++++-- src/VTKViewer/VTKViewer_PolyDataMapper.cxx | 6 ++-- tools/RemoteFileBrowser/CMakeLists.txt | 13 +++---- tools/RemoteFileBrowser/QMachineBrowser.cxx | 4 +-- .../{QMachineBrowser => QMachineBrowser.h} | 8 +++-- tools/RemoteFileBrowser/QRemoteCopyWidget.cxx | 5 +-- ...{QRemoteCopyWidget => QRemoteCopyWidget.h} | 12 ++++--- .../RemoteFileBrowser/QRemoteFileBrowser.cxx | 6 ++-- ...RemoteFileBrowser => QRemoteFileBrowser.h} | 36 ++++++++++--------- tools/RemoteFileBrowser/RemoteFileBrowser.h | 36 +++++++++++++++++++ tools/RemoteFileBrowser/remotefilebrowser.cxx | 2 +- 28 files changed, 224 insertions(+), 74 deletions(-) rename tools/RemoteFileBrowser/{QMachineBrowser => QMachineBrowser.h} (88%) rename tools/RemoteFileBrowser/{QRemoteCopyWidget => QRemoteCopyWidget.h} (90%) rename tools/RemoteFileBrowser/{QRemoteFileBrowser => QRemoteFileBrowser.h} (87%) create mode 100644 tools/RemoteFileBrowser/RemoteFileBrowser.h diff --git a/src/CAM/CAM_Application.cxx b/src/CAM/CAM_Application.cxx index 7721f9f62..00da56461 100755 --- a/src/CAM/CAM_Application.cxx +++ b/src/CAM/CAM_Application.cxx @@ -320,13 +320,25 @@ CAM_Module* CAM_Application::loadModule( const QString& modName, const bool show GET_VERSION_FUNC getVersion = 0; #ifdef WIN32 - HINSTANCE modLib = ::LoadLibrary( libName.toUtf8() ); + +#ifdef UNICODE + LPTSTR str_libname = new TCHAR[libName.length() + 1]; + str_libname[libName.toWCharArray(str_libname)] = '\0'; +#else + LPTSTR str_libname = libName.toLatin1().constData(); +#endif + HINSTANCE modLib = ::LoadLibrary( str_libname ); if ( !modLib ) { LPVOID lpMsgBuf; ::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 0, ::GetLastError(), 0, (LPTSTR)&lpMsgBuf, 0, 0 ); - err = QString( "Failed to load %1. %2" ).arg( libName ).arg( (LPTSTR)lpMsgBuf ); +#ifdef UNICODE + QString out_err = QString::fromWCharArray((LPTSTR)lpMsgBuf); +#else + QString out_err = (LPTSTR)lpMsgBuf; +#endif + err = QString( "Failed to load %1. %2" ).arg( libName ).arg(out_err); ::LocalFree( lpMsgBuf ); } else @@ -337,8 +349,14 @@ CAM_Module* CAM_Application::loadModule( const QString& modName, const bool show LPVOID lpMsgBuf; ::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 0, ::GetLastError(), 0, (LPTSTR)&lpMsgBuf, 0, 0 ); - err = QString( "Failed to find %1 function. %2" ).arg( GET_MODULE_NAME ).arg( (LPTSTR)lpMsgBuf ); - ::LocalFree( lpMsgBuf ); +#ifdef UNICODE + QString out_err = QString::fromWCharArray((LPTSTR)lpMsgBuf); +#else + QString out_err = (LPTSTR)lpMsgBuf; +#endif + + err = QString( "Failed to find %1 function. %2" ).arg( GET_MODULE_NAME ).arg( out_err ); + ::LocalFree( lpMsgBuf ); } getVersion = (GET_VERSION_FUNC)::GetProcAddress( modLib, GET_VERSION_NAME ); diff --git a/src/CAM/CAM_Module.cxx b/src/CAM/CAM_Module.cxx index a5bcaf714..fd814543e 100755 --- a/src/CAM/CAM_Module.cxx +++ b/src/CAM/CAM_Module.cxx @@ -338,8 +338,10 @@ void CAM_Module::putInfo( const QString& msg, const int msec ) */ int CAM_Module::showNotification( const QString& message, const QString& title, int timeout ) { + int res = -1; if ( application() ) - application()->showNotification( message, title, timeout ); + res = application()->showNotification( message, title, timeout ); + return res; } /*! diff --git a/src/CASCatch/CASCatch_CatchSignals.cxx b/src/CASCatch/CASCatch_CatchSignals.cxx index 9ece89eef..5cb436f7f 100644 --- a/src/CASCatch/CASCatch_CatchSignals.cxx +++ b/src/CASCatch/CASCatch_CatchSignals.cxx @@ -201,7 +201,7 @@ void CASCatch_CatchSignals::Deactivate() #else //====================================== WIN32 part ==================================================== -#include +#include #include #include diff --git a/src/GLViewer/GLViewer_BaseObjects.cxx b/src/GLViewer/GLViewer_BaseObjects.cxx index cf12ae7ba..6e65422f2 100644 --- a/src/GLViewer/GLViewer_BaseObjects.cxx +++ b/src/GLViewer/GLViewer_BaseObjects.cxx @@ -1465,8 +1465,13 @@ bool GLViewer_TextObject::translateToEMF( HDC dc, GLViewer_CoordSystem* aViewerC HGDIOBJ old1 = SelectObject( dc, aFont ); HGDIOBJ old2 = SelectObject( dc, aBrush ); - - TextOut( dc, x, y, aText.toLatin1().constData(), aText.length() ); +#ifdef UNICODE + LPTSTR str = new TCHAR[aText.length() + 1]; + str[aText.toWCharArray(str)] = '\0'; +#else + LPTSTR str = aText.toLatin1().constData(); +#endif + TextOut( dc, x, y, str, aText.length() ); SelectObject ( dc, old1 ); SelectObject ( dc, old2 ); diff --git a/src/GLViewer/GLViewer_Viewer2d.cxx b/src/GLViewer/GLViewer_Viewer2d.cxx index e79b9f3a5..b11c4d710 100644 --- a/src/GLViewer/GLViewer_Viewer2d.cxx +++ b/src/GLViewer/GLViewer_Viewer2d.cxx @@ -793,7 +793,16 @@ bool GLViewer_Viewer2d::translateTo( VectorFileType aType, QString FileName, Pap HDC screen_dc = GetDC( 0 ); //The screen device context HDC bitDC = CreateCompatibleDC ( screen_dc ); //The context compatible with screen - hMetaFileDC = CreateEnhMetaFile( bitDC, FileName.toUtf8().data(), &r, "" ); +#ifdef UNICODE + LPTSTR str = new TCHAR[FileName.length() + 1]; + str[FileName.toWCharArray(str)] = '\0'; + LPTSTR empty = L""; +#else + LPTSTR str = FileName.toLatin1().constData(); + LPTSTR empty = ""; +#endif + + hMetaFileDC = CreateEnhMetaFile( bitDC, str, &r, empty ); SetMapMode( hMetaFileDC, MM_HIMETRIC ); SetWindowOrgEx( hMetaFileDC, 0, r.bottom, NULL ); HRGN ClipRgn = CreateRectRgn( 0, 0, AW, AH ); diff --git a/src/LightApp/LightApp_OCCSelector.h b/src/LightApp/LightApp_OCCSelector.h index 06026d2ad..d11d3978c 100644 --- a/src/LightApp/LightApp_OCCSelector.h +++ b/src/LightApp/LightApp_OCCSelector.h @@ -67,7 +67,7 @@ protected: virtual void setSelection( const SUIT_DataOwnerPtrList& ); #ifndef DISABLE_OCCVIEWER - virtual QString entry( const Handle_AIS_InteractiveObject& ) const; + virtual QString entry( const Handle(AIS_InteractiveObject)& ) const; #endif SUIT_DataOwnerPtrList mySelectedExternals; diff --git a/src/LightApp/LightApp_SelectionMgr.h b/src/LightApp/LightApp_SelectionMgr.h index 1bf69dc32..ec10c2a3f 100644 --- a/src/LightApp/LightApp_SelectionMgr.h +++ b/src/LightApp/LightApp_SelectionMgr.h @@ -100,7 +100,7 @@ private: virtual void selectionChanged( SUIT_Selector* ); #ifndef DISABLE_SALOMEOBJECT - QList selectionCache( const QString& = QString() ) const; + QList selectionCache( const QString& = QString() ) const; #else QStringList selectionCache( const QString& = QString() ) const; #endif @@ -110,7 +110,7 @@ private: private: #ifndef DISABLE_SALOMEOBJECT - typedef Handle_SALOME_InteractiveObject SelObject; + typedef Handle(SALOME_InteractiveObject) SelObject; #else typedef QString SelObject; #endif diff --git a/src/OCCViewer/OCCViewer_ClippingDlg.cxx b/src/OCCViewer/OCCViewer_ClippingDlg.cxx index 59ea3461e..3d33406df 100644 --- a/src/OCCViewer/OCCViewer_ClippingDlg.cxx +++ b/src/OCCViewer/OCCViewer_ClippingDlg.cxx @@ -1441,7 +1441,7 @@ void OCCViewer_ClippingDlg::onApply() /*! SLOT: Called when clip plane is clicked in viewer. */ -void OCCViewer_ClippingDlg::onPlaneClicked( const Handle(AIS_Plane)& thePlane ) +void OCCViewer_ClippingDlg::onPlaneClicked( const Handle_AIS_Plane& thePlane ) { for ( int aPlaneIt = 0; aPlaneIt < myPreviewPlaneVector.size(); aPlaneIt++ ) { @@ -1460,7 +1460,7 @@ void OCCViewer_ClippingDlg::onPlaneClicked( const Handle(AIS_Plane)& thePlane ) /*! SLOT: Called when clip plane is changed by dragging in viewer. */ -void OCCViewer_ClippingDlg::onPlaneDragged( const Handle(AIS_Plane)& thePlane ) +void OCCViewer_ClippingDlg::onPlaneDragged( const Handle_AIS_Plane& thePlane ) { for ( int aPlaneIt = 0; aPlaneIt < myPreviewPlaneVector.size(); aPlaneIt++ ) { diff --git a/src/OpenGLUtils/OpenGLUtils_FrameBuffer.cxx b/src/OpenGLUtils/OpenGLUtils_FrameBuffer.cxx index 891ae6511..700cafea8 100755 --- a/src/OpenGLUtils/OpenGLUtils_FrameBuffer.cxx +++ b/src/OpenGLUtils/OpenGLUtils_FrameBuffer.cxx @@ -24,6 +24,7 @@ #define GL_GLEXT_PROTOTYPES #endif + #include "OpenGLUtils_FrameBuffer.h" #include @@ -152,7 +153,7 @@ OpenGLUtils_FrameBuffer::~OpenGLUtils_FrameBuffer() bool OpenGLUtils_FrameBuffer::init( const GLsizei& xSize, const GLsizei& ySize ) { -#ifdef VTK_OPENGL2 +#if defined(VTK_OPENGL2) && ! defined(WIN32) int n = 0; std::ostringstream strm; glGetIntegerv(GL_NUM_EXTENSIONS, &n); diff --git a/src/PVServerService/ServiceLoader/CMakeLists.txt b/src/PVServerService/ServiceLoader/CMakeLists.txt index 7e5c65ece..d0b94d01d 100644 --- a/src/PVServerService/ServiceLoader/CMakeLists.txt +++ b/src/PVServerService/ServiceLoader/CMakeLists.txt @@ -59,7 +59,13 @@ INSTALL(TARGETS PVServerServiceLoader EXPORT ${PROJECT_NAME}TargetGroup DESTINAT # --- SWIG part --- SET_SOURCE_FILES_PROPERTIES(${_SWIG} PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(${_SWIG} PROPERTIES SWIG_FLAGS "-py3") -SWIG_ADD_MODULE(PVServer_ServiceLoader python ${_SWIG}) +IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") + SWIG_ADD_MODULE(PVServer_ServiceLoader python ${_SWIG}) +ELSE() + SWIG_ADD_LIBRARY(PVServer_ServiceLoader LANGUAGE python SOURCES ${_SWIG}) +ENDIF() + + IF(WIN32) SET_TARGET_PROPERTIES(_PVServer_ServiceLoader PROPERTIES DEBUG_OUTPUT_NAME _PVServer_ServiceLoader_d) ENDIF(WIN32) diff --git a/src/Qtx/Qtx.cxx b/src/Qtx/Qtx.cxx index 672fa3f8e..e976086b1 100755 --- a/src/Qtx/Qtx.cxx +++ b/src/Qtx/Qtx.cxx @@ -2225,7 +2225,11 @@ void Qtx::initDefaultSurfaceFormat() fmt.setBlueBufferSize(1); fmt.setDepthBufferSize(1); fmt.setStencilBufferSize(0); +#ifdef WIN32 + fmt.setAlphaBufferSize(0); +#else fmt.setAlphaBufferSize(1); +#endif fmt.setStereo(false); fmt.setSamples(0); diff --git a/src/Qtx/QtxNotify.h b/src/Qtx/QtxNotify.h index f5647c7c2..20d3b2c4c 100644 --- a/src/Qtx/QtxNotify.h +++ b/src/Qtx/QtxNotify.h @@ -23,6 +23,8 @@ #ifndef QTXNOTIFY_H #define QTXNOTIFY_H +#include "Qtx.h" + #include #include @@ -30,7 +32,7 @@ class QTimer; -class QtxNotify : public QObject +class QTX_EXPORT QtxNotify : public QObject { Q_OBJECT diff --git a/src/SALOME_SWIG/CMakeLists.txt b/src/SALOME_SWIG/CMakeLists.txt index 79a410f61..34215e839 100755 --- a/src/SALOME_SWIG/CMakeLists.txt +++ b/src/SALOME_SWIG/CMakeLists.txt @@ -82,7 +82,13 @@ SET(_other_SCRIPTS # --- rules --- -SWIG_ADD_MODULE(libSALOME_Swig python libSALOME_Swig.i SALOMEGUI_Swig.cxx) + +IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") + SWIG_ADD_MODULE(libSALOME_Swig python libSALOME_Swig.i SALOMEGUI_Swig.cxx) +ELSE() + SWIG_ADD_LIBRARY(libSALOME_Swig LANGUAGE python SOURCES libSALOME_Swig.i SALOMEGUI_Swig.cxx) +ENDIF() + SWIG_LINK_LIBRARIES(libSALOME_Swig ${PYTHON_LIBRARIES} LightApp) IF(WIN32) SET_TARGET_PROPERTIES(_libSALOME_Swig PROPERTIES DEBUG_OUTPUT_NAME _libSALOME_Swig_d) diff --git a/src/SUIT/SUIT_LicenseDlg.cxx b/src/SUIT/SUIT_LicenseDlg.cxx index 85c29ef2b..6a2c7dbac 100755 --- a/src/SUIT/SUIT_LicenseDlg.cxx +++ b/src/SUIT/SUIT_LicenseDlg.cxx @@ -118,15 +118,18 @@ void SUIT_LicenseDlg::onAgree() { QString env; #ifdef WIN32 - DWORD aLen=1024; - char aStr[1024]; + DWORD aLen=1024; + TCHAR aStr[1024]; HANDLE aToken=0; HANDLE hProcess = GetCurrentProcess(); OpenProcessToken(hProcess,TOKEN_QUERY,&aToken); if( ! GetUserProfileDirectory( aToken, aStr, &aLen ) ) reject(); - +#ifdef UNICODE + env = QString::fromWCharArray(aStr); +#else env = aStr; +#endif #else if( ! ::getenv( "HOME" ) ) reject(); diff --git a/src/SUIT/SUIT_Session.cxx b/src/SUIT/SUIT_Session.cxx index 0fd4f37db..fa73419bf 100755 --- a/src/SUIT/SUIT_Session.cxx +++ b/src/SUIT/SUIT_Session.cxx @@ -324,7 +324,11 @@ QString SUIT_Session::lastError() const ::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 0, ::GetLastError(), 0, (LPTSTR)&lpMsgBuf, 0, 0 ); LPTSTR msg = (LPTSTR)lpMsgBuf; +#ifdef UNICODE + str = QString::fromWCharArray(msg); +#else str = QString( SUIT_Tools::toQString( msg ) ); +#endif LocalFree( lpMsgBuf ); #else str = QString( dlerror() ); diff --git a/src/SUITApp/SUITApp.cxx b/src/SUITApp/SUITApp.cxx index 75331cfa1..48df0f7e1 100644 --- a/src/SUITApp/SUITApp.cxx +++ b/src/SUITApp/SUITApp.cxx @@ -218,12 +218,17 @@ int main( int argc, char* argv[] ) #ifdef WIN32 DWORD aLen=1024; - char aStr[1024]; + TCHAR aStr[1024]; HANDLE aToken=0; HANDLE hProcess = GetCurrentProcess(); OpenProcessToken(hProcess,TOKEN_QUERY,&aToken); - if( GetUserProfileDirectory( aToken, aStr, &aLen ) ) - env = aStr; + if( GetUserProfileDirectory( aToken, aStr, &aLen ) ) { +#ifdef UNICODE + env = QString::fromWCharArray(aStr); +#else + env = aStr; +#endif + } #else if ( ::getenv( "HOME" ) ) diff --git a/src/VTKViewer/VTKViewer_OpenGLHelper.cxx b/src/VTKViewer/VTKViewer_OpenGLHelper.cxx index 7be1e8b88..d299db78e 100644 --- a/src/VTKViewer/VTKViewer_OpenGLHelper.cxx +++ b/src/VTKViewer/VTKViewer_OpenGLHelper.cxx @@ -71,6 +71,8 @@ VTKViewer_OpenGLHelper::VTKViewer_OpenGLHelper() vglBindVertexArrayARB (NULL), vglUniform1iARB (NULL), vglGetUniformLocationARB (NULL), + vglActiveTextureARB (NULL), + vglGetStringiARB (NULL), #endif mIsInitialized (false) { @@ -171,16 +173,24 @@ void VTKViewer_OpenGLHelper::Init() vglGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)GL_GetProcAddress( "glGetUniformLocationARB" ); if( !vglGetUniformLocationARB ) return; - - vglGetShaderivARB = (PFNGLGETSHADERIVPROC)GL_GetProcAddress( "glGetShaderiv" ); + + vglGetShaderivARB = (PFNGLGETSHADERIVARBPROC)GL_GetProcAddress( "glGetShaderiv" ); if( !vglGetShaderivARB ) return; - vglGetProgramivARB = (PFNGLGETPROGRAMIVPROC)GL_GetProcAddress( "glGetProgramiv" ); + vglActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)GL_GetProcAddress( "glActiveTexture" ); + if (!vglActiveTextureARB) + return; + + vglGetStringiARB = (PFNGLGETSTRINGIPROC)GL_GetProcAddress("glGetStringi"); + if (!vglGetStringiARB) + return; + + vglGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)GL_GetProcAddress( "glGetProgramiv" ); if( !vglGetProgramivARB ) return; - vglGetShaderInfoLogARB = (PFNGLGETSHADERINFOLOGPROC)GL_GetProcAddress( "glGetShaderInfoLog" ); + vglGetShaderInfoLogARB = (PFNGLGETSHADERINFOLOGARBPROC)GL_GetProcAddress( "glGetShaderInfoLog" ); if( !vglGetShaderInfoLogARB ) return; @@ -269,7 +279,7 @@ bool VTKViewer_OpenGLHelper::CreateShaderProgram (const std::string& theFilePath if (compileStatus != GL_TRUE) { GLint size; - GLchar info[1024]; + GLcharARB info[1024]; vglGetShaderInfoLogARB (theVertexShader, 1024, &size, info); std::cerr << "Can't compile vertex shader." << std::endl; @@ -293,7 +303,7 @@ bool VTKViewer_OpenGLHelper::CreateShaderProgram (const std::string& theFilePath if (compileStatus != GL_TRUE) { GLint size; - GLchar info[1024]; + GLcharARB info[1024]; vglGetShaderInfoLogARB (theVertexShader, 1024, &size, info); std::cerr << "Can't compile fragment shader." << std::endl; diff --git a/src/VTKViewer/VTKViewer_OpenGLHelper.h b/src/VTKViewer/VTKViewer_OpenGLHelper.h index 4dd55b8f8..eee81950c 100644 --- a/src/VTKViewer/VTKViewer_OpenGLHelper.h +++ b/src/VTKViewer/VTKViewer_OpenGLHelper.h @@ -70,6 +70,33 @@ typedef ptrdiff_t GLsizeiptrARB; #define GL_STATIC_DRAW_ARB 0x88E4 #endif +#ifndef GL_COMPILE_STATUS +#define GL_COMPILE_STATUS 0x8B81 +#endif + +#ifndef GL_CURRENT_PROGRAM +#define GL_CURRENT_PROGRAM 0x8B8D +#endif + +#ifndef GL_DEBUG_TYPE_ERROR +#define GL_DEBUG_TYPE_ERROR 0x824C +#endif + +#ifndef GL_LINK_STATUS +#define GL_LINK_STATUS 0x8B82 +#endif + +#ifndef GL_TEXTURE0 +#define GL_TEXTURE0 0x84C0 +#endif + +#ifndef GL_VALIDATE_STATUS +#define GL_VALIDATE_STATUS 0x8B83 +#endif + +#ifndef GL_NUM_EXTENSIONS +#define GL_NUM_EXTENSIONS 0x821D +#endif namespace GUI_OPENGL { char* readFromFile( std::string fileName ); @@ -117,17 +144,19 @@ protected: typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); #ifdef VTK_OPENGL2 + typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB program); typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB program, const GLcharARB *name ); typedef void (APIENTRYP PFNGLGETSHADERIVARBPROC) (GLuint shader, GLenum pname, GLint *params); - typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLuint program, GLenum pname, GLint *params); - typedef void (APIENTRYP PFNGLGETSHADERINFOLOGARBPROC) (GLuint shader, GLsizei maxLength, GLsizei *length, GLchar *infoLog); + typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); + typedef void (APIENTRYP PFNGLGETSHADERINFOLOGARBPROC) (GLuint shader, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (APIENTRYP PFNGLGENVERTEXARRAYSARBPROC) (GLsizei n, GLuint *arrays); typedef void (APIENTRYP PFNGLBINDVERTEXARRAYARBPROC) (GLuint array); typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); + typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); #endif public: @@ -161,6 +190,8 @@ public: PFNGLBINDVERTEXARRAYARBPROC vglBindVertexArrayARB; PFNGLUNIFORM1IARBPROC vglUniform1iARB; PFNGLGETUNIFORMLOCATIONARBPROC vglGetUniformLocationARB; + PFNGLACTIVETEXTUREARBPROC vglActiveTextureARB; + PFNGLGETSTRINGIPROC vglGetStringiARB; #endif protected: diff --git a/src/VTKViewer/VTKViewer_PolyDataMapper.cxx b/src/VTKViewer/VTKViewer_PolyDataMapper.cxx index d6386fd7f..84f3dd8e6 100644 --- a/src/VTKViewer/VTKViewer_PolyDataMapper.cxx +++ b/src/VTKViewer/VTKViewer_PolyDataMapper.cxx @@ -104,7 +104,7 @@ void MessageCallback( GLenum source, GLuint id, GLenum severity, GLsizei length, - const GLchar* message, + const GLcharARB* message, const void* userParam ) { fprintf( stderr, "GL CALLBACK: %s type = 0x%x, severity = 0x%x, message = %s\n", @@ -383,7 +383,7 @@ int VTKViewer_PolyDataMapper::InitExtensions() glGetIntegerv(GL_NUM_EXTENSIONS, &n); for (int i = 0; i < n; i++) { - const char *exti = (const char *)glGetStringi(GL_EXTENSIONS, i); + const char *exti = (const char *)this->OpenGLHelper.vglGetStringiARB(GL_EXTENSIONS, i); strm<< exti <<" "; } std::string s = strm.str(); @@ -447,7 +447,7 @@ void VTKViewer_PolyDataMapper::InitTextures() glGenTextures( 1, &this->PointSpriteTexture ); } #ifdef VTK_OPENGL2 - glActiveTexture( GL_TEXTURE0 ); + this->OpenGLHelper.vglActiveTextureARB( GL_TEXTURE0 ); #endif glBindTexture( GL_TEXTURE_2D, this->PointSpriteTexture ); glTexEnvf( GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE ); diff --git a/tools/RemoteFileBrowser/CMakeLists.txt b/tools/RemoteFileBrowser/CMakeLists.txt index 28b51be82..28c6a13df 100644 --- a/tools/RemoteFileBrowser/CMakeLists.txt +++ b/tools/RemoteFileBrowser/CMakeLists.txt @@ -55,9 +55,10 @@ SET(qremotefilebrowser_SOURCES ) SET(qremotefilebrowser_HEADERS - QRemoteFileBrowser - QRemoteCopyWidget - QMachineBrowser + QRemoteFileBrowser.h + QRemoteCopyWidget.h + QMachineBrowser.h + RemoteFileBrowser.h ) SET(qremotefilebrowser_LIBRARIES @@ -65,9 +66,9 @@ SET(qremotefilebrowser_LIBRARIES ) SET(_moc_HEADERS - QRemoteFileBrowser - QMachineBrowser - QRemoteCopyWidget + QRemoteFileBrowser.h + QMachineBrowser.h + QRemoteCopyWidget.h ) # sources / moc wrappings diff --git a/tools/RemoteFileBrowser/QMachineBrowser.cxx b/tools/RemoteFileBrowser/QMachineBrowser.cxx index 9f5a65a8e..3cdf7027e 100644 --- a/tools/RemoteFileBrowser/QMachineBrowser.cxx +++ b/tools/RemoteFileBrowser/QMachineBrowser.cxx @@ -18,8 +18,8 @@ // // Author : Anthony GEAY (EDF R&D) -#include "QMachineBrowser" -#include "QRemoteFileBrowser" +#include "QMachineBrowser.h" +#include "QRemoteFileBrowser.h" #include "QDir" #include "QFileInfo" diff --git a/tools/RemoteFileBrowser/QMachineBrowser b/tools/RemoteFileBrowser/QMachineBrowser.h similarity index 88% rename from tools/RemoteFileBrowser/QMachineBrowser rename to tools/RemoteFileBrowser/QMachineBrowser.h index f5c7f8520..de17fa532 100644 --- a/tools/RemoteFileBrowser/QMachineBrowser +++ b/tools/RemoteFileBrowser/QMachineBrowser.h @@ -21,13 +21,15 @@ #ifndef __QMACHINEBROWSER__ #define __QMACHINEBROWSER__ +#include "RemoteFileBrowser.h" + #include #include class QPushButton; class QLineEdit; -class QMachineSelector : public QComboBox +class QREMOTEFILEBROWSER_EXPORT QMachineSelector : public QComboBox { Q_OBJECT public: @@ -42,7 +44,7 @@ private: void assignToLocalhost(); }; -class QMachineManager : public QWidget +class QREMOTEFILEBROWSER_EXPORT QMachineManager : public QWidget { Q_OBJECT public: @@ -59,7 +61,7 @@ private: class QRemoteFileSystemModel; class FileLoader; -class QMachineBrowser : public QWidget +class QREMOTEFILEBROWSER_EXPORT QMachineBrowser : public QWidget { Q_OBJECT public: diff --git a/tools/RemoteFileBrowser/QRemoteCopyWidget.cxx b/tools/RemoteFileBrowser/QRemoteCopyWidget.cxx index 57b2137d1..934b985d9 100644 --- a/tools/RemoteFileBrowser/QRemoteCopyWidget.cxx +++ b/tools/RemoteFileBrowser/QRemoteCopyWidget.cxx @@ -18,8 +18,9 @@ // // Author : Anthony GEAY (EDF R&D) -#include "QRemoteCopyWidget" -#include "QRemoteFileBrowser" +#include "QRemoteCopyWidget.h" +#include "QRemoteFileBrowser.h" + #include "QVBoxLayout" #include "QPushButton" #include "QHeaderView" diff --git a/tools/RemoteFileBrowser/QRemoteCopyWidget b/tools/RemoteFileBrowser/QRemoteCopyWidget.h similarity index 90% rename from tools/RemoteFileBrowser/QRemoteCopyWidget rename to tools/RemoteFileBrowser/QRemoteCopyWidget.h index 4814b0a67..34dd1bd63 100644 --- a/tools/RemoteFileBrowser/QRemoteCopyWidget +++ b/tools/RemoteFileBrowser/QRemoteCopyWidget.h @@ -21,6 +21,8 @@ #ifndef __QREMOTECOPYWIDGET__ #define __QREMOTECOPYWIDGET__ +#include "RemoteFileBrowser.h" + #include "QDialog" #include "QMutex" #include "QThread" @@ -37,7 +39,7 @@ class QTableView; void PerformCopy(QWidget *parent, QRemoteFileSystemModel *srcModel, const QModelIndexList& srcSelectedFiles, DataStructure *ds); -class CopierThread : public QThread +class QREMOTEFILEBROWSER_EXPORT CopierThread : public QThread { public: CopierThread(QObject *parent, QFilesDirsCopierModel *model):QThread(parent),_model(model) { } @@ -48,7 +50,7 @@ private: QFilesDirsCopierModel *_model; }; -class QFilesDirsCopierModel : public QAbstractListModel +class QREMOTEFILEBROWSER_EXPORT QFilesDirsCopierModel : public QAbstractListModel { Q_OBJECT public: @@ -87,7 +89,7 @@ public: static const char ATOMIC_STOP_MSG[]; }; -class ProgressDelegate : public QItemDelegate +class QREMOTEFILEBROWSER_EXPORT ProgressDelegate : public QItemDelegate { public: ProgressDelegate(QObject *parent, QFilesDirsCopierModel *model):QItemDelegate(parent),_model(model) { } @@ -96,7 +98,7 @@ private: QFilesDirsCopierModel *_model; }; -class CopierTableView : public QTableView +class QREMOTEFILEBROWSER_EXPORT CopierTableView : public QTableView { public: CopierTableView(QWidget *parent); @@ -106,7 +108,7 @@ public: QSize sizeHint() const; }; -class FilesDirsCopier : public QDialog +class QREMOTEFILEBROWSER_EXPORT FilesDirsCopier : public QDialog { Q_OBJECT public: diff --git a/tools/RemoteFileBrowser/QRemoteFileBrowser.cxx b/tools/RemoteFileBrowser/QRemoteFileBrowser.cxx index 8d28a8eae..ee5e55605 100644 --- a/tools/RemoteFileBrowser/QRemoteFileBrowser.cxx +++ b/tools/RemoteFileBrowser/QRemoteFileBrowser.cxx @@ -18,9 +18,9 @@ // // Author : Anthony GEAY (EDF R&D) -#include "QRemoteFileBrowser" -#include "QMachineBrowser" -#include "QRemoteCopyWidget" +#include "QRemoteFileBrowser.h" +#include "QMachineBrowser.h" +#include "QRemoteCopyWidget.h" #include "QDirModel" #include "QFileSystemModel" diff --git a/tools/RemoteFileBrowser/QRemoteFileBrowser b/tools/RemoteFileBrowser/QRemoteFileBrowser.h similarity index 87% rename from tools/RemoteFileBrowser/QRemoteFileBrowser rename to tools/RemoteFileBrowser/QRemoteFileBrowser.h index 6474a3342..9f013d8c2 100644 --- a/tools/RemoteFileBrowser/QRemoteFileBrowser +++ b/tools/RemoteFileBrowser/QRemoteFileBrowser.h @@ -21,6 +21,8 @@ #ifndef __QREMOTEFILEBROWSER__ #define __QREMOTEFILEBROWSER__ +#include "RemoteFileBrowser.h" + #include "QWidget" #include "QTreeView" #include "QMimeData" @@ -31,7 +33,7 @@ class QMachineBrowser; class QRemoteFileSystemModel; class TopDirDataStructure; -class LoadingThread : public QThread +class QREMOTEFILEBROWSER_EXPORT LoadingThread : public QThread { Q_OBJECT public: @@ -48,7 +50,7 @@ private: QRemoteFileSystemModel *_model; }; -class QRemoteFileBrowser : public QWidget +class QREMOTEFILEBROWSER_EXPORT QRemoteFileBrowser : public QWidget { Q_OBJECT public: @@ -62,7 +64,7 @@ private: QMachineBrowser *_mb; }; -class QRemoteFileTransfer : public QWidget +class QREMOTEFILEBROWSER_EXPORT QRemoteFileTransfer : public QWidget { public: QRemoteFileTransfer(QWidget *parent=0); @@ -74,7 +76,7 @@ private: class DirDataStructure; class TopDirDataStructure; -class DataStructure : public QObject +class QREMOTEFILEBROWSER_EXPORT DataStructure : public QObject { Q_OBJECT public: @@ -99,7 +101,7 @@ private: bool _selected; }; -class FileDataStructure : public DataStructure +class QREMOTEFILEBROWSER_EXPORT FileDataStructure : public DataStructure { public: FileDataStructure(DirDataStructure *dds, const QString& name); @@ -109,7 +111,7 @@ public: QString nameOnDrop() const; }; -class DirDataStructure : public DataStructure +class QREMOTEFILEBROWSER_EXPORT DirDataStructure : public DataStructure { public: DirDataStructure(DirDataStructure *dds, const QString& name):DataStructure(dds,name),_is_loaded(false),_is_expanded(false) { } @@ -131,7 +133,7 @@ private: class FileLoader; -class TopDirDataStructure : public DirDataStructure +class QREMOTEFILEBROWSER_EXPORT TopDirDataStructure : public DirDataStructure { public: TopDirDataStructure(QObject *dds, FileLoader *fl); @@ -148,7 +150,7 @@ private: class QRemoteFileSystemModel; -class MyTreeView : public QTreeView +class QREMOTEFILEBROWSER_EXPORT MyTreeView : public QTreeView { Q_OBJECT public: @@ -182,25 +184,25 @@ private: class AnotherTreeView; -class AnotherTreeViewPainter +class QREMOTEFILEBROWSER_EXPORT AnotherTreeViewPainter { public: virtual void paint(AnotherTreeView *atv, QPaintEvent *event) const = 0; }; -class AnotherTreeViewWaitPainter : public AnotherTreeViewPainter +class QREMOTEFILEBROWSER_EXPORT AnotherTreeViewWaitPainter : public AnotherTreeViewPainter { public: void paint(AnotherTreeView *atv, QPaintEvent *event) const; }; -class AnotherTreeViewNothingPainter : public AnotherTreeViewPainter +class QREMOTEFILEBROWSER_EXPORT AnotherTreeViewNothingPainter : public AnotherTreeViewPainter { public: void paint(AnotherTreeView *atv, QPaintEvent *event) const; }; -class AnotherTreeView : public QWidget +class QREMOTEFILEBROWSER_EXPORT AnotherTreeView : public QWidget { Q_OBJECT public: @@ -227,7 +229,7 @@ private: LoadingThread *_th; }; -class FileLoader +class QREMOTEFILEBROWSER_EXPORT FileLoader { protected: FileLoader(const QString& dirName):_dirName(dirName) { } @@ -243,7 +245,7 @@ private: QString _dirName; }; -class LocalFileLoader : public FileLoader +class QREMOTEFILEBROWSER_EXPORT LocalFileLoader : public FileLoader { public: LocalFileLoader(const QString& dirName):FileLoader(dirName) { } @@ -255,7 +257,7 @@ public: void removeFileArgs(const QString& filePath, QString& prg, QStringList& args) const; }; -class RemoteFileLoader : public FileLoader +class QREMOTEFILEBROWSER_EXPORT RemoteFileLoader : public FileLoader { public: RemoteFileLoader(const QString& machine,const QString& dirName):FileLoader(dirName),_machine(machine) { } @@ -269,7 +271,7 @@ private: QString _machine; }; -class SelectionMimeData : public QMimeData +class QREMOTEFILEBROWSER_EXPORT SelectionMimeData : public QMimeData { Q_OBJECT public: @@ -279,7 +281,7 @@ private: QModelIndexList _los; }; -class QRemoteFileSystemModel : public QAbstractItemModel +class QREMOTEFILEBROWSER_EXPORT QRemoteFileSystemModel : public QAbstractItemModel { Q_OBJECT public: diff --git a/tools/RemoteFileBrowser/RemoteFileBrowser.h b/tools/RemoteFileBrowser/RemoteFileBrowser.h new file mode 100644 index 000000000..4120d71c4 --- /dev/null +++ b/tools/RemoteFileBrowser/RemoteFileBrowser.h @@ -0,0 +1,36 @@ +// Copyright (C) 2017 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// Author : Anthony GEAY (EDF R&D) + +#if !defined ( REMOTE_FILE_BROWSER_H ) +#define REMOTE_FILE_BROWSER_H + +// ======================================================== +// set dllexport type for Win platform +#ifdef WIN32 +# if defined QREMOTEFILEBROWSER_EXPORTS || defined qremotefilebrowser_EXPORTS +# define QREMOTEFILEBROWSER_EXPORT __declspec(dllexport) +# else +# define QREMOTEFILEBROWSER_EXPORT __declspec(dllimport) +# endif +#else // WIN32 +# define QREMOTEFILEBROWSER_EXPORT +#endif // WIN32 + +#endif //REMOTE_FILE_BROWSER_H diff --git a/tools/RemoteFileBrowser/remotefilebrowser.cxx b/tools/RemoteFileBrowser/remotefilebrowser.cxx index af7c57416..97cb01d5b 100644 --- a/tools/RemoteFileBrowser/remotefilebrowser.cxx +++ b/tools/RemoteFileBrowser/remotefilebrowser.cxx @@ -19,7 +19,7 @@ // Author : Anthony GEAY (EDF R&D) #include "QApplication" -#include "QRemoteFileBrowser" +#include "QRemoteFileBrowser.h" int main(int argc, char *argv[]) { -- 2.39.2