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/log.h>
13
14 #include <wx/log.h>
15 #include <wx/log.h>
16 #include <wx/log.h>
17
18
19 class sipwxLogGui : public ::wxLogGui
20 {
21 public:
22 sipwxLogGui();
23 virtual ~sipwxLogGui();
24
25 /*
26 * There is a public method for every protected method visible from
27 * this class.
28 */
29 void sipProtectVirt_DoLogRecord(bool, ::wxLogLevel,const ::wxString&,const ::wxLogRecordInfo&);
30 void sipProtectVirt_DoLogTextAtLevel(bool, ::wxLogLevel,const ::wxString&);
31 void sipProtectVirt_DoLogText(bool,const ::wxString&);
32
33 /*
34 * There is a protected method for every virtual method visible from
35 * this class.
36 */
37 protected:
38 void Flush() SIP_OVERRIDE;
39 void DoLogRecord( ::wxLogLevel,const ::wxString&,const ::wxLogRecordInfo&) SIP_OVERRIDE;
40 void DoLogTextAtLevel( ::wxLogLevel,const ::wxString&) SIP_OVERRIDE;
41 void DoLogText(const ::wxString&) SIP_OVERRIDE;
42
43 public:
44 sipSimpleWrapper *sipPySelf;
45
46 private:
47 sipwxLogGui(const sipwxLogGui &);
48 sipwxLogGui &operator = (const sipwxLogGui &);
49
50 char sipPyMethods[4];
51 };
52
sipwxLogGui()53 sipwxLogGui::sipwxLogGui(): ::wxLogGui(), sipPySelf(SIP_NULLPTR)
54 {
55 memset(sipPyMethods, 0, sizeof (sipPyMethods));
56 }
57
~sipwxLogGui()58 sipwxLogGui::~sipwxLogGui()
59 {
60 sipInstanceDestroyedEx(&sipPySelf);
61 }
62
Flush()63 void sipwxLogGui::Flush()
64 {
65 sip_gilstate_t sipGILState;
66 PyObject *sipMeth;
67
68 sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[0],sipPySelf,SIP_NULLPTR,sipName_Flush);
69
70 if (!sipMeth)
71 {
72 ::wxLogGui::Flush();
73 return;
74 }
75
76 extern void sipVH__core_45(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);
77
78 sipVH__core_45(sipGILState, 0, sipPySelf, sipMeth);
79 }
80
DoLogRecord(::wxLogLevel level,const::wxString & msg,const::wxLogRecordInfo & info)81 void sipwxLogGui::DoLogRecord( ::wxLogLevel level,const ::wxString& msg,const ::wxLogRecordInfo& info)
82 {
83 sip_gilstate_t sipGILState;
84 PyObject *sipMeth;
85
86 sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[1],sipPySelf,SIP_NULLPTR,sipName_DoLogRecord);
87
88 if (!sipMeth)
89 {
90 ::wxLogGui::DoLogRecord(level,msg,info);
91 return;
92 }
93
94 extern void sipVH__core_46(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxLogLevel,const ::wxString&,const ::wxLogRecordInfo&);
95
96 sipVH__core_46(sipGILState, 0, sipPySelf, sipMeth, level, msg, info);
97 }
98
DoLogTextAtLevel(::wxLogLevel level,const::wxString & msg)99 void sipwxLogGui::DoLogTextAtLevel( ::wxLogLevel level,const ::wxString& msg)
100 {
101 sip_gilstate_t sipGILState;
102 PyObject *sipMeth;
103
104 sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[2],sipPySelf,SIP_NULLPTR,sipName_DoLogTextAtLevel);
105
106 if (!sipMeth)
107 {
108 ::wxLogGui::DoLogTextAtLevel(level,msg);
109 return;
110 }
111
112 extern void sipVH__core_47(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxLogLevel,const ::wxString&);
113
114 sipVH__core_47(sipGILState, 0, sipPySelf, sipMeth, level, msg);
115 }
116
DoLogText(const::wxString & msg)117 void sipwxLogGui::DoLogText(const ::wxString& msg)
118 {
119 sip_gilstate_t sipGILState;
120 PyObject *sipMeth;
121
122 sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[3],sipPySelf,SIP_NULLPTR,sipName_DoLogText);
123
124 if (!sipMeth)
125 {
126 ::wxLogGui::DoLogText(msg);
127 return;
128 }
129
130 extern void sipVH__core_48(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const ::wxString&);
131
132 sipVH__core_48(sipGILState, 0, sipPySelf, sipMeth, msg);
133 }
134
sipProtectVirt_DoLogRecord(bool sipSelfWasArg,::wxLogLevel level,const::wxString & msg,const::wxLogRecordInfo & info)135 void sipwxLogGui::sipProtectVirt_DoLogRecord(bool sipSelfWasArg, ::wxLogLevel level,const ::wxString& msg,const ::wxLogRecordInfo& info)
136 {
137 (sipSelfWasArg ? ::wxLog::DoLogRecord(level,msg,info) : DoLogRecord(level,msg,info));
138 }
139
sipProtectVirt_DoLogTextAtLevel(bool sipSelfWasArg,::wxLogLevel level,const::wxString & msg)140 void sipwxLogGui::sipProtectVirt_DoLogTextAtLevel(bool sipSelfWasArg, ::wxLogLevel level,const ::wxString& msg)
141 {
142 (sipSelfWasArg ? ::wxLog::DoLogTextAtLevel(level,msg) : DoLogTextAtLevel(level,msg));
143 }
144
sipProtectVirt_DoLogText(bool sipSelfWasArg,const::wxString & msg)145 void sipwxLogGui::sipProtectVirt_DoLogText(bool sipSelfWasArg,const ::wxString& msg)
146 {
147 (sipSelfWasArg ? ::wxLog::DoLogText(msg) : DoLogText(msg));
148 }
149
150
151 PyDoc_STRVAR(doc_wxLogGui_DoLogRecord, "DoLogRecord(level, msg, info)\n"
152 "\n"
153 "Called to log a new record.");
154
155 extern "C" {static PyObject *meth_wxLogGui_DoLogRecord(PyObject *, PyObject *, PyObject *);}
meth_wxLogGui_DoLogRecord(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)156 static PyObject *meth_wxLogGui_DoLogRecord(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
157 {
158 PyObject *sipParseErr = SIP_NULLPTR;
159 bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
160
161 {
162 ::wxLogLevel level;
163 const ::wxString* msg;
164 int msgState = 0;
165 const ::wxLogRecordInfo* info;
166 sipwxLogGui *sipCpp;
167
168 static const char *sipKwdList[] = {
169 sipName_level,
170 sipName_msg,
171 sipName_info,
172 };
173
174 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BmJ1J9", &sipSelf, sipType_wxLogGui, &sipCpp, &level, sipType_wxString,&msg, &msgState, sipType_wxLogRecordInfo, &info))
175 {
176 PyErr_Clear();
177
178 Py_BEGIN_ALLOW_THREADS
179 sipCpp->sipProtectVirt_DoLogRecord(sipSelfWasArg,level,*msg,*info);
180 Py_END_ALLOW_THREADS
181 sipReleaseType(const_cast< ::wxString *>(msg),sipType_wxString,msgState);
182
183 if (PyErr_Occurred())
184 return 0;
185
186 Py_INCREF(Py_None);
187 return Py_None;
188 }
189 }
190
191 /* Raise an exception if the arguments couldn't be parsed. */
192 sipNoMethod(sipParseErr, sipName_LogGui, sipName_DoLogRecord, SIP_NULLPTR);
193
194 return SIP_NULLPTR;
195 }
196
197
198 PyDoc_STRVAR(doc_wxLogGui_DoLogTextAtLevel, "DoLogTextAtLevel(level, msg)\n"
199 "\n"
200 "Called to log the specified string at given level.");
201
202 extern "C" {static PyObject *meth_wxLogGui_DoLogTextAtLevel(PyObject *, PyObject *, PyObject *);}
meth_wxLogGui_DoLogTextAtLevel(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)203 static PyObject *meth_wxLogGui_DoLogTextAtLevel(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
204 {
205 PyObject *sipParseErr = SIP_NULLPTR;
206 bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
207
208 {
209 ::wxLogLevel level;
210 const ::wxString* msg;
211 int msgState = 0;
212 sipwxLogGui *sipCpp;
213
214 static const char *sipKwdList[] = {
215 sipName_level,
216 sipName_msg,
217 };
218
219 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BmJ1", &sipSelf, sipType_wxLogGui, &sipCpp, &level, sipType_wxString,&msg, &msgState))
220 {
221 PyErr_Clear();
222
223 Py_BEGIN_ALLOW_THREADS
224 sipCpp->sipProtectVirt_DoLogTextAtLevel(sipSelfWasArg,level,*msg);
225 Py_END_ALLOW_THREADS
226 sipReleaseType(const_cast< ::wxString *>(msg),sipType_wxString,msgState);
227
228 if (PyErr_Occurred())
229 return 0;
230
231 Py_INCREF(Py_None);
232 return Py_None;
233 }
234 }
235
236 /* Raise an exception if the arguments couldn't be parsed. */
237 sipNoMethod(sipParseErr, sipName_LogGui, sipName_DoLogTextAtLevel, SIP_NULLPTR);
238
239 return SIP_NULLPTR;
240 }
241
242
243 PyDoc_STRVAR(doc_wxLogGui_DoLogText, "DoLogText(msg)\n"
244 "\n"
245 "Called to log the specified string.");
246
247 extern "C" {static PyObject *meth_wxLogGui_DoLogText(PyObject *, PyObject *, PyObject *);}
meth_wxLogGui_DoLogText(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)248 static PyObject *meth_wxLogGui_DoLogText(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
249 {
250 PyObject *sipParseErr = SIP_NULLPTR;
251 bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
252
253 {
254 const ::wxString* msg;
255 int msgState = 0;
256 sipwxLogGui *sipCpp;
257
258 static const char *sipKwdList[] = {
259 sipName_msg,
260 };
261
262 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxLogGui, &sipCpp, sipType_wxString,&msg, &msgState))
263 {
264 PyErr_Clear();
265
266 Py_BEGIN_ALLOW_THREADS
267 sipCpp->sipProtectVirt_DoLogText(sipSelfWasArg,*msg);
268 Py_END_ALLOW_THREADS
269 sipReleaseType(const_cast< ::wxString *>(msg),sipType_wxString,msgState);
270
271 if (PyErr_Occurred())
272 return 0;
273
274 Py_INCREF(Py_None);
275 return Py_None;
276 }
277 }
278
279 /* Raise an exception if the arguments couldn't be parsed. */
280 sipNoMethod(sipParseErr, sipName_LogGui, sipName_DoLogText, SIP_NULLPTR);
281
282 return SIP_NULLPTR;
283 }
284
285
286 PyDoc_STRVAR(doc_wxLogGui_Flush, "Flush()\n"
287 "\n"
288 "Presents the accumulated log messages, if any, to the user.");
289
290 extern "C" {static PyObject *meth_wxLogGui_Flush(PyObject *, PyObject *);}
meth_wxLogGui_Flush(PyObject * sipSelf,PyObject * sipArgs)291 static PyObject *meth_wxLogGui_Flush(PyObject *sipSelf, PyObject *sipArgs)
292 {
293 PyObject *sipParseErr = SIP_NULLPTR;
294 bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
295
296 {
297 ::wxLogGui *sipCpp;
298
299 if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxLogGui, &sipCpp))
300 {
301 PyErr_Clear();
302
303 Py_BEGIN_ALLOW_THREADS
304 (sipSelfWasArg ? sipCpp-> ::wxLogGui::Flush() : sipCpp->Flush());
305 Py_END_ALLOW_THREADS
306
307 if (PyErr_Occurred())
308 return 0;
309
310 Py_INCREF(Py_None);
311 return Py_None;
312 }
313 }
314
315 /* Raise an exception if the arguments couldn't be parsed. */
316 sipNoMethod(sipParseErr, sipName_LogGui, sipName_Flush, SIP_NULLPTR);
317
318 return SIP_NULLPTR;
319 }
320
321
322 /* Cast a pointer to a type somewhere in its inheritance hierarchy. */
323 extern "C" {static void *cast_wxLogGui(void *, const sipTypeDef *);}
cast_wxLogGui(void * sipCppV,const sipTypeDef * targetType)324 static void *cast_wxLogGui(void *sipCppV, const sipTypeDef *targetType)
325 {
326 ::wxLogGui *sipCpp = reinterpret_cast< ::wxLogGui *>(sipCppV);
327
328 if (targetType == sipType_wxLog)
329 return static_cast< ::wxLog *>(sipCpp);
330
331 return sipCppV;
332 }
333
334
335 /* Call the instance's destructor. */
336 extern "C" {static void release_wxLogGui(void *, int);}
release_wxLogGui(void * sipCppV,int sipState)337 static void release_wxLogGui(void *sipCppV, int sipState)
338 {
339 Py_BEGIN_ALLOW_THREADS
340
341 if (sipState & SIP_DERIVED_CLASS)
342 delete reinterpret_cast<sipwxLogGui *>(sipCppV);
343 else
344 delete reinterpret_cast< ::wxLogGui *>(sipCppV);
345
346 Py_END_ALLOW_THREADS
347 }
348
349
350 extern "C" {static void dealloc_wxLogGui(sipSimpleWrapper *);}
dealloc_wxLogGui(sipSimpleWrapper * sipSelf)351 static void dealloc_wxLogGui(sipSimpleWrapper *sipSelf)
352 {
353 if (sipIsDerivedClass(sipSelf))
354 reinterpret_cast<sipwxLogGui *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;
355
356 if (sipIsOwnedByPython(sipSelf))
357 {
358 release_wxLogGui(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
359 }
360 }
361
362
363 extern "C" {static void *init_type_wxLogGui(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
init_type_wxLogGui(sipSimpleWrapper * sipSelf,PyObject * sipArgs,PyObject * sipKwds,PyObject ** sipUnused,PyObject **,PyObject ** sipParseErr)364 static void *init_type_wxLogGui(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
365 {
366 sipwxLogGui *sipCpp = SIP_NULLPTR;
367
368 {
369 if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
370 {
371 PyErr_Clear();
372
373 Py_BEGIN_ALLOW_THREADS
374 sipCpp = new sipwxLogGui();
375 Py_END_ALLOW_THREADS
376
377 if (PyErr_Occurred())
378 {
379 delete sipCpp;
380 return SIP_NULLPTR;
381 }
382
383 sipCpp->sipPySelf = sipSelf;
384
385 return sipCpp;
386 }
387 }
388
389 return SIP_NULLPTR;
390 }
391
392
393 /* Define this type's super-types. */
394 static sipEncodedTypeDef supers_wxLogGui[] = {{298, 255, 1}};
395
396
397 static PyMethodDef methods_wxLogGui[] = {
398 {SIP_MLNAME_CAST(sipName_DoLogRecord), SIP_MLMETH_CAST(meth_wxLogGui_DoLogRecord), METH_VARARGS|METH_KEYWORDS, SIP_NULLPTR},
399 {SIP_MLNAME_CAST(sipName_DoLogText), SIP_MLMETH_CAST(meth_wxLogGui_DoLogText), METH_VARARGS|METH_KEYWORDS, SIP_NULLPTR},
400 {SIP_MLNAME_CAST(sipName_DoLogTextAtLevel), SIP_MLMETH_CAST(meth_wxLogGui_DoLogTextAtLevel), METH_VARARGS|METH_KEYWORDS, SIP_NULLPTR},
401 {SIP_MLNAME_CAST(sipName_Flush), meth_wxLogGui_Flush, METH_VARARGS, SIP_MLDOC_CAST(doc_wxLogGui_Flush)}
402 };
403
404 PyDoc_STRVAR(doc_wxLogGui, "LogGui()\n"
405 "\n"
406 "This is the default log target for the GUI wxWidgets applications.");
407
408
409 sipClassTypeDef sipTypeDef__core_wxLogGui = {
410 {
411 -1,
412 SIP_NULLPTR,
413 SIP_NULLPTR,
414 SIP_TYPE_CLASS,
415 sipNameNr_wxLogGui,
416 {SIP_NULLPTR},
417 SIP_NULLPTR
418 },
419 {
420 sipNameNr_LogGui,
421 {0, 0, 1},
422 4, methods_wxLogGui,
423 0, SIP_NULLPTR,
424 0, SIP_NULLPTR,
425 {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
426 },
427 doc_wxLogGui,
428 -1,
429 -1,
430 supers_wxLogGui,
431 SIP_NULLPTR,
432 init_type_wxLogGui,
433 SIP_NULLPTR,
434 SIP_NULLPTR,
435 #if PY_MAJOR_VERSION >= 3
436 SIP_NULLPTR,
437 SIP_NULLPTR,
438 #else
439 SIP_NULLPTR,
440 SIP_NULLPTR,
441 SIP_NULLPTR,
442 SIP_NULLPTR,
443 #endif
444 dealloc_wxLogGui,
445 SIP_NULLPTR,
446 SIP_NULLPTR,
447 SIP_NULLPTR,
448 release_wxLogGui,
449 cast_wxLogGui,
450 SIP_NULLPTR,
451 SIP_NULLPTR,
452 SIP_NULLPTR,
453 SIP_NULLPTR,
454 SIP_NULLPTR,
455 SIP_NULLPTR
456 };
457