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/withimages.h>
13 
14         #include <wx/imaglist.h>
15 
16 
17 class sipwxWithImages : public  ::wxWithImages
18 {
19 public:
20     sipwxWithImages();
21     virtual ~sipwxWithImages();
22 
23     /*
24      * There is a protected method for every virtual method visible from
25      * this class.
26      */
27 protected:
28     void SetImageList( ::wxImageList*) SIP_OVERRIDE;
29 
30 public:
31     sipSimpleWrapper *sipPySelf;
32 
33 private:
34     sipwxWithImages(const sipwxWithImages &);
35     sipwxWithImages &operator = (const sipwxWithImages &);
36 
37     char sipPyMethods[1];
38 };
39 
sipwxWithImages()40 sipwxWithImages::sipwxWithImages():  ::wxWithImages(), sipPySelf(SIP_NULLPTR)
41 {
42     memset(sipPyMethods, 0, sizeof (sipPyMethods));
43 }
44 
~sipwxWithImages()45 sipwxWithImages::~sipwxWithImages()
46 {
47     sipInstanceDestroyedEx(&sipPySelf);
48 }
49 
SetImageList(::wxImageList * imageList)50 void sipwxWithImages::SetImageList( ::wxImageList*imageList)
51 {
52     sip_gilstate_t sipGILState;
53     PyObject *sipMeth;
54 
55     sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[0],sipPySelf,SIP_NULLPTR,sipName_SetImageList);
56 
57     if (!sipMeth)
58     {
59          ::wxWithImages::SetImageList(imageList);
60         return;
61     }
62 
63     extern void sipVH__core_140(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxImageList*);
64 
65     sipVH__core_140(sipGILState, 0, sipPySelf, sipMeth, imageList);
66 }
67 
68 
69 PyDoc_STRVAR(doc_wxWithImages_AssignImageList, "AssignImageList(imageList)\n"
70 "\n"
71 "Sets the image list for the page control and takes ownership of the\n"
72 "list.");
73 
74 extern "C" {static PyObject *meth_wxWithImages_AssignImageList(PyObject *, PyObject *, PyObject *);}
meth_wxWithImages_AssignImageList(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)75 static PyObject *meth_wxWithImages_AssignImageList(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
76 {
77     PyObject *sipParseErr = SIP_NULLPTR;
78 
79     {
80          ::wxImageList* imageList;
81          ::wxWithImages *sipCpp;
82 
83         static const char *sipKwdList[] = {
84             sipName_imageList,
85         };
86 
87         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ:", &sipSelf, sipType_wxWithImages, &sipCpp, sipType_wxImageList, &imageList))
88         {
89             PyErr_Clear();
90 
91             Py_BEGIN_ALLOW_THREADS
92             sipCpp->AssignImageList(imageList);
93             Py_END_ALLOW_THREADS
94 
95             if (PyErr_Occurred())
96                 return 0;
97 
98             Py_INCREF(Py_None);
99             return Py_None;
100         }
101     }
102 
103     /* Raise an exception if the arguments couldn't be parsed. */
104     sipNoMethod(sipParseErr, sipName_WithImages, sipName_AssignImageList, SIP_NULLPTR);
105 
106     return SIP_NULLPTR;
107 }
108 
109 
110 PyDoc_STRVAR(doc_wxWithImages_SetImageList, "SetImageList(imageList)\n"
111 "\n"
112 "Sets the image list to use.");
113 
114 extern "C" {static PyObject *meth_wxWithImages_SetImageList(PyObject *, PyObject *, PyObject *);}
meth_wxWithImages_SetImageList(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)115 static PyObject *meth_wxWithImages_SetImageList(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
116 {
117     PyObject *sipParseErr = SIP_NULLPTR;
118     bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
119 
120     {
121          ::wxImageList* imageList;
122          ::wxWithImages *sipCpp;
123 
124         static const char *sipKwdList[] = {
125             sipName_imageList,
126         };
127 
128         if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8", &sipSelf, sipType_wxWithImages, &sipCpp, sipType_wxImageList, &imageList))
129         {
130             PyErr_Clear();
131 
132             Py_BEGIN_ALLOW_THREADS
133             (sipSelfWasArg ? sipCpp-> ::wxWithImages::SetImageList(imageList) : sipCpp->SetImageList(imageList));
134             Py_END_ALLOW_THREADS
135 
136             if (PyErr_Occurred())
137                 return 0;
138 
139             Py_INCREF(Py_None);
140             return Py_None;
141         }
142     }
143 
144     /* Raise an exception if the arguments couldn't be parsed. */
145     sipNoMethod(sipParseErr, sipName_WithImages, sipName_SetImageList, SIP_NULLPTR);
146 
147     return SIP_NULLPTR;
148 }
149 
150 
151 PyDoc_STRVAR(doc_wxWithImages_GetImageList, "GetImageList() -> ImageList\n"
152 "\n"
153 "Returns the associated image list, may be NULL.");
154 
155 extern "C" {static PyObject *meth_wxWithImages_GetImageList(PyObject *, PyObject *);}
meth_wxWithImages_GetImageList(PyObject * sipSelf,PyObject * sipArgs)156 static PyObject *meth_wxWithImages_GetImageList(PyObject *sipSelf, PyObject *sipArgs)
157 {
158     PyObject *sipParseErr = SIP_NULLPTR;
159 
160     {
161         const  ::wxWithImages *sipCpp;
162 
163         if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxWithImages, &sipCpp))
164         {
165              ::wxImageList*sipRes;
166 
167             PyErr_Clear();
168 
169             Py_BEGIN_ALLOW_THREADS
170             sipRes = sipCpp->GetImageList();
171             Py_END_ALLOW_THREADS
172 
173             if (PyErr_Occurred())
174                 return 0;
175 
176             return sipConvertFromType(sipRes,sipType_wxImageList,SIP_NULLPTR);
177         }
178     }
179 
180     /* Raise an exception if the arguments couldn't be parsed. */
181     sipNoMethod(sipParseErr, sipName_WithImages, sipName_GetImageList, SIP_NULLPTR);
182 
183     return SIP_NULLPTR;
184 }
185 
186 
187 /* Call the instance's destructor. */
188 extern "C" {static void release_wxWithImages(void *, int);}
release_wxWithImages(void * sipCppV,int sipState)189 static void release_wxWithImages(void *sipCppV, int sipState)
190 {
191     Py_BEGIN_ALLOW_THREADS
192 
193     if (sipState & SIP_DERIVED_CLASS)
194         delete reinterpret_cast<sipwxWithImages *>(sipCppV);
195     else
196         delete reinterpret_cast< ::wxWithImages *>(sipCppV);
197 
198     Py_END_ALLOW_THREADS
199 }
200 
201 
202 extern "C" {static void dealloc_wxWithImages(sipSimpleWrapper *);}
dealloc_wxWithImages(sipSimpleWrapper * sipSelf)203 static void dealloc_wxWithImages(sipSimpleWrapper *sipSelf)
204 {
205     if (sipIsDerivedClass(sipSelf))
206         reinterpret_cast<sipwxWithImages *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;
207 
208     if (sipIsOwnedByPython(sipSelf))
209     {
210         release_wxWithImages(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
211     }
212 }
213 
214 
215 extern "C" {static void *init_type_wxWithImages(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
init_type_wxWithImages(sipSimpleWrapper * sipSelf,PyObject * sipArgs,PyObject * sipKwds,PyObject ** sipUnused,PyObject **,PyObject ** sipParseErr)216 static void *init_type_wxWithImages(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
217 {
218     sipwxWithImages *sipCpp = SIP_NULLPTR;
219 
220     {
221         if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
222         {
223             PyErr_Clear();
224 
225             Py_BEGIN_ALLOW_THREADS
226             sipCpp = new sipwxWithImages();
227             Py_END_ALLOW_THREADS
228 
229             if (PyErr_Occurred())
230             {
231                 delete sipCpp;
232                 return SIP_NULLPTR;
233             }
234 
235             sipCpp->sipPySelf = sipSelf;
236 
237             return sipCpp;
238         }
239     }
240 
241     return SIP_NULLPTR;
242 }
243 
244 
245 static PyMethodDef methods_wxWithImages[] = {
246     {SIP_MLNAME_CAST(sipName_AssignImageList), SIP_MLMETH_CAST(meth_wxWithImages_AssignImageList), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxWithImages_AssignImageList)},
247     {SIP_MLNAME_CAST(sipName_GetImageList), meth_wxWithImages_GetImageList, METH_VARARGS, SIP_MLDOC_CAST(doc_wxWithImages_GetImageList)},
248     {SIP_MLNAME_CAST(sipName_SetImageList), SIP_MLMETH_CAST(meth_wxWithImages_SetImageList), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxWithImages_SetImageList)}
249 };
250 
251 static sipEnumMemberDef enummembers_wxWithImages[] = {
252     {sipName_NO_IMAGE, static_cast<int>( ::wxWithImages::NO_IMAGE), -1},
253 };
254 
255 sipVariableDef variables_wxWithImages[] = {
256     {PropertyVariable, sipName_ImageList, &methods_wxWithImages[1], &methods_wxWithImages[2], SIP_NULLPTR, SIP_NULLPTR},
257 };
258 
259 PyDoc_STRVAR(doc_wxWithImages, "WithImages()\n"
260 "\n"
261 "A mixin class to be used with other classes that use a wxImageList.");
262 
263 
264 sipClassTypeDef sipTypeDef__core_wxWithImages = {
265     {
266         -1,
267         SIP_NULLPTR,
268         SIP_NULLPTR,
269         SIP_TYPE_CLASS,
270         sipNameNr_wxWithImages,
271         {SIP_NULLPTR},
272         SIP_NULLPTR
273     },
274     {
275         sipNameNr_WithImages,
276         {0, 0, 1},
277         3, methods_wxWithImages,
278         1, enummembers_wxWithImages,
279         1, variables_wxWithImages,
280         {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
281     },
282     doc_wxWithImages,
283     -1,
284     -1,
285     SIP_NULLPTR,
286     SIP_NULLPTR,
287     init_type_wxWithImages,
288     SIP_NULLPTR,
289     SIP_NULLPTR,
290 #if PY_MAJOR_VERSION >= 3
291     SIP_NULLPTR,
292     SIP_NULLPTR,
293 #else
294     SIP_NULLPTR,
295     SIP_NULLPTR,
296     SIP_NULLPTR,
297     SIP_NULLPTR,
298 #endif
299     dealloc_wxWithImages,
300     SIP_NULLPTR,
301     SIP_NULLPTR,
302     SIP_NULLPTR,
303     release_wxWithImages,
304     SIP_NULLPTR,
305     SIP_NULLPTR,
306     SIP_NULLPTR,
307     SIP_NULLPTR,
308     SIP_NULLPTR,
309     SIP_NULLPTR,
310     SIP_NULLPTR
311 };
312