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/pen.h>
13         #include "arrayholder.h"
14 
15         #include <wx/colour.h>
16         #include <wx/bitmap.h>
17         #include <wx/object.h>
18         #include <wx/object.h>
19         #include <wx/object.h>
_wxPen_GetDashes(const wxPen * self)20     wxArrayInt* _wxPen_GetDashes(const wxPen* self)
21     {
22         wxArrayInt* arr = new wxArrayInt;
23         wxDash* dashes;
24         int num = self->GetDashes(&dashes);
25         for (int i=0; i<num; i++)
26             arr->Add(dashes[i]);
27         return arr;
28     }
_wxPen__copyFrom(wxPen * self,const wxPen * other)29     void _wxPen__copyFrom(wxPen* self, const wxPen* other)
30     {
31         *self = *other;
32     }
33 
34 
35 PyDoc_STRVAR(doc_wxPen_SetColour, "SetColour(colour)\n"
36 "SetColour(red, green, blue)\n"
37 "\n"
38 "The pen's colour is changed to the given colour.\n"
39 "");
40 
41 extern "C" {static PyObject *meth_wxPen_SetColour(PyObject *, PyObject *, PyObject *);}
meth_wxPen_SetColour(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)42 static PyObject *meth_wxPen_SetColour(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
43 {
44     PyObject *sipParseErr = SIP_NULLPTR;
45 
46     {
47          ::wxColour* colour;
48         int colourState = 0;
49          ::wxPen *sipCpp;
50 
51         static const char *sipKwdList[] = {
52             sipName_colour,
53         };
54 
55         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxPen, &sipCpp, sipType_wxColour, &colour, &colourState))
56         {
57             PyErr_Clear();
58 
59             Py_BEGIN_ALLOW_THREADS
60             sipCpp->SetColour(*colour);
61             Py_END_ALLOW_THREADS
62             sipReleaseType(colour,sipType_wxColour,colourState);
63 
64             if (PyErr_Occurred())
65                 return 0;
66 
67             Py_INCREF(Py_None);
68             return Py_None;
69         }
70     }
71 
72     {
73         unsigned char red;
74         unsigned char green;
75         unsigned char blue;
76          ::wxPen *sipCpp;
77 
78         static const char *sipKwdList[] = {
79             sipName_red,
80             sipName_green,
81             sipName_blue,
82         };
83 
84         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bccc", &sipSelf, sipType_wxPen, &sipCpp, &red, &green, &blue))
85         {
86             PyErr_Clear();
87 
88             Py_BEGIN_ALLOW_THREADS
89             sipCpp->SetColour(red,green,blue);
90             Py_END_ALLOW_THREADS
91 
92             if (PyErr_Occurred())
93                 return 0;
94 
95             Py_INCREF(Py_None);
96             return Py_None;
97         }
98     }
99 
100     /* Raise an exception if the arguments couldn't be parsed. */
101     sipNoMethod(sipParseErr, sipName_Pen, sipName_SetColour, SIP_NULLPTR);
102 
103     return SIP_NULLPTR;
104 }
105 
106 
107 PyDoc_STRVAR(doc_wxPen_GetCap, "GetCap() -> PenCap\n"
108 "\n"
109 "Returns the pen cap style, which may be one of wxCAP_ROUND,\n"
110 "wxCAP_PROJECTING and wxCAP_BUTT.");
111 
112 extern "C" {static PyObject *meth_wxPen_GetCap(PyObject *, PyObject *);}
meth_wxPen_GetCap(PyObject * sipSelf,PyObject * sipArgs)113 static PyObject *meth_wxPen_GetCap(PyObject *sipSelf, PyObject *sipArgs)
114 {
115     PyObject *sipParseErr = SIP_NULLPTR;
116 
117     {
118         const  ::wxPen *sipCpp;
119 
120         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxPen, &sipCpp))
121         {
122              ::wxPenCap sipRes;
123 
124             PyErr_Clear();
125 
126             Py_BEGIN_ALLOW_THREADS
127             sipRes = sipCpp->GetCap();
128             Py_END_ALLOW_THREADS
129 
130             if (PyErr_Occurred())
131                 return 0;
132 
133             return sipConvertFromEnum(static_cast<int>(sipRes), sipType_wxPenCap);
134         }
135     }
136 
137     /* Raise an exception if the arguments couldn't be parsed. */
138     sipNoMethod(sipParseErr, sipName_Pen, sipName_GetCap, SIP_NULLPTR);
139 
140     return SIP_NULLPTR;
141 }
142 
143 
144 PyDoc_STRVAR(doc_wxPen_GetColour, "GetColour() -> Colour\n"
145 "\n"
146 "Returns a reference to the pen colour.");
147 
148 extern "C" {static PyObject *meth_wxPen_GetColour(PyObject *, PyObject *);}
meth_wxPen_GetColour(PyObject * sipSelf,PyObject * sipArgs)149 static PyObject *meth_wxPen_GetColour(PyObject *sipSelf, PyObject *sipArgs)
150 {
151     PyObject *sipParseErr = SIP_NULLPTR;
152 
153     {
154         const  ::wxPen *sipCpp;
155 
156         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxPen, &sipCpp))
157         {
158              ::wxColour*sipRes;
159 
160             PyErr_Clear();
161 
162             Py_BEGIN_ALLOW_THREADS
163             sipRes = new  ::wxColour(sipCpp->GetColour());
164             Py_END_ALLOW_THREADS
165 
166             if (PyErr_Occurred())
167                 return 0;
168 
169             return sipConvertFromNewType(sipRes,sipType_wxColour,SIP_NULLPTR);
170         }
171     }
172 
173     /* Raise an exception if the arguments couldn't be parsed. */
174     sipNoMethod(sipParseErr, sipName_Pen, sipName_GetColour, SIP_NULLPTR);
175 
176     return SIP_NULLPTR;
177 }
178 
179 
180 PyDoc_STRVAR(doc_wxPen_GetDashes, "GetDashes() -> ArrayInt\n"
181 "\n"
182 "Gets an array of dashes (defined as char in X, DWORD under Windows).");
183 
184 extern "C" {static PyObject *meth_wxPen_GetDashes(PyObject *, PyObject *);}
meth_wxPen_GetDashes(PyObject * sipSelf,PyObject * sipArgs)185 static PyObject *meth_wxPen_GetDashes(PyObject *sipSelf, PyObject *sipArgs)
186 {
187     PyObject *sipParseErr = SIP_NULLPTR;
188 
189     {
190         const  ::wxPen *sipCpp;
191 
192         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxPen, &sipCpp))
193         {
194              ::wxArrayInt*sipRes = 0;
195             int sipIsErr = 0;
196 
197         PyErr_Clear();
198         Py_BEGIN_ALLOW_THREADS
199         sipRes = _wxPen_GetDashes(sipCpp);
200         Py_END_ALLOW_THREADS
201         if (PyErr_Occurred()) sipIsErr = 1;
202 
203             if (sipIsErr)
204                 return 0;
205 
206             return sipConvertFromNewType(sipRes,sipType_wxArrayInt,SIP_NULLPTR);
207         }
208     }
209 
210     /* Raise an exception if the arguments couldn't be parsed. */
211     sipNoMethod(sipParseErr, sipName_Pen, sipName_GetDashes, SIP_NULLPTR);
212 
213     return SIP_NULLPTR;
214 }
215 
216 
217 PyDoc_STRVAR(doc_wxPen_GetJoin, "GetJoin() -> PenJoin\n"
218 "\n"
219 "Returns the pen join style, which may be one of wxJOIN_BEVEL,\n"
220 "wxJOIN_ROUND and wxJOIN_MITER.");
221 
222 extern "C" {static PyObject *meth_wxPen_GetJoin(PyObject *, PyObject *);}
meth_wxPen_GetJoin(PyObject * sipSelf,PyObject * sipArgs)223 static PyObject *meth_wxPen_GetJoin(PyObject *sipSelf, PyObject *sipArgs)
224 {
225     PyObject *sipParseErr = SIP_NULLPTR;
226 
227     {
228         const  ::wxPen *sipCpp;
229 
230         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxPen, &sipCpp))
231         {
232              ::wxPenJoin sipRes;
233 
234             PyErr_Clear();
235 
236             Py_BEGIN_ALLOW_THREADS
237             sipRes = sipCpp->GetJoin();
238             Py_END_ALLOW_THREADS
239 
240             if (PyErr_Occurred())
241                 return 0;
242 
243             return sipConvertFromEnum(static_cast<int>(sipRes), sipType_wxPenJoin);
244         }
245     }
246 
247     /* Raise an exception if the arguments couldn't be parsed. */
248     sipNoMethod(sipParseErr, sipName_Pen, sipName_GetJoin, SIP_NULLPTR);
249 
250     return SIP_NULLPTR;
251 }
252 
253 
254 PyDoc_STRVAR(doc_wxPen_GetStipple, "GetStipple() -> Bitmap\n"
255 "\n"
256 "Gets a pointer to the stipple bitmap.");
257 
258 extern "C" {static PyObject *meth_wxPen_GetStipple(PyObject *, PyObject *);}
meth_wxPen_GetStipple(PyObject * sipSelf,PyObject * sipArgs)259 static PyObject *meth_wxPen_GetStipple(PyObject *sipSelf, PyObject *sipArgs)
260 {
261     PyObject *sipParseErr = SIP_NULLPTR;
262 
263     {
264         const  ::wxPen *sipCpp;
265 
266         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxPen, &sipCpp))
267         {
268              ::wxBitmap*sipRes;
269 
270             PyErr_Clear();
271 
272             Py_BEGIN_ALLOW_THREADS
273             sipRes = sipCpp->GetStipple();
274             Py_END_ALLOW_THREADS
275 
276             if (PyErr_Occurred())
277                 return 0;
278 
279             return sipConvertFromType(sipRes,sipType_wxBitmap,SIP_NULLPTR);
280         }
281     }
282 
283     /* Raise an exception if the arguments couldn't be parsed. */
284     sipNoMethod(sipParseErr, sipName_Pen, sipName_GetStipple, SIP_NULLPTR);
285 
286     return SIP_NULLPTR;
287 }
288 
289 
290 PyDoc_STRVAR(doc_wxPen_GetStyle, "GetStyle() -> PenStyle\n"
291 "\n"
292 "Returns the pen style.");
293 
294 extern "C" {static PyObject *meth_wxPen_GetStyle(PyObject *, PyObject *);}
meth_wxPen_GetStyle(PyObject * sipSelf,PyObject * sipArgs)295 static PyObject *meth_wxPen_GetStyle(PyObject *sipSelf, PyObject *sipArgs)
296 {
297     PyObject *sipParseErr = SIP_NULLPTR;
298 
299     {
300         const  ::wxPen *sipCpp;
301 
302         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxPen, &sipCpp))
303         {
304              ::wxPenStyle sipRes;
305 
306             PyErr_Clear();
307 
308             Py_BEGIN_ALLOW_THREADS
309             sipRes = sipCpp->GetStyle();
310             Py_END_ALLOW_THREADS
311 
312             if (PyErr_Occurred())
313                 return 0;
314 
315             return sipConvertFromEnum(static_cast<int>(sipRes), sipType_wxPenStyle);
316         }
317     }
318 
319     /* Raise an exception if the arguments couldn't be parsed. */
320     sipNoMethod(sipParseErr, sipName_Pen, sipName_GetStyle, SIP_NULLPTR);
321 
322     return SIP_NULLPTR;
323 }
324 
325 
326 PyDoc_STRVAR(doc_wxPen_GetWidth, "GetWidth() -> int\n"
327 "\n"
328 "Returns the pen width.");
329 
330 extern "C" {static PyObject *meth_wxPen_GetWidth(PyObject *, PyObject *);}
meth_wxPen_GetWidth(PyObject * sipSelf,PyObject * sipArgs)331 static PyObject *meth_wxPen_GetWidth(PyObject *sipSelf, PyObject *sipArgs)
332 {
333     PyObject *sipParseErr = SIP_NULLPTR;
334 
335     {
336         const  ::wxPen *sipCpp;
337 
338         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxPen, &sipCpp))
339         {
340             int sipRes;
341 
342             PyErr_Clear();
343 
344             Py_BEGIN_ALLOW_THREADS
345             sipRes = sipCpp->GetWidth();
346             Py_END_ALLOW_THREADS
347 
348             if (PyErr_Occurred())
349                 return 0;
350 
351             return SIPLong_FromLong(sipRes);
352         }
353     }
354 
355     /* Raise an exception if the arguments couldn't be parsed. */
356     sipNoMethod(sipParseErr, sipName_Pen, sipName_GetWidth, SIP_NULLPTR);
357 
358     return SIP_NULLPTR;
359 }
360 
361 
362 PyDoc_STRVAR(doc_wxPen_IsOk, "IsOk() -> bool\n"
363 "\n"
364 "Returns true if the pen is initialised.");
365 
366 extern "C" {static PyObject *meth_wxPen_IsOk(PyObject *, PyObject *);}
meth_wxPen_IsOk(PyObject * sipSelf,PyObject * sipArgs)367 static PyObject *meth_wxPen_IsOk(PyObject *sipSelf, PyObject *sipArgs)
368 {
369     PyObject *sipParseErr = SIP_NULLPTR;
370 
371     {
372         const  ::wxPen *sipCpp;
373 
374         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxPen, &sipCpp))
375         {
376             bool sipRes;
377 
378             PyErr_Clear();
379 
380             Py_BEGIN_ALLOW_THREADS
381             sipRes = sipCpp->IsOk();
382             Py_END_ALLOW_THREADS
383 
384             if (PyErr_Occurred())
385                 return 0;
386 
387             return PyBool_FromLong(sipRes);
388         }
389     }
390 
391     /* Raise an exception if the arguments couldn't be parsed. */
392     sipNoMethod(sipParseErr, sipName_Pen, sipName_IsOk, SIP_NULLPTR);
393 
394     return SIP_NULLPTR;
395 }
396 
397 
398 PyDoc_STRVAR(doc_wxPen_IsNonTransparent, "IsNonTransparent() -> bool\n"
399 "\n"
400 "Returns true if the pen is a valid non-transparent pen.");
401 
402 extern "C" {static PyObject *meth_wxPen_IsNonTransparent(PyObject *, PyObject *);}
meth_wxPen_IsNonTransparent(PyObject * sipSelf,PyObject * sipArgs)403 static PyObject *meth_wxPen_IsNonTransparent(PyObject *sipSelf, PyObject *sipArgs)
404 {
405     PyObject *sipParseErr = SIP_NULLPTR;
406 
407     {
408         const  ::wxPen *sipCpp;
409 
410         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxPen, &sipCpp))
411         {
412             bool sipRes;
413 
414             PyErr_Clear();
415 
416             Py_BEGIN_ALLOW_THREADS
417             sipRes = sipCpp->IsNonTransparent();
418             Py_END_ALLOW_THREADS
419 
420             if (PyErr_Occurred())
421                 return 0;
422 
423             return PyBool_FromLong(sipRes);
424         }
425     }
426 
427     /* Raise an exception if the arguments couldn't be parsed. */
428     sipNoMethod(sipParseErr, sipName_Pen, sipName_IsNonTransparent, SIP_NULLPTR);
429 
430     return SIP_NULLPTR;
431 }
432 
433 
434 PyDoc_STRVAR(doc_wxPen_IsTransparent, "IsTransparent() -> bool\n"
435 "\n"
436 "Returns true if the pen is transparent.");
437 
438 extern "C" {static PyObject *meth_wxPen_IsTransparent(PyObject *, PyObject *);}
meth_wxPen_IsTransparent(PyObject * sipSelf,PyObject * sipArgs)439 static PyObject *meth_wxPen_IsTransparent(PyObject *sipSelf, PyObject *sipArgs)
440 {
441     PyObject *sipParseErr = SIP_NULLPTR;
442 
443     {
444         const  ::wxPen *sipCpp;
445 
446         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxPen, &sipCpp))
447         {
448             bool sipRes;
449 
450             PyErr_Clear();
451 
452             Py_BEGIN_ALLOW_THREADS
453             sipRes = sipCpp->IsTransparent();
454             Py_END_ALLOW_THREADS
455 
456             if (PyErr_Occurred())
457                 return 0;
458 
459             return PyBool_FromLong(sipRes);
460         }
461     }
462 
463     /* Raise an exception if the arguments couldn't be parsed. */
464     sipNoMethod(sipParseErr, sipName_Pen, sipName_IsTransparent, SIP_NULLPTR);
465 
466     return SIP_NULLPTR;
467 }
468 
469 
470 PyDoc_STRVAR(doc_wxPen_SetCap, "SetCap(capStyle)\n"
471 "\n"
472 "Sets the pen cap style, which may be one of wxCAP_ROUND,\n"
473 "wxCAP_PROJECTING and wxCAP_BUTT.");
474 
475 extern "C" {static PyObject *meth_wxPen_SetCap(PyObject *, PyObject *, PyObject *);}
meth_wxPen_SetCap(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)476 static PyObject *meth_wxPen_SetCap(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
477 {
478     PyObject *sipParseErr = SIP_NULLPTR;
479 
480     {
481          ::wxPenCap capStyle;
482          ::wxPen *sipCpp;
483 
484         static const char *sipKwdList[] = {
485             sipName_capStyle,
486         };
487 
488         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BE", &sipSelf, sipType_wxPen, &sipCpp, sipType_wxPenCap, &capStyle))
489         {
490             PyErr_Clear();
491 
492             Py_BEGIN_ALLOW_THREADS
493             sipCpp->SetCap(capStyle);
494             Py_END_ALLOW_THREADS
495 
496             if (PyErr_Occurred())
497                 return 0;
498 
499             Py_INCREF(Py_None);
500             return Py_None;
501         }
502     }
503 
504     /* Raise an exception if the arguments couldn't be parsed. */
505     sipNoMethod(sipParseErr, sipName_Pen, sipName_SetCap, SIP_NULLPTR);
506 
507     return SIP_NULLPTR;
508 }
509 
510 
511 PyDoc_STRVAR(doc_wxPen_SetDashes, "SetDashes(dashes)\n"
512 "\n"
513 "Associates an array of dash values (defined as char in X, DWORD under\n"
514 "Windows) with the pen.");
515 
516 extern "C" {static PyObject *meth_wxPen_SetDashes(PyObject *, PyObject *, PyObject *);}
meth_wxPen_SetDashes(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)517 static PyObject *meth_wxPen_SetDashes(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
518 {
519     PyObject *sipParseErr = SIP_NULLPTR;
520 
521     {
522         const  ::wxArrayInt* dashes;
523         int dashesState = 0;
524          ::wxPen *sipCpp;
525 
526         static const char *sipKwdList[] = {
527             sipName_dashes,
528         };
529 
530         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxPen, &sipCpp, sipType_wxArrayInt,&dashes, &dashesState))
531         {
532         size_t len = dashes->GetCount();
533         wxDashCArrayHolder* holder = new wxDashCArrayHolder;
534         holder->m_array = new wxDash[len];
535         for (int idx=0; idx<len; idx+=1) {
536             holder->m_array[idx] = (*dashes)[idx];
537         }
538         // Make a PyObject for the holder, and transfer its ownership to self.
539         PyObject* pyHolder = sipConvertFromNewType(
540                 (void*)holder, sipType_wxDashCArrayHolder, (PyObject*)sipSelf);
541         Py_DECREF(pyHolder);
542         sipCpp->SetDashes(len, holder->m_array);
543             sipReleaseType(const_cast< ::wxArrayInt *>(dashes),sipType_wxArrayInt,dashesState);
544 
545             Py_INCREF(Py_None);
546             return Py_None;
547         }
548     }
549 
550     /* Raise an exception if the arguments couldn't be parsed. */
551     sipNoMethod(sipParseErr, sipName_Pen, sipName_SetDashes, SIP_NULLPTR);
552 
553     return SIP_NULLPTR;
554 }
555 
556 
557 PyDoc_STRVAR(doc_wxPen_SetJoin, "SetJoin(join_style)\n"
558 "\n"
559 "Sets the pen join style, which may be one of wxJOIN_BEVEL,\n"
560 "wxJOIN_ROUND and wxJOIN_MITER.");
561 
562 extern "C" {static PyObject *meth_wxPen_SetJoin(PyObject *, PyObject *, PyObject *);}
meth_wxPen_SetJoin(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)563 static PyObject *meth_wxPen_SetJoin(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
564 {
565     PyObject *sipParseErr = SIP_NULLPTR;
566 
567     {
568          ::wxPenJoin join_style;
569          ::wxPen *sipCpp;
570 
571         static const char *sipKwdList[] = {
572             sipName_join_style,
573         };
574 
575         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BE", &sipSelf, sipType_wxPen, &sipCpp, sipType_wxPenJoin, &join_style))
576         {
577             PyErr_Clear();
578 
579             Py_BEGIN_ALLOW_THREADS
580             sipCpp->SetJoin(join_style);
581             Py_END_ALLOW_THREADS
582 
583             if (PyErr_Occurred())
584                 return 0;
585 
586             Py_INCREF(Py_None);
587             return Py_None;
588         }
589     }
590 
591     /* Raise an exception if the arguments couldn't be parsed. */
592     sipNoMethod(sipParseErr, sipName_Pen, sipName_SetJoin, SIP_NULLPTR);
593 
594     return SIP_NULLPTR;
595 }
596 
597 
598 PyDoc_STRVAR(doc_wxPen_SetStipple, "SetStipple(stipple)\n"
599 "\n"
600 "Sets the bitmap for stippling.");
601 
602 extern "C" {static PyObject *meth_wxPen_SetStipple(PyObject *, PyObject *, PyObject *);}
meth_wxPen_SetStipple(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)603 static PyObject *meth_wxPen_SetStipple(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
604 {
605     PyObject *sipParseErr = SIP_NULLPTR;
606 
607     {
608         const  ::wxBitmap* stipple;
609          ::wxPen *sipCpp;
610 
611         static const char *sipKwdList[] = {
612             sipName_stipple,
613         };
614 
615         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxPen, &sipCpp, sipType_wxBitmap, &stipple))
616         {
617             PyErr_Clear();
618 
619             Py_BEGIN_ALLOW_THREADS
620             sipCpp->SetStipple(*stipple);
621             Py_END_ALLOW_THREADS
622 
623             if (PyErr_Occurred())
624                 return 0;
625 
626             Py_INCREF(Py_None);
627             return Py_None;
628         }
629     }
630 
631     /* Raise an exception if the arguments couldn't be parsed. */
632     sipNoMethod(sipParseErr, sipName_Pen, sipName_SetStipple, SIP_NULLPTR);
633 
634     return SIP_NULLPTR;
635 }
636 
637 
638 PyDoc_STRVAR(doc_wxPen_SetStyle, "SetStyle(style)\n"
639 "\n"
640 "Set the pen style.");
641 
642 extern "C" {static PyObject *meth_wxPen_SetStyle(PyObject *, PyObject *, PyObject *);}
meth_wxPen_SetStyle(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)643 static PyObject *meth_wxPen_SetStyle(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
644 {
645     PyObject *sipParseErr = SIP_NULLPTR;
646 
647     {
648          ::wxPenStyle style;
649          ::wxPen *sipCpp;
650 
651         static const char *sipKwdList[] = {
652             sipName_style,
653         };
654 
655         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BE", &sipSelf, sipType_wxPen, &sipCpp, sipType_wxPenStyle, &style))
656         {
657             PyErr_Clear();
658 
659             Py_BEGIN_ALLOW_THREADS
660             sipCpp->SetStyle(style);
661             Py_END_ALLOW_THREADS
662 
663             if (PyErr_Occurred())
664                 return 0;
665 
666             Py_INCREF(Py_None);
667             return Py_None;
668         }
669     }
670 
671     /* Raise an exception if the arguments couldn't be parsed. */
672     sipNoMethod(sipParseErr, sipName_Pen, sipName_SetStyle, SIP_NULLPTR);
673 
674     return SIP_NULLPTR;
675 }
676 
677 
678 PyDoc_STRVAR(doc_wxPen_SetWidth, "SetWidth(width)\n"
679 "\n"
680 "Sets the pen width.");
681 
682 extern "C" {static PyObject *meth_wxPen_SetWidth(PyObject *, PyObject *, PyObject *);}
meth_wxPen_SetWidth(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)683 static PyObject *meth_wxPen_SetWidth(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
684 {
685     PyObject *sipParseErr = SIP_NULLPTR;
686 
687     {
688         int width;
689          ::wxPen *sipCpp;
690 
691         static const char *sipKwdList[] = {
692             sipName_width,
693         };
694 
695         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bi", &sipSelf, sipType_wxPen, &sipCpp, &width))
696         {
697             PyErr_Clear();
698 
699             Py_BEGIN_ALLOW_THREADS
700             sipCpp->SetWidth(width);
701             Py_END_ALLOW_THREADS
702 
703             if (PyErr_Occurred())
704                 return 0;
705 
706             Py_INCREF(Py_None);
707             return Py_None;
708         }
709     }
710 
711     /* Raise an exception if the arguments couldn't be parsed. */
712     sipNoMethod(sipParseErr, sipName_Pen, sipName_SetWidth, SIP_NULLPTR);
713 
714     return SIP_NULLPTR;
715 }
716 
717 
718 PyDoc_STRVAR(doc_wxPen__copyFrom, "_copyFrom(other)\n"
719 "\n"
720 "For internal use only.");
721 
722 extern "C" {static PyObject *meth_wxPen__copyFrom(PyObject *, PyObject *, PyObject *);}
meth_wxPen__copyFrom(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)723 static PyObject *meth_wxPen__copyFrom(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
724 {
725     PyObject *sipParseErr = SIP_NULLPTR;
726 
727     {
728         const  ::wxPen* other;
729          ::wxPen *sipCpp;
730 
731         static const char *sipKwdList[] = {
732             sipName_other,
733         };
734 
735         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8", &sipSelf, sipType_wxPen, &sipCpp, sipType_wxPen, &other))
736         {
737             int sipIsErr = 0;
738 
739         PyErr_Clear();
740         Py_BEGIN_ALLOW_THREADS
741         _wxPen__copyFrom(sipCpp, other);
742         Py_END_ALLOW_THREADS
743         if (PyErr_Occurred()) sipIsErr = 1;
744 
745             if (sipIsErr)
746                 return 0;
747 
748             Py_INCREF(Py_None);
749             return Py_None;
750         }
751     }
752 
753     /* Raise an exception if the arguments couldn't be parsed. */
754     sipNoMethod(sipParseErr, sipName_Pen, sipName__copyFrom, SIP_NULLPTR);
755 
756     return SIP_NULLPTR;
757 }
758 
759 
760 extern "C" {static PyObject *slot_wxPen___eq__(PyObject *,PyObject *);}
slot_wxPen___eq__(PyObject * sipSelf,PyObject * sipArg)761 static PyObject *slot_wxPen___eq__(PyObject *sipSelf,PyObject *sipArg)
762 {
763      ::wxPen *sipCpp = reinterpret_cast< ::wxPen *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_wxPen));
764 
765     if (!sipCpp)
766         return SIP_NULLPTR;
767 
768     PyObject *sipParseErr = SIP_NULLPTR;
769 
770     {
771         const  ::wxPen* pen;
772 
773         if (sipParseArgs(&sipParseErr, sipArg, "1J9", sipType_wxPen, &pen))
774         {
775             bool sipRes;
776 
777             PyErr_Clear();
778 
779             Py_BEGIN_ALLOW_THREADS
780             sipRes = sipCpp-> ::wxPen::operator==(*pen);
781             Py_END_ALLOW_THREADS
782 
783             if (PyErr_Occurred())
784                 return 0;
785 
786             return PyBool_FromLong(sipRes);
787         }
788     }
789 
790     Py_XDECREF(sipParseErr);
791 
792     if (sipParseErr == Py_None)
793         return SIP_NULLPTR;
794 
795     return sipPySlotExtend(&sipModuleAPI__core, eq_slot, sipType_wxPen, sipSelf, sipArg);
796 }
797 
798 
799 extern "C" {static PyObject *slot_wxPen___ne__(PyObject *,PyObject *);}
slot_wxPen___ne__(PyObject * sipSelf,PyObject * sipArg)800 static PyObject *slot_wxPen___ne__(PyObject *sipSelf,PyObject *sipArg)
801 {
802      ::wxPen *sipCpp = reinterpret_cast< ::wxPen *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_wxPen));
803 
804     if (!sipCpp)
805         return SIP_NULLPTR;
806 
807     PyObject *sipParseErr = SIP_NULLPTR;
808 
809     {
810         const  ::wxPen* pen;
811 
812         if (sipParseArgs(&sipParseErr, sipArg, "1J9", sipType_wxPen, &pen))
813         {
814             bool sipRes;
815 
816             PyErr_Clear();
817 
818             Py_BEGIN_ALLOW_THREADS
819             sipRes = sipCpp-> ::wxPen::operator!=(*pen);
820             Py_END_ALLOW_THREADS
821 
822             if (PyErr_Occurred())
823                 return 0;
824 
825             return PyBool_FromLong(sipRes);
826         }
827     }
828 
829     Py_XDECREF(sipParseErr);
830 
831     if (sipParseErr == Py_None)
832         return SIP_NULLPTR;
833 
834     return sipPySlotExtend(&sipModuleAPI__core, ne_slot, sipType_wxPen, sipSelf, sipArg);
835 }
836 
837 
838 /* Cast a pointer to a type somewhere in its inheritance hierarchy. */
839 extern "C" {static void *cast_wxPen(void *, const sipTypeDef *);}
cast_wxPen(void * sipCppV,const sipTypeDef * targetType)840 static void *cast_wxPen(void *sipCppV, const sipTypeDef *targetType)
841 {
842      ::wxPen *sipCpp = reinterpret_cast< ::wxPen *>(sipCppV);
843 
844     if (targetType == sipType_wxGDIObject)
845         return static_cast< ::wxGDIObject *>(sipCpp);
846 
847     if (targetType == sipType_wxObject)
848         return static_cast< ::wxObject *>(sipCpp);
849 
850     return sipCppV;
851 }
852 
853 
854 /* Call the instance's destructor. */
855 extern "C" {static void release_wxPen(void *, int);}
release_wxPen(void * sipCppV,int)856 static void release_wxPen(void *sipCppV, int)
857 {
858     Py_BEGIN_ALLOW_THREADS
859 
860     delete reinterpret_cast< ::wxPen *>(sipCppV);
861 
862     Py_END_ALLOW_THREADS
863 }
864 
865 
866 extern "C" {static void assign_wxPen(void *, SIP_SSIZE_T, void *);}
assign_wxPen(void * sipDst,SIP_SSIZE_T sipDstIdx,void * sipSrc)867 static void assign_wxPen(void *sipDst, SIP_SSIZE_T sipDstIdx, void *sipSrc)
868 {
869     reinterpret_cast< ::wxPen *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::wxPen *>(sipSrc);
870 }
871 
872 
873 extern "C" {static void *array_wxPen(SIP_SSIZE_T);}
array_wxPen(SIP_SSIZE_T sipNrElem)874 static void *array_wxPen(SIP_SSIZE_T sipNrElem)
875 {
876     return new  ::wxPen[sipNrElem];
877 }
878 
879 
880 extern "C" {static void *copy_wxPen(const void *, SIP_SSIZE_T);}
copy_wxPen(const void * sipSrc,SIP_SSIZE_T sipSrcIdx)881 static void *copy_wxPen(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
882 {
883     return new  ::wxPen(reinterpret_cast<const  ::wxPen *>(sipSrc)[sipSrcIdx]);
884 }
885 
886 
887 extern "C" {static void dealloc_wxPen(sipSimpleWrapper *);}
dealloc_wxPen(sipSimpleWrapper * sipSelf)888 static void dealloc_wxPen(sipSimpleWrapper *sipSelf)
889 {
890     if (sipIsOwnedByPython(sipSelf))
891     {
892         release_wxPen(sipGetAddress(sipSelf), 0);
893     }
894 }
895 
896 
897 extern "C" {static void *init_type_wxPen(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
init_type_wxPen(sipSimpleWrapper *,PyObject * sipArgs,PyObject * sipKwds,PyObject ** sipUnused,PyObject **,PyObject ** sipParseErr)898 static void *init_type_wxPen(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
899 {
900      ::wxPen *sipCpp = SIP_NULLPTR;
901 
902     {
903         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
904         {
905             PyErr_Clear();
906 
907             Py_BEGIN_ALLOW_THREADS
908             sipCpp = new  ::wxPen();
909             Py_END_ALLOW_THREADS
910 
911             if (PyErr_Occurred())
912             {
913                 delete sipCpp;
914                 return SIP_NULLPTR;
915             }
916 
917             return sipCpp;
918         }
919     }
920 
921     {
922         const  ::wxColour* colour;
923         int colourState = 0;
924         int width = 1;
925          ::wxPenStyle style = wxPENSTYLE_SOLID;
926 
927         static const char *sipKwdList[] = {
928             sipName_colour,
929             sipName_width,
930             sipName_style,
931         };
932 
933         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J1|iE", sipType_wxColour, &colour, &colourState, &width, sipType_wxPenStyle, &style))
934         {
935 
936         if (!wxPyCheckForApp()) return NULL;
937 
938             PyErr_Clear();
939 
940             Py_BEGIN_ALLOW_THREADS
941             sipCpp = new  ::wxPen(*colour,width,style);
942             Py_END_ALLOW_THREADS
943             sipReleaseType(const_cast< ::wxColour *>(colour),sipType_wxColour,colourState);
944 
945             if (PyErr_Occurred())
946             {
947                 delete sipCpp;
948                 return SIP_NULLPTR;
949             }
950 
951             return sipCpp;
952         }
953     }
954 
955     {
956         const  ::wxPen* pen;
957 
958         static const char *sipKwdList[] = {
959             sipName_pen,
960         };
961 
962         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9", sipType_wxPen, &pen))
963         {
964 
965         if (!wxPyCheckForApp()) return NULL;
966 
967             PyErr_Clear();
968 
969             Py_BEGIN_ALLOW_THREADS
970             sipCpp = new  ::wxPen(*pen);
971             Py_END_ALLOW_THREADS
972 
973             if (PyErr_Occurred())
974             {
975                 delete sipCpp;
976                 return SIP_NULLPTR;
977             }
978 
979             return sipCpp;
980         }
981     }
982 
983     return SIP_NULLPTR;
984 }
985 
986 
987 /* Define this type's super-types. */
988 static sipEncodedTypeDef supers_wxPen[] = {{204, 255, 1}};
989 
990 
991 /* Define this type's Python slots. */
992 static sipPySlotDef slots_wxPen[] = {
993     {(void *)slot_wxPen___eq__, eq_slot},
994     {(void *)slot_wxPen___ne__, ne_slot},
995     {0, (sipPySlotType)0}
996 };
997 
998 
999 static PyMethodDef methods_wxPen[] = {
1000     {SIP_MLNAME_CAST(sipName_GetCap), meth_wxPen_GetCap, METH_VARARGS, SIP_MLDOC_CAST(doc_wxPen_GetCap)},
1001     {SIP_MLNAME_CAST(sipName_GetColour), meth_wxPen_GetColour, METH_VARARGS, SIP_MLDOC_CAST(doc_wxPen_GetColour)},
1002     {SIP_MLNAME_CAST(sipName_GetDashes), meth_wxPen_GetDashes, METH_VARARGS, SIP_MLDOC_CAST(doc_wxPen_GetDashes)},
1003     {SIP_MLNAME_CAST(sipName_GetJoin), meth_wxPen_GetJoin, METH_VARARGS, SIP_MLDOC_CAST(doc_wxPen_GetJoin)},
1004     {SIP_MLNAME_CAST(sipName_GetStipple), meth_wxPen_GetStipple, METH_VARARGS, SIP_MLDOC_CAST(doc_wxPen_GetStipple)},
1005     {SIP_MLNAME_CAST(sipName_GetStyle), meth_wxPen_GetStyle, METH_VARARGS, SIP_MLDOC_CAST(doc_wxPen_GetStyle)},
1006     {SIP_MLNAME_CAST(sipName_GetWidth), meth_wxPen_GetWidth, METH_VARARGS, SIP_MLDOC_CAST(doc_wxPen_GetWidth)},
1007     {SIP_MLNAME_CAST(sipName_IsNonTransparent), meth_wxPen_IsNonTransparent, METH_VARARGS, SIP_MLDOC_CAST(doc_wxPen_IsNonTransparent)},
1008     {SIP_MLNAME_CAST(sipName_IsOk), meth_wxPen_IsOk, METH_VARARGS, SIP_MLDOC_CAST(doc_wxPen_IsOk)},
1009     {SIP_MLNAME_CAST(sipName_IsTransparent), meth_wxPen_IsTransparent, METH_VARARGS, SIP_MLDOC_CAST(doc_wxPen_IsTransparent)},
1010     {SIP_MLNAME_CAST(sipName_SetCap), SIP_MLMETH_CAST(meth_wxPen_SetCap), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxPen_SetCap)},
1011     {SIP_MLNAME_CAST(sipName_SetColour), SIP_MLMETH_CAST(meth_wxPen_SetColour), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxPen_SetColour)},
1012     {SIP_MLNAME_CAST(sipName_SetDashes), SIP_MLMETH_CAST(meth_wxPen_SetDashes), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxPen_SetDashes)},
1013     {SIP_MLNAME_CAST(sipName_SetJoin), SIP_MLMETH_CAST(meth_wxPen_SetJoin), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxPen_SetJoin)},
1014     {SIP_MLNAME_CAST(sipName_SetStipple), SIP_MLMETH_CAST(meth_wxPen_SetStipple), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxPen_SetStipple)},
1015     {SIP_MLNAME_CAST(sipName_SetStyle), SIP_MLMETH_CAST(meth_wxPen_SetStyle), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxPen_SetStyle)},
1016     {SIP_MLNAME_CAST(sipName_SetWidth), SIP_MLMETH_CAST(meth_wxPen_SetWidth), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxPen_SetWidth)},
1017     {SIP_MLNAME_CAST(sipName__copyFrom), SIP_MLMETH_CAST(meth_wxPen__copyFrom), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxPen__copyFrom)}
1018 };
1019 
1020 sipVariableDef variables_wxPen[] = {
1021     {PropertyVariable, sipName_Width, &methods_wxPen[6], &methods_wxPen[16], SIP_NULLPTR, SIP_NULLPTR},
1022     {PropertyVariable, sipName_Style, &methods_wxPen[5], &methods_wxPen[15], SIP_NULLPTR, SIP_NULLPTR},
1023     {PropertyVariable, sipName_Stipple, &methods_wxPen[4], &methods_wxPen[14], SIP_NULLPTR, SIP_NULLPTR},
1024     {PropertyVariable, sipName_Join, &methods_wxPen[3], &methods_wxPen[13], SIP_NULLPTR, SIP_NULLPTR},
1025     {PropertyVariable, sipName_Dashes, &methods_wxPen[2], &methods_wxPen[12], SIP_NULLPTR, SIP_NULLPTR},
1026     {PropertyVariable, sipName_Colour, &methods_wxPen[1], &methods_wxPen[11], SIP_NULLPTR, SIP_NULLPTR},
1027     {PropertyVariable, sipName_Cap, &methods_wxPen[0], &methods_wxPen[10], SIP_NULLPTR, SIP_NULLPTR},
1028 };
1029 
1030 PyDoc_STRVAR(doc_wxPen, "Pen()\n"
1031 "Pen(colour, width=1, style=PENSTYLE_SOLID)\n"
1032 "Pen(pen)\n"
1033 "\n"
1034 "A pen is a drawing tool for drawing outlines.");
1035 
1036 
1037 sipClassTypeDef sipTypeDef__core_wxPen = {
1038     {
1039         -1,
1040         SIP_NULLPTR,
1041         SIP_NULLPTR,
1042         SIP_TYPE_SCC|SIP_TYPE_CLASS,
1043         sipNameNr_wxPen,
1044         {SIP_NULLPTR},
1045         SIP_NULLPTR
1046     },
1047     {
1048         sipNameNr_Pen,
1049         {0, 0, 1},
1050         18, methods_wxPen,
1051         0, SIP_NULLPTR,
1052         7, variables_wxPen,
1053         {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
1054     },
1055     doc_wxPen,
1056     -1,
1057     -1,
1058     supers_wxPen,
1059     slots_wxPen,
1060     init_type_wxPen,
1061     SIP_NULLPTR,
1062     SIP_NULLPTR,
1063 #if PY_MAJOR_VERSION >= 3
1064     SIP_NULLPTR,
1065     SIP_NULLPTR,
1066 #else
1067     SIP_NULLPTR,
1068     SIP_NULLPTR,
1069     SIP_NULLPTR,
1070     SIP_NULLPTR,
1071 #endif
1072     dealloc_wxPen,
1073     assign_wxPen,
1074     array_wxPen,
1075     copy_wxPen,
1076     release_wxPen,
1077     cast_wxPen,
1078     SIP_NULLPTR,
1079     SIP_NULLPTR,
1080     SIP_NULLPTR,
1081     SIP_NULLPTR,
1082     SIP_NULLPTR,
1083     SIP_NULLPTR
1084 };
1085