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/overlay.h>
13 
14         #include <wx/overlay.h>
15         #include <wx/dc.h>
16 
17 
18 class sipwxDCOverlay : public  ::wxDCOverlay
19 {
20 public:
21     sipwxDCOverlay( ::wxOverlay&, ::wxDC*,int,int,int,int);
22     sipwxDCOverlay( ::wxOverlay&, ::wxDC*);
23     ~sipwxDCOverlay();
24 
25 public:
26     sipSimpleWrapper *sipPySelf;
27 
28 private:
29     sipwxDCOverlay(const sipwxDCOverlay &);
30     sipwxDCOverlay &operator = (const sipwxDCOverlay &);
31 };
32 
sipwxDCOverlay(::wxOverlay & overlay,::wxDC * dc,int x,int y,int width,int height)33 sipwxDCOverlay::sipwxDCOverlay( ::wxOverlay& overlay, ::wxDC*dc,int x,int y,int width,int height):  ::wxDCOverlay(overlay,dc,x,y,width,height), sipPySelf(SIP_NULLPTR)
34 {
35 }
36 
sipwxDCOverlay(::wxOverlay & overlay,::wxDC * dc)37 sipwxDCOverlay::sipwxDCOverlay( ::wxOverlay& overlay, ::wxDC*dc):  ::wxDCOverlay(overlay,dc), sipPySelf(SIP_NULLPTR)
38 {
39 }
40 
~sipwxDCOverlay()41 sipwxDCOverlay::~sipwxDCOverlay()
42 {
43     sipInstanceDestroyedEx(&sipPySelf);
44 }
45 
46 
47 PyDoc_STRVAR(doc_wxDCOverlay_Clear, "Clear()\n"
48 "\n"
49 "Clears the layer, restoring the state at the last init.");
50 
51 extern "C" {static PyObject *meth_wxDCOverlay_Clear(PyObject *, PyObject *);}
meth_wxDCOverlay_Clear(PyObject * sipSelf,PyObject * sipArgs)52 static PyObject *meth_wxDCOverlay_Clear(PyObject *sipSelf, PyObject *sipArgs)
53 {
54     PyObject *sipParseErr = SIP_NULLPTR;
55 
56     {
57          ::wxDCOverlay *sipCpp;
58 
59         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxDCOverlay, &sipCpp))
60         {
61             PyErr_Clear();
62 
63             Py_BEGIN_ALLOW_THREADS
64             sipCpp->Clear();
65             Py_END_ALLOW_THREADS
66 
67             if (PyErr_Occurred())
68                 return 0;
69 
70             Py_INCREF(Py_None);
71             return Py_None;
72         }
73     }
74 
75     /* Raise an exception if the arguments couldn't be parsed. */
76     sipNoMethod(sipParseErr, sipName_DCOverlay, sipName_Clear, SIP_NULLPTR);
77 
78     return SIP_NULLPTR;
79 }
80 
81 
82 /* Call the instance's destructor. */
83 extern "C" {static void release_wxDCOverlay(void *, int);}
release_wxDCOverlay(void * sipCppV,int sipState)84 static void release_wxDCOverlay(void *sipCppV, int sipState)
85 {
86     Py_BEGIN_ALLOW_THREADS
87 
88     if (sipState & SIP_DERIVED_CLASS)
89         delete reinterpret_cast<sipwxDCOverlay *>(sipCppV);
90     else
91         delete reinterpret_cast< ::wxDCOverlay *>(sipCppV);
92 
93     Py_END_ALLOW_THREADS
94 }
95 
96 
97 extern "C" {static void dealloc_wxDCOverlay(sipSimpleWrapper *);}
dealloc_wxDCOverlay(sipSimpleWrapper * sipSelf)98 static void dealloc_wxDCOverlay(sipSimpleWrapper *sipSelf)
99 {
100     if (sipIsDerivedClass(sipSelf))
101         reinterpret_cast<sipwxDCOverlay *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;
102 
103     if (sipIsOwnedByPython(sipSelf))
104     {
105         release_wxDCOverlay(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
106     }
107 }
108 
109 
110 extern "C" {static void *init_type_wxDCOverlay(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
init_type_wxDCOverlay(sipSimpleWrapper * sipSelf,PyObject * sipArgs,PyObject * sipKwds,PyObject ** sipUnused,PyObject **,PyObject ** sipParseErr)111 static void *init_type_wxDCOverlay(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
112 {
113     sipwxDCOverlay *sipCpp = SIP_NULLPTR;
114 
115     {
116          ::wxOverlay* overlay;
117          ::wxDC* dc;
118         PyObject *dcKeep;
119         int x;
120         int y;
121         int width;
122         int height;
123 
124         static const char *sipKwdList[] = {
125             sipName_overlay,
126             sipName_dc,
127             sipName_x,
128             sipName_y,
129             sipName_width,
130             sipName_height,
131         };
132 
133         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9@J8iiii", sipType_wxOverlay, &overlay, &dcKeep, sipType_wxDC, &dc, &x, &y, &width, &height))
134         {
135             PyErr_Clear();
136 
137             Py_BEGIN_ALLOW_THREADS
138             sipCpp = new sipwxDCOverlay(*overlay,dc,x,y,width,height);
139             Py_END_ALLOW_THREADS
140 
141             sipKeepReference((PyObject *)sipSelf, -22, dcKeep);
142 
143             if (PyErr_Occurred())
144             {
145                 delete sipCpp;
146                 return SIP_NULLPTR;
147             }
148 
149             sipCpp->sipPySelf = sipSelf;
150 
151             return sipCpp;
152         }
153     }
154 
155     {
156          ::wxOverlay* overlay;
157          ::wxDC* dc;
158         PyObject *dcKeep;
159 
160         static const char *sipKwdList[] = {
161             sipName_overlay,
162             sipName_dc,
163         };
164 
165         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9@J8", sipType_wxOverlay, &overlay, &dcKeep, sipType_wxDC, &dc))
166         {
167             PyErr_Clear();
168 
169             Py_BEGIN_ALLOW_THREADS
170             sipCpp = new sipwxDCOverlay(*overlay,dc);
171             Py_END_ALLOW_THREADS
172 
173             sipKeepReference((PyObject *)sipSelf, -23, dcKeep);
174 
175             if (PyErr_Occurred())
176             {
177                 delete sipCpp;
178                 return SIP_NULLPTR;
179             }
180 
181             sipCpp->sipPySelf = sipSelf;
182 
183             return sipCpp;
184         }
185     }
186 
187     return SIP_NULLPTR;
188 }
189 
190 
191 static PyMethodDef methods_wxDCOverlay[] = {
192     {SIP_MLNAME_CAST(sipName_Clear), meth_wxDCOverlay_Clear, METH_VARARGS, SIP_MLDOC_CAST(doc_wxDCOverlay_Clear)}
193 };
194 
195 PyDoc_STRVAR(doc_wxDCOverlay, "DCOverlay(overlay, dc, x, y, width, height)\n"
196 "DCOverlay(overlay, dc)\n"
197 "\n"
198 "Connects an overlay with a drawing DC.");
199 
200 
201 sipClassTypeDef sipTypeDef__core_wxDCOverlay = {
202     {
203         -1,
204         SIP_NULLPTR,
205         SIP_NULLPTR,
206         SIP_TYPE_CLASS,
207         sipNameNr_wxDCOverlay,
208         {SIP_NULLPTR},
209         SIP_NULLPTR
210     },
211     {
212         sipNameNr_DCOverlay,
213         {0, 0, 1},
214         1, methods_wxDCOverlay,
215         0, SIP_NULLPTR,
216         0, SIP_NULLPTR,
217         {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
218     },
219     doc_wxDCOverlay,
220     -1,
221     -1,
222     SIP_NULLPTR,
223     SIP_NULLPTR,
224     init_type_wxDCOverlay,
225     SIP_NULLPTR,
226     SIP_NULLPTR,
227 #if PY_MAJOR_VERSION >= 3
228     SIP_NULLPTR,
229     SIP_NULLPTR,
230 #else
231     SIP_NULLPTR,
232     SIP_NULLPTR,
233     SIP_NULLPTR,
234     SIP_NULLPTR,
235 #endif
236     dealloc_wxDCOverlay,
237     SIP_NULLPTR,
238     SIP_NULLPTR,
239     SIP_NULLPTR,
240     release_wxDCOverlay,
241     SIP_NULLPTR,
242     SIP_NULLPTR,
243     SIP_NULLPTR,
244     SIP_NULLPTR,
245     SIP_NULLPTR,
246     SIP_NULLPTR,
247     SIP_NULLPTR
248 };
249