1 /*
2  * Interface wrapper code.
3  *
4  * Generated by SIP 4.19.16
5  *
6  *     Copyright: (c) 2018 by Total Control Software
7  *     License:   wxWindows License
8  */
9 
10 #include "sipAPI_richtext.h"
11 
12         #include <wx/richtext/richtextbuffer.h>
13 
14         #include <wx/font.h>
15         #include <wx/richtext/richtextbuffer.h>
16         #include <wx/object.h>
17         #include <wx/object.h>
18         #include <wx/object.h>
19 
20 
21 class sipwxRichTextFontTable : public  ::wxRichTextFontTable
22 {
23 public:
24     sipwxRichTextFontTable();
25     sipwxRichTextFontTable(const  ::wxRichTextFontTable&);
26     ~sipwxRichTextFontTable();
27 
28 public:
29     sipSimpleWrapper *sipPySelf;
30 
31 private:
32     sipwxRichTextFontTable(const sipwxRichTextFontTable &);
33     sipwxRichTextFontTable &operator = (const sipwxRichTextFontTable &);
34 };
35 
sipwxRichTextFontTable()36 sipwxRichTextFontTable::sipwxRichTextFontTable():  ::wxRichTextFontTable(), sipPySelf(SIP_NULLPTR)
37 {
38 }
39 
sipwxRichTextFontTable(const::wxRichTextFontTable & table)40 sipwxRichTextFontTable::sipwxRichTextFontTable(const  ::wxRichTextFontTable& table):  ::wxRichTextFontTable(table), sipPySelf(SIP_NULLPTR)
41 {
42 }
43 
~sipwxRichTextFontTable()44 sipwxRichTextFontTable::~sipwxRichTextFontTable()
45 {
46     sipInstanceDestroyedEx(&sipPySelf);
47 }
48 
49 
50 PyDoc_STRVAR(doc_wxRichTextFontTable_IsOk, "IsOk() -> bool\n"
51 "\n"
52 "Returns true if the font table is valid.");
53 
54 extern "C" {static PyObject *meth_wxRichTextFontTable_IsOk(PyObject *, PyObject *);}
meth_wxRichTextFontTable_IsOk(PyObject * sipSelf,PyObject * sipArgs)55 static PyObject *meth_wxRichTextFontTable_IsOk(PyObject *sipSelf, PyObject *sipArgs)
56 {
57     PyObject *sipParseErr = SIP_NULLPTR;
58 
59     {
60         const  ::wxRichTextFontTable *sipCpp;
61 
62         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxRichTextFontTable, &sipCpp))
63         {
64             bool sipRes;
65 
66             PyErr_Clear();
67 
68             Py_BEGIN_ALLOW_THREADS
69             sipRes = sipCpp->IsOk();
70             Py_END_ALLOW_THREADS
71 
72             if (PyErr_Occurred())
73                 return 0;
74 
75             return PyBool_FromLong(sipRes);
76         }
77     }
78 
79     /* Raise an exception if the arguments couldn't be parsed. */
80     sipNoMethod(sipParseErr, sipName_RichTextFontTable, sipName_IsOk, SIP_NULLPTR);
81 
82     return SIP_NULLPTR;
83 }
84 
85 
86 PyDoc_STRVAR(doc_wxRichTextFontTable_FindFont, "FindFont(fontSpec) -> wx.Font\n"
87 "\n"
88 "Finds a font for the given attribute object.");
89 
90 extern "C" {static PyObject *meth_wxRichTextFontTable_FindFont(PyObject *, PyObject *, PyObject *);}
meth_wxRichTextFontTable_FindFont(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)91 static PyObject *meth_wxRichTextFontTable_FindFont(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
92 {
93     PyObject *sipParseErr = SIP_NULLPTR;
94 
95     {
96         const  ::wxRichTextAttr* fontSpec;
97          ::wxRichTextFontTable *sipCpp;
98 
99         static const char *sipKwdList[] = {
100             sipName_fontSpec,
101         };
102 
103         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxRichTextFontTable, &sipCpp, sipType_wxRichTextAttr, &fontSpec))
104         {
105              ::wxFont*sipRes;
106 
107             PyErr_Clear();
108 
109             Py_BEGIN_ALLOW_THREADS
110             sipRes = new  ::wxFont(sipCpp->FindFont(*fontSpec));
111             Py_END_ALLOW_THREADS
112 
113             if (PyErr_Occurred())
114                 return 0;
115 
116             return sipConvertFromNewType(sipRes,sipType_wxFont,SIP_NULLPTR);
117         }
118     }
119 
120     /* Raise an exception if the arguments couldn't be parsed. */
121     sipNoMethod(sipParseErr, sipName_RichTextFontTable, sipName_FindFont, SIP_NULLPTR);
122 
123     return SIP_NULLPTR;
124 }
125 
126 
127 PyDoc_STRVAR(doc_wxRichTextFontTable_Clear, "Clear()\n"
128 "\n"
129 "Clears the font table.");
130 
131 extern "C" {static PyObject *meth_wxRichTextFontTable_Clear(PyObject *, PyObject *);}
meth_wxRichTextFontTable_Clear(PyObject * sipSelf,PyObject * sipArgs)132 static PyObject *meth_wxRichTextFontTable_Clear(PyObject *sipSelf, PyObject *sipArgs)
133 {
134     PyObject *sipParseErr = SIP_NULLPTR;
135 
136     {
137          ::wxRichTextFontTable *sipCpp;
138 
139         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxRichTextFontTable, &sipCpp))
140         {
141             PyErr_Clear();
142 
143             Py_BEGIN_ALLOW_THREADS
144             sipCpp->Clear();
145             Py_END_ALLOW_THREADS
146 
147             if (PyErr_Occurred())
148                 return 0;
149 
150             Py_INCREF(Py_None);
151             return Py_None;
152         }
153     }
154 
155     /* Raise an exception if the arguments couldn't be parsed. */
156     sipNoMethod(sipParseErr, sipName_RichTextFontTable, sipName_Clear, SIP_NULLPTR);
157 
158     return SIP_NULLPTR;
159 }
160 
161 
162 PyDoc_STRVAR(doc_wxRichTextFontTable_SetFontScale, "SetFontScale(fontScale)\n"
163 "\n"
164 "Set the font scale factor.");
165 
166 extern "C" {static PyObject *meth_wxRichTextFontTable_SetFontScale(PyObject *, PyObject *, PyObject *);}
meth_wxRichTextFontTable_SetFontScale(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)167 static PyObject *meth_wxRichTextFontTable_SetFontScale(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
168 {
169     PyObject *sipParseErr = SIP_NULLPTR;
170 
171     {
172         double fontScale;
173          ::wxRichTextFontTable *sipCpp;
174 
175         static const char *sipKwdList[] = {
176             sipName_fontScale,
177         };
178 
179         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bd", &sipSelf, sipType_wxRichTextFontTable, &sipCpp, &fontScale))
180         {
181             PyErr_Clear();
182 
183             Py_BEGIN_ALLOW_THREADS
184             sipCpp->SetFontScale(fontScale);
185             Py_END_ALLOW_THREADS
186 
187             if (PyErr_Occurred())
188                 return 0;
189 
190             Py_INCREF(Py_None);
191             return Py_None;
192         }
193     }
194 
195     /* Raise an exception if the arguments couldn't be parsed. */
196     sipNoMethod(sipParseErr, sipName_RichTextFontTable, sipName_SetFontScale, SIP_NULLPTR);
197 
198     return SIP_NULLPTR;
199 }
200 
201 
202 extern "C" {static PyObject *slot_wxRichTextFontTable___ne__(PyObject *,PyObject *);}
slot_wxRichTextFontTable___ne__(PyObject * sipSelf,PyObject * sipArg)203 static PyObject *slot_wxRichTextFontTable___ne__(PyObject *sipSelf,PyObject *sipArg)
204 {
205      ::wxRichTextFontTable *sipCpp = reinterpret_cast< ::wxRichTextFontTable *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_wxRichTextFontTable));
206 
207     if (!sipCpp)
208         return SIP_NULLPTR;
209 
210     PyObject *sipParseErr = SIP_NULLPTR;
211 
212     {
213         const  ::wxRichTextFontTable* table;
214 
215         if (sipParseArgs(&sipParseErr, sipArg, "1J9", sipType_wxRichTextFontTable, &table))
216         {
217             bool sipRes;
218 
219             PyErr_Clear();
220 
221             Py_BEGIN_ALLOW_THREADS
222             sipRes = sipCpp-> ::wxRichTextFontTable::operator!=(*table);
223             Py_END_ALLOW_THREADS
224 
225             if (PyErr_Occurred())
226                 return 0;
227 
228             return PyBool_FromLong(sipRes);
229         }
230     }
231 
232     Py_XDECREF(sipParseErr);
233 
234     if (sipParseErr == Py_None)
235         return SIP_NULLPTR;
236 
237     return sipPySlotExtend(&sipModuleAPI__richtext, ne_slot, sipType_wxRichTextFontTable, sipSelf, sipArg);
238 }
239 
240 
241 extern "C" {static PyObject *slot_wxRichTextFontTable___eq__(PyObject *,PyObject *);}
slot_wxRichTextFontTable___eq__(PyObject * sipSelf,PyObject * sipArg)242 static PyObject *slot_wxRichTextFontTable___eq__(PyObject *sipSelf,PyObject *sipArg)
243 {
244      ::wxRichTextFontTable *sipCpp = reinterpret_cast< ::wxRichTextFontTable *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_wxRichTextFontTable));
245 
246     if (!sipCpp)
247         return SIP_NULLPTR;
248 
249     PyObject *sipParseErr = SIP_NULLPTR;
250 
251     {
252         const  ::wxRichTextFontTable* table;
253 
254         if (sipParseArgs(&sipParseErr, sipArg, "1J9", sipType_wxRichTextFontTable, &table))
255         {
256             bool sipRes;
257 
258             PyErr_Clear();
259 
260             Py_BEGIN_ALLOW_THREADS
261             sipRes = sipCpp-> ::wxRichTextFontTable::operator==(*table);
262             Py_END_ALLOW_THREADS
263 
264             if (PyErr_Occurred())
265                 return 0;
266 
267             return PyBool_FromLong(sipRes);
268         }
269     }
270 
271     Py_XDECREF(sipParseErr);
272 
273     if (sipParseErr == Py_None)
274         return SIP_NULLPTR;
275 
276     return sipPySlotExtend(&sipModuleAPI__richtext, eq_slot, sipType_wxRichTextFontTable, sipSelf, sipArg);
277 }
278 
279 
280 /* Cast a pointer to a type somewhere in its inheritance hierarchy. */
281 extern "C" {static void *cast_wxRichTextFontTable(void *, const sipTypeDef *);}
cast_wxRichTextFontTable(void * sipCppV,const sipTypeDef * targetType)282 static void *cast_wxRichTextFontTable(void *sipCppV, const sipTypeDef *targetType)
283 {
284      ::wxRichTextFontTable *sipCpp = reinterpret_cast< ::wxRichTextFontTable *>(sipCppV);
285 
286     if (targetType == sipType_wxObject)
287         return static_cast< ::wxObject *>(sipCpp);
288 
289     return sipCppV;
290 }
291 
292 
293 /* Call the instance's destructor. */
294 extern "C" {static void release_wxRichTextFontTable(void *, int);}
release_wxRichTextFontTable(void * sipCppV,int sipState)295 static void release_wxRichTextFontTable(void *sipCppV, int sipState)
296 {
297     Py_BEGIN_ALLOW_THREADS
298 
299     if (sipState & SIP_DERIVED_CLASS)
300         delete reinterpret_cast<sipwxRichTextFontTable *>(sipCppV);
301     else
302         delete reinterpret_cast< ::wxRichTextFontTable *>(sipCppV);
303 
304     Py_END_ALLOW_THREADS
305 }
306 
307 
308 extern "C" {static void assign_wxRichTextFontTable(void *, SIP_SSIZE_T, void *);}
assign_wxRichTextFontTable(void * sipDst,SIP_SSIZE_T sipDstIdx,void * sipSrc)309 static void assign_wxRichTextFontTable(void *sipDst, SIP_SSIZE_T sipDstIdx, void *sipSrc)
310 {
311     reinterpret_cast< ::wxRichTextFontTable *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::wxRichTextFontTable *>(sipSrc);
312 }
313 
314 
315 extern "C" {static void *array_wxRichTextFontTable(SIP_SSIZE_T);}
array_wxRichTextFontTable(SIP_SSIZE_T sipNrElem)316 static void *array_wxRichTextFontTable(SIP_SSIZE_T sipNrElem)
317 {
318     return new  ::wxRichTextFontTable[sipNrElem];
319 }
320 
321 
322 extern "C" {static void *copy_wxRichTextFontTable(const void *, SIP_SSIZE_T);}
copy_wxRichTextFontTable(const void * sipSrc,SIP_SSIZE_T sipSrcIdx)323 static void *copy_wxRichTextFontTable(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
324 {
325     return new  ::wxRichTextFontTable(reinterpret_cast<const  ::wxRichTextFontTable *>(sipSrc)[sipSrcIdx]);
326 }
327 
328 
329 extern "C" {static void dealloc_wxRichTextFontTable(sipSimpleWrapper *);}
dealloc_wxRichTextFontTable(sipSimpleWrapper * sipSelf)330 static void dealloc_wxRichTextFontTable(sipSimpleWrapper *sipSelf)
331 {
332     if (sipIsDerivedClass(sipSelf))
333         reinterpret_cast<sipwxRichTextFontTable *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;
334 
335     if (sipIsOwnedByPython(sipSelf))
336     {
337         release_wxRichTextFontTable(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
338     }
339 }
340 
341 
342 extern "C" {static void *init_type_wxRichTextFontTable(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
init_type_wxRichTextFontTable(sipSimpleWrapper * sipSelf,PyObject * sipArgs,PyObject * sipKwds,PyObject ** sipUnused,PyObject **,PyObject ** sipParseErr)343 static void *init_type_wxRichTextFontTable(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
344 {
345     sipwxRichTextFontTable *sipCpp = SIP_NULLPTR;
346 
347     {
348         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
349         {
350             PyErr_Clear();
351 
352             Py_BEGIN_ALLOW_THREADS
353             sipCpp = new sipwxRichTextFontTable();
354             Py_END_ALLOW_THREADS
355 
356             if (PyErr_Occurred())
357             {
358                 delete sipCpp;
359                 return SIP_NULLPTR;
360             }
361 
362             sipCpp->sipPySelf = sipSelf;
363 
364             return sipCpp;
365         }
366     }
367 
368     {
369         const  ::wxRichTextFontTable* table;
370 
371         static const char *sipKwdList[] = {
372             sipName_table,
373         };
374 
375         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9", sipType_wxRichTextFontTable, &table))
376         {
377             PyErr_Clear();
378 
379             Py_BEGIN_ALLOW_THREADS
380             sipCpp = new sipwxRichTextFontTable(*table);
381             Py_END_ALLOW_THREADS
382 
383             if (PyErr_Occurred())
384             {
385                 delete sipCpp;
386                 return SIP_NULLPTR;
387             }
388 
389             sipCpp->sipPySelf = sipSelf;
390 
391             return sipCpp;
392         }
393     }
394 
395     return SIP_NULLPTR;
396 }
397 
398 
399 /* Define this type's super-types. */
400 static sipEncodedTypeDef supers_wxRichTextFontTable[] = {{41, 0, 1}};
401 
402 
403 /* Define this type's Python slots. */
404 static sipPySlotDef slots_wxRichTextFontTable[] = {
405     {(void *)slot_wxRichTextFontTable___ne__, ne_slot},
406     {(void *)slot_wxRichTextFontTable___eq__, eq_slot},
407     {0, (sipPySlotType)0}
408 };
409 
410 
411 static PyMethodDef methods_wxRichTextFontTable[] = {
412     {SIP_MLNAME_CAST(sipName_Clear), meth_wxRichTextFontTable_Clear, METH_VARARGS, SIP_MLDOC_CAST(doc_wxRichTextFontTable_Clear)},
413     {SIP_MLNAME_CAST(sipName_FindFont), SIP_MLMETH_CAST(meth_wxRichTextFontTable_FindFont), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxRichTextFontTable_FindFont)},
414     {SIP_MLNAME_CAST(sipName_IsOk), meth_wxRichTextFontTable_IsOk, METH_VARARGS, SIP_MLDOC_CAST(doc_wxRichTextFontTable_IsOk)},
415     {SIP_MLNAME_CAST(sipName_SetFontScale), SIP_MLMETH_CAST(meth_wxRichTextFontTable_SetFontScale), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxRichTextFontTable_SetFontScale)}
416 };
417 
418 PyDoc_STRVAR(doc_wxRichTextFontTable, "RichTextFontTable()\n"
419 "RichTextFontTable(table)\n"
420 "\n"
421 "Manages quick access to a pool of fonts for rendering rich text.");
422 
423 
424 sipClassTypeDef sipTypeDef__richtext_wxRichTextFontTable = {
425     {
426         -1,
427         SIP_NULLPTR,
428         SIP_NULLPTR,
429         SIP_TYPE_SCC|SIP_TYPE_CLASS,
430         sipNameNr_wxRichTextFontTable,
431         {SIP_NULLPTR},
432         SIP_NULLPTR
433     },
434     {
435         sipNameNr_RichTextFontTable,
436         {0, 0, 1},
437         4, methods_wxRichTextFontTable,
438         0, SIP_NULLPTR,
439         0, SIP_NULLPTR,
440         {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
441     },
442     doc_wxRichTextFontTable,
443     -1,
444     -1,
445     supers_wxRichTextFontTable,
446     slots_wxRichTextFontTable,
447     init_type_wxRichTextFontTable,
448     SIP_NULLPTR,
449     SIP_NULLPTR,
450 #if PY_MAJOR_VERSION >= 3
451     SIP_NULLPTR,
452     SIP_NULLPTR,
453 #else
454     SIP_NULLPTR,
455     SIP_NULLPTR,
456     SIP_NULLPTR,
457     SIP_NULLPTR,
458 #endif
459     dealloc_wxRichTextFontTable,
460     assign_wxRichTextFontTable,
461     array_wxRichTextFontTable,
462     copy_wxRichTextFontTable,
463     release_wxRichTextFontTable,
464     cast_wxRichTextFontTable,
465     SIP_NULLPTR,
466     SIP_NULLPTR,
467     SIP_NULLPTR,
468     SIP_NULLPTR,
469     SIP_NULLPTR,
470     SIP_NULLPTR
471 };
472