itom
Loading...
Searching...
No Matches
pythonFont.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 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 before include global.h)
29 #define NO_IMPORT_ARRAY
30
31 #include "python/pythonWrapper.h"
32#endif
33
34#include <qfont.h>
35
36namespace ito
37{
38
40{
41public:
42 typedef struct
43 {
44 PyObject_HEAD
45 QFont *font;
46 }
47 PyFont;
48
49 #define PyFont_Check(op) PyObject_TypeCheck(op, &ito::PythonFont::PyFontType)
50
51 //-------------------------------------------------------------------------------------------------
52 // constructor, deconstructor, alloc, dellaoc
53 //-------------------------------------------------------------------------------------------------
54 static void PyFont_dealloc(PyFont *self);
55 static PyObject* PyFont_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
56 static int PyFont_init(PyFont *self, PyObject *args, PyObject *kwds);
57
58 static PyObject* createPyFont(const QFont &font);
59
60 //-------------------------------------------------------------------------------------------------
61 // general members
62 //-------------------------------------------------------------------------------------------------
63 static PyObject* PyFont_repr(PyFont *self);
64
65 //-------------------------------------------------------------------------------------------------
66 // pickling
67 //-------------------------------------------------------------------------------------------------
68 static PyObject* PyFont_Reduce(PyFont *self, PyObject *args);
69 static PyObject* PyFont_SetState(PyFont *self, PyObject *args);
70
71 //-------------------------------------------------------------------------------------------------
72 // getter / setter
73 //-------------------------------------------------------------------------------------------------
74 static PyObject* PyFont_getFamily(PyFont *self, void *closure);
75 static int PyFont_setFamily(PyFont *self, PyObject *value, void *closure);
76
77 static PyObject* PyFont_getPointSize(PyFont *self, void *closure);
78 static int PyFont_setPointSize(PyFont *self, PyObject *value, void *closure);
79
80 static PyObject* PyFont_getWeight(PyFont *self, void *closure);
81 static int PyFont_setWeight(PyFont *self, PyObject *value, void *closure);
82
83 static PyObject* PyFont_getItalic(PyFont *self, void *closure);
84 static int PyFont_setItalic(PyFont *self, PyObject *value, void *closure);
85
86 static PyObject* PyFont_getUnderline(PyFont *self, void *closure);
87 static int PyFont_setUnderline(PyFont *self, PyObject *value, void *closure);
88
89 static PyObject* PyFont_getStrikeOut(PyFont *self, void *closure);
90 static int PyFont_setStrikeOut(PyFont *self, PyObject *value, void *closure);
91
92 //-------------------------------------------------------------------------------------------------
93 // static
94 //-------------------------------------------------------------------------------------------------
95 static PyObject* PyFont_isFamilyInstalled(PyFont *self, PyObject *args, PyObject *kwds);
96 static PyObject* PyFont_installedFontFamilies(PyFont * self);
97
98 //-------------------------------------------------------------------------------------------------
99 // type structures
100 //-------------------------------------------------------------------------------------------------
101 //static PyMemberDef PyFont_members[];
102 static PyMethodDef PyFont_methods[];
103 static PyGetSetDef PyFont_getseters[];
104 static PyTypeObject PyFontType;
105 static PyModuleDef PyFontModule;
106
107 static void PyFont_addTpDict(PyObject *tp_dict);
108
109
110
111};
112
113}; //end namespace ito
114
115
116#endif
Definition pythonFont.h:40
Definition apiFunctionsGraph.cpp:40
Definition pythonFont.h:43