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 sipwxMouseCaptureLostEvent : public  ::wxMouseCaptureLostEvent
21 {
22 public:
23     sipwxMouseCaptureLostEvent( ::wxWindowID);
24     sipwxMouseCaptureLostEvent(const  ::wxMouseCaptureLostEvent&);
25     virtual ~sipwxMouseCaptureLostEvent();
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     sipwxMouseCaptureLostEvent(const sipwxMouseCaptureLostEvent &);
40     sipwxMouseCaptureLostEvent &operator = (const sipwxMouseCaptureLostEvent &);
41 
42     char sipPyMethods[2];
43 };
44 
sipwxMouseCaptureLostEvent(::wxWindowID windowId)45 sipwxMouseCaptureLostEvent::sipwxMouseCaptureLostEvent( ::wxWindowID windowId):  ::wxMouseCaptureLostEvent(windowId), sipPySelf(SIP_NULLPTR)
46 {
47     memset(sipPyMethods, 0, sizeof (sipPyMethods));
48 }
49 
sipwxMouseCaptureLostEvent(const::wxMouseCaptureLostEvent & a0)50 sipwxMouseCaptureLostEvent::sipwxMouseCaptureLostEvent(const  ::wxMouseCaptureLostEvent& a0):  ::wxMouseCaptureLostEvent(a0), sipPySelf(SIP_NULLPTR)
51 {
52     memset(sipPyMethods, 0, sizeof (sipPyMethods));
53 }
54 
~sipwxMouseCaptureLostEvent()55 sipwxMouseCaptureLostEvent::~sipwxMouseCaptureLostEvent()
56 {
57     sipInstanceDestroyedEx(&sipPySelf);
58 }
59 
Clone() const60  ::wxEvent* sipwxMouseCaptureLostEvent::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  ::wxMouseCaptureLostEvent::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 sipwxMouseCaptureLostEvent::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  ::wxMouseCaptureLostEvent::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_wxMouseCaptureLostEvent_Clone, "Clone(self) -> Event");
92 
93 extern "C" {static PyObject *meth_wxMouseCaptureLostEvent_Clone(PyObject *, PyObject *);}
meth_wxMouseCaptureLostEvent_Clone(PyObject * sipSelf,PyObject * sipArgs)94 static PyObject *meth_wxMouseCaptureLostEvent_Clone(PyObject *sipSelf, PyObject *sipArgs)
95 {
96     PyObject *sipParseErr = SIP_NULLPTR;
97     bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
98 
99     {
100         const  ::wxMouseCaptureLostEvent *sipCpp;
101 
102         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxMouseCaptureLostEvent, &sipCpp))
103         {
104              ::wxEvent*sipRes;
105 
106             PyErr_Clear();
107 
108             Py_BEGIN_ALLOW_THREADS
109             sipRes = (sipSelfWasArg ? sipCpp-> ::wxMouseCaptureLostEvent::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_MouseCaptureLostEvent, sipName_Clone, doc_wxMouseCaptureLostEvent_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_wxMouseCaptureLostEvent(void *, const sipTypeDef *);}
cast_wxMouseCaptureLostEvent(void * sipCppV,const sipTypeDef * targetType)128 static void *cast_wxMouseCaptureLostEvent(void *sipCppV, const sipTypeDef *targetType)
129 {
130      ::wxMouseCaptureLostEvent *sipCpp = reinterpret_cast< ::wxMouseCaptureLostEvent *>(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_wxMouseCaptureLostEvent(void *, int);}
release_wxMouseCaptureLostEvent(void * sipCppV,int sipState)144 static void release_wxMouseCaptureLostEvent(void *sipCppV, int sipState)
145 {
146     Py_BEGIN_ALLOW_THREADS
147 
148     if (sipState & SIP_DERIVED_CLASS)
149         delete reinterpret_cast<sipwxMouseCaptureLostEvent *>(sipCppV);
150     else
151         delete reinterpret_cast< ::wxMouseCaptureLostEvent *>(sipCppV);
152 
153     Py_END_ALLOW_THREADS
154 }
155 
156 
157 extern "C" {static void dealloc_wxMouseCaptureLostEvent(sipSimpleWrapper *);}
dealloc_wxMouseCaptureLostEvent(sipSimpleWrapper * sipSelf)158 static void dealloc_wxMouseCaptureLostEvent(sipSimpleWrapper *sipSelf)
159 {
160     if (sipIsDerivedClass(sipSelf))
161         reinterpret_cast<sipwxMouseCaptureLostEvent *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;
162 
163     if (sipIsOwnedByPython(sipSelf))
164     {
165         release_wxMouseCaptureLostEvent(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
166     }
167 }
168 
169 
170 extern "C" {static void *init_type_wxMouseCaptureLostEvent(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
init_type_wxMouseCaptureLostEvent(sipSimpleWrapper * sipSelf,PyObject * sipArgs,PyObject * sipKwds,PyObject ** sipUnused,PyObject **,PyObject ** sipParseErr)171 static void *init_type_wxMouseCaptureLostEvent(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
172 {
173     sipwxMouseCaptureLostEvent *sipCpp = SIP_NULLPTR;
174 
175     {
176          ::wxWindowID windowId = 0;
177 
178         static const char *sipKwdList[] = {
179             sipName_windowId,
180         };
181 
182         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|i", &windowId))
183         {
184             PyErr_Clear();
185 
186             Py_BEGIN_ALLOW_THREADS
187             sipCpp = new sipwxMouseCaptureLostEvent(windowId);
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  ::wxMouseCaptureLostEvent* a0;
204 
205         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_wxMouseCaptureLostEvent, &a0))
206         {
207             Py_BEGIN_ALLOW_THREADS
208             sipCpp = new sipwxMouseCaptureLostEvent(*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_wxMouseCaptureLostEvent[] = {{140, 255, 1}};
223 
224 
225 static PyMethodDef methods_wxMouseCaptureLostEvent[] = {
226     {SIP_MLNAME_CAST(sipName_Clone), meth_wxMouseCaptureLostEvent_Clone, METH_VARARGS, SIP_MLDOC_CAST(doc_wxMouseCaptureLostEvent_Clone)}
227 };
228 
229 PyDoc_STRVAR(doc_wxMouseCaptureLostEvent, "MouseCaptureLostEvent(windowId=0)\n"
230 "\n"
231 "A mouse capture lost event is sent to a window that had obtained mouse\n"
232 "capture, which was subsequently lost due to an \"external\" event (for\n"
233 "example, when a dialog box is shown or if another application captures\n"
234 "the mouse).");
235 
236 
237 sipClassTypeDef sipTypeDef__core_wxMouseCaptureLostEvent = {
238     {
239         -1,
240         SIP_NULLPTR,
241         SIP_NULLPTR,
242         SIP_TYPE_SCC|SIP_TYPE_CLASS,
243         sipNameNr_wxMouseCaptureLostEvent,
244         {SIP_NULLPTR},
245         SIP_NULLPTR
246     },
247     {
248         sipNameNr_MouseCaptureLostEvent,
249         {0, 0, 1},
250         1, methods_wxMouseCaptureLostEvent,
251         0, SIP_NULLPTR,
252         0, SIP_NULLPTR,
253         {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
254     },
255     doc_wxMouseCaptureLostEvent,
256     -1,
257     -1,
258     supers_wxMouseCaptureLostEvent,
259     SIP_NULLPTR,
260     init_type_wxMouseCaptureLostEvent,
261     SIP_NULLPTR,
262     SIP_NULLPTR,
263 #if PY_MAJOR_VERSION >= 3
264     SIP_NULLPTR,
265     SIP_NULLPTR,
266 #else
267     SIP_NULLPTR,
268     SIP_NULLPTR,
269     SIP_NULLPTR,
270     SIP_NULLPTR,
271 #endif
272     dealloc_wxMouseCaptureLostEvent,
273     SIP_NULLPTR,
274     SIP_NULLPTR,
275     SIP_NULLPTR,
276     release_wxMouseCaptureLostEvent,
277     cast_wxMouseCaptureLostEvent,
278     SIP_NULLPTR,
279     SIP_NULLPTR,
280     SIP_NULLPTR,
281     SIP_NULLPTR,
282     SIP_NULLPTR,
283     SIP_NULLPTR
284 };
285