itom 2.0.0
|
00001 /* ******************************************************************** 00002 itom software 00003 URL: http://www.uni-stuttgart.de/ito 00004 Copyright (C) 2015, Institut fuer Technische Optik (ITO), 00005 Universitaet 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 PYTHONFONT_H 00024 #define PYTHONFONT_H 00025 00026 /* includes */ 00027 #ifndef Q_MOC_RUN 00028 #define PY_ARRAY_UNIQUE_SYMBOL itom_ARRAY_API //see numpy help ::array api :: Miscellaneous :: Importing the api (this line must bebefore include global.h) 00029 #define NO_IMPORT_ARRAY 00030 00031 //python 00032 // see http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=7f3f750596a105d48ea84ebfe1b1c4ca03e0bab3 00033 #if (defined _DEBUG) && (defined WIN32) 00034 #undef _DEBUG 00035 #include "Python.h" 00036 #define _DEBUG 00037 #else 00038 #include "Python.h" 00039 #endif 00040 #endif 00041 00042 #include <qfont.h> 00043 00044 namespace ito 00045 { 00046 00047 class PythonFont 00048 { 00049 public: 00050 typedef struct 00051 { 00052 PyObject_HEAD 00053 QFont *font; 00054 } 00055 PyFont; 00056 00057 #define PyFont_Check(op) PyObject_TypeCheck(op, &ito::PythonFont::PyFontType) 00058 00059 //------------------------------------------------------------------------------------------------- 00060 // constructor, deconstructor, alloc, dellaoc 00061 //------------------------------------------------------------------------------------------------- 00062 static void PyFont_dealloc(PyFont *self); 00063 static PyObject* PyFont_new(PyTypeObject *type, PyObject *args, PyObject *kwds); 00064 static int PyFont_init(PyFont *self, PyObject *args, PyObject *kwds); 00065 00066 static PyObject* createPyFont(const QFont &font); 00067 00068 //------------------------------------------------------------------------------------------------- 00069 // general members 00070 //------------------------------------------------------------------------------------------------- 00071 static PyObject* PyFont_repr(PyFont *self); 00072 00073 //------------------------------------------------------------------------------------------------- 00074 // pickling 00075 //------------------------------------------------------------------------------------------------- 00076 static PyObject* PyFont_Reduce(PyFont *self, PyObject *args); 00077 static PyObject* PyFont_SetState(PyFont *self, PyObject *args); 00078 00079 //------------------------------------------------------------------------------------------------- 00080 // getter / setter 00081 //------------------------------------------------------------------------------------------------- 00082 static PyObject* PyFont_getFamily(PyFont *self, void *closure); 00083 static int PyFont_setFamily(PyFont *self, PyObject *value, void *closure); 00084 00085 static PyObject* PyFont_getPointSize(PyFont *self, void *closure); 00086 static int PyFont_setPointSize(PyFont *self, PyObject *value, void *closure); 00087 00088 static PyObject* PyFont_getWeight(PyFont *self, void *closure); 00089 static int PyFont_setWeight(PyFont *self, PyObject *value, void *closure); 00090 00091 static PyObject* PyFont_getItalic(PyFont *self, void *closure); 00092 static int PyFont_setItalic(PyFont *self, PyObject *value, void *closure); 00093 00094 static PyObject* PyFont_getUnderline(PyFont *self, void *closure); 00095 static int PyFont_setUnderline(PyFont *self, PyObject *value, void *closure); 00096 00097 static PyObject* PyFont_getStrikeOut(PyFont *self, void *closure); 00098 static int PyFont_setStrikeOut(PyFont *self, PyObject *value, void *closure); 00099 00100 //------------------------------------------------------------------------------------------------- 00101 // type structures 00102 //------------------------------------------------------------------------------------------------- 00103 //static PyMemberDef PyFont_members[]; 00104 static PyMethodDef PyFont_methods[]; 00105 static PyGetSetDef PyFont_getseters[]; 00106 static PyTypeObject PyFontType; 00107 static PyModuleDef PyFontModule; 00108 00109 static void PyFont_addTpDict(PyObject *tp_dict); 00110 00111 00112 00113 }; 00114 00115 }; //end namespace ito 00116 00117 00118 #endif