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/taskbar.h>
13 
14         #include <wx/menu.h>
15         #include <wx/icon.h>
16         #include <wx/event.h>
17         #include <wx/eventfilter.h>
18         #include <wx/event.h>
19         #include <wx/object.h>
20         #include <wx/object.h>
21         #include <wx/object.h>
_wxTaskBarIcon_ShowBalloon(wxTaskBarIcon * self,const wxString * title,const wxString * text,unsigned msec,int flags)22     bool _wxTaskBarIcon_ShowBalloon(wxTaskBarIcon* self, const wxString* title, const wxString* text, unsigned msec, int flags)
23     {
24         #ifdef __WXMSW__
25             return self->ShowBalloon(*title, *text, msec, flags);
26         #else
27             return false;
28         #endif
29     }
30 
31 
32 class sipwxTaskBarIcon : public  ::wxTaskBarIcon
33 {
34 public:
35     sipwxTaskBarIcon( ::wxTaskBarIconType);
36     virtual ~sipwxTaskBarIcon();
37 
38     /*
39      * There is a public method for every protected method visible from
40      * this class.
41      */
42     bool sipProtectVirt_TryBefore(bool, ::wxEvent&);
43     bool sipProtectVirt_TryAfter(bool, ::wxEvent&);
44      ::wxMenu* sipProtectVirt_CreatePopupMenu(bool);
45 
46     /*
47      * There is a protected method for every virtual method visible from
48      * this class.
49      */
50 protected:
51      ::wxMenu* CreatePopupMenu() SIP_OVERRIDE;
52     bool SetIcon(const  ::wxIcon&,const  ::wxString&) SIP_OVERRIDE;
53     bool RemoveIcon() SIP_OVERRIDE;
54     bool PopupMenu( ::wxMenu*) SIP_OVERRIDE;
55     bool ProcessEvent( ::wxEvent&) SIP_OVERRIDE;
56     bool TryBefore( ::wxEvent&) SIP_OVERRIDE;
57     bool TryAfter( ::wxEvent&) SIP_OVERRIDE;
58 
59 public:
60     sipSimpleWrapper *sipPySelf;
61 
62 private:
63     sipwxTaskBarIcon(const sipwxTaskBarIcon &);
64     sipwxTaskBarIcon &operator = (const sipwxTaskBarIcon &);
65 
66     char sipPyMethods[7];
67 };
68 
sipwxTaskBarIcon(::wxTaskBarIconType iconType)69 sipwxTaskBarIcon::sipwxTaskBarIcon( ::wxTaskBarIconType iconType):  ::wxTaskBarIcon(iconType), sipPySelf(SIP_NULLPTR)
70 {
71     memset(sipPyMethods, 0, sizeof (sipPyMethods));
72 }
73 
~sipwxTaskBarIcon()74 sipwxTaskBarIcon::~sipwxTaskBarIcon()
75 {
76     sipInstanceDestroyedEx(&sipPySelf);
77 }
78 
CreatePopupMenu()79  ::wxMenu* sipwxTaskBarIcon::CreatePopupMenu()
80 {
81     sip_gilstate_t sipGILState;
82     PyObject *sipMeth;
83 
84     sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[0],sipPySelf,SIP_NULLPTR,sipName_CreatePopupMenu);
85 
86     if (!sipMeth)
87         return  ::wxTaskBarIcon::CreatePopupMenu();
88 
89     extern  ::wxMenu* sipVH__adv_33(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);
90 
91     return sipVH__adv_33(sipGILState, 0, sipPySelf, sipMeth);
92 }
93 
SetIcon(const::wxIcon & icon,const::wxString & tooltip)94 bool sipwxTaskBarIcon::SetIcon(const  ::wxIcon& icon,const  ::wxString& tooltip)
95 {
96     sip_gilstate_t sipGILState;
97     PyObject *sipMeth;
98 
99     sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[1],sipPySelf,SIP_NULLPTR,sipName_SetIcon);
100 
101     if (!sipMeth)
102         return  ::wxTaskBarIcon::SetIcon(icon,tooltip);
103 
104     extern bool sipVH__adv_32(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const  ::wxIcon&,const  ::wxString&);
105 
106     return sipVH__adv_32(sipGILState, 0, sipPySelf, sipMeth, icon, tooltip);
107 }
108 
RemoveIcon()109 bool sipwxTaskBarIcon::RemoveIcon()
110 {
111     sip_gilstate_t sipGILState;
112     PyObject *sipMeth;
113 
114     sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[2],sipPySelf,SIP_NULLPTR,sipName_RemoveIcon);
115 
116     if (!sipMeth)
117         return  ::wxTaskBarIcon::RemoveIcon();
118 
119     extern bool sipVH__adv_3(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);
120 
121     return sipVH__adv_3(sipGILState, 0, sipPySelf, sipMeth);
122 }
123 
PopupMenu(::wxMenu * menu)124 bool sipwxTaskBarIcon::PopupMenu( ::wxMenu*menu)
125 {
126     sip_gilstate_t sipGILState;
127     PyObject *sipMeth;
128 
129     sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[3],sipPySelf,SIP_NULLPTR,sipName_PopupMenu);
130 
131     if (!sipMeth)
132         return  ::wxTaskBarIcon::PopupMenu(menu);
133 
134     extern bool sipVH__adv_31(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxMenu*);
135 
136     return sipVH__adv_31(sipGILState, 0, sipPySelf, sipMeth, menu);
137 }
138 
ProcessEvent(::wxEvent & event)139 bool sipwxTaskBarIcon::ProcessEvent( ::wxEvent& event)
140 {
141     sip_gilstate_t sipGILState;
142     PyObject *sipMeth;
143 
144     sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[4],sipPySelf,SIP_NULLPTR,sipName_ProcessEvent);
145 
146     if (!sipMeth)
147         return  ::wxTaskBarIcon::ProcessEvent(event);
148 
149     extern bool sipVH__adv_13(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxEvent&);
150 
151     return sipVH__adv_13(sipGILState, 0, sipPySelf, sipMeth, event);
152 }
153 
TryBefore(::wxEvent & event)154 bool sipwxTaskBarIcon::TryBefore( ::wxEvent& event)
155 {
156     sip_gilstate_t sipGILState;
157     PyObject *sipMeth;
158 
159     sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[5],sipPySelf,SIP_NULLPTR,sipName_TryBefore);
160 
161     if (!sipMeth)
162         return  ::wxTaskBarIcon::TryBefore(event);
163 
164     extern bool sipVH__adv_13(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxEvent&);
165 
166     return sipVH__adv_13(sipGILState, 0, sipPySelf, sipMeth, event);
167 }
168 
TryAfter(::wxEvent & event)169 bool sipwxTaskBarIcon::TryAfter( ::wxEvent& event)
170 {
171     sip_gilstate_t sipGILState;
172     PyObject *sipMeth;
173 
174     sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[6],sipPySelf,SIP_NULLPTR,sipName_TryAfter);
175 
176     if (!sipMeth)
177         return  ::wxTaskBarIcon::TryAfter(event);
178 
179     extern bool sipVH__adv_13(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxEvent&);
180 
181     return sipVH__adv_13(sipGILState, 0, sipPySelf, sipMeth, event);
182 }
183 
sipProtectVirt_TryBefore(bool sipSelfWasArg,::wxEvent & event)184 bool sipwxTaskBarIcon::sipProtectVirt_TryBefore(bool sipSelfWasArg, ::wxEvent& event)
185 {
186     return (sipSelfWasArg ?  ::wxEvtHandler::TryBefore(event) : TryBefore(event));
187 }
188 
sipProtectVirt_TryAfter(bool sipSelfWasArg,::wxEvent & event)189 bool sipwxTaskBarIcon::sipProtectVirt_TryAfter(bool sipSelfWasArg, ::wxEvent& event)
190 {
191     return (sipSelfWasArg ?  ::wxEvtHandler::TryAfter(event) : TryAfter(event));
192 }
193 
sipProtectVirt_CreatePopupMenu(bool sipSelfWasArg)194  ::wxMenu* sipwxTaskBarIcon::sipProtectVirt_CreatePopupMenu(bool sipSelfWasArg)
195 {
196     return (sipSelfWasArg ?  ::wxTaskBarIcon::CreatePopupMenu() : CreatePopupMenu());
197 }
198 
199 
200 PyDoc_STRVAR(doc_wxTaskBarIcon_TryBefore, "TryBefore(event) -> bool\n"
201 "\n"
202 "Method called by ProcessEvent() before examining this object event\n"
203 "tables.");
204 
205 extern "C" {static PyObject *meth_wxTaskBarIcon_TryBefore(PyObject *, PyObject *, PyObject *);}
meth_wxTaskBarIcon_TryBefore(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)206 static PyObject *meth_wxTaskBarIcon_TryBefore(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
207 {
208     PyObject *sipParseErr = SIP_NULLPTR;
209     bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
210 
211     {
212          ::wxEvent* event;
213         sipwxTaskBarIcon *sipCpp;
214 
215         static const char *sipKwdList[] = {
216             sipName_event,
217         };
218 
219         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxTaskBarIcon, &sipCpp, sipType_wxEvent, &event))
220         {
221             bool sipRes;
222 
223             PyErr_Clear();
224 
225             Py_BEGIN_ALLOW_THREADS
226             sipRes = sipCpp->sipProtectVirt_TryBefore(sipSelfWasArg,*event);
227             Py_END_ALLOW_THREADS
228 
229             if (PyErr_Occurred())
230                 return 0;
231 
232             return PyBool_FromLong(sipRes);
233         }
234     }
235 
236     /* Raise an exception if the arguments couldn't be parsed. */
237     sipNoMethod(sipParseErr, sipName_TaskBarIcon, sipName_TryBefore, SIP_NULLPTR);
238 
239     return SIP_NULLPTR;
240 }
241 
242 
243 PyDoc_STRVAR(doc_wxTaskBarIcon_TryAfter, "TryAfter(event) -> bool\n"
244 "\n"
245 "Method called by ProcessEvent() as last resort.");
246 
247 extern "C" {static PyObject *meth_wxTaskBarIcon_TryAfter(PyObject *, PyObject *, PyObject *);}
meth_wxTaskBarIcon_TryAfter(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)248 static PyObject *meth_wxTaskBarIcon_TryAfter(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
249 {
250     PyObject *sipParseErr = SIP_NULLPTR;
251     bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
252 
253     {
254          ::wxEvent* event;
255         sipwxTaskBarIcon *sipCpp;
256 
257         static const char *sipKwdList[] = {
258             sipName_event,
259         };
260 
261         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxTaskBarIcon, &sipCpp, sipType_wxEvent, &event))
262         {
263             bool sipRes;
264 
265             PyErr_Clear();
266 
267             Py_BEGIN_ALLOW_THREADS
268             sipRes = sipCpp->sipProtectVirt_TryAfter(sipSelfWasArg,*event);
269             Py_END_ALLOW_THREADS
270 
271             if (PyErr_Occurred())
272                 return 0;
273 
274             return PyBool_FromLong(sipRes);
275         }
276     }
277 
278     /* Raise an exception if the arguments couldn't be parsed. */
279     sipNoMethod(sipParseErr, sipName_TaskBarIcon, sipName_TryAfter, SIP_NULLPTR);
280 
281     return SIP_NULLPTR;
282 }
283 
284 
285 PyDoc_STRVAR(doc_wxTaskBarIcon_Destroy, "Destroy()\n"
286 "\n"
287 "This method is similar to wxWindow::Destroy and can be used to\n"
288 "schedule the task bar icon object for the delayed destruction: it will\n"
289 "be deleted during the next event loop iteration, which allows the task\n"
290 "bar icon to process any pending events for it before being destroyed.");
291 
292 extern "C" {static PyObject *meth_wxTaskBarIcon_Destroy(PyObject *, PyObject *);}
meth_wxTaskBarIcon_Destroy(PyObject * sipSelf,PyObject * sipArgs)293 static PyObject *meth_wxTaskBarIcon_Destroy(PyObject *sipSelf, PyObject *sipArgs)
294 {
295     PyObject *sipParseErr = SIP_NULLPTR;
296 
297     {
298          ::wxTaskBarIcon *sipCpp;
299 
300         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxTaskBarIcon, &sipCpp))
301         {
302             PyErr_Clear();
303 
304             Py_BEGIN_ALLOW_THREADS
305             sipCpp->Destroy();
306             Py_END_ALLOW_THREADS
307 
308             sipTransferTo(sipSelf, SIP_NULLPTR);
309 
310             if (PyErr_Occurred())
311                 return 0;
312 
313             Py_INCREF(Py_None);
314             return Py_None;
315         }
316     }
317 
318     /* Raise an exception if the arguments couldn't be parsed. */
319     sipNoMethod(sipParseErr, sipName_TaskBarIcon, sipName_Destroy, SIP_NULLPTR);
320 
321     return SIP_NULLPTR;
322 }
323 
324 
325 PyDoc_STRVAR(doc_wxTaskBarIcon_IsIconInstalled, "IsIconInstalled() -> bool\n"
326 "\n"
327 "Returns true if SetIcon() was called with no subsequent RemoveIcon().");
328 
329 extern "C" {static PyObject *meth_wxTaskBarIcon_IsIconInstalled(PyObject *, PyObject *);}
meth_wxTaskBarIcon_IsIconInstalled(PyObject * sipSelf,PyObject * sipArgs)330 static PyObject *meth_wxTaskBarIcon_IsIconInstalled(PyObject *sipSelf, PyObject *sipArgs)
331 {
332     PyObject *sipParseErr = SIP_NULLPTR;
333 
334     {
335         const  ::wxTaskBarIcon *sipCpp;
336 
337         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxTaskBarIcon, &sipCpp))
338         {
339             bool sipRes;
340 
341             PyErr_Clear();
342 
343             Py_BEGIN_ALLOW_THREADS
344             sipRes = sipCpp->IsIconInstalled();
345             Py_END_ALLOW_THREADS
346 
347             if (PyErr_Occurred())
348                 return 0;
349 
350             return PyBool_FromLong(sipRes);
351         }
352     }
353 
354     /* Raise an exception if the arguments couldn't be parsed. */
355     sipNoMethod(sipParseErr, sipName_TaskBarIcon, sipName_IsIconInstalled, SIP_NULLPTR);
356 
357     return SIP_NULLPTR;
358 }
359 
360 
361 PyDoc_STRVAR(doc_wxTaskBarIcon_IsOk, "IsOk() -> bool\n"
362 "\n"
363 "Returns true if the object initialized successfully.");
364 
365 extern "C" {static PyObject *meth_wxTaskBarIcon_IsOk(PyObject *, PyObject *);}
meth_wxTaskBarIcon_IsOk(PyObject * sipSelf,PyObject * sipArgs)366 static PyObject *meth_wxTaskBarIcon_IsOk(PyObject *sipSelf, PyObject *sipArgs)
367 {
368     PyObject *sipParseErr = SIP_NULLPTR;
369 
370     {
371         const  ::wxTaskBarIcon *sipCpp;
372 
373         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxTaskBarIcon, &sipCpp))
374         {
375             bool sipRes;
376 
377             PyErr_Clear();
378 
379             Py_BEGIN_ALLOW_THREADS
380             sipRes = sipCpp->IsOk();
381             Py_END_ALLOW_THREADS
382 
383             if (PyErr_Occurred())
384                 return 0;
385 
386             return PyBool_FromLong(sipRes);
387         }
388     }
389 
390     /* Raise an exception if the arguments couldn't be parsed. */
391     sipNoMethod(sipParseErr, sipName_TaskBarIcon, sipName_IsOk, SIP_NULLPTR);
392 
393     return SIP_NULLPTR;
394 }
395 
396 
397 PyDoc_STRVAR(doc_wxTaskBarIcon_PopupMenu, "PopupMenu(menu) -> bool\n"
398 "\n"
399 "Pops up a menu at the current mouse position.");
400 
401 extern "C" {static PyObject *meth_wxTaskBarIcon_PopupMenu(PyObject *, PyObject *, PyObject *);}
meth_wxTaskBarIcon_PopupMenu(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)402 static PyObject *meth_wxTaskBarIcon_PopupMenu(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
403 {
404     PyObject *sipParseErr = SIP_NULLPTR;
405     bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
406 
407     {
408          ::wxMenu* menu;
409          ::wxTaskBarIcon *sipCpp;
410 
411         static const char *sipKwdList[] = {
412             sipName_menu,
413         };
414 
415         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8", &sipSelf, sipType_wxTaskBarIcon, &sipCpp, sipType_wxMenu, &menu))
416         {
417             bool sipRes;
418 
419             PyErr_Clear();
420 
421             Py_BEGIN_ALLOW_THREADS
422             sipRes = (sipSelfWasArg ? sipCpp-> ::wxTaskBarIcon::PopupMenu(menu) : sipCpp->PopupMenu(menu));
423             Py_END_ALLOW_THREADS
424 
425             if (PyErr_Occurred())
426                 return 0;
427 
428             return PyBool_FromLong(sipRes);
429         }
430     }
431 
432     /* Raise an exception if the arguments couldn't be parsed. */
433     sipNoMethod(sipParseErr, sipName_TaskBarIcon, sipName_PopupMenu, SIP_NULLPTR);
434 
435     return SIP_NULLPTR;
436 }
437 
438 
439 PyDoc_STRVAR(doc_wxTaskBarIcon_RemoveIcon, "RemoveIcon() -> bool\n"
440 "\n"
441 "Removes the icon previously set with SetIcon().");
442 
443 extern "C" {static PyObject *meth_wxTaskBarIcon_RemoveIcon(PyObject *, PyObject *);}
meth_wxTaskBarIcon_RemoveIcon(PyObject * sipSelf,PyObject * sipArgs)444 static PyObject *meth_wxTaskBarIcon_RemoveIcon(PyObject *sipSelf, PyObject *sipArgs)
445 {
446     PyObject *sipParseErr = SIP_NULLPTR;
447     bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
448 
449     {
450          ::wxTaskBarIcon *sipCpp;
451 
452         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxTaskBarIcon, &sipCpp))
453         {
454             bool sipRes;
455 
456             PyErr_Clear();
457 
458             Py_BEGIN_ALLOW_THREADS
459             sipRes = (sipSelfWasArg ? sipCpp-> ::wxTaskBarIcon::RemoveIcon() : sipCpp->RemoveIcon());
460             Py_END_ALLOW_THREADS
461 
462             if (PyErr_Occurred())
463                 return 0;
464 
465             return PyBool_FromLong(sipRes);
466         }
467     }
468 
469     /* Raise an exception if the arguments couldn't be parsed. */
470     sipNoMethod(sipParseErr, sipName_TaskBarIcon, sipName_RemoveIcon, SIP_NULLPTR);
471 
472     return SIP_NULLPTR;
473 }
474 
475 
476 PyDoc_STRVAR(doc_wxTaskBarIcon_SetIcon, "SetIcon(icon, tooltip=wx.EmptyString) -> bool\n"
477 "\n"
478 "Sets the icon, and optional tooltip text.");
479 
480 extern "C" {static PyObject *meth_wxTaskBarIcon_SetIcon(PyObject *, PyObject *, PyObject *);}
meth_wxTaskBarIcon_SetIcon(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)481 static PyObject *meth_wxTaskBarIcon_SetIcon(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
482 {
483     PyObject *sipParseErr = SIP_NULLPTR;
484     bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
485 
486     {
487         const  ::wxIcon* icon;
488         const  ::wxString& tooltipdef = wxEmptyString;
489         const  ::wxString* tooltip = &tooltipdef;
490         int tooltipState = 0;
491          ::wxTaskBarIcon *sipCpp;
492 
493         static const char *sipKwdList[] = {
494             sipName_icon,
495             sipName_tooltip,
496         };
497 
498         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9|J1", &sipSelf, sipType_wxTaskBarIcon, &sipCpp, sipType_wxIcon, &icon, sipType_wxString,&tooltip, &tooltipState))
499         {
500             bool sipRes;
501 
502             PyErr_Clear();
503 
504             Py_BEGIN_ALLOW_THREADS
505             sipRes = (sipSelfWasArg ? sipCpp-> ::wxTaskBarIcon::SetIcon(*icon,*tooltip) : sipCpp->SetIcon(*icon,*tooltip));
506             Py_END_ALLOW_THREADS
507             sipReleaseType(const_cast< ::wxString *>(tooltip),sipType_wxString,tooltipState);
508 
509             if (PyErr_Occurred())
510                 return 0;
511 
512             return PyBool_FromLong(sipRes);
513         }
514     }
515 
516     /* Raise an exception if the arguments couldn't be parsed. */
517     sipNoMethod(sipParseErr, sipName_TaskBarIcon, sipName_SetIcon, SIP_NULLPTR);
518 
519     return SIP_NULLPTR;
520 }
521 
522 
523 PyDoc_STRVAR(doc_wxTaskBarIcon_IsAvailable, "IsAvailable() -> bool\n"
524 "\n"
525 "Returns true if system tray is available in the desktop environment\n"
526 "the app runs under.");
527 
528 extern "C" {static PyObject *meth_wxTaskBarIcon_IsAvailable(PyObject *, PyObject *);}
meth_wxTaskBarIcon_IsAvailable(PyObject *,PyObject * sipArgs)529 static PyObject *meth_wxTaskBarIcon_IsAvailable(PyObject *, PyObject *sipArgs)
530 {
531     PyObject *sipParseErr = SIP_NULLPTR;
532 
533     {
534         if (sipParseArgs(&sipParseErr, sipArgs, ""))
535         {
536             bool sipRes;
537 
538             PyErr_Clear();
539 
540             Py_BEGIN_ALLOW_THREADS
541             sipRes =  ::wxTaskBarIcon::IsAvailable();
542             Py_END_ALLOW_THREADS
543 
544             if (PyErr_Occurred())
545                 return 0;
546 
547             return PyBool_FromLong(sipRes);
548         }
549     }
550 
551     /* Raise an exception if the arguments couldn't be parsed. */
552     sipNoMethod(sipParseErr, sipName_TaskBarIcon, sipName_IsAvailable, SIP_NULLPTR);
553 
554     return SIP_NULLPTR;
555 }
556 
557 
558 PyDoc_STRVAR(doc_wxTaskBarIcon_ShowBalloon, "ShowBalloon(title, text, msec=0, flags=0) -> bool\n"
559 "\n"
560 "Show a balloon notification (the icon must have been already\n"
561 "initialized using SetIcon).  Only implemented for Windows.\n"
562 "\n"
563 "The ``title`` and ``text`` parameters are limited to 63 and 255\n"
564 "characters respectively, ``msec`` is the timeout, in milliseconds,\n"
565 "before the balloon disappears (will be clamped down to the allowed\n"
566 "10-30s range by Windows if it's outside it) and ``flags`` can\n"
567 "include wxICON_ERROR/INFO/WARNING to show a corresponding icon.\n"
568 "\n"
569 "Returns ``True`` if balloon was shown, ``False`` on error (incorrect\n"
570 "parameters or function unsupported by OS).");
571 
572 extern "C" {static PyObject *meth_wxTaskBarIcon_ShowBalloon(PyObject *, PyObject *, PyObject *);}
meth_wxTaskBarIcon_ShowBalloon(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)573 static PyObject *meth_wxTaskBarIcon_ShowBalloon(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
574 {
575     PyObject *sipParseErr = SIP_NULLPTR;
576 
577     {
578         const  ::wxString* title;
579         int titleState = 0;
580         const  ::wxString* text;
581         int textState = 0;
582         uint msec = 0;
583         int flags = 0;
584          ::wxTaskBarIcon *sipCpp;
585 
586         static const char *sipKwdList[] = {
587             sipName_title,
588             sipName_text,
589             sipName_msec,
590             sipName_flags,
591         };
592 
593         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1J1|ui", &sipSelf, sipType_wxTaskBarIcon, &sipCpp, sipType_wxString,&title, &titleState, sipType_wxString,&text, &textState, &msec, &flags))
594         {
595             bool sipRes = 0;
596             int sipIsErr = 0;
597 
598         PyErr_Clear();
599         Py_BEGIN_ALLOW_THREADS
600         sipRes = _wxTaskBarIcon_ShowBalloon(sipCpp, title, text, msec, flags);
601         Py_END_ALLOW_THREADS
602         if (PyErr_Occurred()) sipIsErr = 1;
603             sipReleaseType(const_cast< ::wxString *>(title),sipType_wxString,titleState);
604             sipReleaseType(const_cast< ::wxString *>(text),sipType_wxString,textState);
605 
606             if (sipIsErr)
607                 return 0;
608 
609             return PyBool_FromLong(sipRes);
610         }
611     }
612 
613     /* Raise an exception if the arguments couldn't be parsed. */
614     sipNoMethod(sipParseErr, sipName_TaskBarIcon, sipName_ShowBalloon, SIP_NULLPTR);
615 
616     return SIP_NULLPTR;
617 }
618 
619 
620 PyDoc_STRVAR(doc_wxTaskBarIcon_CreatePopupMenu, "CreatePopupMenu() -> wx.Menu\n"
621 "\n"
622 "This method is called by the library when the user requests popup menu\n"
623 "(on Windows and Unix platforms, this is when the user right-clicks the\n"
624 "icon).");
625 
626 extern "C" {static PyObject *meth_wxTaskBarIcon_CreatePopupMenu(PyObject *, PyObject *);}
meth_wxTaskBarIcon_CreatePopupMenu(PyObject * sipSelf,PyObject * sipArgs)627 static PyObject *meth_wxTaskBarIcon_CreatePopupMenu(PyObject *sipSelf, PyObject *sipArgs)
628 {
629     PyObject *sipParseErr = SIP_NULLPTR;
630     bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
631 
632     {
633         sipwxTaskBarIcon *sipCpp;
634 
635         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxTaskBarIcon, &sipCpp))
636         {
637              ::wxMenu*sipRes;
638 
639             PyErr_Clear();
640 
641             Py_BEGIN_ALLOW_THREADS
642             sipRes = sipCpp->sipProtectVirt_CreatePopupMenu(sipSelfWasArg);
643             Py_END_ALLOW_THREADS
644 
645             if (PyErr_Occurred())
646                 return 0;
647 
648             return sipConvertFromType(sipRes,sipType_wxMenu,sipSelf);
649         }
650     }
651 
652     /* Raise an exception if the arguments couldn't be parsed. */
653     sipNoMethod(sipParseErr, sipName_TaskBarIcon, sipName_CreatePopupMenu, SIP_NULLPTR);
654 
655     return SIP_NULLPTR;
656 }
657 
658 
659 /* Cast a pointer to a type somewhere in its inheritance hierarchy. */
660 extern "C" {static void *cast_wxTaskBarIcon(void *, const sipTypeDef *);}
cast_wxTaskBarIcon(void * sipCppV,const sipTypeDef * targetType)661 static void *cast_wxTaskBarIcon(void *sipCppV, const sipTypeDef *targetType)
662 {
663      ::wxTaskBarIcon *sipCpp = reinterpret_cast< ::wxTaskBarIcon *>(sipCppV);
664 
665     if (targetType == sipType_wxEvtHandler)
666         return static_cast< ::wxEvtHandler *>(sipCpp);
667 
668     if (targetType == sipType_wxObject)
669         return static_cast< ::wxObject *>(sipCpp);
670 
671     if (targetType == sipType_wxTrackable)
672         return static_cast< ::wxTrackable *>(sipCpp);
673 
674     return sipCppV;
675 }
676 
677 
678 /* Call the instance's destructor. */
679 extern "C" {static void release_wxTaskBarIcon(void *, int);}
release_wxTaskBarIcon(void * sipCppV,int sipState)680 static void release_wxTaskBarIcon(void *sipCppV, int sipState)
681 {
682     Py_BEGIN_ALLOW_THREADS
683 
684     if (sipState & SIP_DERIVED_CLASS)
685         delete reinterpret_cast<sipwxTaskBarIcon *>(sipCppV);
686     else
687         delete reinterpret_cast< ::wxTaskBarIcon *>(sipCppV);
688 
689     Py_END_ALLOW_THREADS
690 }
691 
692 
693 extern "C" {static void dealloc_wxTaskBarIcon(sipSimpleWrapper *);}
dealloc_wxTaskBarIcon(sipSimpleWrapper * sipSelf)694 static void dealloc_wxTaskBarIcon(sipSimpleWrapper *sipSelf)
695 {
696     if (sipIsDerivedClass(sipSelf))
697         reinterpret_cast<sipwxTaskBarIcon *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;
698 
699     if (sipIsOwnedByPython(sipSelf))
700     {
701         release_wxTaskBarIcon(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
702     }
703 }
704 
705 
706 extern "C" {static void *init_type_wxTaskBarIcon(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
init_type_wxTaskBarIcon(sipSimpleWrapper * sipSelf,PyObject * sipArgs,PyObject * sipKwds,PyObject ** sipUnused,PyObject **,PyObject ** sipParseErr)707 static void *init_type_wxTaskBarIcon(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
708 {
709     sipwxTaskBarIcon *sipCpp = SIP_NULLPTR;
710 
711     {
712          ::wxTaskBarIconType iconType = wxTBI_DEFAULT_TYPE;
713 
714         static const char *sipKwdList[] = {
715             sipName_iconType,
716         };
717 
718         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|E", sipType_wxTaskBarIconType, &iconType))
719         {
720 
721         if (!wxPyCheckForApp()) return NULL;
722 
723             PyErr_Clear();
724 
725             Py_BEGIN_ALLOW_THREADS
726             sipCpp = new sipwxTaskBarIcon(iconType);
727             Py_END_ALLOW_THREADS
728 
729             if (PyErr_Occurred())
730             {
731                 delete sipCpp;
732                 return SIP_NULLPTR;
733             }
734 
735             sipCpp->sipPySelf = sipSelf;
736 
737             return sipCpp;
738         }
739     }
740 
741     return SIP_NULLPTR;
742 }
743 
744 
745 /* Define this type's super-types. */
746 static sipEncodedTypeDef supers_wxTaskBarIcon[] = {{21, 0, 1}};
747 
748 
749 static PyMethodDef methods_wxTaskBarIcon[] = {
750     {SIP_MLNAME_CAST(sipName_CreatePopupMenu), meth_wxTaskBarIcon_CreatePopupMenu, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTaskBarIcon_CreatePopupMenu)},
751     {SIP_MLNAME_CAST(sipName_Destroy), meth_wxTaskBarIcon_Destroy, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTaskBarIcon_Destroy)},
752     {SIP_MLNAME_CAST(sipName_IsAvailable), meth_wxTaskBarIcon_IsAvailable, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTaskBarIcon_IsAvailable)},
753     {SIP_MLNAME_CAST(sipName_IsIconInstalled), meth_wxTaskBarIcon_IsIconInstalled, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTaskBarIcon_IsIconInstalled)},
754     {SIP_MLNAME_CAST(sipName_IsOk), meth_wxTaskBarIcon_IsOk, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTaskBarIcon_IsOk)},
755     {SIP_MLNAME_CAST(sipName_PopupMenu), SIP_MLMETH_CAST(meth_wxTaskBarIcon_PopupMenu), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxTaskBarIcon_PopupMenu)},
756     {SIP_MLNAME_CAST(sipName_RemoveIcon), meth_wxTaskBarIcon_RemoveIcon, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTaskBarIcon_RemoveIcon)},
757     {SIP_MLNAME_CAST(sipName_SetIcon), SIP_MLMETH_CAST(meth_wxTaskBarIcon_SetIcon), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxTaskBarIcon_SetIcon)},
758     {SIP_MLNAME_CAST(sipName_ShowBalloon), SIP_MLMETH_CAST(meth_wxTaskBarIcon_ShowBalloon), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxTaskBarIcon_ShowBalloon)},
759     {SIP_MLNAME_CAST(sipName_TryAfter), SIP_MLMETH_CAST(meth_wxTaskBarIcon_TryAfter), METH_VARARGS|METH_KEYWORDS, SIP_NULLPTR},
760     {SIP_MLNAME_CAST(sipName_TryBefore), SIP_MLMETH_CAST(meth_wxTaskBarIcon_TryBefore), METH_VARARGS|METH_KEYWORDS, SIP_NULLPTR}
761 };
762 
763 PyDoc_STRVAR(doc_wxTaskBarIcon, "TaskBarIcon(iconType=TBI_DEFAULT_TYPE)\n"
764 "\n"
765 "This class represents a taskbar icon.");
766 
767 
768 sipClassTypeDef sipTypeDef__adv_wxTaskBarIcon = {
769     {
770         -1,
771         SIP_NULLPTR,
772         SIP_NULLPTR,
773         SIP_TYPE_SCC|SIP_TYPE_CLASS,
774         sipNameNr_wxTaskBarIcon,
775         {SIP_NULLPTR},
776         SIP_NULLPTR
777     },
778     {
779         sipNameNr_TaskBarIcon,
780         {0, 0, 1},
781         11, methods_wxTaskBarIcon,
782         0, SIP_NULLPTR,
783         0, SIP_NULLPTR,
784         {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
785     },
786     doc_wxTaskBarIcon,
787     -1,
788     -1,
789     supers_wxTaskBarIcon,
790     SIP_NULLPTR,
791     init_type_wxTaskBarIcon,
792     SIP_NULLPTR,
793     SIP_NULLPTR,
794 #if PY_MAJOR_VERSION >= 3
795     SIP_NULLPTR,
796     SIP_NULLPTR,
797 #else
798     SIP_NULLPTR,
799     SIP_NULLPTR,
800     SIP_NULLPTR,
801     SIP_NULLPTR,
802 #endif
803     dealloc_wxTaskBarIcon,
804     SIP_NULLPTR,
805     SIP_NULLPTR,
806     SIP_NULLPTR,
807     release_wxTaskBarIcon,
808     cast_wxTaskBarIcon,
809     SIP_NULLPTR,
810     SIP_NULLPTR,
811     SIP_NULLPTR,
812     SIP_NULLPTR,
813     SIP_NULLPTR,
814     SIP_NULLPTR
815 };
816