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/textctrl.h>
13
14 #include <wx/event.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 sipwxTextUrlEvent : public ::wxTextUrlEvent
22 {
23 public:
24 sipwxTextUrlEvent(int,const ::wxMouseEvent&,long,long);
25 sipwxTextUrlEvent(const ::wxTextUrlEvent&);
26 virtual ~sipwxTextUrlEvent();
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 sipwxTextUrlEvent(const sipwxTextUrlEvent &);
41 sipwxTextUrlEvent &operator = (const sipwxTextUrlEvent &);
42
43 char sipPyMethods[2];
44 };
45
sipwxTextUrlEvent(int winid,const::wxMouseEvent & evtMouse,long start,long end)46 sipwxTextUrlEvent::sipwxTextUrlEvent(int winid,const ::wxMouseEvent& evtMouse,long start,long end): ::wxTextUrlEvent(winid,evtMouse,start,end), sipPySelf(SIP_NULLPTR)
47 {
48 memset(sipPyMethods, 0, sizeof (sipPyMethods));
49 }
50
sipwxTextUrlEvent(const::wxTextUrlEvent & event)51 sipwxTextUrlEvent::sipwxTextUrlEvent(const ::wxTextUrlEvent& event): ::wxTextUrlEvent(event), sipPySelf(SIP_NULLPTR)
52 {
53 memset(sipPyMethods, 0, sizeof (sipPyMethods));
54 }
55
~sipwxTextUrlEvent()56 sipwxTextUrlEvent::~sipwxTextUrlEvent()
57 {
58 sipInstanceDestroyedEx(&sipPySelf);
59 }
60
GetEventCategory() const61 ::wxEventCategory sipwxTextUrlEvent::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 ::wxTextUrlEvent::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* sipwxTextUrlEvent::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 ::wxTextUrlEvent::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_wxTextUrlEvent_GetMouseEvent, "GetMouseEvent() -> MouseEvent");
93
94 extern "C" {static PyObject *meth_wxTextUrlEvent_GetMouseEvent(PyObject *, PyObject *);}
meth_wxTextUrlEvent_GetMouseEvent(PyObject * sipSelf,PyObject * sipArgs)95 static PyObject *meth_wxTextUrlEvent_GetMouseEvent(PyObject *sipSelf, PyObject *sipArgs)
96 {
97 PyObject *sipParseErr = SIP_NULLPTR;
98
99 {
100 const ::wxTextUrlEvent *sipCpp;
101
102 if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxTextUrlEvent, &sipCpp))
103 {
104 ::wxMouseEvent*sipRes;
105
106 PyErr_Clear();
107
108 Py_BEGIN_ALLOW_THREADS
109 sipRes = new ::wxMouseEvent(sipCpp->GetMouseEvent());
110 Py_END_ALLOW_THREADS
111
112 if (PyErr_Occurred())
113 return 0;
114
115 return sipConvertFromNewType(sipRes,sipType_wxMouseEvent,SIP_NULLPTR);
116 }
117 }
118
119 /* Raise an exception if the arguments couldn't be parsed. */
120 sipNoMethod(sipParseErr, sipName_TextUrlEvent, sipName_GetMouseEvent, SIP_NULLPTR);
121
122 return SIP_NULLPTR;
123 }
124
125
126 PyDoc_STRVAR(doc_wxTextUrlEvent_GetURLStart, "GetURLStart() -> long");
127
128 extern "C" {static PyObject *meth_wxTextUrlEvent_GetURLStart(PyObject *, PyObject *);}
meth_wxTextUrlEvent_GetURLStart(PyObject * sipSelf,PyObject * sipArgs)129 static PyObject *meth_wxTextUrlEvent_GetURLStart(PyObject *sipSelf, PyObject *sipArgs)
130 {
131 PyObject *sipParseErr = SIP_NULLPTR;
132
133 {
134 const ::wxTextUrlEvent *sipCpp;
135
136 if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxTextUrlEvent, &sipCpp))
137 {
138 long sipRes;
139
140 PyErr_Clear();
141
142 Py_BEGIN_ALLOW_THREADS
143 sipRes = sipCpp->GetURLStart();
144 Py_END_ALLOW_THREADS
145
146 if (PyErr_Occurred())
147 return 0;
148
149 return PyLong_FromLong(sipRes);
150 }
151 }
152
153 /* Raise an exception if the arguments couldn't be parsed. */
154 sipNoMethod(sipParseErr, sipName_TextUrlEvent, sipName_GetURLStart, SIP_NULLPTR);
155
156 return SIP_NULLPTR;
157 }
158
159
160 PyDoc_STRVAR(doc_wxTextUrlEvent_GetURLEnd, "GetURLEnd() -> long");
161
162 extern "C" {static PyObject *meth_wxTextUrlEvent_GetURLEnd(PyObject *, PyObject *);}
meth_wxTextUrlEvent_GetURLEnd(PyObject * sipSelf,PyObject * sipArgs)163 static PyObject *meth_wxTextUrlEvent_GetURLEnd(PyObject *sipSelf, PyObject *sipArgs)
164 {
165 PyObject *sipParseErr = SIP_NULLPTR;
166
167 {
168 const ::wxTextUrlEvent *sipCpp;
169
170 if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxTextUrlEvent, &sipCpp))
171 {
172 long sipRes;
173
174 PyErr_Clear();
175
176 Py_BEGIN_ALLOW_THREADS
177 sipRes = sipCpp->GetURLEnd();
178 Py_END_ALLOW_THREADS
179
180 if (PyErr_Occurred())
181 return 0;
182
183 return PyLong_FromLong(sipRes);
184 }
185 }
186
187 /* Raise an exception if the arguments couldn't be parsed. */
188 sipNoMethod(sipParseErr, sipName_TextUrlEvent, sipName_GetURLEnd, SIP_NULLPTR);
189
190 return SIP_NULLPTR;
191 }
192
193
194 PyDoc_STRVAR(doc_wxTextUrlEvent_Clone, "Clone() -> Event\n"
195 "\n"
196 "Returns a copy of the event.");
197
198 extern "C" {static PyObject *meth_wxTextUrlEvent_Clone(PyObject *, PyObject *);}
meth_wxTextUrlEvent_Clone(PyObject * sipSelf,PyObject * sipArgs)199 static PyObject *meth_wxTextUrlEvent_Clone(PyObject *sipSelf, PyObject *sipArgs)
200 {
201 PyObject *sipParseErr = SIP_NULLPTR;
202 bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
203
204 {
205 const ::wxTextUrlEvent *sipCpp;
206
207 if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxTextUrlEvent, &sipCpp))
208 {
209 ::wxEvent*sipRes;
210
211 PyErr_Clear();
212
213 Py_BEGIN_ALLOW_THREADS
214 sipRes = (sipSelfWasArg ? sipCpp-> ::wxTextUrlEvent::Clone() : sipCpp->Clone());
215 Py_END_ALLOW_THREADS
216
217 if (PyErr_Occurred())
218 return 0;
219
220 return sipConvertFromNewType(sipRes,sipType_wxEvent,SIP_NULLPTR);
221 }
222 }
223
224 /* Raise an exception if the arguments couldn't be parsed. */
225 sipNoMethod(sipParseErr, sipName_TextUrlEvent, sipName_Clone, SIP_NULLPTR);
226
227 return SIP_NULLPTR;
228 }
229
230
231 /* Cast a pointer to a type somewhere in its inheritance hierarchy. */
232 extern "C" {static void *cast_wxTextUrlEvent(void *, const sipTypeDef *);}
cast_wxTextUrlEvent(void * sipCppV,const sipTypeDef * targetType)233 static void *cast_wxTextUrlEvent(void *sipCppV, const sipTypeDef *targetType)
234 {
235 ::wxTextUrlEvent *sipCpp = reinterpret_cast< ::wxTextUrlEvent *>(sipCppV);
236
237 if (targetType == sipType_wxCommandEvent)
238 return static_cast< ::wxCommandEvent *>(sipCpp);
239
240 if (targetType == sipType_wxEvent)
241 return static_cast< ::wxEvent *>(sipCpp);
242
243 if (targetType == sipType_wxObject)
244 return static_cast< ::wxObject *>(sipCpp);
245
246 return sipCppV;
247 }
248
249
250 /* Call the instance's destructor. */
251 extern "C" {static void release_wxTextUrlEvent(void *, int);}
release_wxTextUrlEvent(void * sipCppV,int sipState)252 static void release_wxTextUrlEvent(void *sipCppV, int sipState)
253 {
254 Py_BEGIN_ALLOW_THREADS
255
256 if (sipState & SIP_DERIVED_CLASS)
257 delete reinterpret_cast<sipwxTextUrlEvent *>(sipCppV);
258 else
259 delete reinterpret_cast< ::wxTextUrlEvent *>(sipCppV);
260
261 Py_END_ALLOW_THREADS
262 }
263
264
265 extern "C" {static void dealloc_wxTextUrlEvent(sipSimpleWrapper *);}
dealloc_wxTextUrlEvent(sipSimpleWrapper * sipSelf)266 static void dealloc_wxTextUrlEvent(sipSimpleWrapper *sipSelf)
267 {
268 if (sipIsDerivedClass(sipSelf))
269 reinterpret_cast<sipwxTextUrlEvent *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;
270
271 if (sipIsOwnedByPython(sipSelf))
272 {
273 release_wxTextUrlEvent(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
274 }
275 }
276
277
278 extern "C" {static void *init_type_wxTextUrlEvent(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
init_type_wxTextUrlEvent(sipSimpleWrapper * sipSelf,PyObject * sipArgs,PyObject * sipKwds,PyObject ** sipUnused,PyObject **,PyObject ** sipParseErr)279 static void *init_type_wxTextUrlEvent(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
280 {
281 sipwxTextUrlEvent *sipCpp = SIP_NULLPTR;
282
283 {
284 int winid;
285 const ::wxMouseEvent* evtMouse;
286 long start;
287 long end;
288
289 static const char *sipKwdList[] = {
290 sipName_winid,
291 sipName_evtMouse,
292 sipName_start,
293 sipName_end,
294 };
295
296 if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "iJ9ll", &winid, sipType_wxMouseEvent, &evtMouse, &start, &end))
297 {
298 PyErr_Clear();
299
300 Py_BEGIN_ALLOW_THREADS
301 sipCpp = new sipwxTextUrlEvent(winid,*evtMouse,start,end);
302 Py_END_ALLOW_THREADS
303
304 if (PyErr_Occurred())
305 {
306 delete sipCpp;
307 return SIP_NULLPTR;
308 }
309
310 sipCpp->sipPySelf = sipSelf;
311
312 return sipCpp;
313 }
314 }
315
316 {
317 const ::wxTextUrlEvent* event;
318
319 static const char *sipKwdList[] = {
320 sipName_event,
321 };
322
323 if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9", sipType_wxTextUrlEvent, &event))
324 {
325 PyErr_Clear();
326
327 Py_BEGIN_ALLOW_THREADS
328 sipCpp = new sipwxTextUrlEvent(*event);
329 Py_END_ALLOW_THREADS
330
331 if (PyErr_Occurred())
332 {
333 delete sipCpp;
334 return SIP_NULLPTR;
335 }
336
337 sipCpp->sipPySelf = sipSelf;
338
339 return sipCpp;
340 }
341 }
342
343 return SIP_NULLPTR;
344 }
345
346
347 /* Define this type's super-types. */
348 static sipEncodedTypeDef supers_wxTextUrlEvent[] = {{77, 255, 1}};
349
350
351 static PyMethodDef methods_wxTextUrlEvent[] = {
352 {SIP_MLNAME_CAST(sipName_Clone), meth_wxTextUrlEvent_Clone, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTextUrlEvent_Clone)},
353 {SIP_MLNAME_CAST(sipName_GetMouseEvent), meth_wxTextUrlEvent_GetMouseEvent, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTextUrlEvent_GetMouseEvent)},
354 {SIP_MLNAME_CAST(sipName_GetURLEnd), meth_wxTextUrlEvent_GetURLEnd, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTextUrlEvent_GetURLEnd)},
355 {SIP_MLNAME_CAST(sipName_GetURLStart), meth_wxTextUrlEvent_GetURLStart, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTextUrlEvent_GetURLStart)}
356 };
357
358 sipVariableDef variables_wxTextUrlEvent[] = {
359 {PropertyVariable, sipName_URLStart, &methods_wxTextUrlEvent[3], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
360 {PropertyVariable, sipName_URLEnd, &methods_wxTextUrlEvent[2], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
361 {PropertyVariable, sipName_MouseEvent, &methods_wxTextUrlEvent[1], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
362 };
363
364 PyDoc_STRVAR(doc_wxTextUrlEvent, "TextUrlEvent(winid, evtMouse, start, end)\n"
365 "TextUrlEvent(event)");
366
367
368 sipClassTypeDef sipTypeDef__core_wxTextUrlEvent = {
369 {
370 -1,
371 SIP_NULLPTR,
372 SIP_NULLPTR,
373 SIP_TYPE_SCC|SIP_TYPE_CLASS,
374 sipNameNr_wxTextUrlEvent,
375 {SIP_NULLPTR},
376 SIP_NULLPTR
377 },
378 {
379 sipNameNr_TextUrlEvent,
380 {0, 0, 1},
381 4, methods_wxTextUrlEvent,
382 0, SIP_NULLPTR,
383 3, variables_wxTextUrlEvent,
384 {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
385 },
386 doc_wxTextUrlEvent,
387 -1,
388 -1,
389 supers_wxTextUrlEvent,
390 SIP_NULLPTR,
391 init_type_wxTextUrlEvent,
392 SIP_NULLPTR,
393 SIP_NULLPTR,
394 #if PY_MAJOR_VERSION >= 3
395 SIP_NULLPTR,
396 SIP_NULLPTR,
397 #else
398 SIP_NULLPTR,
399 SIP_NULLPTR,
400 SIP_NULLPTR,
401 SIP_NULLPTR,
402 #endif
403 dealloc_wxTextUrlEvent,
404 SIP_NULLPTR,
405 SIP_NULLPTR,
406 SIP_NULLPTR,
407 release_wxTextUrlEvent,
408 cast_wxTextUrlEvent,
409 SIP_NULLPTR,
410 SIP_NULLPTR,
411 SIP_NULLPTR,
412 SIP_NULLPTR,
413 SIP_NULLPTR,
414 SIP_NULLPTR
415 };
416