]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
PR: SARGE port...
authorprascle <prascle>
Mon, 14 Mar 2005 15:21:40 +0000 (15:21 +0000)
committerprascle <prascle>
Mon, 14 Mar 2005 15:21:40 +0000 (15:21 +0000)
17 files changed:
salome_adm/unix/config_files/check_pyqt.m4
salome_adm/unix/config_files/check_qt.m4
salome_adm/unix/config_files/check_sip.m4
salome_adm/unix/make_commence.in
src/PatchQt/Makefile.in
src/PatchQt/qactionP.h
src/PatchQt/qfiledialogP.h
src/PatchQt/qworkspaceP.h
src/SALOMEGUI/PyInterp_PyQt.cxx
src/SALOMEGUI/PyInterp_base.cxx
src/SALOMEGUI/QAD_Desktop.h
src/SALOMEGUI/QAD_FileDlg.h
src/SALOMEGUI/QAD_PyInterp.cxx
src/SALOME_PYQT/Makefile.in
src/SALOME_PYQT/SALOME_PYQT_GUI.cxx
src/SALOME_PYQT/SalomePyQt.sip
src/SALOME_PYQT/SalomePyQt_v4.sip [new file with mode: 0644]

index b1d608adfcd10e8b1a0626b3165f55adbe7cb70c..9374319a6562e210b5ae1c19eceb34f8888ab865 100644 (file)
@@ -56,17 +56,17 @@ fi
   
 AC_CHECK_FILE("$PYUIC",pyqt_ok=yes,pyqt_ok=no)
 
-#if test "x$pyqt_ok" = xyes ; then
-#  AC_CHECK_FILES("$PYQTLIB/qt.py",pyqt_ok=yes,pyqt_ok=no)
-#fi
+dnl if test "x$pyqt_ok" = xyes ; then
+dnl   AC_CHECK_FILES("$PYQTLIB/qt.py",pyqt_ok=yes,pyqt_ok=no)
+dnl fi
 
-#if test "x$pyqt_ok" = xno ; then
-#  AC_CHECK_FILES("$PYQTLIB/qt/qt.py",pyqt_ok=yes,pyqt_ok=no)
-#fi
+dnl if test "x$pyqt_ok" = xno ; then
+dnl  AC_CHECK_FILES("$PYQTLIB/qt/qt.py",pyqt_ok=yes,pyqt_ok=no)
+dnl fi
 
-#if test "x$pyqt_ok" = xyes ; then
-#  AC_CHECK_FILE("$PYQTLIB/libqtcmodule.so",pyqt_ok=yes,pyqt_ok=no)
-#fi
+dnl if test "x$pyqt_ok" = xyes ; then
+dnl   AC_CHECK_FILE("$PYQTLIB/libqtcmodule.so",pyqt_ok=yes,pyqt_ok=no)
+dnl fi
 
 if test "x$pyqt_ok" = xyes ; then
   AC_CHECK_FILES("$PYQT_SIPS/qtmod.sip",pyqt_ok=yes,pyqt_ok=no)
@@ -78,7 +78,7 @@ fi
 if test "x$pyqt_ok" = xyes ; then
   PYQT_ROOT=$PYQTDIR
   PYQT_INCLUDES="-I$PYQT_SIPS"
-  PYQT_LIBS="-L$PYQTLIB -lqtcmodule"
+  PYQT_LIBS="-L$PYQTLIB "
   AC_SUBST(PYQT_ROOT)
   AC_SUBST(PYQT_INCLUDES)
   AC_SUBST(PYQT_LIBS)
index 305a4335fb2e5db7a2ef639c996e670ff6b77dfd..b1557decd72952de075d84afab0a80667366e7eb 100644 (file)
@@ -75,6 +75,25 @@ then
   fi
 fi
 
