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_adv.h"
11 
12         #include <wx/wizard.h>
13 
14         #include <wx/wizard.h>
15         #include <wx/event.h>
16         #include <wx/object.h>
17         #include <wx/object.h>
18         #include <wx/object.h>
19 
20 
21 class sipwxWizardEvent : public  ::wxWizardEvent
22 {
23 public:
24     sipwxWizardEvent( ::wxEventType,int,bool, ::wxWizardPage*);
25     sipwxWizardEvent(const  ::wxWizardEvent&);
26     virtual ~sipwxWizardEvent();
27 
28     /*
29      * There is a protected method for every virtual method visible from
30      * this class.
31      */
32 protected:
33      ::wxEvent* Clone() const SIP_OVERRIDE;
34      ::wxEventCategory GetEventCategory() const SIP_OVERRIDE;
35 
36 public:
37     sipSimpleWrapper *sipPySelf;
38 
39 private:
40     sipwxWizardEvent(const sipwxWizardEvent &);
41     sipwxWizardEvent &operator = (const sipwxWizardEvent &);
42 
43     char sipPyMethods[2];
44 };
45 
sipwxWizardEvent(::wxEventType type,int id,bool direction,::wxWizardPage * page)46 sipwxWizardEvent::sipwxWizardEvent( ::wxEventType type,int id,bool direction, ::wxWizardPage*page):  ::wxWizardEvent(type,id,direction,page), sipPySelf(SIP_NULLPTR)
47 {
48     memset(sipPyMethods, 0, sizeof (sipPyMethods));
49 }
50 
sipwxWizardEvent(const::wxWizardEvent & a0)51 sipwxWizardEvent::sipwxWizardEvent(const  ::wxWizardEvent& a0):  ::wxWizardEvent(a0), sipPySelf(SIP_NULLPTR)
52 {
53     memset(sipPyMethods, 0, sizeof (sipPyMethods));
54 }
55 
~sipwxWizardEvent()56 sipwxWizardEvent::~sipwxWizardEvent()
57 {
58     sipInstanceDestroyedEx(&sipPySelf);
59 }
60 
Clone() const61  ::wxEvent* sipwxWizardEvent::Clone() const
62 {
63     sip_gilstate_t sipGILState;
64     PyObject *sipMeth;
65 
66     sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[0]),sipPySelf,SIP_NULLPTR,sipName_Clone);
67 
68     if (!sipMeth)
69         return  ::wxWizardEvent::Clone();
70 
71     extern  ::wxEvent* sipVH__adv_27(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);
72 
73     return sipVH__adv_27(sipGILState, 0, sipPySelf, sipMeth);
74 }
75 
GetEventCategory() const76  ::wxEventCategory sipwxWizardEvent::GetEventCategory() const
77 {
78     sip_gilstate_t sipGILState;
79     PyObject *sipMeth;
80 
81     sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[1]),sipPySelf,SIP_NULLPTR,sipName_GetEventCategory);
82 
83     if (!sipMeth)
84         return  ::wxWizardEvent::GetEventCategory();
85 
86     extern  ::wxEventCategory sipVH__adv_28(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);
87 
88     return sipVH__adv_28(sipGILState, 0, sipPySelf, sipMeth);
89 }
90 
91 
92 PyDoc_STRVAR(doc_wxWizardEvent_GetDirection, "GetDirection() -> bool\n"
93 "\n"
94 "Return the direction in which the page is changing: for\n"
95 "EVT_WIZARD_PAGE_CHANGING, return true if we're going forward or false\n"
96 "otherwise and for EVT_WIZARD_PAGE_CHANGED return true if we came from\n"
97 "the previous page and false if we returned from the next one.");
98 
99 extern "C" {static PyObject *meth_wxWizardEvent_GetDirection(PyObject *, PyObject *);}
meth_wxWizardEvent_GetDirection(PyObject * sipSelf,PyObject * sipArgs)100 static PyObject *meth_wxWizardEvent_GetDirection(PyObject *sipSelf, PyObject *sipArgs)
101 {
102     PyObject *sipParseErr = SIP_NULLPTR;
103 
104     {
105         const  ::wxWizardEvent *sipCpp;
106 
107         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxWizardEvent, &sipCpp))
108         {
109             bool sipRes;
110 
111             PyErr_Clear();
112 
113             Py_BEGIN_ALLOW_THREADS
114             sipRes = sipCpp->GetDirection();
115             Py_END_ALLOW_THREADS
116 
117             if (PyErr_Occurred())
118                 return 0;
119 
120             return PyBool_FromLong(sipRes);
121         }
122     }
123 
124     /* Raise an exception if the arguments couldn't be parsed. */
125     sipNoMethod(sipParseErr, sipName_WizardEvent, sipName_GetDirection, SIP_NULLPTR);
126 
127     return SIP_NULLPTR;
128 }
129 
130 
131 PyDoc_STRVAR(doc_wxWizardEvent_GetPage, "GetPage() -> WizardPage\n"
132 "\n"
133 "Returns the wxWizardPage which was active when this event was\n"
134 "generated.");
135 
136 extern "C" {static PyObject *meth_wxWizardEvent_GetPage(PyObject *, PyObject *);}
meth_wxWizardEvent_GetPage(PyObject * sipSelf,PyObject * sipArgs)137 static PyObject *meth_wxWizardEvent_GetPage(PyObject *sipSelf, PyObject *sipArgs)
138 {
139     PyObject *sipParseErr = SIP_NULLPTR;
140 
141     {
142         const  ::wxWizardEvent *sipCpp;
143 
144         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxWizardEvent, &sipCpp))
145         {
146              ::wxWizardPage*sipRes;
147 
148             PyErr_Clear();
149 
150             Py_BEGIN_ALLOW_THREADS
151             sipRes = sipCpp->GetPage();
152             Py_END_ALLOW_THREADS
153 
154             if (PyErr_Occurred())
155                 return 0;
156 
157             return sipConvertFromType(sipRes,sipType_wxWizardPage,SIP_NULLPTR);
158         }
159     }
160 
161     /* Raise an exception if the arguments couldn't be parsed. */
162     sipNoMethod(sipParseErr, sipName_WizardEvent, sipName_GetPage, SIP_NULLPTR);
163 
164     return SIP_NULLPTR;
165 }
166 
167 
168 PyDoc_STRVAR(doc_wxWizardEvent_Clone, "Clone(self) -> Event");
169 
170 extern "C" {static PyObject *meth_wxWizardEvent_Clone(PyObject *, PyObject *);}
meth_wxWizardEvent_Clone(PyObject * sipSelf,PyObject * sipArgs)171 static PyObject *meth_wxWizardEvent_Clone(PyObject *sipSelf, PyObject *sipArgs)
172 {
173     PyObject *sipParseErr = SIP_NULLPTR;
174     bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
175 
176     {
177         const  ::wxWizardEvent *sipCpp;
178 
179         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxWizardEvent, &sipCpp))
180         {
181              ::wxEvent*sipRes;
182 
183             PyErr_Clear();
184 
185             Py_BEGIN_ALLOW_THREADS
186             sipRes = (sipSelfWasArg ? sipCpp-> ::wxWizardEvent::Clone() : sipCpp->Clone());
187             Py_END_ALLOW_THREADS
188 
189             if (PyErr_Occurred())
190                 return 0;
191 
192             return sipConvertFromNewType(sipRes,sipType_wxEvent,SIP_NULLPTR);
193         }
194     }
195 
196     /* Raise an exception if the arguments couldn't be parsed. */
197     sipNoMethod(sipParseErr, sipName_WizardEvent, sipName_Clone, doc_wxWizardEvent_Clone);
198 
199     return SIP_NULLPTR;
200 }
201 
202 
203 /* Cast a pointer to a type somewhere in its inheritance hierarchy. */
204 extern "C" {static void *cast_wxWizardEvent(void *, const sipTypeDef *);}
cast_wxWizardEvent(void * sipCppV,const sipTypeDef * targetType)205 static void *cast_wxWizardEvent(void *sipCppV, const sipTypeDef *targetType)
206 {
207      ::wxWizardEvent *sipCpp = reinterpret_cast< ::wxWizardEvent *>(sipCppV);
208 
209     if (targetType == sipType_wxNotifyEvent)
210         return static_cast< ::wxNotifyEvent *>(sipCpp);
211 
212     if (targetType == sipType_wxCommandEvent)
213         return static_cast< ::wxCommandEvent *>(sipCpp);
214 
215     if (targetType == sipType_wxEvent)
216         return static_cast< ::wxEvent *>(sipCpp);
217 
218     if (targetType == sipType_wxObject)
219         return static_cast< ::wxObject *>(sipCpp);
220 
221     return sipCppV;
222 }
223 
224 
225 /* Call the instance's destructor. */
226 extern "C" {static void release_wxWizardEvent(void *, int);}
release_wxWizardEvent(void * sipCppV,int sipState)227 static void release_wxWizardEvent(void *sipCppV, int sipState)
228 {
229     Py_BEGIN_ALLOW_THREADS
230 
231     if (sipState & SIP_DERIVED_CLASS)
232         delete reinterpret_cast<sipwxWizardEvent *>(sipCppV);
233     else
234         delete reinterpret_cast< ::wxWizardEvent *>(sipCppV);
235 
236     Py_END_ALLOW_THREADS
237 }
238 
239 
240 extern "C" {static void dealloc_wxWizardEvent(sipSimpleWrapper *);}
dealloc_wxWizardEvent(sipSimpleWrapper * sipSelf)241 static void dealloc_wxWizardEvent(sipSimpleWrapper *sipSelf)
242 {
243     if (sipIsDerivedClass(sipSelf))
244         reinterpret_cast<sipwxWizardEvent *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;
245 
246     if (sipIsOwnedByPython(sipSelf))
247     {
248         release_wxWizardEvent(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
249     }
250 }
251 
252 
253 extern "C" {static void *init_type_wxWizardEvent(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
init_type_wxWizardEvent(sipSimpleWrapper * sipSelf,PyObject * sipArgs,PyObject * sipKwds,PyObject ** sipUnused,PyObject **,PyObject ** sipParseErr)254 static void *init_type_wxWizardEvent(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
255 {
256     sipwxWizardEvent *sipCpp = SIP_NULLPTR;
257 
258     {
259          ::wxEventType type = wxEVT_NULL;
260         int id = wxID_ANY;
261         bool direction = 1;
262          ::wxWizardPage* page = 0;
263 
264         static const char *sipKwdList[] = {
265             sipName_type,
266             sipName_id,
267             sipName_direction,
268             sipName_page,
269         };
270 
271         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|iibJ8", &type, &id, &direction, sipType_wxWizardPage, &page))
272         {
273             PyErr_Clear();
274 
275             Py_BEGIN_ALLOW_THREADS
276             sipCpp = new sipwxWizardEvent(type,id,direction,page);
277             Py_END_ALLOW_THREADS
278 
279             if (PyErr_Occurred())
280             {
281                 delete sipCpp;
282                 return SIP_NULLPTR;
283             }
284 
285             sipCpp->sipPySelf = sipSelf;
286 
287             return sipCpp;
288         }
289     }
290 
291     {
292         const  ::wxWizardEvent* a0;
293 
294         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_wxWizardEvent, &a0))
295         {
296             Py_BEGIN_ALLOW_THREADS
297             sipCpp = new sipwxWizardEvent(*a0);
298             Py_END_ALLOW_THREADS
299 
300             sipCpp->sipPySelf = sipSelf;
301 
302             return sipCpp;
303         }
304     }
305 
306     return SIP_NULLPTR;
307 }
308 
309 
310 /* Define this type's super-types. */
311 static sipEncodedTypeDef supers_wxWizardEvent[] = {{37, 0, 1}};
312 
313 
314 static PyMethodDef methods_wxWizardEvent[] = {
315     {SIP_MLNAME_CAST(sipName_Clone), meth_wxWizardEvent_Clone, METH_VARARGS, SIP_MLDOC_CAST(doc_wxWizardEvent_Clone)},
316     {SIP_MLNAME_CAST(sipName_GetDirection), meth_wxWizardEvent_GetDirection, METH_VARARGS, SIP_MLDOC_CAST(doc_wxWizardEvent_GetDirection)},
317     {SIP_MLNAME_CAST(sipName_GetPage), meth_wxWizardEvent_GetPage, METH_VARARGS, SIP_MLDOC_CAST(doc_wxWizardEvent_GetPage)}
318 };
319 
320 sipVariableDef variables_wxWizardEvent[] = {
321     {PropertyVariable, sipName_Page, &methods_wxWizardEvent[2], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
322     {PropertyVariable, sipName_Direction, &methods_wxWizardEvent[1], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
323 };
324 
325 PyDoc_STRVAR(doc_wxWizardEvent, "WizardEvent(type=wx.wxEVT_NULL, id=wx.ID_ANY, direction=True, page=0)\n"
326 "\n"
327 "wxWizardEvent class represents an event generated by the wxWizard:\n"
328 "this event is first sent to the page itself and, if not processed\n"
329 "there, goes up the window hierarchy as usual.");
330 
331 
332 sipClassTypeDef sipTypeDef__adv_wxWizardEvent = {
333     {
334         -1,
335         SIP_NULLPTR,
336         SIP_NULLPTR,
337         SIP_TYPE_SCC|SIP_TYPE_CLASS,
338         sipNameNr_wxWizardEvent,
339         {SIP_NULLPTR},
340         SIP_NULLPTR
341     },
342     {
343         sipNameNr_WizardEvent,
344         {0, 0, 1},
345         3, methods_wxWizardEvent,
346         0, SIP_NULLPTR,
347         2, variables_wxWizardEvent,
348         {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
349     },
350     doc_wxWizardEvent,
351     -1,
352     -1,
353     supers_wxWizardEvent,
354     SIP_NULLPTR,
355     init_type_wxWizardEvent,
356     SIP_NULLPTR,
357     SIP_NULLPTR,
358 #if PY_MAJOR_VERSION >= 3
359     SIP_NULLPTR,
360     SIP_NULLPTR,
361 #else
362     SIP_NULLPTR,
363     SIP_NULLPTR,
364     SIP_NULLPTR,
365     SIP_NULLPTR,
366 #endif
367     dealloc_wxWizardEvent,
368     SIP_NULLPTR,
369     SIP_NULLPTR,
370     SIP_NULLPTR,
371     release_wxWizardEvent,
372     cast_wxWizardEvent,
373     SIP_NULLPTR,
374     SIP_NULLPTR,
375     SIP_NULLPTR,
376     SIP_NULLPTR,
377     SIP_NULLPTR,
378     SIP_NULLPTR
379 };
380