itom  4.1.0
pythonFont.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, Institut fuer Technische Optik (ITO),
5  Universitaet 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 PYTHONFONT_H
24 #define PYTHONFONT_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 bebefore include global.h)
29  #define NO_IMPORT_ARRAY
30 
31  //python
32  // see http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=7f3f750596a105d48ea84ebfe1b1c4ca03e0bab3
33  #if (defined _DEBUG) && (defined WIN32)
34  #undef _DEBUG
35  #include "python/pythonWrapper.h"
36  #define _DEBUG
37  #else
38  #include "python/pythonWrapper.h"
39  #endif
40 #endif
41 
42 #include <qfont.h>
43 
44 namespace ito
45 {
46 
48 {
49 public:
50  typedef struct
51  {
52  PyObject_HEAD
53  QFont *font;
54  }
55  PyFont;
56 
57  #define PyFont_Check(op) PyObject_TypeCheck(op, &ito::PythonFont::PyFontType)
58 
59  //-------------------------------------------------------------------------------------------------
60  // constructor, deconstructor, alloc, dellaoc
61  //-------------------------------------------------------------------------------------------------
62  static void PyFont_dealloc(PyFont *self);
63  static PyObject* PyFont_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
64  static int PyFont_init(PyFont *self, PyObject *args, PyObject *kwds);
65 
66  static PyObject* createPyFont(const QFont &font);
67 
68  //-------------------------------------------------------------------------------------------------
69  // general members
70  //-------------------------------------------------------------------------------------------------
71  static PyObject* PyFont_repr(PyFont *self);
72 
73  //-------------------------------------------------------------------------------------------------
74  // pickling
75  //-------------------------------------------------------------------------------------------------
76  static PyObject* PyFont_Reduce(PyFont *self, PyObject *args);
77  static PyObject* PyFont_SetState(PyFont *self, PyObject *args);
78 
79  //-------------------------------------------------------------------------------------------------
80  // getter / setter
81  //-------------------------------------------------------------------------------------------------
82  static PyObject* PyFont_getFamily(PyFont *self, void *closure);
83  static int PyFont_setFamily(PyFont *self, PyObject *value, void *closure);
84 
85  static PyObject* PyFont_getPointSize(PyFont *self, void *closure);
86  static int PyFont_setPointSize(PyFont *self, PyObject *value, void *closure);
87 
88  static PyObject* PyFont_getWeight(PyFont *self, void *closure);
89  static int PyFont_setWeight(PyFont *self, PyObject *value, void *closure);
90 
91  static PyObject* PyFont_getItalic(PyFont *self, void *closure);
92  static int PyFont_setItalic(PyFont *self, PyObject *value, void *closure);
93 
94  static PyObject* PyFont_getUnderline(PyFont *self, void *closure);
95  static int PyFont_setUnderline(PyFont *self, PyObject *value, void *closure);
96 
97  static PyObject* PyFont_getStrikeOut(PyFont *self, void *closure);
98  static int PyFont_setStrikeOut(PyFont *self, PyObject *value, void *closure);
99 
100  //-------------------------------------------------------------------------------------------------
101  // static
102  //-------------------------------------------------------------------------------------------------
103  static PyObject* PyFont_isFamilyInstalled(PyFont *self, PyObject *args, PyObject *kwds);
104  static PyObject* PyFont_installedFontFamilies(PyFont * self);
105 
106  //-------------------------------------------------------------------------------------------------
107  // type structures
108  //-------------------------------------------------------------------------------------------------
109  //static PyMemberDef PyFont_members[];
110  static PyMethodDef PyFont_methods[];
111  static PyGetSetDef PyFont_getseters[];
112  static PyTypeObject PyFontType;
113  static PyModuleDef PyFontModule;
114 
115  static void PyFont_addTpDict(PyObject *tp_dict);
116 
117 
118 
119 };
120 
121 }; //end namespace ito
122 
123 
124 #endif
Definition: pythonFont.h:47
Definition: pythonFont.h:50
Definition: apiFunctionsGraph.cpp:39