lib_LTLIBRARIES = libsuit.la
-salomeinclude_HEADERS= \
- SUIT.h \
- SUIT_ActionOperation.h \
- SUIT_Application.h \
- SUIT_Convertor.h \
- SUIT_DataObject.h \
- SUIT_DataObjectIterator.h \
- SUIT_DataObjectKey.h \
- SUIT_DataOwner.h \
- SUIT_Desktop.h \
- SUIT_ExceptionHandler.h \
- SUIT_FileDlg.h \
- SUIT_FileValidator.h \
- SUIT_MessageBox.h \
- SUIT_Operation.h \
- SUIT_OverrideCursor.h \
- SUIT_ParserSettings.h \
- SUIT_PopupClient.h \
- SUIT_ResourceMgr.h \
- SUIT_SelectionMgr.h \
- SUIT_Selector.h \
- SUIT_Session.h \
- SUIT_SmartPtr.h \
- SUIT_Study.h \
- SUIT_ToolButton.h \
- SUIT_Tools.h \
- SUIT_ViewManager.h \
- SUIT_ViewModel.h \
- SUIT_ViewWindow.h \
- SUIT_SelectionFilter.h \
- SUIT_Accel.h \
- SUIT_TreeSync.h
+#VSR: already migrated to Qt4 files
+salomeinclude_HEADERS= \
+ SUIT.h \
+ SUIT_Accel.h \
+ SUIT_ActionOperation.h \
+ SUIT_Application.h \
+ SUIT_DataObject.h \
+ SUIT_DataObjectIterator.h \
+ SUIT_DataObjectKey.h \
+ SUIT_DataOwner.h \
+ SUIT_Desktop.h \
+ SUIT_ExceptionHandler.h \
+ SUIT_FileDlg.h \
+ SUIT_FileValidator.h \
+ SUIT_MessageBox.h \
+ SUIT_Operation.h \
+ SUIT_OverrideCursor.h \
+ SUIT_PopupClient.h \
+ SUIT_ResourceMgr.h \
+ SUIT_SelectionFilter.h \
+ SUIT_SelectionMgr.h \
+ SUIT_Selector.h \
+ SUIT_Session.h \
+ SUIT_SmartPtr.h \
+ SUIT_Study.h \
+ SUIT_ToolButton.h \
+ SUIT_Tools.h \
+ SUIT_TreeSync.h \
+ SUIT_ViewManager.h \
+ SUIT_ViewModel.h \
+ SUIT_ViewWindow.h
-dist_libsuit_la_SOURCES= \
- SUIT_ActionOperation.cxx \
- SUIT_Application.cxx \
- SUIT_DataObject.cxx \
- SUIT_DataObjectIterator.cxx \
- SUIT_DataObjectKey.cxx \
- SUIT_DataOwner.cxx \
- SUIT_Desktop.cxx \
- SUIT_ExceptionHandler.cxx \
- SUIT_FileDlg.cxx \
- SUIT_FileValidator.cxx \
- SUIT_MessageBox.cxx \
- SUIT_Operation.cxx \
- SUIT_OverrideCursor.cxx \
- SUIT_ParserSettings.cxx \
- SUIT_PopupClient.cxx \
- SUIT_ResourceMgr.cxx \
- SUIT_SelectionMgr.cxx \
- SUIT_Selector.cxx \
- SUIT_Session.cxx \
- SUIT_Study.cxx \
- SUIT_ToolButton.cxx \
- SUIT_Tools.cxx \
- SUIT_ViewManager.cxx \
- SUIT_ViewModel.cxx \
- SUIT_ViewWindow.cxx \
- SUIT_SelectionFilter.cxx \
- SUIT_Accel.cxx
+#VSR: not yet migrated to Qt4 files
+# \
+ SUIT_Convertor.h \
+ SUIT_ParserSettings.h
+
+#VSR: already migrated to Qt4 files
+dist_libsuit_la_SOURCES= \
+ SUIT_Accel.cxx \
+ SUIT_ActionOperation.cxx \
+ SUIT_Application.cxx \
+ SUIT_DataObject.cxx \
+ SUIT_DataObjectIterator.cxx \
+ SUIT_DataObjectKey.cxx \
+ SUIT_DataOwner.cxx \
+ SUIT_Desktop.cxx \
+ SUIT_ExceptionHandler.cxx \
+ SUIT_FileDlg.cxx \
+ SUIT_FileValidator.cxx \
+ SUIT_MessageBox.cxx \
+ SUIT_Operation.cxx \
+ SUIT_OverrideCursor.cxx \
+ SUIT_PopupClient.cxx \
+ SUIT_ResourceMgr.cxx \
+ SUIT_SelectionFilter.cxx \
+ SUIT_SelectionMgr.cxx \
+ SUIT_Selector.cxx \
+ SUIT_Session.cxx \
+ SUIT_Study.cxx \
+ SUIT_ToolButton.cxx \
+ SUIT_Tools.cxx \
+ SUIT_ViewManager.cxx \
+ SUIT_ViewModel.cxx \
+ SUIT_ViewWindow.cxx
+
+#VSR: not yet migrated to Qt4 files
+# \
+ SUIT_ParserSettings.cxx
+
+MOC_FILES= \
+ SUIT_Accel_moc.cxx \
+ SUIT_ActionOperation_moc.cxx \
+ SUIT_Application_moc.cxx \
+ SUIT_DataObject_moc.cxx \
+ SUIT_Desktop_moc.cxx \
+ SUIT_FileDlg_moc.cxx \
+ SUIT_Operation_moc.cxx \
+ SUIT_PopupClient_moc.cxx \
+ SUIT_SelectionMgr_moc.cxx \
+ SUIT_Selector_moc.cxx \
+ SUIT_Session_moc.cxx \
+ SUIT_Study_moc.cxx \
+ SUIT_ToolButton_moc.cxx \
+ SUIT_ViewManager_moc.cxx \
+ SUIT_ViewModel_moc.cxx \
+ SUIT_ViewWindow_moc.cxx
-MOC_FILES= \
- SUIT_ActionOperation_moc.cxx \
- SUIT_Application_moc.cxx \
- SUIT_DataObject_moc.cxx \
- SUIT_Desktop_moc.cxx \
- SUIT_FileDlg_moc.cxx \
- SUIT_Operation_moc.cxx \
- SUIT_PopupClient_moc.cxx \
- SUIT_Session_moc.cxx \
- SUIT_Study_moc.cxx \
- SUIT_ToolButton_moc.cxx \
- SUIT_ViewModel_moc.cxx \
- SUIT_ViewWindow_moc.cxx \
- SUIT_ViewManager_moc.cxx \
- SUIT_SelectionMgr_moc.cxx \
- SUIT_Selector_moc.cxx \
- SUIT_Accel_moc.cxx
nodist_libsuit_la_SOURCES=$(MOC_FILES)
-dist_salomeres_DATA = \
- resources/cascade.png \
- resources/htile.png \
+dist_salomeres_DATA = \
+ resources/cascade.png \
+ resources/htile.png \
resources/vtile.png
-nodist_salomeres_DATA = \
- SUIT_images.qm \
+nodist_salomeres_DATA = \
+ SUIT_images.qm \
SUIT_msg_en.qm
libsuit_la_CPPFLAGS=$(QT_INCLUDES) -I$(srcdir)/../Qtx
#define SUIT_H
#if defined SUIT_EXPORTS
-#if defined WNT
+#if defined WIN32
#define SUIT_EXPORT __declspec( dllexport )
#else
#define SUIT_EXPORT
#endif
#else
-#if defined WNT
+#if defined WIN32
#define SUIT_EXPORT __declspec( dllimport )
#else
#define SUIT_EXPORT
#define true 1
#endif
-#if defined WNT
+#if defined WIN32
#pragma warning ( disable: 4251 )
#endif
--- /dev/null
+TEMPLATE = lib
+TARGET = suit
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+INCLUDEPATH += ../../include ../Qtx
+LIBS += -L../../lib -lqtx
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32
+DEFINES += SUIT_EXPORTS
+
+HEADERS = SUIT.h
+HEADERS += SUIT_Accel.h
+HEADERS += SUIT_ActionOperation.h
+HEADERS += SUIT_Application.h
+HEADERS += SUIT_DataObject.h
+HEADERS += SUIT_DataObjectIterator.h
+HEADERS += SUIT_DataObjectKey.h
+HEADERS += SUIT_DataOwner.h
+HEADERS += SUIT_Desktop.h
+HEADERS += SUIT_ExceptionHandler.h
+HEADERS += SUIT_FileDlg.h
+HEADERS += SUIT_FileValidator.h
+HEADERS += SUIT_MessageBox.h
+HEADERS += SUIT_Operation.h
+HEADERS += SUIT_OverrideCursor.h
+HEADERS += SUIT_PopupClient.h
+HEADERS += SUIT_ResourceMgr.h
+HEADERS += SUIT_SelectionFilter.h
+HEADERS += SUIT_SelectionMgr.h
+HEADERS += SUIT_Selector.h
+HEADERS += SUIT_Session.h
+HEADERS += SUIT_SmartPtr.h
+HEADERS += SUIT_Study.h
+HEADERS += SUIT_ToolButton.h
+HEADERS += SUIT_Tools.h
+HEADERS += SUIT_TreeSync.h
+HEADERS += SUIT_ViewManager.h
+HEADERS += SUIT_ViewModel.h
+HEADERS += SUIT_ViewWindow.h
+#HEADERS += SUIT_Convertor.h
+#HEADERS += SUIT_ParserSettings.h
+
+SOURCES = SUIT_Accel.cxx
+SOURCES += SUIT_ActionOperation.cxx
+SOURCES += SUIT_Application.cxx
+SOURCES += SUIT_DataObject.cxx
+SOURCES += SUIT_DataObjectIterator.cxx
+SOURCES += SUIT_DataObjectKey.cxx
+SOURCES += SUIT_DataOwner.cxx
+SOURCES += SUIT_Desktop.cxx
+SOURCES += SUIT_ExceptionHandler.cxx
+SOURCES += SUIT_FileDlg.cxx
+SOURCES += SUIT_FileValidator.cxx
+SOURCES += SUIT_MessageBox.cxx
+SOURCES += SUIT_Operation.cxx
+SOURCES += SUIT_OverrideCursor.cxx
+SOURCES += SUIT_PopupClient.cxx
+SOURCES += SUIT_ResourceMgr.cxx
+SOURCES += SUIT_SelectionFilter.cxx
+SOURCES += SUIT_SelectionMgr.cxx
+SOURCES += SUIT_Selector.cxx
+SOURCES += SUIT_Session.cxx
+SOURCES += SUIT_Study.cxx
+SOURCES += SUIT_ToolButton.cxx
+SOURCES += SUIT_Tools.cxx
+SOURCES += SUIT_ViewManager.cxx
+SOURCES += SUIT_ViewModel.cxx
+SOURCES += SUIT_ViewWindow.cxx
+#SOURCES += SUIT_ParserSettings.cxx
+
+TRANSLATIONS = resources/SUIT_images.ts \
+ resources/SUIT_msg_en.ts
+
+ICONS = resources/*.png
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+resources.files = $$ICONS resources/*.qm
+resources.path = ../../resources
+
+INSTALLS += includes resources
// SUIT_Accel.cxx: implementation of the SUIT_Accel class.
#include "SUIT_Accel.h"
+
#include "SUIT_ViewWindow.h"
#include "SUIT_ViewManager.h"
#include "SUIT_ViewModel.h"
-#include <qobjectlist.h>
-#include <qapplication.h>
-#include <qnamespace.h>
+#include <QCoreApplication>
+#include <QEvent>
+#include <QKeyEvent>
+/*!
+ \class SUIT_Accel
+ \brief Manager of keyboard accelerator bindings.
+*/
SUIT_Accel* SUIT_Accel::myself = 0;
/*! Constructor [private].*/
SUIT_Accel::SUIT_Accel()
- : QObject( qApp, "SUIT_Accel" )
+: QObject( QCoreApplication::instance() )
{
- qApp->installEventFilter( this );
+ QCoreApplication::instance()->installEventFilter( this );
}
/*! getAccel() : public interface for SUIT_Accel object. Only one instance is created and returned. */
/*! unsetActionKey() : unregister a certain key accelerator */
void SUIT_Accel::unsetActionKey( const int key, const QString& type )
{
- if ( myMap.contains( type ) ) {
+ if ( myMap.contains( type ) )
+ {
IdActionMap idActionMap = myMap[type];
- if ( idActionMap.contains( key ) ) {
- idActionMap.erase( key );
+ if ( idActionMap.contains( key ) )
+ {
+ idActionMap.remove( key );
myMap[type] = idActionMap;
}
}
/*! getParentViewWindow() : returns given object or any of its parents-grandparents-.. if it is a SUIT_ViewWindow */
SUIT_ViewWindow* getParentViewWindow( const QObject* obj )
{
- if ( obj ) {
+ if ( obj )
+ {
if ( obj->inherits( "SUIT_ViewWindow" ) )
return (SUIT_ViewWindow*)obj;
else
}
/*! getKey() : returns integer key code (with modifiers) made of key pressed 'inside' given event */
-int getKey( QKeyEvent *keyEvent )
+int getKey( QKeyEvent* keyEvent )
{
- int key = keyEvent->key(),
- state = keyEvent->state();
- if ( state & Qt::ShiftButton )
+ int key = keyEvent->key(), state = keyEvent->modifiers();
+ if ( state & Qt::ShiftModifier )
key += Qt::SHIFT;
- if ( state & Qt::ControlButton )
+ if ( state & Qt::ControlModifier )
key += Qt::CTRL;
- if ( state & Qt::AltButton )
+ if ( state & Qt::AltModifier )
key += Qt::ALT;
- if ( state & Qt::MetaButton )
+ if ( state & Qt::MetaModifier )
key += Qt::META;
return key;
}
-/*! getAccelKey() : returns key pressed if 1) event was KeyPress 2) pressed key is a registered accelerator */
+/*!
+ Returns key pressed if
+ -# event was KeyPress
+ -# pressed key is a registered accelerator
+*/
int SUIT_Accel::getAccelKey( QEvent *event )
{
if ( event && event->type() == QEvent::KeyPress ) {
//
// SUIT_Accel.h: interface for the SUIT_Accel class.
-#ifndef SUIT_Accel_h
-#define SUIT_Accel_h
+#ifndef SUIT_ACELL_H
+#define SUIT_ACELL_H
#include "SUIT.h"
-#include <qobject.h>
-#include <qstring.h>
-#include <qmap.h>
+#include <QMap>
+#include <QObject>
+#include <QString>
-/*!
- \class SUIT_Accel
- Manager of keyboard accelerator bindings
-*/
class SUIT_EXPORT SUIT_Accel: public QObject
{
Q_OBJECT
private:
SUIT_Accel();
- int getAccelKey( QEvent* ); // returns key pressed if 1) event was KeyPress
- // 2) pressed key is a registered accelerator
+ int getAccelKey( QEvent* );
- typedef QMap<int, int> IdActionMap; // key - to - action_id map
- typedef QMap<QString, IdActionMap> ViewerTypeIdActionMap; // viewer_type - to - IdActionMap
- ViewerTypeIdActionMap myMap;
+ typedef QMap<int, int> IdActionMap; //!< maps key to action id
+ typedef QMap<QString, IdActionMap>
+ ViewerTypeIdActionMap; //!< maps viewer type to IdActionMap
+ ViewerTypeIdActionMap myMap; //!< viewer actions map
- QMap<int, bool> myOptMap; // key - to - <not_used> map, used for optimazation. all registered keys (accelerators)
- // are stored in this map.
+ //! Maps key to <not_used> flag map, used for optimization.
+ //! All registered keys (accelerators) are stored in this map.
+ QMap<int, bool> myOptMap;
static SUIT_Accel* myself;
};
/*!Set action.
* Create new instance of QtxAction and set.
*/
-void SUIT_ActionOperation::setAction( const QString& text, const QIconSet& icon,
- const QString& menuText, QKeySequence accel,
- QObject* parent, const char* name, bool toggle )
+void SUIT_ActionOperation::setAction( const QString& text, const QIcon& icon,
+ const QString& menuText, QKeySequence accel,
+ QObject* parent, bool toggle )
{
- setAction( new QtxAction( text, icon, menuText, accel, parent, name, toggle ) );
+ setAction( new QtxAction( text, icon, menuText, accel, parent, 0, toggle ) );
}
/*!Set action.
* Create new instance of QtxAction and set.
*/
void SUIT_ActionOperation::setAction( const QString& text, const QString& menuText,
- QKeySequence accel, QObject* parent, const char* name, bool toggle )
+ QKeySequence accel, QObject* parent, bool toggle )
{
- setAction( new QtxAction(text, menuText, accel, parent, name, toggle ) );
+ setAction( new QtxAction( text, menuText, accel, parent, 0, toggle ) );
}
/*!Set action.
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUIT_ACTIONOPERATION_H
#define SUIT_ACTIONOPERATION_H
#include "SUIT_Operation.h"
-class QtxAction;
+#include <QKeySequence>
+
+class QIcon;
class QString;
-class QIconSet;
-class QKeySequence;
class QWidget;
+class QtxAction;
+
/*!Provide support QtxAction*/
class SUIT_EXPORT SUIT_ActionOperation : public SUIT_Operation
{
Q_OBJECT
public:
- SUIT_ActionOperation( SUIT_Application* theApp );
+ SUIT_ActionOperation( SUIT_Application* );
virtual ~SUIT_ActionOperation();
QtxAction* action() const;
/** @name GUI management*/
//@{
- virtual void setAction( const QString& text, const QIconSet& icon, const QString& menuText,
- QKeySequence accel, QObject* parent, const char* name = 0, bool toggle = false );
+ virtual void setAction( const QString& text, const QIcon& icon, const QString& menuText,
+ QKeySequence accel, QObject* parent, bool toggle = false );
- virtual void setAction( const QString& text, const QString& menuText, QKeySequence accel,
- QObject* parent, const char* name = 0, bool toggle = false );
+ virtual void setAction( const QString& text, const QString& menuText,
+ QKeySequence accel, QObject* parent, bool toggle = false );
virtual void setAction( QtxAction* theAction );
bool addTo( QWidget* theWidget );
bool addTo( QWidget* theWidget, int thePos );
-
+
void setStatusTip( const QString& theTip );
//@}
-
+
private:
QtxAction* myAction;