Salome HOME
SALOME 9.1.0 Windows version
authorrnv <rnv@opencascade.com>
Wed, 29 Aug 2018 11:23:41 +0000 (14:23 +0300)
committervsr <vsr@opencascade.com>
Fri, 7 Sep 2018 11:13:46 +0000 (14:13 +0300)
31 files changed:
src/CAM/CAM_Application.cxx
src/CAM/CAM_Module.cxx
src/CASCatch/CASCatch_CatchSignals.cxx
src/GLViewer/GLViewer_BaseObjects.cxx
src/GLViewer/GLViewer_Viewer2d.cxx
src/LightApp/LightApp_OCCSelector.h
src/LightApp/LightApp_SelectionMgr.h
src/OCCViewer/OCCViewer_ClippingDlg.cxx
src/OpenGLUtils/OpenGLUtils_FrameBuffer.cxx
src/PVServerService/ServiceLoader/CMakeLists.txt
src/Qtx/Qtx.cxx
src/Qtx/QtxNotify.h
src/SALOME_SWIG/CMakeLists.txt
src/SUIT/SUIT_LicenseDlg.cxx
src/SUIT/SUIT_Session.cxx
src/SUITApp/SUITApp.cxx
src/VTKViewer/VTKViewer_OpenGLHelper.cxx
src/VTKViewer/VTKViewer_OpenGLHelper.h
src/VTKViewer/VTKViewer_PolyDataMapper.cxx
tools/RemoteFileBrowser/CMakeLists.txt
tools/RemoteFileBrowser/QMachineBrowser [deleted file]
tools/RemoteFileBrowser/QMachineBrowser.cxx
tools/RemoteFileBrowser/QMachineBrowser.h [new file with mode: 0644]
tools/RemoteFileBrowser/QRemoteCopyWidget [deleted file]
tools/RemoteFileBrowser/QRemoteCopyWidget.cxx
tools/RemoteFileBrowser/QRemoteCopyWidget.h [new file with mode: 0644]
tools/RemoteFileBrowser/QRemoteFileBrowser [deleted file]
tools/RemoteFileBrowser/QRemoteFileBrowser.cxx
tools/RemoteFileBrowser/QRemoteFileBrowser.h [new file with mode: 0644]
tools/RemoteFileBrowser/RemoteFileBrowser.h [new file with mode: 0644]
tools/RemoteFileBrowser/remotefilebrowser.cxx

