X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSALOME_PYQT%2FSalomePyQt%2FSalomePyQt.sip;h=a01c11840039498faeac65312de6d38996c640c9;hb=c9eb32123d4286f92442b06f6ecdf27468b5dec5;hp=19927fffa8430036578acf795eb90f29688e5dcc;hpb=e4b132cf6375e1f4bc1fef8ce9eb7aaf703e2ffc;p=modules%2Fgui.git diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip index 19927fffa..a01c11840 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // 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. +// 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 @@ -25,13 +25,25 @@ %Module SalomePyQt -%Import QtGuimod.sip -%Import QtXmlmod.sip +%Feature ENABLE_CORBA +%Feature ENABLE_PLOT2D + +%Import QtCore/QtCoremod.sip +%Import QtGui/QtGuimod.sip +%If (Qt_5_0_0 -) +%Import QtWidgets/QtWidgetsmod.sip +%End +%Import QtXml/QtXmlmod.sip + +%If (ENABLE_PLOT2D) +%Include SalomePyQt_Plot2d.sip +%End %ExportedHeaderCode #include #include #include +#include #include %End @@ -67,6 +79,9 @@ enum WindowType { WT_ObjectBrowser, WT_PyConsole, WT_LogWindow, +%If (ENABLE_CORBA) + WT_NoteBook, +%End WT_User }; @@ -196,6 +211,39 @@ private: QtxActionGroup( const QtxActionGroup& ); }; +class QtxTreeView : public QTreeView +{ +%TypeHeaderCode +#include +%End + +%ConvertToSubClassCode + if ( qobject_cast( sipCpp ) ) + sipClass = sipClass_QtxTreeView; + else + sipClass = NULL; +%End + +public: + explicit QtxTreeView( QWidget* /TransferThis/ = 0 ); + QtxTreeView( const bool, QWidget* /TransferThis/ = 0 ); + virtual ~QtxTreeView(); + +signals: + void sortingEnabled( bool ); + void selectionChanged(); + +private: + QtxTreeView( const QtxTreeView& ); +}; + +enum VisibilityState +{ + ShownState, + HiddenState, + UnpresentableState +}; + class SalomePyQt { %TypeHeaderCode @@ -203,13 +251,27 @@ class SalomePyQt %End public: +/* KeepReference is necessary on method getDesktop with SIP >= 4.15.5 to avoid garbage collection of + the Python objects added to the desktop. This causes a small memory leak (the wrapper around desktop + object is never garbage collected) but since this object contains only references this is not + considered a big problem. With versions < 4.15, it seems that this reference was kept implicitly. + No proper solution was found for versions between 4.15 and 4.15.4 (included), so those versions + should not be used to compile GUI module. +*/ +%If (SIP_4_15_5 - ) + static QWidget* getDesktop() /ReleaseGIL,KeepReference/ ; +%End +%If ( - SIP_4_15_5) static QWidget* getDesktop() /ReleaseGIL/ ; +%End + static QWidget* getMainFrame() /ReleaseGIL/ ; static QMenuBar* getMainMenuBar() /ReleaseGIL/ ; static QMenu* getPopupMenu( const MenuName ) /ReleaseGIL/ ; static QMenu* getPopupMenu( const QString& ) /ReleaseGIL/ ; static QTreeView* getObjectBrowser() /ReleaseGIL/ ; static SALOME_Selection* getSelection() /Factory,ReleaseGIL/ ; + static void setSelection( const QStringList& ) /ReleaseGIL/ ; static int getStudyId() /ReleaseGIL/ ; static void putInfo( const QString&, const int = 0 ) /ReleaseGIL/ ; static const QString getActiveComponent() /ReleaseGIL/ ; @@ -224,6 +286,7 @@ public: static QStringList getOpenFileNames ( QWidget*, const QString&, const QStringList&, const QString& ) /ReleaseGIL/ ; static QString getExistingDirectory( QWidget*, const QString&, const QString& ) /ReleaseGIL/ ; + static void createRoot() /ReleaseGIL/ ; static QString createObject( const QString& = QString("") ) /ReleaseGIL/ ; static QString createObject( const QString&, const QString&, @@ -236,6 +299,12 @@ public: static QString getName(const QString& ) /ReleaseGIL/ ; static QString getToolTip(const QString& ) /ReleaseGIL/ ; + static void setVisibilityState( const QString&, VisibilityState ); + static VisibilityState getVisibilityState( const QString& ); + + static void setObjectPosition( const QString&, int ); + static int getObjectPosition( const QString& ); + static void setColor( const QString&, const QColor& ) /ReleaseGIL/ ; static QColor getColor( const QString& ) /ReleaseGIL/ ; @@ -250,11 +319,11 @@ public: static QIcon loadIcon( const QString&, const QString& ) /ReleaseGIL/ ; static void helpContext( const QString&, const QString& ) /ReleaseGIL/ ; - static bool dumpView( const QString& ) /ReleaseGIL/ ; + static bool dumpView( const QString&, const int = 0 ) /ReleaseGIL/ ; static int defaultMenuGroup() /ReleaseGIL/ ; - static int createTool( const QString& ) /ReleaseGIL/ ; + static int createTool( const QString&, const QString& = QString() ) /ReleaseGIL/ ; static int createTool( const int, const int, const int = -1 ) /ReleaseGIL/ ; static int createTool( const int, const QString&, const int = -1 ) /ReleaseGIL/ ; static int createTool( QAction*, const int, const int = -1, const int = -1 ) /ReleaseGIL/ ; @@ -283,18 +352,24 @@ public: static QAction* action( const int ) /ReleaseGIL/ ; static int actionId( const QAction* ) /ReleaseGIL/ ; + static QString constant ( const QString& ) /ReleaseGIL/ ; + static void setConstant ( const QString&, const QString& ) /ReleaseGIL/ ; static void addSetting ( const QString&, const QString&, const double ) /ReleaseGIL/ ; static void addSetting ( const QString&, const QString&, const int /Constrained/ ) /ReleaseGIL/ ; static void addSetting ( const QString&, const QString&, const bool, const int ) /ReleaseGIL/ ; static void addSetting ( const QString&, const QString&, const QString& ) /ReleaseGIL/ ; static void addSetting ( const QString&, const QString&, const QColor& ) /ReleaseGIL/ ; + static void addSetting ( const QString&, const QString&, const QByteArray& ) /ReleaseGIL/ ; static int integerSetting( const QString&, const QString&, const int = 0 ) /ReleaseGIL/ ; static double doubleSetting ( const QString&, const QString&, const double = 0 ) /ReleaseGIL/ ; static bool boolSetting ( const QString&, const QString&, const bool = false ) /ReleaseGIL/ ; - static QString stringSetting ( const QString&, const QString&, const QString& = QString("") ) /ReleaseGIL/ ; + static QString stringSetting ( const QString&, const QString&, const QString& = QString(""), const bool = true ) /ReleaseGIL/ ; static QColor colorSetting ( const QString&, const QString&, const QColor& = QColor() ) /ReleaseGIL/ ; + static QByteArray byteArraySetting( const QString&, const QString&, const QByteArray& = QByteArray() ) /ReleaseGIL/ ; static void removeSetting ( const QString&, const QString& ) /ReleaseGIL/ ; static bool hasSetting ( const QString&, const QString& ) /ReleaseGIL/ ; + static QStringList parameters ( const QString& ) /ReleaseGIL/ ; + static QStringList parameters ( const QStringList& ) /ReleaseGIL/ ; // obsolete static void addStringSetting( const QString&, const QString&, bool = true ) /ReleaseGIL/ ; @@ -327,12 +402,16 @@ public: static QString getViewType( const int ) /ReleaseGIL/ ; static bool setViewTitle( const int, const QString& ) /ReleaseGIL/ ; static QString getViewTitle( const int ) /ReleaseGIL/ ; + static bool setViewSize( const int, const int, const int = 0 ) /ReleaseGIL/ ; static QList findViews( const QString& ) /ReleaseGIL/ ; static bool activateView( const int ) /ReleaseGIL/ ; - static int createView( const QString& ) /ReleaseGIL/ ; + static bool activateViewManagerAndView( const int ) /ReleaseGIL/ ; + static QWidget* getViewWidget( const int ) /ReleaseGIL/ ; + static int createView( const QString&, bool visible = true, const int width = 0, const int height = 0 ) /ReleaseGIL/ ; static int createView( const QString&, QWidget* ) /ReleaseGIL/ ; static bool closeView( const int ) /ReleaseGIL/ ; static int cloneView( const int ) /ReleaseGIL/ ; + static void setViewVisible( const int id, bool visible = true ) /ReleaseGIL/ ; static bool isViewVisible( const int id ) /ReleaseGIL/ ; static void setViewClosable( const int id, const bool ) /ReleaseGIL/ ; static bool isViewClosable( const int id ) /ReleaseGIL/ ; @@ -341,4 +420,23 @@ public: static bool splitView( const int, Orientation, Action ) /ReleaseGIL/ ; static bool moveView( const int, const int, const bool ) /ReleaseGIL/ ; static QList neighbourViews( const int ) /ReleaseGIL/ ; + +%If (ENABLE_PLOT2D) +// start Plot2d-related functionality + static void displayCurve(const int, Plot2d_Curve*) /ReleaseGIL/ ; + static void eraseCurve(const int, Plot2d_Curve*) /ReleaseGIL/ ; + static void eraseCurve(Plot2d_Curve*) /ReleaseGIL/ ; + static void updateCurves( const int ) /ReleaseGIL/ ; + static QString getPlot2dTitle(const int, ObjectType = MainTitle) /ReleaseGIL/ ; + static void setPlot2dTitle(const int, const QString&, ObjectType = MainTitle, bool = true) /ReleaseGIL/ ; + static QList getPlot2dFitRangeByCurves(const int) /ReleaseGIL/ ; + static QList getPlot2dFitRangeCurrent(const int) /ReleaseGIL/ ; + static void setPlot2dFitRange(const int, const double XMin, const double XMax, const double YMin, const double YMax ) /ReleaseGIL/ ; +// end of Plot2d-related functionality +%End + + static void processEvents(); + + static void startPyLog(const QString&) /ReleaseGIL/ ; + static void stopPyLog() /ReleaseGIL/ ; };