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/event.h>
13 
14         #include <wx/event.h>
15         #include <wx/object.h>
16         #include <wx/object.h>
17         #include <wx/object.h>
18 
19 
20 class sipwxInitDialogEvent : public  ::wxInitDialogEvent
21 {
22 public:
23     sipwxInitDialogEvent(int);
24     sipwxInitDialogEvent(const  ::wxInitDialogEvent&);
25     virtual ~sipwxInitDialogEvent();
26 
27     /*
28      * There is a protected method for every virtual method visible from
29      * this class.
30      */
31 protected:
32      ::wxEvent* Clone() const SIP_OVERRIDE;
33      ::wxEventCategory GetEventCategory() const SIP_OVERRIDE;
34 
35 public:
36     sipSimpleWrapper *sipPySelf;
37 
38 private:
39     sipwxInitDialogEvent(const sipwxInitDialogEvent &);
40     sipwxInitDialogEvent &operator = (const sipwxInitDialogEvent &);
41 
42     char sipPyMethods[2];
43 };
44 
sipwxInitDialogEvent(int id)45 sipwxInitDialogEvent::sipwxInitDialogEvent(int id):  ::wxInitDialogEvent(id), sipPySelf(SIP_NULLPTR)
46 {
47     memset(sipPyMethods, 0, sizeof (sipPyMethods));
48 }
49 
sipwxInitDialogEvent(const::wxInitDialogEvent & a0)50 sipwxInitDialogEvent::sipwxInitDialogEvent(const  ::wxInitDialogEvent& a0):  ::wxInitDialogEvent(a0), sipPySelf(SIP_NULLPTR)
51 {
52     memset(sipPyMethods, 0, sizeof (sipPyMethods));
53 }
54 
~sipwxInitDialogEvent()55 sipwxInitDialogEvent::~sipwxInitDialogEvent()
56 {
57     sipInstanceDestroyedEx(&sipPySelf);
58 }
59 
Clone() const60  ::wxEvent* sipwxInitDialogEvent::Clone() const
61 {
62     sip_gilstate_t sipGILState;
63     PyObject *sipMeth;
64 
65     sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[0]),sipPySelf,SIP_NULLPTR,sipName_Clone);
66 
67     if (!sipMeth)
68         return  ::wxInitDialogEvent::Clone();
69 
70     extern  ::wxEvent* sipVH__core_91(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);
71 
72     return sipVH__core_91(sipGILState, 0, sipPySelf, sipMeth);
73 }
74 
GetEventCategory() const75  ::wxEventCategory sipwxInitDialogEvent::GetEventCategory() const
76 {
77     sip_gilstate_t sipGILState;
78     PyObject *sipMeth;
79 
80     sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[1]),sipPySelf,SIP_NULLPTR,sipName_GetEventCategory);
81 
82     if (!sipMeth)
83         return  ::wxInitDialogEvent::GetEventCategory();
84 
85     extern  ::wxEventCategory sipVH__core_92(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);
86 
87     return sipVH__core_92(sipGILState, 0, sipPySelf, sipMeth);
88 }
89 
90 
91 PyDoc_STRVAR(doc_wxInitDialogEvent_Clone, "Clone(self) -> Event");
92 
93 extern "C" {static PyObject *meth_wxInitDialogEvent_Clone(PyObject *, PyObject *);}
meth_wxInitDialogEvent_Clone(PyObject * sipSelf,PyObject * sipArgs)94 static PyObject *meth_wxInitDialogEvent_Clone(PyObject *sipSelf, PyObject *sipArgs)
95 {
96     PyObject *sipParseErr = SIP_NULLPTR;
97     bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
98 
99     {
100         const  ::wxInitDialogEvent *sipCpp;
101 
102         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxInitDialogEvent, &sipCpp))
103         {
104              ::wxEvent*sipRes;
105 
106             PyErr_Clear();
107 
108             Py_BEGIN_ALLOW_THREADS
109             sipRes = (sipSelfWasArg ? sipCpp-> ::wxInitDialogEvent::Clone() : sipCpp->Clone());
110             Py_END_ALLOW_THREADS
111 
112             if (PyErr_Occurred())
113                 return 0;
114 
115             return sipConvertFromNewType(sipRes,sipType_wxEvent,SIP_NULLPTR);
116         }
117     }
118 
119     /* Raise an exception if the arguments couldn't be parsed. */
120     sipNoMethod(sipParseErr, sipName_InitDialogEvent, sipName_Clone, doc_wxInitDialogEvent_Clone);
121 
122     return SIP_NULLPTR;
123 }
124 
125 
126 /* Cast a pointer to a type somewhere in its inheritance hierarchy. */
127 extern "C" {static void *cast_wxInitDialogEvent(void *, const sipTypeDef *);}
cast_wxInitDialogEvent(void * sipCppV,const sipTypeDef * targetType)128 static void *cast_wxInitDialogEvent(void *sipCppV, const sipTypeDef *targetType)
129 {
130      ::wxInitDialogEvent *sipCpp = reinterpret_cast< ::wxInitDialogEvent *>(sipCppV);
131 
132     if (targetType == sipType_wxEvent)
133         return static_cast< ::wxEvent *>(sipCpp);
134 
135     if (targetType == sipType_wxObject)
136         return static_cast< ::wxObject *>(sipCpp);
137 
138     return sipCppV;
139 }
140 
141 
142 /* Call the instance's destructor. */
143 extern "C" {static void release_wxInitDialogEvent(void *, int);}
release_wxInitDialogEvent(void * sipCppV,int sipState)144 static void release_wxInitDialogEvent(void *sipCppV, int sipState)
145 {
146     Py_BEGIN_ALLOW_THREADS
147 
148     if (sipState & SIP_DERIVED_CLASS)
149         delete reinterpret_cast<sipwxInitDialogEvent *>(sipCppV);
150     else
151         delete reinterpret_cast< ::wxInitDialogEvent *>(sipCppV);
152 
153     Py_END_ALLOW_THREADS
154 }
155 
156 
157 extern "C" {static void dealloc_wxInitDialogEvent(sipSimpleWrapper *);}
dealloc_wxInitDialogEvent(sipSimpleWrapper * sipSelf)158 static void dealloc_wxInitDialogEvent(sipSimpleWrapper *sipSelf)
159 {
160     if (sipIsDerivedClass(sipSelf))
161         reinterpret_cast<sipwxInitDialogEvent *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;
162 
163     if (sipIsOwnedByPython(sipSelf))
164     {
165         release_wxInitDialogEvent(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
166     }
167 }
168 
169 
170 extern "C" {static void *init_type_wxInitDialogEvent(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
init_type_wxInitDialogEvent(sipSimpleWrapper * sipSelf,PyObject * sipArgs,PyObject * sipKwds,PyObject ** sipUnused,PyObject **,PyObject ** sipParseErr)171 static void *init_type_wxInitDialogEvent(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
172 {
173     sipwxInitDialogEvent *sipCpp = SIP_NULLPTR;
174 
175     {
176         int id = 0;
177 
178         static const char *sipKwdList[] = {
179             sipName_id,
180         };
181 
182         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|i", &id))
183         {
184             PyErr_Clear();
185 
186             Py_BEGIN_ALLOW_THREADS
187             sipCpp = new sipwxInitDialogEvent(id);
188             Py_END_ALLOW_THREADS
189 
190             if (PyErr_Occurred())
191             {
192                 delete sipCpp;
193                 return SIP_NULLPTR;
194             }
195 
196             sipCpp->sipPySelf = sipSelf;
197 
198             return sipCpp;
199         }
200     }
201 
202     {
203         const  ::wxInitDialogEvent* a0;
204 
205         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_wxInitDialogEvent, &a0))
206         {
207             Py_BEGIN_ALLOW_THREADS
208             sipCpp = new sipwxInitDialogEvent(*a0);
209             Py_END_ALLOW_THREADS
210 
211             sipCpp->sipPySelf = sipSelf;
212 
213             return sipCpp;
214         }
215     }
216 
217     return SIP_NULLPTR;
218 }
219 
220 
221 /* Define this type's super-types. */
222 static sipEncodedTypeDef supers_wxInitDialogEvent[] = {{140, 255, 1}};
223 
224 
225 static PyMethodDef methods_wxInitDialogEvent[] = {
226     {SIP_MLNAME_CAST(sipName_Clone), meth_wxInitDialogEvent_Clone, METH_VARARGS, SIP_MLDOC_CAST(doc_wxInitDialogEvent_Clone)}
227 };
228 
229 PyDoc_STRVAR(doc_wxInitDialogEvent, "InitDialogEvent(id=0)\n"
230 "\n"
231 "A wxInitDialogEvent is sent as a dialog or panel is being initialised.");
232 
233 
234 sipClassTypeDef sipTypeDef__core_wxInitDialogEvent = {
235     {
236         -1,
237         SIP_NULLPTR,
238         SIP_NULLPTR,
239         SIP_TYPE_SCC|SIP_TYPE_CLASS,
240         sipNameNr_wxInitDialogEvent,
241         {SIP_NULLPTR},
242         SIP_NULLPTR
243     },
244     {
245         sipNameNr_InitDialogEvent,
246         {0, 0, 1},
247         1, methods_wxInitDialogEvent,
248         0, SIP_NULLPTR,
249         0, SIP_NULLPTR,
250         {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
251     },
252     doc_wxInitDialogEvent,
253     -1,
254     -1,
255     supers_wxInitDialogEvent,
256     SIP_NULLPTR,
257     init_type_wxInitDialogEvent,
258     SIP_NULLPTR,
259     SIP_NULLPTR,
260 #if PY_MAJOR_VERSION >= 3
261     SIP_NULLPTR,
262     SIP_NULLPTR,
263 #else
264     SIP_NULLPTR,
265     SIP_NULLPTR,
266     SIP_NULLPTR,
267     SIP_NULLPTR,
268 #endif
269     dealloc_wxInitDialogEvent,
270     SIP_NULLPTR,
271     SIP_NULLPTR,
272     SIP_NULLPTR,
273     release_wxInitDialogEvent,
274     cast_wxInitDialogEvent,
275     SIP_NULLPTR,
276     SIP_NULLPTR,
277     SIP_NULLPTR,
278     SIP_NULLPTR,
279     SIP_NULLPTR,
280     SIP_NULLPTR
281 };
282