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_adv.h"
11 
12         #include <wx/laywin.h>
13 
14         #include <wx/window.h>
15         #include <wx/mdi.h>
16         #include <wx/gdicmn.h>
17         #include <wx/frame.h>
18         #include <wx/object.h>
19         #include <wx/object.h>
20         #include <wx/object.h>
21 
22 
23 class sipwxLayoutAlgorithm : public  ::wxLayoutAlgorithm
24 {
25 public:
26     sipwxLayoutAlgorithm();
27     sipwxLayoutAlgorithm(const  ::wxLayoutAlgorithm&);
28     ~sipwxLayoutAlgorithm();
29 
30 public:
31     sipSimpleWrapper *sipPySelf;
32 
33 private:
34     sipwxLayoutAlgorithm(const sipwxLayoutAlgorithm &);
35     sipwxLayoutAlgorithm &operator = (const sipwxLayoutAlgorithm &);
36 };
37 
sipwxLayoutAlgorithm()38 sipwxLayoutAlgorithm::sipwxLayoutAlgorithm():  ::wxLayoutAlgorithm(), sipPySelf(SIP_NULLPTR)
39 {
40 }
41 
sipwxLayoutAlgorithm(const::wxLayoutAlgorithm & a0)42 sipwxLayoutAlgorithm::sipwxLayoutAlgorithm(const  ::wxLayoutAlgorithm& a0):  ::wxLayoutAlgorithm(a0), sipPySelf(SIP_NULLPTR)
43 {
44 }
45 
~sipwxLayoutAlgorithm()46 sipwxLayoutAlgorithm::~sipwxLayoutAlgorithm()
47 {
48     sipInstanceDestroyedEx(&sipPySelf);
49 }
50 
51 
52 PyDoc_STRVAR(doc_wxLayoutAlgorithm_LayoutFrame, "LayoutFrame(frame, mainWindow=None) -> bool\n"
53 "\n"
54 "Lays out the children of a normal frame.");
55 
56 extern "C" {static PyObject *meth_wxLayoutAlgorithm_LayoutFrame(PyObject *, PyObject *, PyObject *);}
meth_wxLayoutAlgorithm_LayoutFrame(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)57 static PyObject *meth_wxLayoutAlgorithm_LayoutFrame(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
58 {
59     PyObject *sipParseErr = SIP_NULLPTR;
60 
61     {
62          ::wxFrame* frame;
63          ::wxWindow* mainWindow = 0;
64          ::wxLayoutAlgorithm *sipCpp;
65 
66         static const char *sipKwdList[] = {
67             sipName_frame,
68             sipName_mainWindow,
69         };
70 
71         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8|J8", &sipSelf, sipType_wxLayoutAlgorithm, &sipCpp, sipType_wxFrame, &frame, sipType_wxWindow, &mainWindow))
72         {
73             bool sipRes;
74 
75             PyErr_Clear();
76 
77             Py_BEGIN_ALLOW_THREADS
78             sipRes = sipCpp->LayoutFrame(frame,mainWindow);
79             Py_END_ALLOW_THREADS
80 
81             if (PyErr_Occurred())
82                 return 0;
83 
84             return PyBool_FromLong(sipRes);
85         }
86     }
87 
88     /* Raise an exception if the arguments couldn't be parsed. */
89     sipNoMethod(sipParseErr, sipName_LayoutAlgorithm, sipName_LayoutFrame, SIP_NULLPTR);
90 
91     return SIP_NULLPTR;
92 }
93 
94 
95 PyDoc_STRVAR(doc_wxLayoutAlgorithm_LayoutMDIFrame, "LayoutMDIFrame(frame, rect=None) -> bool\n"
96 "\n"
97 "Lays out the children of an MDI parent frame.");
98 
99 extern "C" {static PyObject *meth_wxLayoutAlgorithm_LayoutMDIFrame(PyObject *, PyObject *, PyObject *);}
meth_wxLayoutAlgorithm_LayoutMDIFrame(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)100 static PyObject *meth_wxLayoutAlgorithm_LayoutMDIFrame(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
101 {
102     PyObject *sipParseErr = SIP_NULLPTR;
103 
104     {
105          ::wxMDIParentFrame* frame;
106          ::wxRect* rect = 0;
107         int rectState = 0;
108          ::wxLayoutAlgorithm *sipCpp;
109 
110         static const char *sipKwdList[] = {
111             sipName_frame,
112             sipName_rect,
113         };
114 
115         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8|J0", &sipSelf, sipType_wxLayoutAlgorithm, &sipCpp, sipType_wxMDIParentFrame, &frame, sipType_wxRect, &rect, &rectState))
116         {
117             bool sipRes;
118 
119             PyErr_Clear();
120 
121             Py_BEGIN_ALLOW_THREADS
122             sipRes = sipCpp->LayoutMDIFrame(frame,rect);
123             Py_END_ALLOW_THREADS
124             sipReleaseType(rect,sipType_wxRect,rectState);
125 
126             if (PyErr_Occurred())
127                 return 0;
128 
129             return PyBool_FromLong(sipRes);
130         }
131     }
132 
133     /* Raise an exception if the arguments couldn't be parsed. */
134     sipNoMethod(sipParseErr, sipName_LayoutAlgorithm, sipName_LayoutMDIFrame, SIP_NULLPTR);
135 
136     return SIP_NULLPTR;
137 }
138 
139 
140 PyDoc_STRVAR(doc_wxLayoutAlgorithm_LayoutWindow, "LayoutWindow(parent, mainWindow=None) -> bool\n"
141 "\n"
142 "Lays out the children of a normal frame or other window.");
143 
144 extern "C" {static PyObject *meth_wxLayoutAlgorithm_LayoutWindow(PyObject *, PyObject *, PyObject *);}
meth_wxLayoutAlgorithm_LayoutWindow(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)145 static PyObject *meth_wxLayoutAlgorithm_LayoutWindow(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
146 {
147     PyObject *sipParseErr = SIP_NULLPTR;
148 
149     {
150          ::wxWindow* parent;
151          ::wxWindow* mainWindow = 0;
152          ::wxLayoutAlgorithm *sipCpp;
153 
154         static const char *sipKwdList[] = {
155             sipName_parent,
156             sipName_mainWindow,
157         };
158 
159         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8|J8", &sipSelf, sipType_wxLayoutAlgorithm, &sipCpp, sipType_wxWindow, &parent, sipType_wxWindow, &mainWindow))
160         {
161             bool sipRes;
162 
163             PyErr_Clear();
164 
165             Py_BEGIN_ALLOW_THREADS
166             sipRes = sipCpp->LayoutWindow(parent,mainWindow);
167             Py_END_ALLOW_THREADS
168 
169             if (PyErr_Occurred())
170                 return 0;
171 
172             return PyBool_FromLong(sipRes);
173         }
174     }
175 
176     /* Raise an exception if the arguments couldn't be parsed. */
177     sipNoMethod(sipParseErr, sipName_LayoutAlgorithm, sipName_LayoutWindow, SIP_NULLPTR);
178 
179     return SIP_NULLPTR;
180 }
181 
182 
183 /* Cast a pointer to a type somewhere in its inheritance hierarchy. */
184 extern "C" {static void *cast_wxLayoutAlgorithm(void *, const sipTypeDef *);}
cast_wxLayoutAlgorithm(void * sipCppV,const sipTypeDef * targetType)185 static void *cast_wxLayoutAlgorithm(void *sipCppV, const sipTypeDef *targetType)
186 {
187      ::wxLayoutAlgorithm *sipCpp = reinterpret_cast< ::wxLayoutAlgorithm *>(sipCppV);
188 
189     if (targetType == sipType_wxObject)
190         return static_cast< ::wxObject *>(sipCpp);
191 
192     return sipCppV;
193 }
194 
195 
196 /* Call the instance's destructor. */
197 extern "C" {static void release_wxLayoutAlgorithm(void *, int);}
release_wxLayoutAlgorithm(void * sipCppV,int sipState)198 static void release_wxLayoutAlgorithm(void *sipCppV, int sipState)
199 {
200     Py_BEGIN_ALLOW_THREADS
201 
202     if (sipState & SIP_DERIVED_CLASS)
203         delete reinterpret_cast<sipwxLayoutAlgorithm *>(sipCppV);
204     else
205         delete reinterpret_cast< ::wxLayoutAlgorithm *>(sipCppV);
206 
207     Py_END_ALLOW_THREADS
208 }
209 
210 
211 extern "C" {static void assign_wxLayoutAlgorithm(void *, SIP_SSIZE_T, void *);}
assign_wxLayoutAlgorithm(void * sipDst,SIP_SSIZE_T sipDstIdx,void * sipSrc)212 static void assign_wxLayoutAlgorithm(void *sipDst, SIP_SSIZE_T sipDstIdx, void *sipSrc)
213 {
214     reinterpret_cast< ::wxLayoutAlgorithm *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::wxLayoutAlgorithm *>(sipSrc);
215 }
216 
217 
218 extern "C" {static void *array_wxLayoutAlgorithm(SIP_SSIZE_T);}
array_wxLayoutAlgorithm(SIP_SSIZE_T sipNrElem)219 static void *array_wxLayoutAlgorithm(SIP_SSIZE_T sipNrElem)
220 {
221     return new  ::wxLayoutAlgorithm[sipNrElem];
222 }
223 
224 
225 extern "C" {static void *copy_wxLayoutAlgorithm(const void *, SIP_SSIZE_T);}
copy_wxLayoutAlgorithm(const void * sipSrc,SIP_SSIZE_T sipSrcIdx)226 static void *copy_wxLayoutAlgorithm(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
227 {
228     return new  ::wxLayoutAlgorithm(reinterpret_cast<const  ::wxLayoutAlgorithm *>(sipSrc)[sipSrcIdx]);
229 }
230 
231 
232 extern "C" {static void dealloc_wxLayoutAlgorithm(sipSimpleWrapper *);}
dealloc_wxLayoutAlgorithm(sipSimpleWrapper * sipSelf)233 static void dealloc_wxLayoutAlgorithm(sipSimpleWrapper *sipSelf)
234 {
235     if (sipIsDerivedClass(sipSelf))
236         reinterpret_cast<sipwxLayoutAlgorithm *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;
237 
238     if (sipIsOwnedByPython(sipSelf))
239     {
240         release_wxLayoutAlgorithm(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
241     }
242 }
243 
244 
245 extern "C" {static void *init_type_wxLayoutAlgorithm(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
init_type_wxLayoutAlgorithm(sipSimpleWrapper * sipSelf,PyObject * sipArgs,PyObject * sipKwds,PyObject ** sipUnused,PyObject **,PyObject ** sipParseErr)246 static void *init_type_wxLayoutAlgorithm(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
247 {
248     sipwxLayoutAlgorithm *sipCpp = SIP_NULLPTR;
249 
250     {
251         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
252         {
253             PyErr_Clear();
254 
255             Py_BEGIN_ALLOW_THREADS
256             sipCpp = new sipwxLayoutAlgorithm();
257             Py_END_ALLOW_THREADS
258 
259             if (PyErr_Occurred())
260             {
261                 delete sipCpp;
262                 return SIP_NULLPTR;
263             }
264 
265             sipCpp->sipPySelf = sipSelf;
266 
267             return sipCpp;
268         }
269     }
270 
271     {
272         const  ::wxLayoutAlgorithm* a0;
273 
274         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_wxLayoutAlgorithm, &a0))
275         {
276             Py_BEGIN_ALLOW_THREADS
277             sipCpp = new sipwxLayoutAlgorithm(*a0);
278             Py_END_ALLOW_THREADS
279 
280             sipCpp->sipPySelf = sipSelf;
281 
282             return sipCpp;
283         }
284     }
285 
286     return SIP_NULLPTR;
287 }
288 
289 
290 /* Define this type's super-types. */
291 static sipEncodedTypeDef supers_wxLayoutAlgorithm[] = {{38, 0, 1}};
292 
293 
294 static PyMethodDef methods_wxLayoutAlgorithm[] = {
295     {SIP_MLNAME_CAST(sipName_LayoutFrame), SIP_MLMETH_CAST(meth_wxLayoutAlgorithm_LayoutFrame), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxLayoutAlgorithm_LayoutFrame)},
296     {SIP_MLNAME_CAST(sipName_LayoutMDIFrame), SIP_MLMETH_CAST(meth_wxLayoutAlgorithm_LayoutMDIFrame), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxLayoutAlgorithm_LayoutMDIFrame)},
297     {SIP_MLNAME_CAST(sipName_LayoutWindow), SIP_MLMETH_CAST(meth_wxLayoutAlgorithm_LayoutWindow), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxLayoutAlgorithm_LayoutWindow)}
298 };
299 
300 PyDoc_STRVAR(doc_wxLayoutAlgorithm, "LayoutAlgorithm()\n"
301 "\n"
302 "wxLayoutAlgorithm implements layout of subwindows in MDI or SDI\n"
303 "frames.");
304 
305 
306 sipClassTypeDef sipTypeDef__adv_wxLayoutAlgorithm = {
307     {
308         -1,
309         SIP_NULLPTR,
310         SIP_NULLPTR,
311         SIP_TYPE_SCC|SIP_TYPE_CLASS,
312         sipNameNr_wxLayoutAlgorithm,
313         {SIP_NULLPTR},
314         SIP_NULLPTR
315     },
316     {
317         sipNameNr_LayoutAlgorithm,
318         {0, 0, 1},
319         3, methods_wxLayoutAlgorithm,
320         0, SIP_NULLPTR,
321         0, SIP_NULLPTR,
322         {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
323     },
324     doc_wxLayoutAlgorithm,
325     -1,
326     -1,
327     supers_wxLayoutAlgorithm,
328     SIP_NULLPTR,
329     init_type_wxLayoutAlgorithm,
330     SIP_NULLPTR,
331     SIP_NULLPTR,
332 #if PY_MAJOR_VERSION >= 3
333     SIP_NULLPTR,
334     SIP_NULLPTR,
335 #else
336     SIP_NULLPTR,
337     SIP_NULLPTR,
338     SIP_NULLPTR,
339     SIP_NULLPTR,
340 #endif
341     dealloc_wxLayoutAlgorithm,
342     assign_wxLayoutAlgorithm,
343     array_wxLayoutAlgorithm,
344     copy_wxLayoutAlgorithm,
345     release_wxLayoutAlgorithm,
346     cast_wxLayoutAlgorithm,
347     SIP_NULLPTR,
348     SIP_NULLPTR,
349     SIP_NULLPTR,
350     SIP_NULLPTR,
351     SIP_NULLPTR,
352     SIP_NULLPTR
353 };
354