| 1 |
/*************************************************************************** |
| 2 |
* Copyright (c) 2021 Werner Mayer <wmayer[at]users.sourceforge.net> * |
| 3 |
* * |
| 4 |
* This file is part of the FreeCAD CAx development system. * |
| 5 |
* * |
| 6 |
* This library is free software; you can redistribute it and/or * |
| 7 |
* modify it under the terms of the GNU Library General Public * |
| 8 |
* License as published by the Free Software Foundation; either * |
| 9 |
* version 2 of the License, or (at your option) any later version. * |
| 10 |
* * |
| 11 |
* This library is distributed in the hope that it will be useful, * |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
| 14 |
* GNU Library General Public License for more details. * |
| 15 |
* * |
| 16 |
* You should have received a copy of the GNU Library General Public * |
| 17 |
* License along with this library; see the file COPYING.LIB. If not, * |
| 18 |
* write to the Free Software Foundation, Inc., 59 Temple Place, * |
| 19 |
* Suite 330, Boston, MA 02111-1307, USA * |
| 20 |
* * |
| 21 |
***************************************************************************/ |
| 22 |
|
| 23 |
|
| 24 |
#ifndef GUI_MAINWINDOWPY_H |
| 25 |
#define GUI_MAINWINDOWPY_H |
| 26 |
|
| 27 |
#include <Base/PyObjectBase.h> |
| 28 |
#include <CXX/Extensions.hxx> |
| 29 |
#include <QPointer> |
| 30 |
#include <FCGlobal.h> |
| 31 |
|
| 32 |
namespace Gui |
| 33 |
{ |
| 34 |
class MainWindow; |
| 35 |
|
| 36 |
class GuiExport MainWindowPy: public Py::PythonExtension<MainWindowPy> |
| 37 |
{ |
| 38 |
public: |
| 39 |
static void init_type(); |
| 40 |
static PyObject* extension_object_new(PyTypeObject* subtype, PyObject* /*args*/, PyObject* /*kwds*/); |
| 41 |
|
| 42 |
static Py::Object createWrapper(MainWindow* mw); |
| 43 |
static Py::Object type(); |
| 44 |
static Py::ExtensionObject<MainWindowPy> create(MainWindow* mw); |
| 45 |
|
| 46 |
explicit MainWindowPy(MainWindow* mw); |
| 47 |
~MainWindowPy() override; |
| 48 |
|
| 49 |
Py::Object repr() override; |
| 50 |
|
| 51 |
Py::Object getWindows(const Py::Tuple&); |
| 52 |
Py::Object getWindowsOfType(const Py::Tuple&); |
| 53 |
Py::Object setActiveWindow(const Py::Tuple&); |
| 54 |
Py::Object getActiveWindow(const Py::Tuple&); |
| 55 |
Py::Object addWindow(const Py::Tuple&); |
| 56 |
Py::Object removeWindow(const Py::Tuple&); |
| 57 |
|
| 58 |
Py::Object showHint(const Py::Tuple&); |
| 59 |
Py::Object hideHint(const Py::Tuple&); |
| 60 |
|
| 61 |
private: |
| 62 |
QPointer<MainWindow> _mw; |
| 63 |
}; |
| 64 |
|
| 65 |
} // namespace Gui |
| 66 |
|
| 67 |
#endif // GUI_MAINWINDOWPY_H |