+version=`moc -v > mocversion 2>&1;cut -c40-44 mocversion;rm -rf mocversion`
+case "$version" in
+  3.3.3)
+   QT_VERS=v3_3_3
+   AC_MSG_RESULT(QT3.3.3 install detected)
+   qt_ok=yes;;
+  3.0.5)
+   AC_MSG_RESULT(QT3.0.5 install detected)
+   QT_VERS=v3_0_5
+   qt_ok=yes;;
+  *)
+   AC_MSG_RESULT(qt version $version not supported)
+   qt_ok=no
+   QT_VERS=no ;;
+esac
+
+AC_SUBST(QT_VERS)
+AC_MSG_RESULT(qt version $QT_VERS )
+
 AC_SUBST(QTDIR)
 QT_ROOT=$QTDIR
 
@@ -160,6 +179,7 @@ AC_SUBST(QT_ROOT)
 AC_SUBST(QT_INCLUDES)
 AC_SUBST(QT_LIBS)
 AC_SUBST(QT_MT_LIBS)
+AC_SUBST(QT_VERS)
 
 AC_LANG_RESTORE
 
index 0a551209b30d617af377b6b46712a2c661f220a8..84d35f62938cc22ea254438f3a3343c260747447 100644 (file)
@@ -38,8 +38,8 @@ else
            SIP_VERS=new ;;
          3.10*)
            SIP_VERS=new2 ;;
-         4.1*)
-           SIP_VERS=new3 ;;
+        4.1*)
+          SIP_VERS=v4_1 ;;
          *)
            AC_MSG_RESULT(sip version $version not supported)
            SIP_VERS=no ;;
@@ -86,15 +86,15 @@ else
        SIP_LIBS="-L${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/site-packages -lsip"
     fi
 
-    if test "x$SIP_VERS" = "xnew3"
+    if test "x$SIP_VERS" = "xv4_1"
         then
-        dnl new3 install : includes and libs are in python install 
-        AC_MSG_RESULT(new3 install detected)
+        dnl 4.1 install : includes and libs are in python install 
+        AC_MSG_RESULT(4.1 install detected)
        sip_ok=yes
         AC_CHECK_FILE($PYTHON_PREFIX/include/python$PYTHON_VERSION/sip.h,sip_ok=$sip_ok,sip_ok=no)
        SIP_INCLUDES="${PYTHON_INCLUDES}"
         AC_CHECK_FILE($PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages/sip.so,sip_ok=$sip_ok,sip_ok=no)
-       SIP_LIBS="-L${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/site-packages -lsip"
+       SIP_LIBS="${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/sip.so"
     fi
 fi
 
index 620cfd9fffdf394f9c6c0ae1bdcf71609ab3fb71..d23993edfb6aa17b7bc964c534f73e078189594a 100644 (file)
@@ -81,6 +81,7 @@ QT_MT_LIBS = @QT_MT_LIBS@
 MOC = @MOC@
 UIC = @UIC@
 
+QT_VERS = @QT_VERS@
 
 #QWT
 
index 0923a7efd0f44c2ca45a13d882b2bada8be41c36..7909f104a0d1d7631eb14f02d92cd46179ec8bf5 100644 (file)
@@ -33,30 +33,32 @@ VPATH=.:@srcdir@:@top_srcdir@/idl
 
 EXPORT_HEADERS = \
        qsplitterP.h \
-       qactionP.h 
-
-#      qfiledialogP.h \
-#      qworkspaceP.h \
+       qworkspaceP.h \
+       qactionP.h \
+       qfiledialogP.h
 
 # Libraries targets
+ifeq ($(QT_VERS),v3_3_3)
+       LIB_SRC = qsplitterP.cxx qsplitterP_moc.cxx
+else
+       LIB_SRC = qsplitterP.cxx qsplitterP_moc.cxx qworkspaceP.cxx qworkspaceP_moc.cxx qactionP.cxx qactionP_moc.cxx qfiledialogP.cxx qfiledialogP_moc.cxx
+endif
 
 LIB = libqsplitterP.la 
-#LIB_SRC = qsplitterP.cxx qsplitterP_moc.cxx qworkspaceP.cxx qworkspaceP_moc.cxx qactionP.cxx qactionP_moc.cxx qfiledialogP.cxx qfiledialogP_moc.cxx
-LIB_SRC = qsplitterP.cxx qsplitterP_moc.cxx qactionP.cxx qactionP_moc.cxx
 
 qsplitterP_moc.cxx: $(inc_builddir)/qsplitterP.h
        $(MOC) $(inc_builddir)/qsplitterP.h -o qsplitterP_moc.cxx
 