index 7721f9f62f1568d1bbb7af9bab8a360ec6a4d432..00da564614266962cee2f7afc9c1d1b1a7cce15a 100755 (executable)
@@ -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 );
index a5bcaf714e5925d17923871908e552d7d3f44455..fd814543e77538ce054bbbfc3e08f617c1d110c0 100755 (executable)
@@ -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;
 }
 
 /*!
index 9ece89eef0d407e7b9c5e753f3618a6768a117b4..5cb436f7f6ed541ea6772fec34427875baf71f7d 100644 (file)
@@ -201,7 +201,7 @@ void CASCatch_CatchSignals::Deactivate()
 
 #else
 //====================================== WIN32 part ====================================================
-#include <OSD_WNT_1.hxx>
+#include <OSD_WNT.hxx>
 
 #include <process.h>
 #include <signal.h>
index cf12ae7ba5d29b1c5520cba1e17c03af4f09be15..6e65422f294b93b43d9d748e7d0a80dc55018a7a 100644 (file)
@@ -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 );
index e79b9f3a54c1f1d81774a81b99c057af7dff5549..b11c4d710a0e62b2d758b67d0cdcb53dd1762dc2 100644 (file)
@@ -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 );
index 06026d2adf980e39749760609a874dfdc866c583..d11d3978ca4a10a0fd1671dec7d28f57a5a3a199 100644 (file)
@@ -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;
index 1bf69dc32ad99503ba96749c6a4990f32a91514c..ec10c2a3fa7846e5765c44462090e1f23ddd498c 100644 (file)
@@ -100,7 +100,7 @@ private:
   virtual void           selectionChanged( SUIT_Selector* );
 
 #ifndef DISABLE_SALOMEOBJECT
-  QList<Handle_SALOME_InteractiveObject> selectionCache( const QString& = QString() ) const;
+  QList<Handle(SALOME_InteractiveObject)> 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
index 59ea3461e8a91e7d5807138e789afc36cda59b9d..3d33406dfacec4e688c2ef382fa8262c9aaab7dd 100644 (file)
@@ -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++ )
   {
index 891ae65117c4994ceca864a97cdfb8bdd8a6f4cb..700cafea8b7904572545a3d13160b4ca45918590 100755 (executable)
@@ -24,6 +24,7 @@
 #define GL_GLEXT_PROTOTYPES
 #endif
 
+
 #include "OpenGLUtils_FrameBuffer.h"
 
 #include <utilities.h>
@@ -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);
index 7e5c65ecedcc9bc7ffa8d017e45db031f810e472..d0b94d01d131fa6ff9438c0a7a245d4d080c5e4f 100644 (file)
@@ -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)
index 672fa3f8e7000547f6a29c9503c977a0d50b4ff8..e976086b150139a09a35429643cefd4aefa9e43e 100755 (executable)
@@ -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);
   
index f5647c7c20163704c77e0e320d08c7aa5c441c9e..20d3b2c4cf36eedb0f56a83a29456170343969bf 100644 (file)
@@ -23,6 +23,8 @@
 #ifndef QTXNOTIFY_H
 #define QTXNOTIFY_H
 
+#include "Qtx.h"
+
 #include <QWidget>
 
 #include <QList>
@@ -30,7 +32,7 @@
 
 class QTimer;
 
-class QtxNotify : public QObject
+class QTX_EXPORT QtxNotify : public QObject
 {
     Q_OBJECT
 
index 79a410f6131ec3fbbfe685a79993acda25fc52a6..34215e839a43e778710c3b87cf3dd51b3dd40e88 100755 (executable)
@@ -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)
index 85c29ef2b8c255764873fb11934d1c1cac0b4307..6a2c7dbac636055d786cc929b0bacc5dffebc1a5 100755 (executable)
@@ -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();
index 0fd4f37dbcaf20c9421cc3bf6637587e79a997e0..fa73419bf0786818a857bf591df10a2887470fa5 100755 (executable)
@@ -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() );
index 75331cfa114b068acf3216f5dad43f348a7dacb6..48df0f7e1647f60ccc42ef325d44a30450a14e4e 100644 (file)
@@ -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" ) )
index 7be1e8b881118421892446653afad00de0739e17..d299db78ea6ef3469bfbef140ae12689f36dd16c 100644 (file)
@@ -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;
index 4dd55b8f83567825df06b609f43b679fba3976eb..eee81950c6fa72af0852976fd2277fe29559fcac 100644 (file)
@@ -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:
index d6386fd7f09bed08cf5111cd45cf3e7fe0168518..84f3dd8e6bd6663f3e4f965da4e6a984a9df079c 100644 (file)
@@ -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 );
index 28b51be821efdf464cf7c4315d1fc7b83751d456..28c6a13df8a1d8ce252e073b9a00c90700c963df 100644 (file)
@@ -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 b/tools/RemoteFileBrowser/QMachineBrowser
deleted file mode 100644 (file)
index f5c7f85..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-// 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)
-
-#ifndef __QMACHINEBROWSER__
-#define __QMACHINEBROWSER__
-
-#include <QWidget>
-#include <QComboBox>
-
-class QPushButton;
-class QLineEdit;
-
-class QMachineSelector : public QComboBox
-{
-  Q_OBJECT
-public:
-  QMachineSelector(QWidget *parent);
-  void initLocation();
-public slots:
-  void appendEntry(const QString& entry);
-private:
-  void fillMachines();
-  void fillMachinesFromCatalog();
-  void fillMachinesFromSettings();
-  void assignToLocalhost();
-};
-
-class QMachineManager : public QWidget
-{
-  Q_OBJECT
-public:
-  QMachineManager(QWidget *parent);
-  void initLocation();
-  QString getSelectedHost() const;
-public slots:
-  void newEntryRequested();
-private:
-  QPushButton *_pb;
-  QMachineSelector *_ms;
-};
-
-class QRemoteFileSystemModel;
-class FileLoader;
-
-class QMachineBrowser : public QWidget
-{
-  Q_OBJECT
-public:
-  QMachineBrowser(QWidget *parent=NULL);
-  void initLocation();
-  QRemoteFileSystemModel *generateModel();
-  FileLoader *generateFileLoader();
-signals:
-  void locationChanged();
-private:
-  QMachineManager *_msel;
-  QLineEdit *_le;
-};
-
-#endif
index 9f5a65a8ecad60cd2310308924c86f47dec18e6f..3cdf7027ea4159f1b7cdada01d8d9f416b2572cd 100644 (file)
@@ -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.h b/tools/RemoteFileBrowser/QMachineBrowser.h
new file mode 100644 (file)
index 0000000..de17fa5
--- /dev/null
@@ -0,0 +1,79 @@
+// 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)
+
+#ifndef __QMACHINEBROWSER__
+#define __QMACHINEBROWSER__
+
+#include "RemoteFileBrowser.h"
+
+#include <QWidget>
+#include <QComboBox>
+
+class QPushButton;
+class QLineEdit;
+
+class QREMOTEFILEBROWSER_EXPORT QMachineSelector : public QComboBox
+{
+  Q_OBJECT
+public:
+  QMachineSelector(QWidget *parent);
+  void initLocation();
+public slots:
+  void appendEntry(const QString& entry);
+private:
+  void fillMachines();
+  void fillMachinesFromCatalog();
+  void fillMachinesFromSettings();
+  void assignToLocalhost();
+};
+
+class QREMOTEFILEBROWSER_EXPORT QMachineManager : public QWidget
+{
+  Q_OBJECT
+public:
+  QMachineManager(QWidget *parent);
+  void initLocation();
+  QString getSelectedHost() const;
+public slots:
+  void newEntryRequested();
+private:
+  QPushButton *_pb;
+  QMachineSelector *_ms;
+};
+
+class QRemoteFileSystemModel;
+class FileLoader;
+
+class QREMOTEFILEBROWSER_EXPORT QMachineBrowser : public QWidget
+{
+  Q_OBJECT
+public:
+  QMachineBrowser(QWidget *parent=NULL);
+  void initLocation();
+  QRemoteFileSystemModel *generateModel();
+  FileLoader *generateFileLoader();
+signals:
+  void locationChanged();
+private:
+  QMachineManager *_msel;
+  QLineEdit *_le;
+};
+
+#endif
diff --git a/tools/RemoteFileBrowser/QRemoteCopyWidget b/tools/RemoteFileBrowser/QRemoteCopyWidget
deleted file mode 100644 (file)
index 4814b0a..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-// 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)
-
-#ifndef __QREMOTECOPYWIDGET__
-#define __QREMOTECOPYWIDGET__
-
-#include "QDialog"
-#include "QMutex"
-#include "QThread"
-#include "QTreeView"
-#include "QTableView"
-#include "QItemDelegate"
-#include "QPointer"
-#include "QProcess"
-
-class QRemoteFileSystemModel;
-class QFilesDirsCopierModel;
-class DataStructure;
-class QTableView;
-
-void PerformCopy(QWidget *parent, QRemoteFileSystemModel *srcModel, const QModelIndexList& srcSelectedFiles, DataStructure *ds);
-
-class CopierThread : public QThread
-{
-public:
-  CopierThread(QObject *parent, QFilesDirsCopierModel *model):QThread(parent),_model(model) { }
-  void stopRequested();
-protected:
-  void run();
-private:
-  QFilesDirsCopierModel *_model;
-};
-
-class QFilesDirsCopierModel : public QAbstractListModel
-{
-  Q_OBJECT
-public:
-  QFilesDirsCopierModel(QObject *parent, const QList<const DataStructure *>& srcFiles, DataStructure *destLoc);
-  int nbOfRows() const;
-  int rowCount(const QModelIndex&) const;
-  int columnCount(const QModelIndex&) const;
-  QVariant data(const QModelIndex&, int) const;
-  QVariant headerData(int section, Qt::Orientation orientation, int role) const;
-  const QString& getErrorStr() const { return _error; }
-  int getProgressOf(int srcFileId) const;
-  QString getFullNameOf(int srcFileId) const;
-  QString getNameOf(int srcFileId) const;
-  QString getPrettyText(int srcFileId) const;
-  QSize sizeHint() const;
-  //
-  void launchCopy();
-  void stopCurrentCopy();
-public slots:
-  void newOutputAvailable();
-private:
-  void fillArgsForRSync(const DataStructure *srcFile, QStringList& args) const;
-private:
-  QList<const DataStructure *> _srcFiles;
-  //
-  mutable QMutex _mutOnProc;
-  volatile int _currentElt;
-  QPointer<QProcess> _curProc;
-  QString _error;
-  //
-  QVector<int> _progress;
-  DataStructure *_destLoc;
-public:
-  static constexpr int PROGRESS_STATUS_START=-1;
-  static constexpr int PROGRESS_STATUS_OVER=101;
-  static const char ATOMIC_STOP_MSG[];
-};
-
-class ProgressDelegate : public QItemDelegate
-{
-public:
-  ProgressDelegate(QObject *parent, QFilesDirsCopierModel *model):QItemDelegate(parent),_model(model) { }
-  void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
-private:
-  QFilesDirsCopierModel *_model;
-};
-
-class CopierTableView : public QTableView
-{
-public:
-  CopierTableView(QWidget *parent);
-  int sizeHintForColumn(int column) const;
-  int sizeHintForRow(int row) const;
-  void resizeEvent(QResizeEvent *event);
-  QSize sizeHint() const;
-};
-   
-class FilesDirsCopier : public QDialog
-{
-  Q_OBJECT
-public:
-  FilesDirsCopier(QWidget *parent, const QList<const DataStructure *>& srcFiles, DataStructure *destLoc);
-public slots:
-  void cancelRequested();
-  void myAccept(bool);
-  int exec();
-  const QString& getErrorStr() const { return _model->getErrorStr(); }
-signals:
-  void myAcceptSignal(bool);
-private:
-  CopierTableView *_table;
-  QPushButton *_cancel;
-  CopierThread *_th;
-  QFilesDirsCopierModel *_model;
-};
-
-#endif
index 57b2137d17d30aa46ed94562eaa863e8242b411e..934b985d91420886b705f80d2e026d4678f9a4e4 100644 (file)
@@ -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.h b/tools/RemoteFileBrowser/QRemoteCopyWidget.h
new file mode 100644 (file)
index 0000000..34dd1bd
--- /dev/null
@@ -0,0 +1,130 @@
+// 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)
+
+#ifndef __QREMOTECOPYWIDGET__
+#define __QREMOTECOPYWIDGET__
+
+#include "RemoteFileBrowser.h"
+
+#include "QDialog"
+#include "QMutex"
+#include "QThread"
+#include "QTreeView"
+#include "QTableView"
+#include "QItemDelegate"
+#include "QPointer"
+#include "QProcess"
+
+class QRemoteFileSystemModel;
+class QFilesDirsCopierModel;
+class DataStructure;
+class QTableView;
+
+void PerformCopy(QWidget *parent, QRemoteFileSystemModel *srcModel, const QModelIndexList& srcSelectedFiles, DataStructure *ds);
+
+class QREMOTEFILEBROWSER_EXPORT CopierThread : public QThread
+{
+public:
+  CopierThread(QObject *parent, QFilesDirsCopierModel *model):QThread(parent),_model(model) { }
+  void stopRequested();
+protected:
+  void run();
+private:
+  QFilesDirsCopierModel *_model;
+};
+
+class QREMOTEFILEBROWSER_EXPORT QFilesDirsCopierModel : public QAbstractListModel
+{
+  Q_OBJECT
+public:
+  QFilesDirsCopierModel(QObject *parent, const QList<const DataStructure *>& srcFiles, DataStructure *destLoc);
+  int nbOfRows() const;
+  int rowCount(const QModelIndex&) const;
+  int columnCount(const QModelIndex&) const;
+  QVariant data(const QModelIndex&, int) const;
+  QVariant headerData(int section, Qt::Orientation orientation, int role) const;
+  const QString& getErrorStr() const { return _error; }
+  int getProgressOf(int srcFileId) const;
+  QString getFullNameOf(int srcFileId) const;
+  QString getNameOf(int srcFileId) const;
+  QString getPrettyText(int srcFileId) const;
+  QSize sizeHint() const;
+  //
+  void launchCopy();
+  void stopCurrentCopy();
+public slots:
+  void newOutputAvailable();
+private:
+  void fillArgsForRSync(const DataStructure *srcFile, QStringList& args) const;
+private:
+  QList<const DataStructure *> _srcFiles;
+  //
+  mutable QMutex _mutOnProc;
+  volatile int _currentElt;
+  QPointer<QProcess> _curProc;
+  QString _error;
+  //
+  QVector<int> _progress;
+  DataStructure *_destLoc;
+public:
+  static constexpr int PROGRESS_STATUS_START=-1;
+  static constexpr int PROGRESS_STATUS_OVER=101;
+  static const char ATOMIC_STOP_MSG[];
+};
+
+class QREMOTEFILEBROWSER_EXPORT ProgressDelegate : public QItemDelegate
+{
+public:
+  ProgressDelegate(QObject *parent, QFilesDirsCopierModel *model):QItemDelegate(parent),_model(model) { }
+  void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
+private:
+  QFilesDirsCopierModel *_model;
+};
+
+class QREMOTEFILEBROWSER_EXPORT CopierTableView : public QTableView
+{
+public:
+  CopierTableView(QWidget *parent);
+  int sizeHintForColumn(int column) const;
+  int sizeHintForRow(int row) const;
+  void resizeEvent(QResizeEvent *event);
+  QSize sizeHint() const;
+};
+   
+class QREMOTEFILEBROWSER_EXPORT FilesDirsCopier : public QDialog
+{
+  Q_OBJECT
+public:
+  FilesDirsCopier(QWidget *parent, const QList<const DataStructure *>& srcFiles, DataStructure *destLoc);
+public slots:
+  void cancelRequested();
+  void myAccept(bool);
+  int exec();
+  const QString& getErrorStr() const { return _model->getErrorStr(); }
+signals:
+  void myAcceptSignal(bool);
+private:
+  CopierTableView *_table;
+  QPushButton *_cancel;
+  CopierThread *_th;
+  QFilesDirsCopierModel *_model;
+};
+
+#endif
diff --git a/tools/RemoteFileBrowser/QRemoteFileBrowser b/tools/RemoteFileBrowser/QRemoteFileBrowser
deleted file mode 100644 (file)
index 6474a33..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-// 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)
-
-#ifndef __QREMOTEFILEBROWSER__
-#define __QREMOTEFILEBROWSER__
-
-#include "QWidget"
-#include "QTreeView"
-#include "QMimeData"
-#include "QThread"
-
-class AnotherTreeView;
-class QMachineBrowser;
-class QRemoteFileSystemModel;
-class TopDirDataStructure;
-
-class LoadingThread : public QThread
-{
-  Q_OBJECT
-public:
-  LoadingThread(QThread *th, QMachineBrowser *mb):_fatherThread(th),_mb(mb),_model(nullptr) { }
-  void setGeneratedModel(QRemoteFileSystemModel *model) { _model=model; }
-  QRemoteFileSystemModel *generatedModel() const { return _model; }
-signals:
-  void letsGenerateModel(TopDirDataStructure *fds);
-protected:
-  void run();
-private:
-  QThread *_fatherThread;
-  QMachineBrowser *_mb;
-  QRemoteFileSystemModel *_model;
-};
-
-class QRemoteFileBrowser : public QWidget
-{
-  Q_OBJECT
-public:
-  QRemoteFileBrowser(QWidget *parent);
-  QMachineBrowser *machineBrower() const { return _mb; }
-public slots:
-  void onLocationChanged();
-  void locationHasBeenChanged();
-private:
-  AnotherTreeView *_treeView;
-  QMachineBrowser *_mb;
-};
-
-class QRemoteFileTransfer : public QWidget
-{
-public:
-  QRemoteFileTransfer(QWidget *parent=0);
-private:
-  QRemoteFileBrowser *_left;
-  QRemoteFileBrowser *_right;
-};
-
-class DirDataStructure;
-class TopDirDataStructure;
-
-class DataStructure : public QObject
-{
-  Q_OBJECT
-public:
-  DataStructure(QObject *parent, const QString& name):QObject(parent),_name(name),_selected(false) { }
-  void select() { _selected=true; }
-  void unselect() { _selected=false; }
-  bool isSelected() const { return _selected; }
-  virtual bool isFile() const = 0;
-  virtual QString nameOnDrop() const = 0;
-  const DirDataStructure *getDirParent() const;
-  bool isRoot() const { return getDirParent()==NULL; }
-  const TopDirDataStructure *getRoot() const;
-  std::vector<const DataStructure *> getItermediateElts(const TopDirDataStructure *tpds) const;
-  virtual int size() const = 0;
-  QString entryForRSyncSrc() const;
-  virtual QString entryForRSyncDest() const = 0;
-  QString name() const;
-  const QString& fullName() const { return _name; }
-  void removeFileArgs(QString& prg, QStringList& args) const;
-private:
-  QString _name;
-  bool _selected;
-};
-
-class FileDataStructure : public DataStructure
-{
-public:
-  FileDataStructure(DirDataStructure *dds, const QString& name);
-  bool isFile() const { return true; }
-  int size() const { return 0; }
-  QString entryForRSyncDest() const;
-  QString nameOnDrop() const;
-};
-
-class DirDataStructure : public DataStructure
-{
-public:
-  DirDataStructure(DirDataStructure *dds, const QString& name):DataStructure(dds,name),_is_loaded(false),_is_expanded(false) { }
-  DirDataStructure(QObject *dds, const QString& name):DataStructure(dds,name),_is_loaded(false) { }
-  bool isFile() const { return false; }
-  int size() const { load(); return children().size(); }
-  QString entryForRSyncDest() const;
-  QString nameOnDrop() const { return name(); }
-  const DataStructure *operator[](int pos) const;
-  int posOf(const DataStructure *ds) const;
-  bool load() const;
-  void markAsLoaded() const { _is_loaded=true; }
-  void setExpanded(bool status) { _is_expanded=status; }
-  bool isExpanded() const { return _is_expanded; }
-private:
-  mutable bool _is_loaded;
-  mutable bool _is_expanded;
-};
-
-class FileLoader;
-
-class TopDirDataStructure : public DirDataStructure
-{
-public:
-  TopDirDataStructure(QObject *dds, FileLoader *fl);
-  virtual ~TopDirDataStructure();
-  FileLoader *getLoader() const { return _fl; }
-  bool isOK() const { return _isOK; }
-  QString entryForRSync(const QString& fn) const;
-  QString getMachine() const;
-  void removeFileArgsImpl(const QString& filePath, QString& prg, QStringList& args) const;
-private:
-  FileLoader *_fl;
-  bool _isOK;
-};
-
-class QRemoteFileSystemModel;
-
-class MyTreeView : public QTreeView
-{
-  Q_OBJECT
-public:
-  MyTreeView(QWidget *parent);
-  void mousePressEvent(QMouseEvent *event);
-  void mouseReleaseEvent(QMouseEvent *event);
-  void mouseMoveEvent(QMouseEvent *event);
-  void keyPressEvent(QKeyEvent *event);
-  void dragEnterEvent(QDragEnterEvent *event);
-  void dragMoveEvent(QDragMoveEvent *event);
-  void dragLeaveEvent(QDragLeaveEvent *event);
-  void dropEvent(QDropEvent *event);
-  QRemoteFileSystemModel *zeModel();
-  void emitResetModel();
-public slots:
-  void itemExpanded(const QModelIndex &index);
-  void itemCollapsed(const QModelIndex &index);
-signals:
-  void somethingChangedDueToFileModif();
-private:
-  void itemExpandedStatus(const QModelIndex &index, bool status);
-  void drawBranches(QPainter *painter, const QRect &rect, const QModelIndex &index) const;
-  void paintEvent(QPaintEvent *event);
-private:
-  QPoint _start_pos;
-  // during drag drop _sel is the element under the mouse on the drop site
-  DataStructure *_sel;
-  // during drag drop _slider_pos is the pos of vertical slider on drop site
-  int _slider_pos;
-};
-
-class AnotherTreeView;
-
-class AnotherTreeViewPainter
-{
-public:
-  virtual void paint(AnotherTreeView *atv, QPaintEvent *event) const = 0;
-};
-
-class AnotherTreeViewWaitPainter : public AnotherTreeViewPainter
-{
-public:
-  void paint(AnotherTreeView *atv, QPaintEvent *event) const;
-};
-
-class AnotherTreeViewNothingPainter : public AnotherTreeViewPainter
-{
-public:
-  void paint(AnotherTreeView *atv, QPaintEvent *event) const;
-};
-
-class AnotherTreeView : public QWidget
-{
-  Q_OBJECT
-public:
-  AnotherTreeView(QWidget *parent);
-  void generateModel(QMachineBrowser *mb);
-  QSize sizeHint() const;
-  QSize minimumSizeHint() const;
-  int getAngle() const { return _angle; }
-  ~AnotherTreeView();
-public slots:
-  void goGenerate(TopDirDataStructure *fds);
-  void modelHasBeenGenerated();
-signals:
-  void modelHasBeenGeneratedSignal(bool isOK);
-  void somethingChangedDueToFileModif();
-protected:
-  void paintEvent(QPaintEvent *event);
-  void timerEvent(QTimerEvent *e);
-private:
-  int _timerId;
-  int _angle;
-  AnotherTreeViewPainter *_painter;
-  MyTreeView *_tw;
-  LoadingThread *_th;
-};
-
-class FileLoader
-{
-protected:
-  FileLoader(const QString& dirName):_dirName(dirName) { }
-public:
-  QString getDirName() const { return _dirName; }
-  virtual bool load(DirDataStructure *parent) const = 0;
-  virtual QString prettyPrint() const = 0;
-  virtual QString entryForRSync(const QString& fn) const = 0;
-  virtual QString getMachine() const = 0;
-  virtual void removeFileArgs(const QString& filePath, QString& prg, QStringList& args) const = 0;
-  virtual ~FileLoader() { }
-private:
-  QString _dirName;
-};
-
-class LocalFileLoader : public FileLoader
-{
-public:
-  LocalFileLoader(const QString& dirName):FileLoader(dirName) { }
-  bool load(DirDataStructure *parent) const;
-  void fillArgs(const QString& dn, QString& prg, QStringList& args) const;
-  QString prettyPrint() const;
-  QString entryForRSync(const QString& fn) const;
-  QString getMachine() const;
-  void removeFileArgs(const QString& filePath, QString& prg, QStringList& args) const;
-};
-
-class RemoteFileLoader : public FileLoader
-{
-public:
-  RemoteFileLoader(const QString& machine,const QString& dirName):FileLoader(dirName),_machine(machine) { }
-  bool load(DirDataStructure *parent) const;
-  void fillArgs(const QString& dn, QString& prg, QStringList& args) const;
-  QString prettyPrint() const;
-  QString entryForRSync(const QString& fn) const;
-  QString getMachine() const;
-  void removeFileArgs(const QString& filePath, QString& prg, QStringList& args) const;
-private:
-  QString _machine;
-};
-
-class SelectionMimeData : public QMimeData
-{
-  Q_OBJECT
-public:
-  SelectionMimeData(const QModelIndexList& los):_los(los) { }
-  const QModelIndexList& getSelection() const { return _los; }
-private:
-  QModelIndexList _los;
-};
-
-class QRemoteFileSystemModel : public QAbstractItemModel
-{
-  Q_OBJECT
-public:
-  QRemoteFileSystemModel(QObject *parent, FileLoader *fl);
-  QRemoteFileSystemModel(QObject *parent, TopDirDataStructure *fds);
-  QVariant headerData(int section, Qt::Orientation orientation, int role) const;
-  QModelIndex parent(const QModelIndex&) const;
-  QModelIndex index(int, int, const QModelIndex&) const;
-  int rowCount(const QModelIndex&) const;
-  int columnCount(const QModelIndex&) const;
-  QVariant data(const QModelIndex&, int) const;
-  void emitResetModel();
-  FileLoader *getLoader() const { return _fds->getLoader(); }
-  bool isOK() const { return _fds->isOK(); }
-  QString getMachine() const { return _fds->getMachine(); }
-private:
-  TopDirDataStructure *_fds;
-};
-
-#endif
index 8d28a8eaed98840447b966f8dbc88c8fc47c16f8..ee5e55605278d316d0a4c5bca928263c32a07bbd 100644 (file)
@@ -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.h b/tools/RemoteFileBrowser/QRemoteFileBrowser.h
new file mode 100644 (file)
index 0000000..9f013d8
--- /dev/null
@@ -0,0 +1,304 @@
+// 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)
+
+#ifndef __QREMOTEFILEBROWSER__
+#define __QREMOTEFILEBROWSER__
+
+#include "RemoteFileBrowser.h"
+
+#include "QWidget"
+#include "QTreeView"
+#include "QMimeData"
+#include "QThread"
+
+class AnotherTreeView;
+class QMachineBrowser;
+class QRemoteFileSystemModel;
+class TopDirDataStructure;
+
+class QREMOTEFILEBROWSER_EXPORT LoadingThread : public QThread
+{
+  Q_OBJECT
+public:
+  LoadingThread(QThread *th, QMachineBrowser *mb):_fatherThread(th),_mb(mb),_model(nullptr) { }
+  void setGeneratedModel(QRemoteFileSystemModel *model) { _model=model; }
+  QRemoteFileSystemModel *generatedModel() const { return _model; }
+signals:
+  void letsGenerateModel(TopDirDataStructure *fds);
+protected:
+  void run();
+private:
+  QThread *_fatherThread;
+  QMachineBrowser *_mb;
+  QRemoteFileSystemModel *_model;
+};
+
+class QREMOTEFILEBROWSER_EXPORT QRemoteFileBrowser : public QWidget
+{
+  Q_OBJECT
+public:
+  QRemoteFileBrowser(QWidget *parent);
+  QMachineBrowser *machineBrower() const { return _mb; }
+public slots:
+  void onLocationChanged();
+  void locationHasBeenChanged();
+private:
+  AnotherTreeView *_treeView;
+  QMachineBrowser *_mb;
+};
+
+class QREMOTEFILEBROWSER_EXPORT QRemoteFileTransfer : public QWidget
+{
+public:
+  QRemoteFileTransfer(QWidget *parent=0);
+private:
+  QRemoteFileBrowser *_left;
+  QRemoteFileBrowser *_right;
+};
+
+class DirDataStructure;
+class TopDirDataStructure;
+
+class QREMOTEFILEBROWSER_EXPORT DataStructure : public QObject
+{
+  Q_OBJECT
+public:
+  DataStructure(QObject *parent, const QString& name):QObject(parent),_name(name),_selected(false) { }
+  void select() { _selected=true; }
+  void unselect() { _selected=false; }
+  bool isSelected() const { return _selected; }
+  virtual bool isFile() const = 0;
+  virtual QString nameOnDrop() const = 0;
+  const DirDataStructure *getDirParent() const;
+  bool isRoot() const { return getDirParent()==NULL; }
+  const TopDirDataStructure *getRoot() const;
+  std::vector<const DataStructure *> getItermediateElts(const TopDirDataStructure *tpds) const;
+  virtual int size() const = 0;
+  QString entryForRSyncSrc() const;
+  virtual QString entryForRSyncDest() const = 0;
+  QString name() const;
+  const QString& fullName() const { return _name; }
+  void removeFileArgs(QString& prg, QStringList& args) const;
+private:
+  QString _name;
+  bool _selected;
+};
+
+class QREMOTEFILEBROWSER_EXPORT FileDataStructure : public DataStructure
+{
+public:
+  FileDataStructure(DirDataStructure *dds, const QString& name);
+  bool isFile() const { return true; }
+  int size() const { return 0; }
+  QString entryForRSyncDest() const;
+  QString nameOnDrop() const;
+};
+
+class QREMOTEFILEBROWSER_EXPORT DirDataStructure : public DataStructure
+{
+public:
+  DirDataStructure(DirDataStructure *dds, const QString& name):DataStructure(dds,name),_is_loaded(false),_is_expanded(false) { }
+  DirDataStructure(QObject *dds, const QString& name):DataStructure(dds,name),_is_loaded(false) { }
+  bool isFile() const { return false; }
+  int size() const { load(); return children().size(); }
+  QString entryForRSyncDest() const;
+  QString nameOnDrop() const { return name(); }
+  const DataStructure *operator[](int pos) const;
+  int posOf(const DataStructure *ds) const;
+  bool load() const;
+  void markAsLoaded() const { _is_loaded=true; }
+  void setExpanded(bool status) { _is_expanded=status; }
+  bool isExpanded() const { return _is_expanded; }
+private:
+  mutable bool _is_loaded;
+  mutable bool _is_expanded;
+};
+
+class FileLoader;
+
+class QREMOTEFILEBROWSER_EXPORT TopDirDataStructure : public DirDataStructure
+{
+public:
+  TopDirDataStructure(QObject *dds, FileLoader *fl);
+  virtual ~TopDirDataStructure();
+  FileLoader *getLoader() const { return _fl; }
+  bool isOK() const { return _isOK; }
+  QString entryForRSync(const QString& fn) const;
+  QString getMachine() const;
+  void removeFileArgsImpl(const QString& filePath, QString& prg, QStringList& args) const;
+private:
+  FileLoader *_fl;
+  bool _isOK;
+};
+
+class QRemoteFileSystemModel;
+
+class QREMOTEFILEBROWSER_EXPORT MyTreeView : public QTreeView
+{
+  Q_OBJECT
+public:
+  MyTreeView(QWidget *parent);
+  void mousePressEvent(QMouseEvent *event);
+  void mouseReleaseEvent(QMouseEvent *event);
+  void mouseMoveEvent(QMouseEvent *event);
+  void keyPressEvent(QKeyEvent *event);
+  void dragEnterEvent(QDragEnterEvent *event);
+  void dragMoveEvent(QDragMoveEvent *event);
+  void dragLeaveEvent(QDragLeaveEvent *event);
+  void dropEvent(QDropEvent *event);
+  QRemoteFileSystemModel *zeModel();
+  void emitResetModel();
+public slots:
+  void itemExpanded(const QModelIndex &index);
+  void itemCollapsed(const QModelIndex &index);
+signals:
+  void somethingChangedDueToFileModif();
+private:
+  void itemExpandedStatus(const QModelIndex &index, bool status);
+  void drawBranches(QPainter *painter, const QRect &rect, const QModelIndex &index) const;
+  void paintEvent(QPaintEvent *event);
+private:
+  QPoint _start_pos;
+  // during drag drop _sel is the element under the mouse on the drop site
+  DataStructure *_sel;
+  // during drag drop _slider_pos is the pos of vertical slider on drop site
+  int _slider_pos;
+};
+
+class AnotherTreeView;
+
+class QREMOTEFILEBROWSER_EXPORT AnotherTreeViewPainter
+{
+public:
+  virtual void paint(AnotherTreeView *atv, QPaintEvent *event) const = 0;
+};
+
+class QREMOTEFILEBROWSER_EXPORT AnotherTreeViewWaitPainter : public AnotherTreeViewPainter
+{
+public:
+  void paint(AnotherTreeView *atv, QPaintEvent *event) const;
+};
+
+class QREMOTEFILEBROWSER_EXPORT AnotherTreeViewNothingPainter : public AnotherTreeViewPainter
+{
+public:
+  void paint(AnotherTreeView *atv, QPaintEvent *event) const;
+};
+
+class QREMOTEFILEBROWSER_EXPORT AnotherTreeView : public QWidget
+{
+  Q_OBJECT
+public:
+  AnotherTreeView(QWidget *parent);
+  void generateModel(QMachineBrowser *mb);
+  QSize sizeHint() const;
+  QSize minimumSizeHint() const;
+  int getAngle() const { return _angle; }
+  ~AnotherTreeView();
+public slots:
+  void goGenerate(TopDirDataStructure *fds);
+  void modelHasBeenGenerated();
+signals:
+  void modelHasBeenGeneratedSignal(bool isOK);
+  void somethingChangedDueToFileModif();
+protected:
+  void paintEvent(QPaintEvent *event);
+  void timerEvent(QTimerEvent *e);
+private:
+  int _timerId;
+  int _angle;
+  AnotherTreeViewPainter *_painter;
+  MyTreeView *_tw;
+  LoadingThread *_th;
+};
+
+class QREMOTEFILEBROWSER_EXPORT FileLoader
+{
+protected:
+  FileLoader(const QString& dirName):_dirName(dirName) { }
+public:
+  QString getDirName() const { return _dirName; }
+  virtual bool load(DirDataStructure *parent) const = 0;
+  virtual QString prettyPrint() const = 0;
+  virtual QString entryForRSync(const QString& fn) const = 0;
+  virtual QString getMachine() const = 0;
+  virtual void removeFileArgs(const QString& filePath, QString& prg, QStringList& args) const = 0;
+  virtual ~FileLoader() { }
+private:
+  QString _dirName;
+};
+
+class QREMOTEFILEBROWSER_EXPORT LocalFileLoader : public FileLoader
+{
+public:
+  LocalFileLoader(const QString& dirName):FileLoader(dirName) { }
+  bool load(DirDataStructure *parent) const;
+  void fillArgs(const QString& dn, QString& prg, QStringList& args) const;
+  QString prettyPrint() const;
+  QString entryForRSync(const QString& fn) const;
+  QString getMachine() const;
+  void removeFileArgs(const QString& filePath, QString& prg, QStringList& args) const;
+};
+
+class QREMOTEFILEBROWSER_EXPORT RemoteFileLoader : public FileLoader
+{
+public:
+  RemoteFileLoader(const QString& machine,const QString& dirName):FileLoader(dirName),_machine(machine) { }
+  bool load(DirDataStructure *parent) const;
+  void fillArgs(const QString& dn, QString& prg, QStringList& args) const;
+  QString prettyPrint() const;
+  QString entryForRSync(const QString& fn) const;
+  QString getMachine() const;
+  void removeFileArgs(const QString& filePath, QString& prg, QStringList& args) const;
+private:
+  QString _machine;
+};
+
+class QREMOTEFILEBROWSER_EXPORT SelectionMimeData : public QMimeData
+{
+  Q_OBJECT
+public:
+  SelectionMimeData(const QModelIndexList& los):_los(los) { }
+  const QModelIndexList& getSelection() const { return _los; }
+private:
+  QModelIndexList _los;
+};
+
+class QREMOTEFILEBROWSER_EXPORT QRemoteFileSystemModel : public QAbstractItemModel
+{
+  Q_OBJECT
+public:
+  QRemoteFileSystemModel(QObject *parent, FileLoader *fl);
+  QRemoteFileSystemModel(QObject *parent, TopDirDataStructure *fds);
+  QVariant headerData(int section, Qt::Orientation orientation, int role) const;
+  QModelIndex parent(const QModelIndex&) const;
+  QModelIndex index(int, int, const QModelIndex&) const;
+  int rowCount(const QModelIndex&) const;
+  int columnCount(const QModelIndex&) const;
+  QVariant data(const QModelIndex&, int) const;
+  void emitResetModel();
+  FileLoader *getLoader() const { return _fds->getLoader(); }
+  bool isOK() const { return _fds->isOK(); }
+  QString getMachine() const { return _fds->getMachine(); }
+private:
+  TopDirDataStructure *_fds;
+};
+
+#endif
diff --git a/tools/RemoteFileBrowser/RemoteFileBrowser.h b/tools/RemoteFileBrowser/RemoteFileBrowser.h
new file mode 100644 (file)
index 0000000..4120d71
--- /dev/null
@@ -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
index af7c57416fa2821f0d1f2184cc72e6c2df20436f..97cb01d5bb46d97f43e3fe7e25addfb4bb4c42ce 100644 (file)
@@ -19,7 +19,7 @@
 // Author : Anthony GEAY (EDF R&D)
 
 #include "QApplication"
-#include "QRemoteFileBrowser"
+#include "QRemoteFileBrowser.h"
 
 int main(int argc, char *argv[])
 {