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_core.h"
11 
12         #include <wx/iconloc.h>
13 
_wxIconLocation_ctor()14     wxIconLocation* _wxIconLocation_ctor()
15     {
16         return new wxIconLocation;
17     }
_wxIconLocation_ctor(const wxString * filename,int num)18     wxIconLocation* _wxIconLocation_ctor(const wxString* filename, int num)
19     {
20         #ifdef __WXMSW__
21             return new wxIconLocation(*filename, num);
22         #else
23             return new wxIconLocation(*filename);
24         #endif
25     }
_wxIconLocation___nonzero__(wxIconLocation * self)26     int _wxIconLocation___nonzero__(wxIconLocation* self)
27     {
28         return self->IsOk();
29     }
_wxIconLocation___bool__(wxIconLocation * self)30     int _wxIconLocation___bool__(wxIconLocation* self)
31     {
32         return self->IsOk();
33     }
_wxIconLocation_GetIndex(wxIconLocation * self)34     int _wxIconLocation_GetIndex(wxIconLocation* self)
35     {
36         #ifdef __WXMSW__
37             return self->GetIndex();
38         #else
39             return -1;
40         #endif
41     }
_wxIconLocation_SetIndex(wxIconLocation * self,int num)42     void _wxIconLocation_SetIndex(wxIconLocation* self, int num)
43     {
44         #ifdef __WXMSW__
45             self->SetIndex(num);
46         #endif
47     }
48 
49 
50 PyDoc_STRVAR(doc_wxIconLocation_IsOk, "IsOk() -> bool\n"
51 "\n"
52 "Returns true if the object is valid, i.e. was properly initialized,\n"
53 "and false otherwise.");
54 
55 extern "C" {static PyObject *meth_wxIconLocation_IsOk(PyObject *, PyObject *);}
meth_wxIconLocation_IsOk(PyObject * sipSelf,PyObject * sipArgs)56 static PyObject *meth_wxIconLocation_IsOk(PyObject *sipSelf, PyObject *sipArgs)
57 {
58     PyObject *sipParseErr = SIP_NULLPTR;
59 
60     {
61         const  ::wxIconLocation *sipCpp;
62 
63         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxIconLocation, &sipCpp))
64         {
65             bool sipRes;
66 
67             PyErr_Clear();
68 
69             Py_BEGIN_ALLOW_THREADS
70             sipRes = sipCpp->IsOk();
71             Py_END_ALLOW_THREADS
72 
73             if (PyErr_Occurred())
74                 return 0;
75 
76             return PyBool_FromLong(sipRes);
77         }
78     }
79 
80     /* Raise an exception if the arguments couldn't be parsed. */
81     sipNoMethod(sipParseErr, sipName_IconLocation, sipName_IsOk, SIP_NULLPTR);
82 
83     return SIP_NULLPTR;
84 }
85 
86 
87 PyDoc_STRVAR(doc_wxIconLocation_SetFileName, "SetFileName(filename)");
88 
89 extern "C" {static PyObject *meth_wxIconLocation_SetFileName(PyObject *, PyObject *, PyObject *);}
meth_wxIconLocation_SetFileName(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)90 static PyObject *meth_wxIconLocation_SetFileName(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
91 {
92     PyObject *sipParseErr = SIP_NULLPTR;
93 
94     {
95         const  ::wxString* filename;
96         int filenameState = 0;
97          ::wxIconLocation *sipCpp;
98 
99         static const char *sipKwdList[] = {
100             sipName_filename,
101         };
102 
103         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxIconLocation, &sipCpp, sipType_wxString,&filename, &filenameState))
104         {
105             PyErr_Clear();
106 
107             Py_BEGIN_ALLOW_THREADS
108             sipCpp->SetFileName(*filename);
109             Py_END_ALLOW_THREADS
110             sipReleaseType(const_cast< ::wxString *>(filename),sipType_wxString,filenameState);
111 
112             if (PyErr_Occurred())
113                 return 0;
114 
115             Py_INCREF(Py_None);
116             return Py_None;
117         }
118     }
119 
120     /* Raise an exception if the arguments couldn't be parsed. */
121     sipNoMethod(sipParseErr, sipName_IconLocation, sipName_SetFileName, SIP_NULLPTR);
122 
123     return SIP_NULLPTR;
124 }
125 
126 
127 PyDoc_STRVAR(doc_wxIconLocation_GetFileName, "GetFileName() -> String");
128 
129 extern "C" {static PyObject *meth_wxIconLocation_GetFileName(PyObject *, PyObject *);}
meth_wxIconLocation_GetFileName(PyObject * sipSelf,PyObject * sipArgs)130 static PyObject *meth_wxIconLocation_GetFileName(PyObject *sipSelf, PyObject *sipArgs)
131 {
132     PyObject *sipParseErr = SIP_NULLPTR;
133 
134     {
135         const  ::wxIconLocation *sipCpp;
136 
137         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxIconLocation, &sipCpp))
138         {
139              ::wxString*sipRes;
140 
141             PyErr_Clear();
142 
143             Py_BEGIN_ALLOW_THREADS
144             sipRes = new  ::wxString(sipCpp->GetFileName());
145             Py_END_ALLOW_THREADS
146 
147             if (PyErr_Occurred())
148                 return 0;
149 
150             return sipConvertFromNewType(sipRes,sipType_wxString,SIP_NULLPTR);
151         }
152     }
153 
154     /* Raise an exception if the arguments couldn't be parsed. */
155     sipNoMethod(sipParseErr, sipName_IconLocation, sipName_GetFileName, SIP_NULLPTR);
156 
157     return SIP_NULLPTR;
158 }
159 
160 
161 PyDoc_STRVAR(doc_wxIconLocation_GetIndex, "GetIndex() -> int");
162 
163 extern "C" {static PyObject *meth_wxIconLocation_GetIndex(PyObject *, PyObject *);}
meth_wxIconLocation_GetIndex(PyObject * sipSelf,PyObject * sipArgs)164 static PyObject *meth_wxIconLocation_GetIndex(PyObject *sipSelf, PyObject *sipArgs)
165 {
166     PyObject *sipParseErr = SIP_NULLPTR;
167 
168     {
169          ::wxIconLocation *sipCpp;
170 
171         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxIconLocation, &sipCpp))
172         {
173             int sipRes = 0;
174             int sipIsErr = 0;
175 
176         PyErr_Clear();
177         Py_BEGIN_ALLOW_THREADS
178         sipRes = _wxIconLocation_GetIndex(sipCpp);
179         Py_END_ALLOW_THREADS
180         if (PyErr_Occurred()) sipIsErr = 1;
181 
182             if (sipIsErr)
183                 return 0;
184 
185             return SIPLong_FromLong(sipRes);
186         }
187     }
188 
189     /* Raise an exception if the arguments couldn't be parsed. */
190     sipNoMethod(sipParseErr, sipName_IconLocation, sipName_GetIndex, SIP_NULLPTR);
191 
192     return SIP_NULLPTR;
193 }
194 
195 
196 PyDoc_STRVAR(doc_wxIconLocation_SetIndex, "SetIndex(num)");
197 
198 extern "C" {static PyObject *meth_wxIconLocation_SetIndex(PyObject *, PyObject *, PyObject *);}
meth_wxIconLocation_SetIndex(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)199 static PyObject *meth_wxIconLocation_SetIndex(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
200 {
201     PyObject *sipParseErr = SIP_NULLPTR;
202 
203     {
204         int num;
205          ::wxIconLocation *sipCpp;
206 
207         static const char *sipKwdList[] = {
208             sipName_num,
209         };
210 
211         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bi", &sipSelf, sipType_wxIconLocation, &sipCpp, &num))
212         {
213             int sipIsErr = 0;
214 
215         PyErr_Clear();
216         Py_BEGIN_ALLOW_THREADS
217         _wxIconLocation_SetIndex(sipCpp, num);
218         Py_END_ALLOW_THREADS
219         if (PyErr_Occurred()) sipIsErr = 1;
220 
221             if (sipIsErr)
222                 return 0;
223 
224             Py_INCREF(Py_None);
225             return Py_None;
226         }
227     }
228 
229     /* Raise an exception if the arguments couldn't be parsed. */
230     sipNoMethod(sipParseErr, sipName_IconLocation, sipName_SetIndex, SIP_NULLPTR);
231 
232     return SIP_NULLPTR;
233 }
234 
235 
236 extern "C" {static int slot_wxIconLocation___bool__(PyObject *);}
slot_wxIconLocation___bool__(PyObject * sipSelf)237 static int slot_wxIconLocation___bool__(PyObject *sipSelf)
238 {
239      ::wxIconLocation *sipCpp = reinterpret_cast< ::wxIconLocation *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_wxIconLocation));
240 
241     if (!sipCpp)
242         return -1;
243 
244 
245     {
246         {
247             int sipRes = 0;
248             int sipIsErr = 0;
249 
250         PyErr_Clear();
251         Py_BEGIN_ALLOW_THREADS
252         sipRes = _wxIconLocation___bool__(sipCpp);
253         Py_END_ALLOW_THREADS
254         if (PyErr_Occurred()) sipIsErr = 1;
255 
256             if (sipIsErr)
257                 return -1;
258 
259             return sipRes;
260         }
261     }
262 
263     return 0;
264 }
265 
266 
267 extern "C" {static int slot_wxIconLocation___nonzero__(PyObject *);}
slot_wxIconLocation___nonzero__(PyObject * sipSelf)268 static int slot_wxIconLocation___nonzero__(PyObject *sipSelf)
269 {
270      ::wxIconLocation *sipCpp = reinterpret_cast< ::wxIconLocation *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_wxIconLocation));
271 
272     if (!sipCpp)
273         return -1;
274 
275 
276     {
277         {
278             int sipRes = 0;
279             int sipIsErr = 0;
280 
281         PyErr_Clear();
282         Py_BEGIN_ALLOW_THREADS
283         sipRes = _wxIconLocation___nonzero__(sipCpp);
284         Py_END_ALLOW_THREADS
285         if (PyErr_Occurred()) sipIsErr = 1;
286 
287             if (sipIsErr)
288                 return -1;
289 
290             return sipRes;
291         }
292     }
293 
294     return 0;
295 }
296 
297 
298 /* Call the instance's destructor. */
299 extern "C" {static void release_wxIconLocation(void *, int);}
release_wxIconLocation(void * sipCppV,int)300 static void release_wxIconLocation(void *sipCppV, int)
301 {
302     Py_BEGIN_ALLOW_THREADS
303 
304     delete reinterpret_cast< ::wxIconLocation *>(sipCppV);
305 
306     Py_END_ALLOW_THREADS
307 }
308 
309 
310 extern "C" {static void dealloc_wxIconLocation(sipSimpleWrapper *);}
dealloc_wxIconLocation(sipSimpleWrapper * sipSelf)311 static void dealloc_wxIconLocation(sipSimpleWrapper *sipSelf)
312 {
313     if (sipIsOwnedByPython(sipSelf))
314     {
315         release_wxIconLocation(sipGetAddress(sipSelf), 0);
316     }
317 }
318 
319 
320 extern "C" {static void *init_type_wxIconLocation(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
init_type_wxIconLocation(sipSimpleWrapper *,PyObject * sipArgs,PyObject * sipKwds,PyObject ** sipUnused,PyObject **,PyObject ** sipParseErr)321 static void *init_type_wxIconLocation(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
322 {
323      ::wxIconLocation *sipCpp = SIP_NULLPTR;
324 
325     {
326         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
327         {
328         PyErr_Clear();
329         sipCpp = _wxIconLocation_ctor();
330 
331             return sipCpp;
332         }
333     }
334 
335     {
336         const  ::wxString* filename;
337         int filenameState = 0;
338         int num = 0;
339 
340         static const char *sipKwdList[] = {
341             sipName_filename,
342             sipName_num,
343         };
344 
345         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J0|i", sipType_wxString,&filename, &filenameState, &num))
346         {
347         PyErr_Clear();
348         sipCpp = _wxIconLocation_ctor(filename, num);
349             sipReleaseType(const_cast< ::wxString *>(filename),sipType_wxString,filenameState);
350 
351             return sipCpp;
352         }
353     }
354 
355     {
356         const  ::wxIconLocation* a0;
357 
358         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_wxIconLocation, &a0))
359         {
360             Py_BEGIN_ALLOW_THREADS
361             sipCpp = new  ::wxIconLocation(*a0);
362             Py_END_ALLOW_THREADS
363 
364             return sipCpp;
365         }
366     }
367 
368     return SIP_NULLPTR;
369 }
370 
371 
372 /* Define this type's Python slots. */
373 static sipPySlotDef slots_wxIconLocation[] = {
374     {(void *)slot_wxIconLocation___bool__, bool_slot},
375     {(void *)slot_wxIconLocation___nonzero__, bool_slot},
376     {0, (sipPySlotType)0}
377 };
378 
379 
380 static PyMethodDef methods_wxIconLocation[] = {
381     {SIP_MLNAME_CAST(sipName_GetFileName), meth_wxIconLocation_GetFileName, METH_VARARGS, SIP_MLDOC_CAST(doc_wxIconLocation_GetFileName)},
382     {SIP_MLNAME_CAST(sipName_GetIndex), meth_wxIconLocation_GetIndex, METH_VARARGS, SIP_MLDOC_CAST(doc_wxIconLocation_GetIndex)},
383     {SIP_MLNAME_CAST(sipName_IsOk), meth_wxIconLocation_IsOk, METH_VARARGS, SIP_MLDOC_CAST(doc_wxIconLocation_IsOk)},
384     {SIP_MLNAME_CAST(sipName_SetFileName), SIP_MLMETH_CAST(meth_wxIconLocation_SetFileName), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxIconLocation_SetFileName)},
385     {SIP_MLNAME_CAST(sipName_SetIndex), SIP_MLMETH_CAST(meth_wxIconLocation_SetIndex), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxIconLocation_SetIndex)}
386 };
387 
388 sipVariableDef variables_wxIconLocation[] = {
389     {PropertyVariable, sipName_Index, &methods_wxIconLocation[1], &methods_wxIconLocation[4], SIP_NULLPTR, SIP_NULLPTR},
390     {PropertyVariable, sipName_FileName, &methods_wxIconLocation[0], &methods_wxIconLocation[3], SIP_NULLPTR, SIP_NULLPTR},
391 };
392 
393 PyDoc_STRVAR(doc_wxIconLocation, "IconLocation()\n"
394 "IconLocation(filename, num=0)\n"
395 "\n"
396 "wxIconLocation is a tiny class describing the location of an\n"
397 "(external, i.e.");
398 
399 
400 sipClassTypeDef sipTypeDef__core_wxIconLocation = {
401     {
402         -1,
403         SIP_NULLPTR,
404         SIP_NULLPTR,
405         SIP_TYPE_CLASS,
406         sipNameNr_wxIconLocation,
407         {SIP_NULLPTR},
408         SIP_NULLPTR
409     },
410     {
411         sipNameNr_IconLocation,
412         {0, 0, 1},
413         5, methods_wxIconLocation,
414         0, SIP_NULLPTR,
415         2, variables_wxIconLocation,
416         {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
417     },
418     doc_wxIconLocation,
419     -1,
420     -1,
421     SIP_NULLPTR,
422     slots_wxIconLocation,
423     init_type_wxIconLocation,
424     SIP_NULLPTR,
425     SIP_NULLPTR,
426 #if PY_MAJOR_VERSION >= 3
427     SIP_NULLPTR,
428     SIP_NULLPTR,
429 #else
430     SIP_NULLPTR,
431     SIP_NULLPTR,
432     SIP_NULLPTR,
433     SIP_NULLPTR,
434 #endif
435     dealloc_wxIconLocation,
436     SIP_NULLPTR,
437     SIP_NULLPTR,
438     SIP_NULLPTR,
439     release_wxIconLocation,
440     SIP_NULLPTR,
441     SIP_NULLPTR,
442     SIP_NULLPTR,
443     SIP_NULLPTR,
444     SIP_NULLPTR,
445     SIP_NULLPTR,
446     SIP_NULLPTR
447 };
448