-#qworkspaceP_moc.cxx: $(inc_builddir)/qworkspaceP.h
-#      $(MOC) $(inc_builddir)/qworkspaceP.h -o qworkspaceP_moc.cxx
+qworkspaceP_moc.cxx: $(inc_builddir)/qworkspaceP.h 
+       $(MOC) $(inc_builddir)/qworkspaceP.h -o qworkspaceP_moc.cxx
 
 qactionP_moc.cxx: $(inc_builddir)/qactionP.h
        $(MOC) $(inc_builddir)/qactionP.h -o qactionP_moc.cxx
 
-#qfiledialogP_moc.cxx: $(inc_builddir)/qfiledialogP.h
-#      $(MOC) $(inc_builddir)/qfiledialogP.h -o qfiledialogP_moc.cxx
+qfiledialogP_moc.cxx: $(inc_builddir)/qfiledialogP.h
+       $(MOC) $(inc_builddir)/qfiledialogP.h -o qfiledialogP_moc.cxx
 
-CPPFLAGS+=$(QT_INCLUDES) -I${QTDIR}/src/kernel -I$(QTDIR)/mkspecs/linux-g++
+CPPFLAGS+=$(QT_INCLUDES) -I${QTDIR}/src/kernel -I$(QTDIR)/mkspecs/linux-g++ -I/usr/share/qt3/mkspecs/linux-g++
 CXXFLAGS+=
 LDFLAGS+=$(QT_MT_LIBS) 
 
index 1fcf05053e73ddee4f6b18884d96bc9f06e7076b..160324087b70d35a40db2ceb45c4cf2ca2a97d2b 100644 (file)
 
 #ifndef QT_NO_ACTION
 
+#if QT_VERSION > 0x030005
+#include <qaction.h>
+#define QActionP QAction
+#define QActionPGroup QActionGroup
+#else
+
 class QActionPPrivate;
 class QActionPGroupPrivate;
 class QStatusBar;
@@ -184,4 +190,6 @@ public:
 
 #endif
 
+#endif // QT_VERSION
+
 #endif
index f7355a193deaf63e1f849a60a509d25d3a21c2fc..ab615b7533b0c6be1adb00a149244351c70bd562 100644 (file)
@@ -68,6 +68,11 @@ class QFileDialogQFileListView;
 #include "qlineedit.h"
 #endif // QT_H
 
+#if QT_VERSION > 0x030005
+#include <qfiledialog.h>
+#define QFileDialogP QFileDialog
+#else
+
 #ifndef QT_NO_FILEDIALOG
 
 class Q_EXPORT QFileIconProviderP : public QObject
@@ -525,4 +530,6 @@ private:
 
 #endif
 
+#endif // QT_VERSION
+
 #endif // QFILEDIALOG_H
index fb15237357d196e2c39d84f7b08fc70a9fcb446c..2197da251308a1b610ab34a35c6aee6f79eef7d4 100644 (file)
 #include <qlabel.h>
 #endif // QT_H
 
+#if QT_VERSION > 0x030005
+#include <qworkspace.h>
+#define QWorkspaceP QWorkspace
+#else
+
 class QWorkspacePChild;
 class QShowEvent;
 class QWorkspacePPrivate;
@@ -350,5 +355,5 @@ private:
 
     QTitleBarPPrivate *d;
 };
-
+#endif // QT_VERSION
 #endif // QWORKSPACEP_H
