]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Porting to Qt4.
authormkr <mkr@opencascade.com>
Thu, 24 May 2007 07:10:37 +0000 (07:10 +0000)
committermkr <mkr@opencascade.com>
Thu, 24 May 2007 07:10:37 +0000 (07:10 +0000)
src/DDS/DDS.pro
src/Event/Event.pro [new file with mode: 0644]
src/Event/SALOME_Event.cxx
src/Event/SALOME_Event.hxx
src/Makefile.am
src/OBJECT/OBJECT.pro [new file with mode: 0644]
src/src.pro

index 96434e96d1fc609a9dec6610d53349198361a5f5..f4d677c4570afa0e242e861df3ac9501938ce59a 100644 (file)
@@ -18,7 +18,7 @@ CONFIG -= debug release debug_and_release
 CONFIG += qt thread debug dll shared
 
 win32:DEFINES += WIN32
-DEFINES += DDS_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
+DEFINES += OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
 
 HEADERS  =  DDS.h
 HEADERS += DDS_DicGroup.h
diff --git a/src/Event/Event.pro b/src/Event/Event.pro
new file mode 100644 (file)
index 0000000..4361449
--- /dev/null
@@ -0,0 +1,26 @@
+TEMPLATE = lib
+TARGET = Event
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+KERNEL_CXXFLAGS = $$(KERNEL_ROOT_DIR)/include/salome
+
+INCLUDEPATH += ../../include $${KERNEL_CXXFLAGS}
+LIBS += 
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32 
+DEFINES += EVENT_EXPORTS
+
+HEADERS  = Event.h
+HEADERS += SALOME_Event.hxx
+
+SOURCES  = SALOME_Event.cxx
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+INSTALLS += includes
index 928cd2341c2f5954a344002f85e7e53b3cfac726..f50cdc9c4715a8bb7f4e17138dc1cc47d4bf6a0c 100755 (executable)
@@ -30,9 +30,8 @@
 
 //#include "utilities.h"
 
-#include <qsemaphore.h>
-#include <qapplication.h>
-#include <qthread.h>
+#include <QSemaphore>
+#include <QApplication>
 
 // asv 21.02.05 : introducing multi-platform approach of thread comparison
 // on Unix using pthread_t type for storing ThreadId
 
 static DWORD myThread;
 #else
-#include <qthread.h>
 #include <pthread.h>
 
 static pthread_t myThread;
 #endif
 
+SALOME_CustomEvent::SALOME_CustomEvent( int type )
+  : QEvent( (QEvent::Type)type ), d( 0 )
+{
+}
+
+SALOME_CustomEvent::SALOME_CustomEvent( QEvent::Type type, void *data )
+  : QEvent( type ), d( data )
+{
+}
+
+void * SALOME_CustomEvent::data() const
+{
+  return d;
+}
+
+void SALOME_CustomEvent::setData( void* data )
+{
+  d = data;
+}
+
+const int NumberOfResources = 2;
+
 /*!
   \return thread id
 */
