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/gdicmn.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 sipwxHelpEvent : public  ::wxHelpEvent
22 {
23 public:
24     sipwxHelpEvent( ::wxEventType, ::wxWindowID,const  ::wxPoint&, ::wxHelpEvent::Origin);
25     sipwxHelpEvent(const  ::wxHelpEvent&);
26     virtual ~sipwxHelpEvent();
27 
28     /*
29      * There is a protected method for every virtual method visible from
30      * this class.
31      */
32 protected:
33      ::wxEventCategory GetEventCategory() const SIP_OVERRIDE;
34      ::wxEvent* Clone() const SIP_OVERRIDE;
35 
36 public:
37     sipSimpleWrapper *sipPySelf;
38 
39 private:
40     sipwxHelpEvent(const sipwxHelpEvent &);
41     sipwxHelpEvent &operator = (const sipwxHelpEvent &);
42 
43     char sipPyMethods[2];
44 };
45 
sipwxHelpEvent(::wxEventType type,::wxWindowID winid,const::wxPoint & pt,::wxHelpEvent::Origin origin)46 sipwxHelpEvent::sipwxHelpEvent( ::wxEventType type, ::wxWindowID winid,const  ::wxPoint& pt, ::wxHelpEvent::Origin origin):  ::wxHelpEvent(type,winid,pt,origin), sipPySelf(SIP_NULLPTR)
47 {
48     memset(sipPyMethods, 0, sizeof (sipPyMethods));
49 }
50 
sipwxHelpEvent(const::wxHelpEvent & a0)51 sipwxHelpEvent::sipwxHelpEvent(const  ::wxHelpEvent& a0):  ::wxHelpEvent(a0), sipPySelf(SIP_NULLPTR)
52 {
53     memset(sipPyMethods, 0, sizeof (sipPyMethods));
54 }
55 
~sipwxHelpEvent()56 sipwxHelpEvent::~sipwxHelpEvent()
57 {
58     sipInstanceDestroyedEx(&sipPySelf);
59 }
60 
GetEventCategory() const61  ::wxEventCategory sipwxHelpEvent::GetEventCategory() const
62 {
63     sip_gilstate_t sipGILState;
64     PyObject *sipMeth;
65 
66     sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[0]),sipPySelf,SIP_NULLPTR,sipName_GetEventCategory);
67 
68     if (!sipMeth)
69         return  ::wxHelpEvent::GetEventCategory();
70 
71     extern  ::wxEventCategory sipVH__core_92(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);
72 
73     return sipVH__core_92(sipGILState, 0, sipPySelf, sipMeth);
74 }
75 
Clone() const76  ::wxEvent* sipwxHelpEvent::Clone() const
77 {
78     sip_gilstate_t sipGILState;
79     PyObject *sipMeth;
80 
81     sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[1]),sipPySelf,SIP_NULLPTR,sipName_Clone);
82 
83     if (!sipMeth)
84         return  ::wxHelpEvent::Clone();
85 
86     extern  ::wxEvent* sipVH__core_91(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);
87 
88     return sipVH__core_91(sipGILState, 0, sipPySelf, sipMeth);
89 }
90 
91 
92 PyDoc_STRVAR(doc_wxHelpEvent_GetOrigin, "GetOrigin() -> HelpEvent.Origin\n"
93 "\n"
94 "Returns the origin of the help event which is one of the\n"
95 "wxHelpEvent::Origin values.");
96 
97 extern "C" {static PyObject *meth_wxHelpEvent_GetOrigin(PyObject *, PyObject *);}
meth_wxHelpEvent_GetOrigin(PyObject * sipSelf,PyObject * sipArgs)98 static PyObject *meth_wxHelpEvent_GetOrigin(PyObject *sipSelf, PyObject *sipArgs)
99 {
100     PyObject *sipParseErr = SIP_NULLPTR;
101 
102     {
103         const  ::wxHelpEvent *sipCpp;
104 
105         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxHelpEvent, &sipCpp))
106         {
107              ::wxHelpEvent::Origin sipRes;
108 
109             PyErr_Clear();
110 
111             Py_BEGIN_ALLOW_THREADS
112             sipRes = sipCpp->GetOrigin();
113             Py_END_ALLOW_THREADS
114 
115             if (PyErr_Occurred())
116                 return 0;
117 
118             return sipConvertFromEnum(static_cast<int>(sipRes), sipType_wxHelpEvent_Origin);
119         }
120     }
121 
122     /* Raise an exception if the arguments couldn't be parsed. */
123     sipNoMethod(sipParseErr, sipName_HelpEvent, sipName_GetOrigin, SIP_NULLPTR);
124 
125     return SIP_NULLPTR;
126 }
127 
128 
129 PyDoc_STRVAR(doc_wxHelpEvent_GetPosition, "GetPosition() -> Point\n"
130 "\n"
131 "Returns the left-click position of the mouse, in screen coordinates.");
132 
133 extern "C" {static PyObject *meth_wxHelpEvent_GetPosition(PyObject *, PyObject *);}
meth_wxHelpEvent_GetPosition(PyObject * sipSelf,PyObject * sipArgs)134 static PyObject *meth_wxHelpEvent_GetPosition(PyObject *sipSelf, PyObject *sipArgs)
135 {
136     PyObject *sipParseErr = SIP_NULLPTR;
137 
138     {
139         const  ::wxHelpEvent *sipCpp;
140 
141         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxHelpEvent, &sipCpp))
142         {
143              ::wxPoint*sipRes;
144 
145             PyErr_Clear();
146 
147             Py_BEGIN_ALLOW_THREADS
148             sipRes = new  ::wxPoint(sipCpp->GetPosition());
149             Py_END_ALLOW_THREADS
150 
151             if (PyErr_Occurred())
152                 return 0;
153 
154             return sipConvertFromNewType(sipRes,sipType_wxPoint,SIP_NULLPTR);
155         }
156     }
157 
158     /* Raise an exception if the arguments couldn't be parsed. */
159     sipNoMethod(sipParseErr, sipName_HelpEvent, sipName_GetPosition, SIP_NULLPTR);
160 
161     return SIP_NULLPTR;
162 }
163 
164 
165 PyDoc_STRVAR(doc_wxHelpEvent_SetOrigin, "SetOrigin(origin)\n"
166 "\n"
167 "Set the help event origin, only used internally by wxWidgets normally.");
168 
169 extern "C" {static PyObject *meth_wxHelpEvent_SetOrigin(PyObject *, PyObject *, PyObject *);}
meth_wxHelpEvent_SetOrigin(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)170 static PyObject *meth_wxHelpEvent_SetOrigin(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
171 {
172     PyObject *sipParseErr = SIP_NULLPTR;
173 
174     {
175          ::wxHelpEvent::Origin origin;
176          ::wxHelpEvent *sipCpp;
177 
178         static const char *sipKwdList[] = {
179             sipName_origin,
180         };
181 
182         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BE", &sipSelf, sipType_wxHelpEvent, &sipCpp, sipType_wxHelpEvent_Origin, &origin))
183         {
184             PyErr_Clear();
185 
186             Py_BEGIN_ALLOW_THREADS
187             sipCpp->SetOrigin(origin);
188             Py_END_ALLOW_THREADS
189 
190             if (PyErr_Occurred())
191                 return 0;
192 
193             Py_INCREF(Py_None);
194             return Py_None;
195         }
196     }
197 
198     /* Raise an exception if the arguments couldn't be parsed. */
199     sipNoMethod(sipParseErr, sipName_HelpEvent, sipName_SetOrigin, SIP_NULLPTR);
200 
201     return SIP_NULLPTR;
202 }
203 
204 
205 PyDoc_STRVAR(doc_wxHelpEvent_SetPosition, "SetPosition(pt)\n"
206 "\n"
207 "Sets the left-click position of the mouse, in screen coordinates.");
208 
209 extern "C" {static PyObject *meth_wxHelpEvent_SetPosition(PyObject *, PyObject *, PyObject *);}
meth_wxHelpEvent_SetPosition(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)210 static PyObject *meth_wxHelpEvent_SetPosition(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
211 {
212     PyObject *sipParseErr = SIP_NULLPTR;
213 
214     {
215         const  ::wxPoint* pt;
216         int ptState = 0;
217          ::wxHelpEvent *sipCpp;
218 
219         static const char *sipKwdList[] = {
220             sipName_pt,
221         };
222 
223         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxHelpEvent, &sipCpp, sipType_wxPoint, &pt, &ptState))
224         {
225             PyErr_Clear();
226 
227             Py_BEGIN_ALLOW_THREADS
228             sipCpp->SetPosition(*pt);
229             Py_END_ALLOW_THREADS
230             sipReleaseType(const_cast< ::wxPoint *>(pt),sipType_wxPoint,ptState);
231 
232             if (PyErr_Occurred())
233                 return 0;
234 
235             Py_INCREF(Py_None);
236             return Py_None;
237         }
238     }
239 
240     /* Raise an exception if the arguments couldn't be parsed. */
241     sipNoMethod(sipParseErr, sipName_HelpEvent, sipName_SetPosition, SIP_NULLPTR);
242 
243     return SIP_NULLPTR;
244 }
245 
246 
247 PyDoc_STRVAR(doc_wxHelpEvent_Clone, "Clone(self) -> Event");
248 
249 extern "C" {static PyObject *meth_wxHelpEvent_Clone(PyObject *, PyObject *);}
meth_wxHelpEvent_Clone(PyObject * sipSelf,PyObject * sipArgs)250 static PyObject *meth_wxHelpEvent_Clone(PyObject *sipSelf, PyObject *sipArgs)
251 {
252     PyObject *sipParseErr = SIP_NULLPTR;
253     bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
254 
255     {
256         const  ::wxHelpEvent *sipCpp;
257 
258         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxHelpEvent, &sipCpp))
259         {
260              ::wxEvent*sipRes;
261 
262             PyErr_Clear();
263 
264             Py_BEGIN_ALLOW_THREADS
265             sipRes = (sipSelfWasArg ? sipCpp-> ::wxHelpEvent::Clone() : sipCpp->Clone());
266             Py_END_ALLOW_THREADS
267 
268             if (PyErr_Occurred())
269                 return 0;
270 
271             return sipConvertFromNewType(sipRes,sipType_wxEvent,SIP_NULLPTR);
272         }
273     }
274 
275     /* Raise an exception if the arguments couldn't be parsed. */
276     sipNoMethod(sipParseErr, sipName_HelpEvent, sipName_Clone, doc_wxHelpEvent_Clone);
277 
278     return SIP_NULLPTR;
279 }
280 
281 
282 /* Cast a pointer to a type somewhere in its inheritance hierarchy. */
283 extern "C" {static void *cast_wxHelpEvent(void *, const sipTypeDef *);}
cast_wxHelpEvent(void * sipCppV,const sipTypeDef * targetType)284 static void *cast_wxHelpEvent(void *sipCppV, const sipTypeDef *targetType)
285 {
286      ::wxHelpEvent *sipCpp = reinterpret_cast< ::wxHelpEvent *>(sipCppV);
287 
288     if (targetType == sipType_wxCommandEvent)
289         return static_cast< ::wxCommandEvent *>(sipCpp);
290 
291     if (targetType == sipType_wxEvent)
292         return static_cast< ::wxEvent *>(sipCpp);
293 
294     if (targetType == sipType_wxObject)
295         return static_cast< ::wxObject *>(sipCpp);
296 
297     return sipCppV;
298 }
299 
300 
301 /* Call the instance's destructor. */
302 extern "C" {static void release_wxHelpEvent(void *, int);}
release_wxHelpEvent(void * sipCppV,int sipState)303 static void release_wxHelpEvent(void *sipCppV, int sipState)
304 {
305     Py_BEGIN_ALLOW_THREADS
306 
307     if (sipState & SIP_DERIVED_CLASS)
308         delete reinterpret_cast<sipwxHelpEvent *>(sipCppV);
309     else
310         delete reinterpret_cast< ::wxHelpEvent *>(sipCppV);
311 
312     Py_END_ALLOW_THREADS
313 }
314 
315 
316 extern "C" {static void dealloc_wxHelpEvent(sipSimpleWrapper *);}
dealloc_wxHelpEvent(sipSimpleWrapper * sipSelf)317 static void dealloc_wxHelpEvent(sipSimpleWrapper *sipSelf)
318 {
319     if (sipIsDerivedClass(sipSelf))
320         reinterpret_cast<sipwxHelpEvent *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;
321 
322     if (sipIsOwnedByPython(sipSelf))
323     {
324         release_wxHelpEvent(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
325     }
326 }
327 
328 
329 extern "C" {static void *init_type_wxHelpEvent(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
init_type_wxHelpEvent(sipSimpleWrapper * sipSelf,PyObject * sipArgs,PyObject * sipKwds,PyObject ** sipUnused,PyObject **,PyObject ** sipParseErr)330 static void *init_type_wxHelpEvent(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
331 {
332     sipwxHelpEvent *sipCpp = SIP_NULLPTR;
333 
334     {
335          ::wxEventType type = wxEVT_NULL;
336          ::wxWindowID winid = 0;
337         const  ::wxPoint& ptdef = wxDefaultPosition;
338         const  ::wxPoint* pt = &ptdef;
339         int ptState = 0;
340          ::wxHelpEvent::Origin origin =  ::wxHelpEvent::Origin_Unknown;
341 
342         static const char *sipKwdList[] = {
343             sipName_type,
344             sipName_winid,
345             sipName_pt,
346             sipName_origin,
347         };
348 
349         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|iiJ1E", &type, &winid, sipType_wxPoint, &pt, &ptState, sipType_wxHelpEvent_Origin, &origin))
350         {
351             PyErr_Clear();
352 
353             Py_BEGIN_ALLOW_THREADS
354             sipCpp = new sipwxHelpEvent(type,winid,*pt,origin);
355             Py_END_ALLOW_THREADS
356             sipReleaseType(const_cast< ::wxPoint *>(pt),sipType_wxPoint,ptState);
357 
358             if (PyErr_Occurred())
359             {
360                 delete sipCpp;
361                 return SIP_NULLPTR;
362             }
363 
364             sipCpp->sipPySelf = sipSelf;
365 
366             return sipCpp;
367         }
368     }
369 
370     {
371         const  ::wxHelpEvent* a0;
372 
373         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_wxHelpEvent, &a0))
374         {
375             Py_BEGIN_ALLOW_THREADS
376             sipCpp = new sipwxHelpEvent(*a0);
377             Py_END_ALLOW_THREADS
378 
379             sipCpp->sipPySelf = sipSelf;
380 
381             return sipCpp;
382         }
383     }
384 
385     return SIP_NULLPTR;
386 }
387 
388 
389 /* Define this type's super-types. */
390 static sipEncodedTypeDef supers_wxHelpEvent[] = {{77, 255, 1}};
391 
392 
393 static PyMethodDef methods_wxHelpEvent[] = {
394     {SIP_MLNAME_CAST(sipName_Clone), meth_wxHelpEvent_Clone, METH_VARARGS, SIP_MLDOC_CAST(doc_wxHelpEvent_Clone)},
395     {SIP_MLNAME_CAST(sipName_GetOrigin), meth_wxHelpEvent_GetOrigin, METH_VARARGS, SIP_MLDOC_CAST(doc_wxHelpEvent_GetOrigin)},
396     {SIP_MLNAME_CAST(sipName_GetPosition), meth_wxHelpEvent_GetPosition, METH_VARARGS, SIP_MLDOC_CAST(doc_wxHelpEvent_GetPosition)},
397     {SIP_MLNAME_CAST(sipName_SetOrigin), SIP_MLMETH_CAST(meth_wxHelpEvent_SetOrigin), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxHelpEvent_SetOrigin)},
398     {SIP_MLNAME_CAST(sipName_SetPosition), SIP_MLMETH_CAST(meth_wxHelpEvent_SetPosition), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxHelpEvent_SetPosition)}
399 };
400 
401 static sipEnumMemberDef enummembers_wxHelpEvent[] = {
402     {sipName_Origin_HelpButton, static_cast<int>( ::wxHelpEvent::Origin_HelpButton), 239},
403     {sipName_Origin_Keyboard, static_cast<int>( ::wxHelpEvent::Origin_Keyboard), 239},
404     {sipName_Origin_Unknown, static_cast<int>( ::wxHelpEvent::Origin_Unknown), 239},
405 };
406 
407 sipVariableDef variables_wxHelpEvent[] = {
408     {PropertyVariable, sipName_Position, &methods_wxHelpEvent[2], &methods_wxHelpEvent[4], SIP_NULLPTR, SIP_NULLPTR},
409 };
410 
411 PyDoc_STRVAR(doc_wxHelpEvent, "HelpEvent(type=wxEVT_NULL, winid=0, pt=DefaultPosition, origin=Origin_Unknown)\n"
412 "\n"
413 "A help event is sent when the user has requested context-sensitive\n"
414 "help.");
415 
416 
417 sipClassTypeDef sipTypeDef__core_wxHelpEvent = {
418     {
419         -1,
420         SIP_NULLPTR,
421         SIP_NULLPTR,
422         SIP_TYPE_SCC|SIP_TYPE_CLASS,
423         sipNameNr_wxHelpEvent,
424         {SIP_NULLPTR},
425         SIP_NULLPTR
426     },
427     {
428         sipNameNr_HelpEvent,
429         {0, 0, 1},
430         5, methods_wxHelpEvent,
431         3, enummembers_wxHelpEvent,
432         1, variables_wxHelpEvent,
433         {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
434     },
435     doc_wxHelpEvent,
436     -1,
437     -1,
438     supers_wxHelpEvent,
439     SIP_NULLPTR,
440     init_type_wxHelpEvent,
441     SIP_NULLPTR,
442     SIP_NULLPTR,
443 #if PY_MAJOR_VERSION >= 3
444     SIP_NULLPTR,
445     SIP_NULLPTR,
446 #else
447     SIP_NULLPTR,
448     SIP_NULLPTR,
449     SIP_NULLPTR,
450     SIP_NULLPTR,
451 #endif
452     dealloc_wxHelpEvent,
453     SIP_NULLPTR,
454     SIP_NULLPTR,
455     SIP_NULLPTR,
456     release_wxHelpEvent,
457     cast_wxHelpEvent,
458     SIP_NULLPTR,
459     SIP_NULLPTR,
460     SIP_NULLPTR,
461     SIP_NULLPTR,
462     SIP_NULLPTR,
463     SIP_NULLPTR
464 };
465