itom
Loading...
Searching...
No Matches
pythonItom.h
1/* ********************************************************************
2 itom software
3 URL: http://www.uni-stuttgart.de/ito
4 Copyright (C) 2020, Institut für Technische Optik (ITO),
5 Universität Stuttgart, Germany
6
7 This file is part of itom.
8
9 itom is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Library General Public Licence as published by
11 the Free Software Foundation; either version 2 of the Licence, or (at
12 your option) any later version.
13
14 itom is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
17 General Public Licence for more details.
18
19 You should have received a copy of the GNU Library General Public License
20 along with itom. If not, see <http://www.gnu.org/licenses/>.
21*********************************************************************** */
22
23#ifndef PYTHONITOM_H
24#define PYTHONITOM_H
25
26/* includes */
27#ifndef Q_MOC_RUN
28 #define PY_ARRAY_UNIQUE_SYMBOL itom_ARRAY_API //see numpy help ::array api :: Miscellaneous :: Importing the api (this line must before include global.h)
29 #define NO_IMPORT_ARRAY
30
31 #include "python/pythonWrapper.h"
32#endif
33
34#include "../global.h"
35
36#include <qhash.h>
37#include <qstring.h>
38
39namespace ito
40{
41
42class FuncWeakRef; //forward declaration
43
45{
46
47public:
48 static PyMethodDef PythonMethodItom[];
49 static PyModuleDef PythonModuleItom;
50 static PyObject* PyInitItom(void);
51
53 static PyObject* PyOpenEmptyScriptEditor(PyObject *pSelf, PyObject *pArgs);
54 static PyObject* PyNewScript(PyObject *pSelf, PyObject *pArgs);
55 static PyObject* PyLog(PyObject* pSelf, PyObject* pArgs);
56 static PyObject* PyOpenScript(PyObject *pSelf, PyObject *pArgs);
57 static PyObject* PyClearCommandLine(PyObject *pSelf);
58 static PyObject* PyShowHelpViewer(PyObject* pSelf, PyObject* pArgs, PyObject* pKwds);
59
60 static PyObject* PyPlotImage(PyObject *pSelf, PyObject *pArgs, PyObject *pKwds);
61 static PyObject* PyLiveImage(PyObject *pSelf, PyObject *pArgs, PyObject *pKwds);
62
63 static PyObject* PyPlot1d(PyObject *pSelf, PyObject *pArgs, PyObject *pKwds);
64 static PyObject* PyPlot2d(PyObject *pSelf, PyObject *pArgs, PyObject *pKwds);
65 static PyObject* PyPlot25d(PyObject *pSelf, PyObject *pArgs, PyObject *pKwds);
66
67 static PyObject* PyFilter(PyObject *pSelf, PyObject *pArgs, PyObject *pKwds);
68 static PyObject* PyFilterHelp(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds);
69 static PyObject* PyWidgetHelp(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds);
70 static PyObject* PyPluginHelp(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds);
71 static PyObject* PyAboutInfo(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds);
72 static PyObject* PyPlotHelp(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds);
73 static PyObject* PyItomVersion(PyObject* pSelf, PyObject* pArgs, PyObject* pKwds);
74
75 static PyObject* PyLoadIDC(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds);
76 static PyObject* PySaveIDC(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds);
77
78 static PyObject* PyPluginLoaded(PyObject* pSelf, PyObject* pArgs);
79 static PyObject* PyFilterLoaded(PyObject* pSelf, PyObject* pArgs);
80 static PyObject* PyPlotLoaded(PyObject* pSelf, PyObject* pArgs);
81
82 static PyObject* PySaveDataObject(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds);
83 static PyObject* PyLoadDataObject(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds);
84
85 static PyObject* PyRegisterResource(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds);
86 static PyObject* PyUnregisterResource(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds);
87
88 static PyObject* PyAddButton(PyObject* pSelf, PyObject* pArgs, PyObject *kwds);
89 static PyObject* PyRemoveButton(PyObject* pSelf, PyObject* pArgs);
90
91 static PyObject* PyAddMenu(PyObject* pSelf, PyObject* args, PyObject *kwds);
92 static PyObject* PyRemoveMenu(PyObject* pSelf, PyObject* args, PyObject *kwds);
93
94 static PyObject* PySetCentralWidgetsSizes(PyObject* pSelf, PyObject* pArgs, PyObject* pKwds);
95
96 static PyObject* PyDumpMenusAndButtons(PyObject* pSelf);
97
98 static PyObject* PyCheckSignals(PyObject* pSelf);
99 static PyObject* PyProcessEvents(PyObject* pSelf);
100
101 static PyObject* PySaveMatlabMat(PyObject* pSelf, PyObject* pArgs);
102 static PyObject* PyLoadMatlabMat(PyObject* pSelf, PyObject* pArgs);
103 static PyObject* PyMatlabMatDataObjectConverter(PyObject *element);
105 static PyObject* PyGetDebugger(PyObject* pSelf);
106 static PyObject* PyGCStartTracking(PyObject *pSelf);
107 static PyObject* PyGCEndTracking(PyObject *pSelf);
108
109 static PyObject* PyAutoReloader(PyObject* pSelf, PyObject *args, PyObject *kwds);
110
111 static PyObject* PyGetScreenInfo(PyObject* pSelf);
112
113 static PyObject* getDefaultScaleableUnits(PyObject* pSelf);
114 static PyObject* scaleValueAndUnit(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds);
115
116 static PyObject* getAppPath(PyObject* pSelf);
117 static PyObject* getQtToolPath(PyObject* pSelf, PyObject* pArgs);
118 static PyObject* getCurrentPath(PyObject* pSelf);
119 static PyObject* setCurrentPath(PyObject* pSelf, PyObject* pArgs);
120
121 static PyObject* PyGetPalette(PyObject* pSelf, PyObject* pArgs);
122 static PyObject* PySetPalette(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds);
123 static PyObject* PyGetPaletteList(PyObject* pSelf, PyObject* pArgs);
124
125 static PyObject* compressData(PyObject* pSelf, PyObject* pArgs);
126 static PyObject* uncompressData(PyObject* pSelf, PyObject* pArgs);
127
128 static PyObject* setApplicationCursor(PyObject* pSelf, PyObject* pArgs);
129
130 static PyObject* userCheckIsAdmin(PyObject* pSelf);
131 static PyObject* userCheckIsDeveloper(PyObject* pSelf);
132 static PyObject* userCheckIsUser(PyObject* pSelf);
133 static PyObject* userGetUserInfo(PyObject* pSelf);
134
135 static PyObject* PyClearAll(PyObject* pSelf);
136
137 static PyObject* PyCopyStringToClipboard(PyObject* pSelf, PyObject* pArgs, PyObject *pKwds);
138
139protected:
140 static QHash<size_t, QString> m_gcTrackerList;
141
142 static ito::FuncWeakRef* hashButtonOrMenuCode(PyObject *code, PyObject *argtuple, ito::RetVal &retval, QString &codeString);
143 static ito::RetVal unhashButtonOrMenuCode(const size_t &funcID);
144 static ito::RetVal unhashButtonOrMenuCode(const ito::FuncWeakRef *funcWeakRef);
145};
146
147} //end namespace ito
148#endif
Definition pythonEngine.h:96
Definition pythonItom.h:45
static PyObject * PyMatlabMatDataObjectConverter(PyObject *element)
returns new reference to element and extracts tags, if possible
Definition pythonItom.cpp:4706
static PyObject * PyInitItom(void)
methods of module itom
Definition pythonItom.cpp:6838
static QHash< size_t, QString > m_gcTrackerList
list with objects currently tracked by python garbage collector.
Definition pythonItom.h:140
static PyObject * PyOpenEmptyScriptEditor(PyObject *pSelf, PyObject *pArgs)
Definition pythonItom.cpp:89
static PyObject * PyNewScript(PyObject *pSelf, PyObject *pArgs)
Definition pythonItom.cpp:134
static PyObject * PyOpenScript(PyObject *pSelf, PyObject *pArgs)
Definition pythonItom.cpp:236
Class for managing status values (like errors or warning)
Definition retVal.h:54
Definition apiFunctionsGraph.cpp:40