@@ -83,8 +103,8 @@ bool SALOME_Event::IsSessionThread(){
 SALOME_Event::SALOME_Event(){
 //  if(MYDEBUG) MESSAGE( "SALOME_Event::SALOME_Event(): this = "<<this );
   // Prepare the semaphore 
-  mySemaphore = new QSemaphore( 2 );
-  *mySemaphore += 2;
+  mySemaphore = new QSemaphore( NumberOfResources );
+  mySemaphore->acquire( NumberOfResources );
 }
 
 /*!
@@ -92,8 +112,8 @@ SALOME_Event::SALOME_Event(){
 */
 SALOME_Event::~SALOME_Event(){
 //  if(MYDEBUG) MESSAGE( "SALOME_Event::~SALOME_Event(): this = "<<this );
-  if ( mySemaphore->available() < mySemaphore->total() )
-    *mySemaphore -= mySemaphore->total() - mySemaphore->available();
+  if ( mySemaphore->available() < NumberOfResources )
+    mySemaphore->release( NumberOfResources - mySemaphore->available() );
   delete mySemaphore;
 }
 
@@ -102,9 +122,9 @@ SALOME_Event::~SALOME_Event(){
 */
 void SALOME_Event::process()
 {
-  QThread::postEvent( qApp, new QCustomEvent( SALOME_EVENT, (void*)this ) );
-//  if(MYDEBUG) MESSAGE( "SALOME_Event::process(): this = "<<this<<", *mySemaphore += 1 " );
-  *mySemaphore += 1;
+  QApplication::postEvent( qApp, new SALOME_CustomEvent( SALOME_EVENT, (void*)this ) );
+//  if(MYDEBUG) MESSAGE( "SALOME_Event::process(): this = "<<this<<", mySemaphore->acquire( 1 )" );
+  mySemaphore->acquire( 1 );
 //  if(MYDEBUG) MESSAGE( "SALOME_Event::process(): this = "<<this<<" - COMPLETED" );
 }
 
@@ -115,5 +135,5 @@ void SALOME_Event::processed()
 {
 //  if(MYDEBUG) MESSAGE( "SALOME_Event::processed(): this = "<<this );
   // process() takes control over mySemaphore after the next line is executed
-  *mySemaphore -= 1;
+  mySemaphore->release( 1 );
 }
index 91f53d6bcd5ac5bf3996f2808eb4680b132bfd9f..424eb97df57e83492ace4c9bf896fc3e31c79ab2 100755 (executable)
 #ifndef SALOME_Event_HeaderFile
 #define SALOME_Event_HeaderFile
 
-#include <qevent.h>
+#include <QEvent>
+
+#include <Event.h>
 
 #define SALOME_EVENT QEvent::Type( QEvent::User + 10000 )
 
+/*!
+  \class SALOME_CustomEvent
+  *  Description:
+  *  It is a generic event class for user-defined events.
+  *  This class contains a generic void* data member that may be used
+  *  for transferring event-specific data to the receiver.
+*/
+class EVENT_EXPORT SALOME_CustomEvent : public QEvent {
+public:
+  SALOME_CustomEvent( int type );
+  SALOME_CustomEvent( QEvent::Type type, void *data );
+
+  void *data() const;
+  void setData( void* data );
+
+private:
+  void *d;
+};
+
 class QSemaphore;
 
 /*!
@@ -66,8 +87,6 @@ class QSemaphore;
  *    There is no.
  */
 
-#include <Event.h>
-
 class EVENT_EXPORT SALOME_Event{
 public:
   SALOME_Event();
index e0e99408e265d9601e1e5e557bdd6781fc98326f..462e3ac2eba0bc57884c629168ad0bfb93e3f7c4 100755 (executable)
@@ -33,7 +33,7 @@ if ENABLE_SALOMEOBJECT
 # VSR: this is the original packages list
 #  SUBDIRS += OBJECT
 # VSR: already migrated to Qt4 packages
-  SUBDIRS += 
+  SUBDIRS += OBJECT
 endif
 
 if ENABLE_GLVIEWER
@@ -101,5 +101,5 @@ if GUI_ENABLE_CORBA
 #  SUBDIRS +=  RegistryDisplay TOOLSGUI \
 #          Event Session SalomeApp SALOME_SWIG SALOME_PY SALOME_PYQT
 # VSR: already migrated to Qt4 packages
-  SUBDIRS += 
+  SUBDIRS += Event
 endif
diff --git a/src/OBJECT/OBJECT.pro b/src/OBJECT/OBJECT.pro
new file mode 100644 (file)
index 0000000..c6f0708
--- /dev/null
@@ -0,0 +1,66 @@
+TEMPLATE = lib
+TARGET = SalomeObject
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+CASROOT = $$(CASROOT)
+CAS_CPPFLAGS = $${CASROOT}/inc
+
+CAS_LDPATH = -L$${CASROOT}/Linux/lib -lTKV3d
+
+INCLUDEPATH += ../../include $${CAS_CPPFLAGS}
+LIBS += $${CAS_LDPATH}
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32 
+DEFINES += OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
+
+HEADERS  = SALOME_InteractiveObject.hxx
+HEADERS += Handle_SALOME_InteractiveObject.hxx
+HEADERS += SALOME_AISShape.hxx
+HEADERS += Handle_SALOME_AISShape.hxx
+HEADERS += SALOME_AISObject.hxx
+HEADERS += Handle_SALOME_AISObject.hxx
+HEADERS += SALOME_ListIO.hxx
+HEADERS += SALOME_ListIteratorOfListIO.hxx
+HEADERS += Handle_SALOME_ListNodeOfListIO.hxx
+HEADERS += SALOME_ListNodeOfListIO.hxx
+HEADERS += Handle_SALOME_Filter.hxx
+HEADERS += SALOME_Filter.hxx
+HEADERS += Handle_SALOME_TypeFilter.hxx
+HEADERS += SALOME_TypeFilter.hxx
+HEADERS += SALOME_DataMapOfIOMapOfInteger.hxx
+HEADERS += SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger.hxx
+HEADERS += Handle_SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx
+HEADERS += SALOME_Selection.h
+HEADERS += SALOME_AISObject.ixx
+HEADERS += SALOME_AISObject.jxx
+HEADERS += SALOME_AISShape.ixx
+HEADERS += SALOME_AISShape.jxx
+HEADERS += SALOME_Filter.ixx
+HEADERS += SALOME_Filter.jxx
+HEADERS += SALOME_InteractiveObject.ixx
+HEADERS += SALOME_InteractiveObject.jxx
+HEADERS += SALOME_TypeFilter.ixx
+HEADERS += SALOME_TypeFilter.jxx
+HEADERS += SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx
+
+SOURCES  = SALOME_InteractiveObject.cxx
+SOURCES += SALOME_AISShape.cxx
+SOURCES += SALOME_AISObject.cxx
+SOURCES += SALOME_ListIO_0.cxx
+SOURCES += SALOME_ListIteratorOfListIO_0.cxx
+SOURCES += SALOME_ListNodeOfListIO_0.cxx
+SOURCES += SALOME_Filter.cxx
+SOURCES += SALOME_TypeFilter.cxx
+SOURCES += SALOME_DataMapOfIOMapOfInteger_0.cxx
+SOURCES += SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_0.cxx
+SOURCES += SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger_0.cxx
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+INSTALLS += includes
index 3057752ad864bf9dfd85539d86f2564d70f9a608..04c513cfa0017ad9f1e4173638381d1ccf26cb25 100644 (file)
@@ -13,4 +13,6 @@ SUBDIRS += LogWindow
 SUBDIRS += PyInterp
 SUBDIRS += PyConsole
 SUBDIRS += Prs
+SUBDIRS += OBJECT
+SUBDIRS += Event