index 2d6119b512e741d09de98e795faa45176e4359a6..9ebf3f1d90db62079805f856f92b7fb7864e3e99 100644 (file)
@@ -31,6 +31,7 @@ PyInterp_PyQt::~PyInterp_PyQt()
 void PyInterp_PyQt::initState()
 {
   SCRUTE(PyInterp_base::_gtstate);
+  //PyLockWrapper aLock(_tstate);
   _tstate=PyInterp_base::_gtstate;
   PyThreadState_Swap(_tstate);
   SCRUTE(_tstate);
@@ -38,6 +39,7 @@ void PyInterp_PyQt::initState()
 
 void PyInterp_PyQt::initContext()
 {
+  //PyLockWrapper aLock(_tstate);
   _g = PyDict_New();          // create interpreter dictionnary context
   PyObject *bimod = PyImport_ImportModule("__builtin__");
   PyDict_SetItemString(_g, "__builtins__", bimod);
@@ -47,14 +49,11 @@ void PyInterp_PyQt::initContext()
 void PyInterp_PyQt::run(const char *command)
 {
   MESSAGE("compile");
-  //PyLockWrapper aLock(_tstate);
-  PyEval_AcquireLock();
-  PyThreadState_Swap(_tstate);
+  PyLockWrapper aLock(_tstate);
   PyObject *code = Py_CompileString((char *)command,"PyGUI",Py_file_input);
   if(!code){
     // Une erreur s est produite en general SyntaxError
     PyErr_Print();
-    PyEval_ReleaseLock();
     return;
   }
   PyObject *r = PyEval_EvalCode(code,_g,_g);
@@ -62,10 +61,8 @@ void PyInterp_PyQt::run(const char *command)
   if(!r){
     // Une erreur s est produite a l execution
     PyErr_Print();
-    PyEval_ReleaseLock();
     return;
   }
   Py_DECREF(r);
-  PyEval_ReleaseLock();
 }
 
index 851fc73f631601db0c337aadbe9a16769614185e..92c2e68ba3b92e162834d34409e00afc97fb6f7d 100644 (file)
@@ -36,18 +36,19 @@ static int MYPYDEBUG = 0;
 static QMutex myMutex(true);
 
 
-PyLockWrapper::PyLockWrapper(PyThreadState* theThreadState):
+PyLockWrapper::PyLockWrapper(PyThreadState* theThreadState): 
   myThreadState(theThreadState),
   mySaveThreadState(PyInterp_base::_gtstate)
 {
   PyEval_AcquireLock();
-  mySaveThreadState = PyThreadState_Swap(theThreadState);
+  mySaveThreadState = PyThreadState_Swap(myThreadState); // store previous current in save,
+                                                         // set local in current
 }
 
 
 PyLockWrapper::~PyLockWrapper(){
-  PyThreadState_Swap(mySaveThreadState);
-  PyEval_ReleaseLock();
+  PyThreadState_Swap(mySaveThreadState); // restore previous current (no need to get local,
+  PyEval_ReleaseLock();                  // local thread state* already in _tstate
 }
 
 
@@ -112,11 +113,8 @@ PyInterp_base::PyInterp_base(): _tstate(0), _vout(0), _verr(0), _g(0), _atFirst(
 PyInterp_base::~PyInterp_base()
 {
   if(MYPYDEBUG) MESSAGE("PyInterp_base::~PyInterp_base() - this = "<<this);
-  //PyLockWrapper aLock(_tstate);
-  PyEval_AcquireLock();
-  PyThreadState_Swap(_tstate);
+  PyLockWrapper aLock(_tstate);
   //Py_EndInterpreter(_tstate);
-  PyEval_ReleaseLock();
 }
 
 
@@ -153,7 +151,7 @@ void PyInterp_base::initialize()
   if(MYPYDEBUG) MESSAGE("PyInterp_base::initialize() - this = "<<this<<"; _gtstate = "<<_gtstate);
 
   // The lock will be acquired in initState. Make provision to release it on exit
-  //PyReleaseLock aReleaseLock;
+  PyReleaseLock aReleaseLock;
 
   initState();
   initContext();
@@ -175,7 +173,6 @@ void PyInterp_base::initialize()
   
   // All the initRun outputs are redirected to the standard output (console)
   initRun();
-  PyEval_ReleaseLock();
 }
 
 
@@ -281,9 +278,7 @@ int PyInterp_base::simpleRun(const char *command)
 
   // We come from C++ to enter Python world
   // We need to acquire the Python global lock
-  //PyLockWrapper aLock(_tstate);
-  PyEval_AcquireLock();
-  PyThreadState_Swap(_tstate);
+  PyLockWrapper aLock(_tstate);
 
   // Reset redirected outputs before treatment
   PySys_SetObject("stderr",_verr);
@@ -297,7 +292,6 @@ int PyInterp_base::simpleRun(const char *command)
   // Outputs are redirected on standards outputs (console)
   PySys_SetObject("stdout",PySys_GetObject("__stdout__"));
   PySys_SetObject("stderr",PySys_GetObject("__stderr__"));
-  PyEval_ReleaseLock();
   return ier;
 }
 
@@ -326,23 +320,17 @@ const char * PyInterp_base::getNext()
 
 
 string PyInterp_base::getverr(){ 
-  //PyLockWrapper aLock(_tstate);
-  PyEval_AcquireLock();
-  PyThreadState_Swap(_tstate);
+  PyLockWrapper aLock(_tstate);
   PyObjWrapper v(PycStringIO->cgetvalue(_verr));
   string aRet(PyString_AsString(v));
-  PyEval_ReleaseLock();
   return aRet;
 }
 
 
 string PyInterp_base::getvout(){  
-  //PyLockWrapper aLock(_tstate);
-  PyEval_AcquireLock();
-  PyThreadState_Swap(_tstate);
+  PyLockWrapper aLock(_tstate);
   PyObjWrapper v(PycStringIO->cgetvalue(_vout));
   string aRet(PyString_AsString(v));
-  PyEval_ReleaseLock();
   return aRet;
 }
  
index a14f7d785b3ebba9c431cae0bb9d30fa30f6544c..35c71416e8726c46d93ec3ed892c600cc6bb0473 100644 (file)
 #include <qcombobox.h>
 #include <qstatusbar.h>
 #include <qpopupmenu.h>
-#if QT_VERSION == 0x030005
 #include "qworkspaceP.h"
-#else
-#include <qworkspace.h>
-#define QWorkspaceP QWorkspace
-#endif
 #include <qmainwindow.h>
 #include <qfiledialog.h>
 #include <qtoolbutton.h>
index a234de43da0f1610d1ac394210c4a5cb5cb60d6a..71b19cfe25099bd8547d1391c452a1f15a796e03 100644 (file)
 #include <qcombobox.h>
 #include <qpushbutton.h>
 
-// VSR (18/01/2005): use patched QFileDialog only for the official 3.0.5 version of Qt
-#if QT_VERSION == 0x030005
 #include <qfiledialogP.h>
-#else
-#include <qfiledialog.h>
-#define QFileDialogP QFileDialog
-#endif
 
 #include "QAD.h"
 #include "QAD_FileValidator.h"
index d7da14e4299b4752a68a5d47fa5e576c1f370768..ac0ddd2b5f46fa51092bccabb9dcd01575a7887f 100644 (file)
@@ -72,6 +72,7 @@ QAD_PyInterp::~QAD_PyInterp()
 
 void QAD_PyInterp::initState()
 {
+  //PyLockWrapper aLock(_tstate);
   _tstate = Py_NewInterpreter(); // create an interpreter and save current state
   PySys_SetArgv(PyInterp_base::_argc,PyInterp_base::_argv); // initialize sys.argv
   if(MYDEBUG) MESSAGE("QAD_PyInterp::initState - this = "<<this<<"; _tstate = "<<_tstate);
@@ -92,6 +93,7 @@ void QAD_PyInterp::initState()
 
 void QAD_PyInterp::initContext()
 {
+  //PyLockWrapper aLock(_tstate);
   PyObject *m = PyImport_AddModule("__main__");  // interpreter main module (module context)
   if(!m){
     if(MYDEBUG) MESSAGE("problem...");
index a8e766b14571a9eafa909d95925c28d92bc93dd4..30a129164c4ac54d02645e02c3b23e54433147aa 100644 (file)
@@ -21,32 +21,63 @@ VPATH=.:@srcdir@:@top_srcdir@/idl
 # SIP C++ Python
 # SIP defined in make_commence.in
 #SIP_FLAGS    = -t WS_X11 -t Qt_3_0_5 -s ".cc" -c $(CURDIR) -I $(PYQT_SIPS)
-SIP_FLAGS    =  -t WS_X11 -t Qt_3_3_0 -s ".cc" -c $(CURDIR) -I $(PYQT_SIPS)
 
 
 # SIP input file(s)
 
-SIP_FILES = SalomePyQt.sip
+#SIP_FILES = SalomePyQt.sip
 
 # SIP-generated C++ source files (corresponding line should be added for each wrapped class 
 # contained by SalomePyQt module)
+#SIP_SRC=$(CURDIR)/SalomePyQtcmodule.cc \
+#      $(CURDIR)/sipSalomePyQtSalomePyQt.cc \
+#      $(CURDIR)/sipSalomePyQtSALOME_Selection.cc
 
+ifeq ($(SIP_VERS),v4_1)
+SIP_FLAGS    = -t WS_X11 -t Qt_3_3_0 -s ".cc" -c $(CURDIR) -I $(PYQT_SIPS)
 SIP_SRC=$(CURDIR)/sipSalomePyQtcmodule.cc \
        $(CURDIR)/sipSalomePyQtSalomePyQt.cc \
        $(CURDIR)/sipSalomePyQtSALOME_Selection.cc
-
-ifeq ($(SIP_VERS),new3)
 MOC_SRC = sipSalomePyQtcmodule_moc.cxx
 MOC_H = sipSalomePyQtcmodule.h
+SIP_FILES = SalomePyQt_v4.sip
+#LDFLAGS+= -lSalomeGUI 
+LDFLAGS+= -lSalomeGUI -module
+
+# Libraries targets
+LIB = SalomePyQt.la
+else
+ifeq ($(SIP_VERS),new2)
+SIP_FLAGS    = -t WS_X11 -t Qt_3_0_5 -s ".cc" -c $(CURDIR) -I $(PYQT_SIPS)
+SIP_SRC=$(CURDIR)/SalomePyQtcmodule.cc \
+       $(CURDIR)/sipSalomePyQtSalomePyQt.cc \
+       $(CURDIR)/sipSalomePyQtSALOME_Selection.cc
+MOC_SRC = SalomePyQtcmodule_moc.cxx
+MOC_H = SalomePyQtcmodule.h
+SIP_FILES = SalomePyQt.sip
+LDFLAGS+= -lSalomeGUI -lqtcmodule
+
+# Libraries targets
+LIB = libSalomePyQtcmodule.la
+
+EXPORT_SHAREDPYSCRIPTS = SalomePyQt.py
 else
+SIP_FLAGS    = -t WS_X11 -t Qt_3_0_5 -s ".cc" -c $(CURDIR) -I $(PYQT_SIPS)
+SIP_SRC=$(CURDIR)/SalomePyQtcmodule.cc \
+       $(CURDIR)/sipSalomePyQtSalomePyQt.cc \
+       $(CURDIR)/sipSalomePyQtSALOME_Selection.cc
 MOC_SRC = sipSalomePyQtProxySalomePyQt_moc.cxx
 MOC_H = sipSalomePyQtProxySalomePyQt.h
-endif
+SIP_FILES = SalomePyQt.sip
+LDFLAGS+= -lSalomeGUI -lqtcmodule
 
 # Libraries targets
-
 LIB = libSalomePyQtcmodule.la
 
+EXPORT_SHAREDPYSCRIPTS = SalomePyQt.py
+endif
+endif
+
 LIB_SRC += SalomePyQt.cxx SALOME_PYQT_GUI.cxx $(SIP_SRC) $(MOC_SRC) 
 LIB_MOC = SALOME_PYQT_GUI.h
 
@@ -57,10 +88,9 @@ LIB_MOC = SALOME_PYQT_GUI.h
 LIB_CLIENT_IDL = SALOME_Exception.idl SALOME_ContainerManager.idl
 
 CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(SIP_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES)
-LIBS+= $(PYTHON_LIBS) $(VTK_LIBS) $(OGL_LIBS)
-# $(SIP_LIBS) $(PYQT_LIBS)
-LDFLAGS+= -lSalomeGUI
-# -lqtcmodule
+LIBS+= $(PYTHON_LIBS) $(SIP_LIBS) $(PYQT_LIBS) $(VTK_LIBS) $(OGL_LIBS)
+#LDFLAGS+= -lSalomeGUI -lqtcmodule
+#LDFLAGS+= -lSalomeGUI 
 
 
 # Custom build step: generate C++ wrapping according to $(SIP_FILES)
index 4bc22a58c2ea97aac1317c7a92448c4d8305e5ea..c8a3eabcc6056d28c5959bebf6d643e15ba08379 100644 (file)
@@ -7,7 +7,7 @@
 // $Header$
 //=============================================================================
 
-#include "SALOME_PYQT_GUI.h" // this include must be first (see PyInterp_base.h)!
+#include "SALOME_PYQT_GUI.h"
 
 #include "QAD_Desktop.h"
 
 #include "SALOMEGUI_QtCatchCorbaException.hxx"
 #include "utilities.h"
 
-//#include <sipSalomePyQtDeclSalomePyQt.h>
+
+#if QT_VERSION > 0x030005
 #include <sipAPISalomePyQt.h>
+#else
+#include <sipSalomePyQtDeclSalomePyQt.h>
+#endif
+
 #include <sipqtQWorkspace.h>
 #include <sipqtQPopupMenu.h>
 
index 69bbcfd135c8ef8e365cbb1d767152655aea7167..ebfac3e001f5b7a5e516328dd909419f490b7408 100644 (file)
@@ -2,12 +2,15 @@
 
 %Import qtmod.sip
 
+
 class SALOME_Selection : QObject
 {
-%TypeHeaderCode
+
+%HeaderCode
 #include <SALOME_Selection.h>
 %End
 
+
 public:
   SALOME_Selection(const QString &);
   void Clear();
@@ -29,7 +32,8 @@ enum MenuName {
 
 class SalomePyQt
 {
-%TypeHeaderCode
+
+%HeaderCode
 #include <SalomePyQt.hxx>
 %End
 
diff --git a/src/SALOME_PYQT/SalomePyQt_v4.sip b/src/SALOME_PYQT/SalomePyQt_v4.sip
new file mode 100644 (file)
index 0000000..69bbcfd
--- /dev/null
@@ -0,0 +1,62 @@
+%Module SalomePyQt
+
+%Import qtmod.sip
+
+class SALOME_Selection : QObject
+{
+%TypeHeaderCode
+#include <SALOME_Selection.h>
+%End
+
+public:
+  SALOME_Selection(const QString &);
+  void Clear();
+  void ClearIObjects();
+
+signals:
+  void currentSelectionChanged();
+};
+
+enum MenuName {
+  File        = 1,
+  View        = 2,
+  Edit        = 3,
+  Preferences = 4,
+  Tools       = 5,
+  Window      = 6,
+  Help        = 7  
+};
+
+class SalomePyQt
+{
+%TypeHeaderCode
+#include <SalomePyQt.hxx>
+%End
+
+public:
+  static QWidget*    getDesktop();
+  static QWorkspace* getMainFrame();
+  static QMenuBar*   getMainMenuBar();
+  static QPopupMenu* getPopupMenu( const MenuName );
+  static SALOME_Selection* getSelection();
+  static int getStudyId();
+  static void putInfo( const QString& );
+  static void putInfo( const QString&, int );
+
+  static const QString& getActiveComponent();
+
+  static void updateObjBrowser( int, bool );
+
+
+  static bool removeSettings(QString);
+  static QString getSetting(QString);
+  static void addStringSetting(QString, QString, bool);
+  static void addIntSetting(QString, int, bool);
+  static void addDoubleSetting(QString, double, bool);
+
+  static QString getFileName(QWidget*, const QString&, const QStringList&, const QString&, bool);
+  static QStringList getOpenFileNames(QWidget*, const QString&, const QStringList&, const QString&);
+  static QString getExistingDirectory(QWidget*, const QString&, const QString&);
+  static void helpContext(const QString&, const QString&);
+  static bool dumpView(const QString&);
+};