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/image.h>
13 #include <wx/image.h>
14
15
16
17 /* Call the instance's destructor. */
18 extern "C" {static void release_wxImage_RGBValue(void *, int);}
release_wxImage_RGBValue(void * sipCppV,int)19 static void release_wxImage_RGBValue(void *sipCppV, int)
20 {
21 Py_BEGIN_ALLOW_THREADS
22
23 delete reinterpret_cast< ::wxImage::RGBValue *>(sipCppV);
24
25 Py_END_ALLOW_THREADS
26 }
27
28
29 extern "C" {static void assign_wxImage_RGBValue(void *, SIP_SSIZE_T, void *);}
assign_wxImage_RGBValue(void * sipDst,SIP_SSIZE_T sipDstIdx,void * sipSrc)30 static void assign_wxImage_RGBValue(void *sipDst, SIP_SSIZE_T sipDstIdx, void *sipSrc)
31 {
32 reinterpret_cast< ::wxImage::RGBValue *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::wxImage::RGBValue *>(sipSrc);
33 }
34
35
36 extern "C" {static void *array_wxImage_RGBValue(SIP_SSIZE_T);}
array_wxImage_RGBValue(SIP_SSIZE_T sipNrElem)37 static void *array_wxImage_RGBValue(SIP_SSIZE_T sipNrElem)
38 {
39 return new ::wxImage::RGBValue[sipNrElem];
40 }
41
42
43 extern "C" {static void *copy_wxImage_RGBValue(const void *, SIP_SSIZE_T);}
copy_wxImage_RGBValue(const void * sipSrc,SIP_SSIZE_T sipSrcIdx)44 static void *copy_wxImage_RGBValue(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
45 {
46 return new ::wxImage::RGBValue(reinterpret_cast<const ::wxImage::RGBValue *>(sipSrc)[sipSrcIdx]);
47 }
48
49
50 extern "C" {static void dealloc_wxImage_RGBValue(sipSimpleWrapper *);}
dealloc_wxImage_RGBValue(sipSimpleWrapper * sipSelf)51 static void dealloc_wxImage_RGBValue(sipSimpleWrapper *sipSelf)
52 {
53 if (sipIsOwnedByPython(sipSelf))
54 {
55 release_wxImage_RGBValue(sipGetAddress(sipSelf), 0);
56 }
57 }
58
59
60 extern "C" {static void *init_type_wxImage_RGBValue(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
init_type_wxImage_RGBValue(sipSimpleWrapper *,PyObject * sipArgs,PyObject * sipKwds,PyObject ** sipUnused,PyObject **,PyObject ** sipParseErr)61 static void *init_type_wxImage_RGBValue(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
62 {
63 ::wxImage::RGBValue *sipCpp = SIP_NULLPTR;
64
65 {
66 unsigned char r = 0;
67 unsigned char g = 0;
68 unsigned char b = 0;
69
70 static const char *sipKwdList[] = {
71 sipName_r,
72 sipName_g,
73 sipName_b,
74 };
75
76 if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|MMM", &r, &g, &b))
77 {
78 PyErr_Clear();
79
80 Py_BEGIN_ALLOW_THREADS
81 sipCpp = new ::wxImage::RGBValue(r,g,b);
82 Py_END_ALLOW_THREADS
83
84 if (PyErr_Occurred())
85 {
86 delete sipCpp;
87 return SIP_NULLPTR;
88 }
89
90 return sipCpp;
91 }
92 }
93
94 {
95 const ::wxImage::RGBValue* a0;
96
97 if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_wxImage_RGBValue, &a0))
98 {
99 Py_BEGIN_ALLOW_THREADS
100 sipCpp = new ::wxImage::RGBValue(*a0);
101 Py_END_ALLOW_THREADS
102
103 return sipCpp;
104 }
105 }
106
107 return SIP_NULLPTR;
108 }
109
110
111 extern "C" {static PyObject *varget_wxImage_RGBValue_blue(void *, PyObject *, PyObject *);}
varget_wxImage_RGBValue_blue(void * sipSelf,PyObject *,PyObject *)112 static PyObject *varget_wxImage_RGBValue_blue(void *sipSelf, PyObject *, PyObject *)
113 {
114 unsigned char sipVal;
115 ::wxImage::RGBValue *sipCpp = reinterpret_cast< ::wxImage::RGBValue *>(sipSelf);
116
117 sipVal = sipCpp->blue;
118
119 #if PY_MAJOR_VERSION >= 3
120 return PyLong_FromUnsignedLong(sipVal);
121 #else
122 return PyInt_FromLong(sipVal);
123 #endif
124 }
125
126
127 extern "C" {static int varset_wxImage_RGBValue_blue(void *, PyObject *, PyObject *);}
varset_wxImage_RGBValue_blue(void * sipSelf,PyObject * sipPy,PyObject *)128 static int varset_wxImage_RGBValue_blue(void *sipSelf, PyObject *sipPy, PyObject *)
129 {
130 unsigned char sipVal;
131 ::wxImage::RGBValue *sipCpp = reinterpret_cast< ::wxImage::RGBValue *>(sipSelf);
132
133 sipVal = sipLong_AsUnsignedChar(sipPy);
134
135 if (PyErr_Occurred() != SIP_NULLPTR)
136 return -1;
137
138 sipCpp->blue = sipVal;
139
140 return 0;
141 }
142
143
144 extern "C" {static PyObject *varget_wxImage_RGBValue_green(void *, PyObject *, PyObject *);}
varget_wxImage_RGBValue_green(void * sipSelf,PyObject *,PyObject *)145 static PyObject *varget_wxImage_RGBValue_green(void *sipSelf, PyObject *, PyObject *)
146 {
147 unsigned char sipVal;
148 ::wxImage::RGBValue *sipCpp = reinterpret_cast< ::wxImage::RGBValue *>(sipSelf);
149
150 sipVal = sipCpp->green;
151
152 #if PY_MAJOR_VERSION >= 3
153 return PyLong_FromUnsignedLong(sipVal);
154 #else
155 return PyInt_FromLong(sipVal);
156 #endif
157 }
158
159
160 extern "C" {static int varset_wxImage_RGBValue_green(void *, PyObject *, PyObject *);}
varset_wxImage_RGBValue_green(void * sipSelf,PyObject * sipPy,PyObject *)161 static int varset_wxImage_RGBValue_green(void *sipSelf, PyObject *sipPy, PyObject *)
162 {
163 unsigned char sipVal;
164 ::wxImage::RGBValue *sipCpp = reinterpret_cast< ::wxImage::RGBValue *>(sipSelf);
165
166 sipVal = sipLong_AsUnsignedChar(sipPy);
167
168 if (PyErr_Occurred() != SIP_NULLPTR)
169 return -1;
170
171 sipCpp->green = sipVal;
172
173 return 0;
174 }
175
176
177 extern "C" {static PyObject *varget_wxImage_RGBValue_red(void *, PyObject *, PyObject *);}
varget_wxImage_RGBValue_red(void * sipSelf,PyObject *,PyObject *)178 static PyObject *varget_wxImage_RGBValue_red(void *sipSelf, PyObject *, PyObject *)
179 {
180 unsigned char sipVal;
181 ::wxImage::RGBValue *sipCpp = reinterpret_cast< ::wxImage::RGBValue *>(sipSelf);
182
183 sipVal = sipCpp->red;
184
185 #if PY_MAJOR_VERSION >= 3
186 return PyLong_FromUnsignedLong(sipVal);
187 #else
188 return PyInt_FromLong(sipVal);
189 #endif
190 }
191
192
193 extern "C" {static int varset_wxImage_RGBValue_red(void *, PyObject *, PyObject *);}
varset_wxImage_RGBValue_red(void * sipSelf,PyObject * sipPy,PyObject *)194 static int varset_wxImage_RGBValue_red(void *sipSelf, PyObject *sipPy, PyObject *)
195 {
196 unsigned char sipVal;
197 ::wxImage::RGBValue *sipCpp = reinterpret_cast< ::wxImage::RGBValue *>(sipSelf);
198
199 sipVal = sipLong_AsUnsignedChar(sipPy);
200
201 if (PyErr_Occurred() != SIP_NULLPTR)
202 return -1;
203
204 sipCpp->red = sipVal;
205
206 return 0;
207 }
208
209 sipVariableDef variables_wxImage_RGBValue[] = {
210 {InstanceVariable, sipName_blue, (PyMethodDef *)varget_wxImage_RGBValue_blue, (PyMethodDef *)varset_wxImage_RGBValue_blue, SIP_NULLPTR, SIP_NULLPTR},
211 {InstanceVariable, sipName_green, (PyMethodDef *)varget_wxImage_RGBValue_green, (PyMethodDef *)varset_wxImage_RGBValue_green, SIP_NULLPTR, SIP_NULLPTR},
212 {InstanceVariable, sipName_red, (PyMethodDef *)varget_wxImage_RGBValue_red, (PyMethodDef *)varset_wxImage_RGBValue_red, SIP_NULLPTR, SIP_NULLPTR},
213 };
214
215 PyDoc_STRVAR(doc_wxImage_RGBValue, "RGBValue(r=0, g=0, b=0)\n"
216 "\n"
217 "A simple class which stores red, green and blue values as 8 bit\n"
218 "unsigned integers in the range of 0-255.");
219
220
221 sipClassTypeDef sipTypeDef__core_wxImage_RGBValue = {
222 {
223 -1,
224 SIP_NULLPTR,
225 SIP_NULLPTR,
226 SIP_TYPE_CLASS,
227 sipNameNr_wxImage__RGBValue,
228 {SIP_NULLPTR},
229 SIP_NULLPTR
230 },
231 {
232 sipNameNr_RGBValue,
233 {251, 255, 0},
234 0, SIP_NULLPTR,
235 0, SIP_NULLPTR,
236 3, variables_wxImage_RGBValue,
237 {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
238 },
239 doc_wxImage_RGBValue,
240 -1,
241 -1,
242 SIP_NULLPTR,
243 SIP_NULLPTR,
244 init_type_wxImage_RGBValue,
245 SIP_NULLPTR,
246 SIP_NULLPTR,
247 #if PY_MAJOR_VERSION >= 3
248 SIP_NULLPTR,
249 SIP_NULLPTR,
250 #else
251 SIP_NULLPTR,
252 SIP_NULLPTR,
253 SIP_NULLPTR,
254 SIP_NULLPTR,
255 #endif
256 dealloc_wxImage_RGBValue,
257 assign_wxImage_RGBValue,
258 array_wxImage_RGBValue,
259 copy_wxImage_RGBValue,
260 release_wxImage_RGBValue,
261 SIP_NULLPTR,
262 SIP_NULLPTR,
263 SIP_NULLPTR,
264 SIP_NULLPTR,
265 SIP_NULLPTR,
266 SIP_NULLPTR,
267 SIP_NULLPTR
268 };
269