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/timer.h>
13 
14         #include <wx/event.h>
15         #include <wx/event.h>
16         #include <wx/eventfilter.h>
17         #include <wx/object.h>
18         #include <wx/object.h>
19         #include <wx/object.h>
20 
21 
22 class sipwxTimer : public  ::wxTimer
23 {
24 public:
25     sipwxTimer();
26     sipwxTimer( ::wxEvtHandler*,int);
27     virtual ~sipwxTimer();
28 
29     /*
30      * There is a public method for every protected method visible from
31      * this class.
32      */
33     bool sipProtectVirt_TryBefore(bool, ::wxEvent&);
34     bool sipProtectVirt_TryAfter(bool, ::wxEvent&);
35 
36     /*
37      * There is a protected method for every virtual method visible from
38      * this class.
39      */
40 protected:
41     void Stop() SIP_OVERRIDE;
42     bool Start(int,bool) SIP_OVERRIDE;
43     void Notify() SIP_OVERRIDE;
44     bool ProcessEvent( ::wxEvent&) SIP_OVERRIDE;
45     bool TryBefore( ::wxEvent&) SIP_OVERRIDE;
46     bool TryAfter( ::wxEvent&) SIP_OVERRIDE;
47 
48 public:
49     sipSimpleWrapper *sipPySelf;
50 
51 private:
52     sipwxTimer(const sipwxTimer &);
53     sipwxTimer &operator = (const sipwxTimer &);
54 
55     char sipPyMethods[6];
56 };
57 
sipwxTimer()58 sipwxTimer::sipwxTimer():  ::wxTimer(), sipPySelf(SIP_NULLPTR)
59 {
60     memset(sipPyMethods, 0, sizeof (sipPyMethods));
61 }
62 
sipwxTimer(::wxEvtHandler * owner,int id)63 sipwxTimer::sipwxTimer( ::wxEvtHandler*owner,int id):  ::wxTimer(owner,id), sipPySelf(SIP_NULLPTR)
64 {
65     memset(sipPyMethods, 0, sizeof (sipPyMethods));
66 }
67 
~sipwxTimer()68 sipwxTimer::~sipwxTimer()
69 {
70     sipInstanceDestroyedEx(&sipPySelf);
71 }
72 
Stop()73 void sipwxTimer::Stop()
74 {
75     sip_gilstate_t sipGILState;
76     PyObject *sipMeth;
77 
78     sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[0],sipPySelf,SIP_NULLPTR,sipName_Stop);
79 
80     if (!sipMeth)
81     {
82          ::wxTimer::Stop();
83         return;
84     }
85 
86     extern void sipVH__core_45(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);
87 
88     sipVH__core_45(sipGILState, 0, sipPySelf, sipMeth);
89 }
90 
Start(int milliseconds,bool oneShot)91 bool sipwxTimer::Start(int milliseconds,bool oneShot)
92 {
93     sip_gilstate_t sipGILState;
94     PyObject *sipMeth;
95 
96     sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[1],sipPySelf,SIP_NULLPTR,sipName_Start);
97 
98     if (!sipMeth)
99         return  ::wxTimer::Start(milliseconds,oneShot);
100 
101     extern bool sipVH__core_109(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, int,bool);
102 
103     return sipVH__core_109(sipGILState, 0, sipPySelf, sipMeth, milliseconds, oneShot);
104 }
105 
Notify()106 void sipwxTimer::Notify()
107 {
108     sip_gilstate_t sipGILState;
109     PyObject *sipMeth;
110 
111     sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[2],sipPySelf,SIP_NULLPTR,sipName_Notify);
112 
113     if (!sipMeth)
114     {
115          ::wxTimer::Notify();
116         return;
117     }
118 
119     extern void sipVH__core_45(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);
120 
121     sipVH__core_45(sipGILState, 0, sipPySelf, sipMeth);
122 }
123 
ProcessEvent(::wxEvent & event)124 bool sipwxTimer::ProcessEvent( ::wxEvent& event)
125 {
126     sip_gilstate_t sipGILState;
127     PyObject *sipMeth;
128 
129     sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[3],sipPySelf,SIP_NULLPTR,sipName_ProcessEvent);
130 
131     if (!sipMeth)
132         return  ::wxTimer::ProcessEvent(event);
133 
134     extern bool sipVH__core_90(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxEvent&);
135 
136     return sipVH__core_90(sipGILState, 0, sipPySelf, sipMeth, event);
137 }
138 
TryBefore(::wxEvent & event)139 bool sipwxTimer::TryBefore( ::wxEvent& event)
140 {
141     sip_gilstate_t sipGILState;
142     PyObject *sipMeth;
143 
144     sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[4],sipPySelf,SIP_NULLPTR,sipName_TryBefore);
145 
146     if (!sipMeth)
147         return  ::wxTimer::TryBefore(event);
148 
149     extern bool sipVH__core_90(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxEvent&);
150 
151     return sipVH__core_90(sipGILState, 0, sipPySelf, sipMeth, event);
152 }
153 
TryAfter(::wxEvent & event)154 bool sipwxTimer::TryAfter( ::wxEvent& event)
155 {
156     sip_gilstate_t sipGILState;
157     PyObject *sipMeth;
158 
159     sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[5],sipPySelf,SIP_NULLPTR,sipName_TryAfter);
160 
161     if (!sipMeth)
162         return  ::wxTimer::TryAfter(event);
163 
164     extern bool sipVH__core_90(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxEvent&);
165 
166     return sipVH__core_90(sipGILState, 0, sipPySelf, sipMeth, event);
167 }
168 
sipProtectVirt_TryBefore(bool sipSelfWasArg,::wxEvent & event)169 bool sipwxTimer::sipProtectVirt_TryBefore(bool sipSelfWasArg, ::wxEvent& event)
170 {
171     return (sipSelfWasArg ?  ::wxEvtHandler::TryBefore(event) : TryBefore(event));
172 }
173 
sipProtectVirt_TryAfter(bool sipSelfWasArg,::wxEvent & event)174 bool sipwxTimer::sipProtectVirt_TryAfter(bool sipSelfWasArg, ::wxEvent& event)
175 {
176     return (sipSelfWasArg ?  ::wxEvtHandler::TryAfter(event) : TryAfter(event));
177 }
178 
179 
180 PyDoc_STRVAR(doc_wxTimer_TryBefore, "TryBefore(event) -> bool\n"
181 "\n"
182 "Method called by ProcessEvent() before examining this object event\n"
183 "tables.");
184 
185 extern "C" {static PyObject *meth_wxTimer_TryBefore(PyObject *, PyObject *, PyObject *);}
meth_wxTimer_TryBefore(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)186 static PyObject *meth_wxTimer_TryBefore(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
187 {
188     PyObject *sipParseErr = SIP_NULLPTR;
189     bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
190 
191     {
192          ::wxEvent* event;
193         sipwxTimer *sipCpp;
194 
195         static const char *sipKwdList[] = {
196             sipName_event,
197         };
198 
199         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxTimer, &sipCpp, sipType_wxEvent, &event))
200         {
201             bool sipRes;
202 
203             PyErr_Clear();
204 
205             Py_BEGIN_ALLOW_THREADS
206             sipRes = sipCpp->sipProtectVirt_TryBefore(sipSelfWasArg,*event);
207             Py_END_ALLOW_THREADS
208 
209             if (PyErr_Occurred())
210                 return 0;
211 
212             return PyBool_FromLong(sipRes);
213         }
214     }
215 
216     /* Raise an exception if the arguments couldn't be parsed. */
217     sipNoMethod(sipParseErr, sipName_Timer, sipName_TryBefore, SIP_NULLPTR);
218 
219     return SIP_NULLPTR;
220 }
221 
222 
223 PyDoc_STRVAR(doc_wxTimer_TryAfter, "TryAfter(event) -> bool\n"
224 "\n"
225 "Method called by ProcessEvent() as last resort.");
226 
227 extern "C" {static PyObject *meth_wxTimer_TryAfter(PyObject *, PyObject *, PyObject *);}
meth_wxTimer_TryAfter(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)228 static PyObject *meth_wxTimer_TryAfter(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
229 {
230     PyObject *sipParseErr = SIP_NULLPTR;
231     bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
232 
233     {
234          ::wxEvent* event;
235         sipwxTimer *sipCpp;
236 
237         static const char *sipKwdList[] = {
238             sipName_event,
239         };
240 
241         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxTimer, &sipCpp, sipType_wxEvent, &event))
242         {
243             bool sipRes;
244 
245             PyErr_Clear();
246 
247             Py_BEGIN_ALLOW_THREADS
248             sipRes = sipCpp->sipProtectVirt_TryAfter(sipSelfWasArg,*event);
249             Py_END_ALLOW_THREADS
250 
251             if (PyErr_Occurred())
252                 return 0;
253 
254             return PyBool_FromLong(sipRes);
255         }
256     }
257 
258     /* Raise an exception if the arguments couldn't be parsed. */
259     sipNoMethod(sipParseErr, sipName_Timer, sipName_TryAfter, SIP_NULLPTR);
260 
261     return SIP_NULLPTR;
262 }
263 
264 
265 PyDoc_STRVAR(doc_wxTimer_GetId, "GetId() -> int\n"
266 "\n"
267 "Returns the ID of the events generated by this timer.");
268 
269 extern "C" {static PyObject *meth_wxTimer_GetId(PyObject *, PyObject *);}
meth_wxTimer_GetId(PyObject * sipSelf,PyObject * sipArgs)270 static PyObject *meth_wxTimer_GetId(PyObject *sipSelf, PyObject *sipArgs)
271 {
272     PyObject *sipParseErr = SIP_NULLPTR;
273 
274     {
275         const  ::wxTimer *sipCpp;
276 
277         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxTimer, &sipCpp))
278         {
279             int sipRes;
280 
281             PyErr_Clear();
282 
283             Py_BEGIN_ALLOW_THREADS
284             sipRes = sipCpp->GetId();
285             Py_END_ALLOW_THREADS
286 
287             if (PyErr_Occurred())
288                 return 0;
289 
290             return SIPLong_FromLong(sipRes);
291         }
292     }
293 
294     /* Raise an exception if the arguments couldn't be parsed. */
295     sipNoMethod(sipParseErr, sipName_Timer, sipName_GetId, SIP_NULLPTR);
296 
297     return SIP_NULLPTR;
298 }
299 
300 
301 PyDoc_STRVAR(doc_wxTimer_GetInterval, "GetInterval() -> int\n"
302 "\n"
303 "Returns the current interval for the timer (in milliseconds).");
304 
305 extern "C" {static PyObject *meth_wxTimer_GetInterval(PyObject *, PyObject *);}
meth_wxTimer_GetInterval(PyObject * sipSelf,PyObject * sipArgs)306 static PyObject *meth_wxTimer_GetInterval(PyObject *sipSelf, PyObject *sipArgs)
307 {
308     PyObject *sipParseErr = SIP_NULLPTR;
309 
310     {
311         const  ::wxTimer *sipCpp;
312 
313         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxTimer, &sipCpp))
314         {
315             int sipRes;
316 
317             PyErr_Clear();
318 
319             Py_BEGIN_ALLOW_THREADS
320             sipRes = sipCpp->GetInterval();
321             Py_END_ALLOW_THREADS
322 
323             if (PyErr_Occurred())
324                 return 0;
325 
326             return SIPLong_FromLong(sipRes);
327         }
328     }
329 
330     /* Raise an exception if the arguments couldn't be parsed. */
331     sipNoMethod(sipParseErr, sipName_Timer, sipName_GetInterval, SIP_NULLPTR);
332 
333     return SIP_NULLPTR;
334 }
335 
336 
337 PyDoc_STRVAR(doc_wxTimer_GetOwner, "GetOwner() -> EvtHandler\n"
338 "\n"
339 "Returns the current owner of the timer.");
340 
341 extern "C" {static PyObject *meth_wxTimer_GetOwner(PyObject *, PyObject *);}
meth_wxTimer_GetOwner(PyObject * sipSelf,PyObject * sipArgs)342 static PyObject *meth_wxTimer_GetOwner(PyObject *sipSelf, PyObject *sipArgs)
343 {
344     PyObject *sipParseErr = SIP_NULLPTR;
345 
346     {
347         const  ::wxTimer *sipCpp;
348 
349         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxTimer, &sipCpp))
350         {
351              ::wxEvtHandler*sipRes;
352 
353             PyErr_Clear();
354 
355             Py_BEGIN_ALLOW_THREADS
356             sipRes = sipCpp->GetOwner();
357             Py_END_ALLOW_THREADS
358 
359             if (PyErr_Occurred())
360                 return 0;
361 
362             return sipConvertFromType(sipRes,sipType_wxEvtHandler,SIP_NULLPTR);
363         }
364     }
365 
366     /* Raise an exception if the arguments couldn't be parsed. */
367     sipNoMethod(sipParseErr, sipName_Timer, sipName_GetOwner, SIP_NULLPTR);
368 
369     return SIP_NULLPTR;
370 }
371 
372 
373 PyDoc_STRVAR(doc_wxTimer_IsOneShot, "IsOneShot() -> bool\n"
374 "\n"
375 "Returns true if the timer is one shot, i.e. if it will stop after\n"
376 "firing the first notification automatically.");
377 
378 extern "C" {static PyObject *meth_wxTimer_IsOneShot(PyObject *, PyObject *);}
meth_wxTimer_IsOneShot(PyObject * sipSelf,PyObject * sipArgs)379 static PyObject *meth_wxTimer_IsOneShot(PyObject *sipSelf, PyObject *sipArgs)
380 {
381     PyObject *sipParseErr = SIP_NULLPTR;
382 
383     {
384         const  ::wxTimer *sipCpp;
385 
386         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxTimer, &sipCpp))
387         {
388             bool sipRes;
389 
390             PyErr_Clear();
391 
392             Py_BEGIN_ALLOW_THREADS
393             sipRes = sipCpp->IsOneShot();
394             Py_END_ALLOW_THREADS
395 
396             if (PyErr_Occurred())
397                 return 0;
398 
399             return PyBool_FromLong(sipRes);
400         }
401     }
402 
403     /* Raise an exception if the arguments couldn't be parsed. */
404     sipNoMethod(sipParseErr, sipName_Timer, sipName_IsOneShot, SIP_NULLPTR);
405 
406     return SIP_NULLPTR;
407 }
408 
409 
410 PyDoc_STRVAR(doc_wxTimer_IsRunning, "IsRunning() -> bool\n"
411 "\n"
412 "Returns true if the timer is running, false if it is stopped.");
413 
414 extern "C" {static PyObject *meth_wxTimer_IsRunning(PyObject *, PyObject *);}
meth_wxTimer_IsRunning(PyObject * sipSelf,PyObject * sipArgs)415 static PyObject *meth_wxTimer_IsRunning(PyObject *sipSelf, PyObject *sipArgs)
416 {
417     PyObject *sipParseErr = SIP_NULLPTR;
418 
419     {
420         const  ::wxTimer *sipCpp;
421 
422         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxTimer, &sipCpp))
423         {
424             bool sipRes;
425 
426             PyErr_Clear();
427 
428             Py_BEGIN_ALLOW_THREADS
429             sipRes = sipCpp->IsRunning();
430             Py_END_ALLOW_THREADS
431 
432             if (PyErr_Occurred())
433                 return 0;
434 
435             return PyBool_FromLong(sipRes);
436         }
437     }
438 
439     /* Raise an exception if the arguments couldn't be parsed. */
440     sipNoMethod(sipParseErr, sipName_Timer, sipName_IsRunning, SIP_NULLPTR);
441 
442     return SIP_NULLPTR;
443 }
444 
445 
446 PyDoc_STRVAR(doc_wxTimer_Notify, "Notify()\n"
447 "\n"
448 "This member should be overridden by the user if the default\n"
449 "constructor was used and SetOwner() wasn't called.");
450 
451 extern "C" {static PyObject *meth_wxTimer_Notify(PyObject *, PyObject *);}
meth_wxTimer_Notify(PyObject * sipSelf,PyObject * sipArgs)452 static PyObject *meth_wxTimer_Notify(PyObject *sipSelf, PyObject *sipArgs)
453 {
454     PyObject *sipParseErr = SIP_NULLPTR;
455     bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
456 
457     {
458          ::wxTimer *sipCpp;
459 
460         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxTimer, &sipCpp))
461         {
462             PyErr_Clear();
463 
464             Py_BEGIN_ALLOW_THREADS
465             (sipSelfWasArg ? sipCpp-> ::wxTimer::Notify() : sipCpp->Notify());
466             Py_END_ALLOW_THREADS
467 
468             if (PyErr_Occurred())
469                 return 0;
470 
471             Py_INCREF(Py_None);
472             return Py_None;
473         }
474     }
475 
476     /* Raise an exception if the arguments couldn't be parsed. */
477     sipNoMethod(sipParseErr, sipName_Timer, sipName_Notify, SIP_NULLPTR);
478 
479     return SIP_NULLPTR;
480 }
481 
482 
483 PyDoc_STRVAR(doc_wxTimer_SetOwner, "SetOwner(owner, id=-1)\n"
484 "\n"
485 "Associates the timer with the given owner object.");
486 
487 extern "C" {static PyObject *meth_wxTimer_SetOwner(PyObject *, PyObject *, PyObject *);}
meth_wxTimer_SetOwner(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)488 static PyObject *meth_wxTimer_SetOwner(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
489 {
490     PyObject *sipParseErr = SIP_NULLPTR;
491 
492     {
493          ::wxEvtHandler* owner;
494         int id = -1;
495          ::wxTimer *sipCpp;
496 
497         static const char *sipKwdList[] = {
498             sipName_owner,
499             sipName_id,
500         };
501 
502         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8|i", &sipSelf, sipType_wxTimer, &sipCpp, sipType_wxEvtHandler, &owner, &id))
503         {
504             PyErr_Clear();
505 
506             Py_BEGIN_ALLOW_THREADS
507             sipCpp->SetOwner(owner,id);
508             Py_END_ALLOW_THREADS
509 
510             if (PyErr_Occurred())
511                 return 0;
512 
513             Py_INCREF(Py_None);
514             return Py_None;
515         }
516     }
517 
518     /* Raise an exception if the arguments couldn't be parsed. */
519     sipNoMethod(sipParseErr, sipName_Timer, sipName_SetOwner, SIP_NULLPTR);
520 
521     return SIP_NULLPTR;
522 }
523 
524 
525 PyDoc_STRVAR(doc_wxTimer_Start, "Start(milliseconds=-1, oneShot=TIMER_CONTINUOUS) -> bool\n"
526 "\n"
527 "(Re)starts the timer.");
528 
529 extern "C" {static PyObject *meth_wxTimer_Start(PyObject *, PyObject *, PyObject *);}
meth_wxTimer_Start(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)530 static PyObject *meth_wxTimer_Start(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
531 {
532     PyObject *sipParseErr = SIP_NULLPTR;
533     bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
534 
535     {
536         int milliseconds = -1;
537         bool oneShot = wxTIMER_CONTINUOUS;
538          ::wxTimer *sipCpp;
539 
540         static const char *sipKwdList[] = {
541             sipName_milliseconds,
542             sipName_oneShot,
543         };
544 
545         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|ib", &sipSelf, sipType_wxTimer, &sipCpp, &milliseconds, &oneShot))
546         {
547             bool sipRes;
548 
549             PyErr_Clear();
550 
551             Py_BEGIN_ALLOW_THREADS
552             sipRes = (sipSelfWasArg ? sipCpp-> ::wxTimer::Start(milliseconds,oneShot) : sipCpp->Start(milliseconds,oneShot));
553             Py_END_ALLOW_THREADS
554 
555             if (PyErr_Occurred())
556                 return 0;
557 
558             return PyBool_FromLong(sipRes);
559         }
560     }
561 
562     /* Raise an exception if the arguments couldn't be parsed. */
563     sipNoMethod(sipParseErr, sipName_Timer, sipName_Start, SIP_NULLPTR);
564 
565     return SIP_NULLPTR;
566 }
567 
568 
569 PyDoc_STRVAR(doc_wxTimer_StartOnce, "StartOnce(milliseconds=-1) -> bool\n"
570 "\n"
571 "Starts the timer for a once-only notification.");
572 
573 extern "C" {static PyObject *meth_wxTimer_StartOnce(PyObject *, PyObject *, PyObject *);}
meth_wxTimer_StartOnce(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)574 static PyObject *meth_wxTimer_StartOnce(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
575 {
576     PyObject *sipParseErr = SIP_NULLPTR;
577 
578     {
579         int milliseconds = -1;
580          ::wxTimer *sipCpp;
581 
582         static const char *sipKwdList[] = {
583             sipName_milliseconds,
584         };
585 
586         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|i", &sipSelf, sipType_wxTimer, &sipCpp, &milliseconds))
587         {
588             bool sipRes;
589 
590             PyErr_Clear();
591 
592             Py_BEGIN_ALLOW_THREADS
593             sipRes = sipCpp->StartOnce(milliseconds);
594             Py_END_ALLOW_THREADS
595 
596             if (PyErr_Occurred())
597                 return 0;
598 
599             return PyBool_FromLong(sipRes);
600         }
601     }
602 
603     /* Raise an exception if the arguments couldn't be parsed. */
604     sipNoMethod(sipParseErr, sipName_Timer, sipName_StartOnce, SIP_NULLPTR);
605 
606     return SIP_NULLPTR;
607 }
608 
609 
610 PyDoc_STRVAR(doc_wxTimer_Stop, "Stop()\n"
611 "\n"
612 "Stops the timer.");
613 
614 extern "C" {static PyObject *meth_wxTimer_Stop(PyObject *, PyObject *);}
meth_wxTimer_Stop(PyObject * sipSelf,PyObject * sipArgs)615 static PyObject *meth_wxTimer_Stop(PyObject *sipSelf, PyObject *sipArgs)
616 {
617     PyObject *sipParseErr = SIP_NULLPTR;
618     bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
619 
620     {
621          ::wxTimer *sipCpp;
622 
623         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxTimer, &sipCpp))
624         {
625             PyErr_Clear();
626 
627             Py_BEGIN_ALLOW_THREADS
628             (sipSelfWasArg ? sipCpp-> ::wxTimer::Stop() : sipCpp->Stop());
629             Py_END_ALLOW_THREADS
630 
631             if (PyErr_Occurred())
632                 return 0;
633 
634             Py_INCREF(Py_None);
635             return Py_None;
636         }
637     }
638 
639     /* Raise an exception if the arguments couldn't be parsed. */
640     sipNoMethod(sipParseErr, sipName_Timer, sipName_Stop, SIP_NULLPTR);
641 
642     return SIP_NULLPTR;
643 }
644 
645 
646 /* Cast a pointer to a type somewhere in its inheritance hierarchy. */
647 extern "C" {static void *cast_wxTimer(void *, const sipTypeDef *);}
cast_wxTimer(void * sipCppV,const sipTypeDef * targetType)648 static void *cast_wxTimer(void *sipCppV, const sipTypeDef *targetType)
649 {
650      ::wxTimer *sipCpp = reinterpret_cast< ::wxTimer *>(sipCppV);
651 
652     if (targetType == sipType_wxEvtHandler)
653         return static_cast< ::wxEvtHandler *>(sipCpp);
654 
655     if (targetType == sipType_wxObject)
656         return static_cast< ::wxObject *>(sipCpp);
657 
658     if (targetType == sipType_wxTrackable)
659         return static_cast< ::wxTrackable *>(sipCpp);
660 
661     return sipCppV;
662 }
663 
664 
665 /* Call the instance's destructor. */
666 extern "C" {static void release_wxTimer(void *, int);}
release_wxTimer(void * sipCppV,int sipState)667 static void release_wxTimer(void *sipCppV, int sipState)
668 {
669     Py_BEGIN_ALLOW_THREADS
670 
671     if (sipState & SIP_DERIVED_CLASS)
672         delete reinterpret_cast<sipwxTimer *>(sipCppV);
673     else
674         delete reinterpret_cast< ::wxTimer *>(sipCppV);
675 
676     Py_END_ALLOW_THREADS
677 }
678 
679 
680 extern "C" {static void dealloc_wxTimer(sipSimpleWrapper *);}
dealloc_wxTimer(sipSimpleWrapper * sipSelf)681 static void dealloc_wxTimer(sipSimpleWrapper *sipSelf)
682 {
683     if (sipIsDerivedClass(sipSelf))
684         reinterpret_cast<sipwxTimer *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;
685 
686     if (sipIsOwnedByPython(sipSelf))
687     {
688         release_wxTimer(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
689     }
690 }
691 
692 
693 extern "C" {static void *init_type_wxTimer(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
init_type_wxTimer(sipSimpleWrapper * sipSelf,PyObject * sipArgs,PyObject * sipKwds,PyObject ** sipUnused,PyObject **,PyObject ** sipParseErr)694 static void *init_type_wxTimer(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
695 {
696     sipwxTimer *sipCpp = SIP_NULLPTR;
697 
698     {
699         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
700         {
701 
702         if (!wxPyCheckForApp()) return NULL;
703 
704             PyErr_Clear();
705 
706             Py_BEGIN_ALLOW_THREADS
707             sipCpp = new sipwxTimer();
708             Py_END_ALLOW_THREADS
709 
710             if (PyErr_Occurred())
711             {
712                 delete sipCpp;
713                 return SIP_NULLPTR;
714             }
715 
716             sipCpp->sipPySelf = sipSelf;
717 
718             return sipCpp;
719         }
720     }
721 
722     {
723          ::wxEvtHandler* owner;
724         int id = -1;
725 
726         static const char *sipKwdList[] = {
727             sipName_owner,
728             sipName_id,
729         };
730 
731         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J8|i", sipType_wxEvtHandler, &owner, &id))
732         {
733 
734         if (!wxPyCheckForApp()) return NULL;
735 
736             PyErr_Clear();
737 
738             Py_BEGIN_ALLOW_THREADS
739             sipCpp = new sipwxTimer(owner,id);
740             Py_END_ALLOW_THREADS
741 
742             if (PyErr_Occurred())
743             {
744                 delete sipCpp;
745                 return SIP_NULLPTR;
746             }
747 
748             sipCpp->sipPySelf = sipSelf;
749 
750             return sipCpp;
751         }
752     }
753 
754     return SIP_NULLPTR;
755 }
756 
757 
758 /* Define this type's super-types. */
759 static sipEncodedTypeDef supers_wxTimer[] = {{147, 255, 1}};
760 
761 
762 static PyMethodDef methods_wxTimer[] = {
763     {SIP_MLNAME_CAST(sipName_GetId), meth_wxTimer_GetId, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTimer_GetId)},
764     {SIP_MLNAME_CAST(sipName_GetInterval), meth_wxTimer_GetInterval, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTimer_GetInterval)},
765     {SIP_MLNAME_CAST(sipName_GetOwner), meth_wxTimer_GetOwner, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTimer_GetOwner)},
766     {SIP_MLNAME_CAST(sipName_IsOneShot), meth_wxTimer_IsOneShot, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTimer_IsOneShot)},
767     {SIP_MLNAME_CAST(sipName_IsRunning), meth_wxTimer_IsRunning, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTimer_IsRunning)},
768     {SIP_MLNAME_CAST(sipName_Notify), meth_wxTimer_Notify, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTimer_Notify)},
769     {SIP_MLNAME_CAST(sipName_SetOwner), SIP_MLMETH_CAST(meth_wxTimer_SetOwner), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxTimer_SetOwner)},
770     {SIP_MLNAME_CAST(sipName_Start), SIP_MLMETH_CAST(meth_wxTimer_Start), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxTimer_Start)},
771     {SIP_MLNAME_CAST(sipName_StartOnce), SIP_MLMETH_CAST(meth_wxTimer_StartOnce), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxTimer_StartOnce)},
772     {SIP_MLNAME_CAST(sipName_Stop), meth_wxTimer_Stop, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTimer_Stop)},
773     {SIP_MLNAME_CAST(sipName_TryAfter), SIP_MLMETH_CAST(meth_wxTimer_TryAfter), METH_VARARGS|METH_KEYWORDS, SIP_NULLPTR},
774     {SIP_MLNAME_CAST(sipName_TryBefore), SIP_MLMETH_CAST(meth_wxTimer_TryBefore), METH_VARARGS|METH_KEYWORDS, SIP_NULLPTR}
775 };
776 
777 sipVariableDef variables_wxTimer[] = {
778     {PropertyVariable, sipName_Owner, &methods_wxTimer[2], &methods_wxTimer[6], SIP_NULLPTR, SIP_NULLPTR},
779     {PropertyVariable, sipName_Interval, &methods_wxTimer[1], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
780     {PropertyVariable, sipName_Id, &methods_wxTimer[0], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
781 };
782 
783 PyDoc_STRVAR(doc_wxTimer, "Timer()\n"
784 "Timer(owner, id=-1)\n"
785 "\n"
786 "The wxTimer class allows you to execute code at specified intervals.");
787 
788 
789 sipClassTypeDef sipTypeDef__core_wxTimer = {
790     {
791         -1,
792         SIP_NULLPTR,
793         SIP_NULLPTR,
794         SIP_TYPE_SCC|SIP_TYPE_CLASS,
795         sipNameNr_wxTimer,
796         {SIP_NULLPTR},
797         SIP_NULLPTR
798     },
799     {
800         sipNameNr_Timer,
801         {0, 0, 1},
802         12, methods_wxTimer,
803         0, SIP_NULLPTR,
804         3, variables_wxTimer,
805         {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
806     },
807     doc_wxTimer,
808     -1,
809     -1,
810     supers_wxTimer,
811     SIP_NULLPTR,
812     init_type_wxTimer,
813     SIP_NULLPTR,
814     SIP_NULLPTR,
815 #if PY_MAJOR_VERSION >= 3
816     SIP_NULLPTR,
817     SIP_NULLPTR,
818 #else
819     SIP_NULLPTR,
820     SIP_NULLPTR,
821     SIP_NULLPTR,
822     SIP_NULLPTR,
823 #endif
824     dealloc_wxTimer,
825     SIP_NULLPTR,
826     SIP_NULLPTR,
827     SIP_NULLPTR,
828     release_wxTimer,
829     cast_wxTimer,
830     SIP_NULLPTR,
831     SIP_NULLPTR,
832     SIP_NULLPTR,
833     SIP_NULLPTR,
834     SIP_NULLPTR,
835     SIP_NULLPTR
836 };
837