itom 2.0.0
|
00001 /* ******************************************************************** 00002 itom software 00003 URL: http://www.uni-stuttgart.de/ito 00004 Copyright (C) 2013, Institut für Technische Optik (ITO), 00005 Universität Stuttgart, Germany 00006 00007 This file is part of itom. 00008 00009 itom is free software; you can redistribute it and/or modify it 00010 under the terms of the GNU Library General Public Licence as published by 00011 the Free Software Foundation; either version 2 of the Licence, or (at 00012 your option) any later version. 00013 00014 itom is distributed in the hope that it will be useful, but 00015 WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library 00017 General Public Licence for more details. 00018 00019 You should have received a copy of the GNU Library General Public License 00020 along with itom. If not, see <http://www.gnu.org/licenses/>. 00021 *********************************************************************** */ 00022 00023 #ifndef PYTHONFIGURE_H 00024 #define PYTHONFIGURE_H 00025 00026 #include "pythonCommon.h" 00027 #include "pythonUi.h" 00028 #include "pythonQtConversion.h" 00029 #include "pythonQtSignalMapper.h" 00030 #include "pythonItomMetaObject.h" 00031 00032 #include <qstring.h> 00033 #include <qvariant.h> 00034 #include <qobject.h> 00035 #include <qhash.h> 00036 #include <qsharedpointer.h> 00037 #include <qpointer.h> 00038 00039 namespace ito 00040 { 00041 00042 class PythonFigure 00043 { 00044 public: 00045 00046 //################################################################################################# 00047 // Figure 00048 //################################################################################################# 00049 00050 //------------------------------------------------------------------------------------------------- 00051 // typedefs 00052 //------------------------------------------------------------------------------------------------- 00053 00054 typedef struct 00055 { 00056 // PyFigure() : uiItem(0), rows(0), cols(0), currentSubplotIdx(0), signalMapper(NULL) {} 00057 PythonUi::PyUiItem uiItem; 00058 QSharedPointer<unsigned int> guardedFigHandle; 00059 int rows; 00060 int cols; 00061 int currentSubplotIdx; 00062 PythonQtSignalMapper *signalMapper; 00063 } 00064 PyFigure; 00065 00066 //------------------------------------------------------------------------------------------------- 00067 // macros 00068 //------------------------------------------------------------------------------------------------- 00069 #define PyFigure_Check(op) PyObject_TypeCheck(op, &ito::PythonFigure::PyFigureType) 00070 00071 //------------------------------------------------------------------------------------------------- 00072 // constructor, deconstructor, alloc, dellaoc 00073 //------------------------------------------------------------------------------------------------- 00074 static void PyFigure_dealloc(PyFigure *self); 00075 static PyObject *PyFigure_new(PyTypeObject *type, PyObject *args, PyObject *kwds); 00076 static int PyFigure_init(PyFigure *self, PyObject *args, PyObject *kwds); 00077 00078 //------------------------------------------------------------------------------------------------- 00079 // general members 00080 //------------------------------------------------------------------------------------------------- 00081 static PyObject* PyFigure_repr(PyFigure *self); 00082 static PyObject* PyFigure_show(PyFigure *self, PyObject *args); 00083 static PyObject* PyFigure_hide(PyFigure *self); 00084 static PyObject* PyFigure_plot(PyFigure *self, PyObject *args, PyObject *kwds); 00085 static PyObject* PyFigure_liveImage(PyFigure *self, PyObject *args, PyObject *kwds); 00086 00087 static PyObject* PyFigure_getSubplot(PyFigure *self, PyObject *args); 00088 00089 //------------------------------------------------------------------------------------------------- 00090 // getter / setter 00091 //------------------------------------------------------------------------------------------------- 00092 static PyObject* PyFigure_getHandle(PyFigure *self, void *closure); 00093 static PyObject* PyFigure_getDocked(PyFigure *self, void *closure); 00094 static int PyFigure_setDocked(PyFigure *self, PyObject *value, void *closure); 00095 00096 //------------------------------------------------------------------------------------------------- 00097 // static members 00098 //------------------------------------------------------------------------------------------------- 00099 static PyObject* PyFigure_close(PyFigure *self, PyObject *args); 00100 00101 //------------------------------------------------------------------------------------------------- 00102 // type structures 00103 //------------------------------------------------------------------------------------------------- 00104 static PyGetSetDef PyFigure_getseters[]; 00105 static PyMemberDef PyFigure_members[]; 00106 static PyMethodDef PyFigure_methods[]; 00107 static PyTypeObject PyFigureType; 00108 static PyModuleDef PyFigureModule; 00109 static void PyFigure_addTpDict(PyObject *tp_dict); 00110 00111 private: 00112 00113 }; 00114 00115 }; //end namespace ito 00116 00117 00118 #endif