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_dataview.h"
11
12 #include <wx/dataview.h>
13
14 #include <wx/gdicmn.h>
15 #include <wx/dc.h>
16 #include <wx/gdicmn.h>
17 #include <wx/gdicmn.h>
18 #include <wx/dataview.h>
19 #include <wx/dataview.h>
20 #include <wx/window.h>
21 #include <wx/dataview.h>
22 #include <wx/event.h>
23 #include <wx/dataview.h>
24 #include <wx/dataview.h>
25 #include <wx/object.h>
26 #include <wx/object.h>
27 #include <wx/object.h>
28
29
30 class sipwxDataViewSpinRenderer : public ::wxDataViewSpinRenderer
31 {
32 public:
33 sipwxDataViewSpinRenderer(int,int, ::wxDataViewCellMode,int);
34 virtual ~sipwxDataViewSpinRenderer();
35
36 /*
37 * There is a public method for every protected method visible from
38 * this class.
39 */
40 ::wxDataViewCtrl* sipProtect_GetView() const;
41 ::wxSize sipProtect_GetTextExtent(const ::wxString&) const;
42
43 /*
44 * There is a protected method for every virtual method visible from
45 * this class.
46 */
47 protected:
48 bool FinishEditing() SIP_OVERRIDE;
49 void CancelEditing() SIP_OVERRIDE;
50 bool StartEditing(const ::wxDataViewItem&, ::wxRect) SIP_OVERRIDE;
51 bool GetValueFromEditorCtrl( ::wxWindow*, ::wxVariant&) SIP_OVERRIDE;
52 ::wxWindow* CreateEditorCtrl( ::wxWindow*, ::wxRect,const ::wxVariant&) SIP_OVERRIDE;
53 bool HasEditorCtrl() const SIP_OVERRIDE;
54 bool Validate( ::wxDVCVariant&) SIP_OVERRIDE;
55 bool SetValue(const ::wxVariant&) SIP_OVERRIDE;
56 void SetAlignment(int) SIP_OVERRIDE;
57 bool GetValue( ::wxVariant&) const SIP_OVERRIDE;
58 ::wxDataViewCellMode GetMode() const SIP_OVERRIDE;
59 int GetAlignment() const SIP_OVERRIDE;
60 bool ActivateCell(const ::wxRect&, ::wxDataViewModel*,const ::wxDataViewItem&,uint,const ::wxMouseEvent*) SIP_OVERRIDE;
61 ::wxSize GetSize() const SIP_OVERRIDE;
62 bool LeftClick( ::wxPoint, ::wxRect, ::wxDataViewModel*,const ::wxDataViewItem&,uint) SIP_OVERRIDE;
63 bool Activate( ::wxRect, ::wxDataViewModel*,const ::wxDataViewItem&,uint) SIP_OVERRIDE;
64 bool Render( ::wxRect, ::wxDC*,int) SIP_OVERRIDE;
65 bool StartDrag(const ::wxPoint&,const ::wxRect&, ::wxDataViewModel*,const ::wxDataViewItem&,uint) SIP_OVERRIDE;
66
67 public:
68 sipSimpleWrapper *sipPySelf;
69
70 private:
71 sipwxDataViewSpinRenderer(const sipwxDataViewSpinRenderer &);
72 sipwxDataViewSpinRenderer &operator = (const sipwxDataViewSpinRenderer &);
73
74 char sipPyMethods[18];
75 };
76
sipwxDataViewSpinRenderer(int min,int max,::wxDataViewCellMode mode,int align)77 sipwxDataViewSpinRenderer::sipwxDataViewSpinRenderer(int min,int max, ::wxDataViewCellMode mode,int align): ::wxDataViewSpinRenderer(min,max,mode,align), sipPySelf(SIP_NULLPTR)
78 {
79 memset(sipPyMethods, 0, sizeof (sipPyMethods));
80 }
81
~sipwxDataViewSpinRenderer()82 sipwxDataViewSpinRenderer::~sipwxDataViewSpinRenderer()
83 {
84 sipInstanceDestroyedEx(&sipPySelf);
85 }
86
FinishEditing()87 bool sipwxDataViewSpinRenderer::FinishEditing()
88 {
89 sip_gilstate_t sipGILState;
90 PyObject *sipMeth;
91
92 sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[0],sipPySelf,SIP_NULLPTR,sipName_FinishEditing);
93
94 if (!sipMeth)
95 return ::wxDataViewSpinRenderer::FinishEditing();
96
97 extern bool sipVH__dataview_0(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);
98
99 return sipVH__dataview_0(sipGILState, 0, sipPySelf, sipMeth);
100 }
101
CancelEditing()102 void sipwxDataViewSpinRenderer::CancelEditing()
103 {
104 sip_gilstate_t sipGILState;
105 PyObject *sipMeth;
106
107 sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[1],sipPySelf,SIP_NULLPTR,sipName_CancelEditing);
108
109 if (!sipMeth)
110 {
111 ::wxDataViewSpinRenderer::CancelEditing();
112 return;
113 }
114
115 extern void sipVH__dataview_5(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);
116
117 sipVH__dataview_5(sipGILState, 0, sipPySelf, sipMeth);
118 }
119
StartEditing(const::wxDataViewItem & item,::wxRect labelRect)120 bool sipwxDataViewSpinRenderer::StartEditing(const ::wxDataViewItem& item, ::wxRect labelRect)
121 {
122 sip_gilstate_t sipGILState;
123 PyObject *sipMeth;
124
125 sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[2],sipPySelf,SIP_NULLPTR,sipName_StartEditing);
126
127 if (!sipMeth)
128 return ::wxDataViewSpinRenderer::StartEditing(item,labelRect);
129
130 extern bool sipVH__dataview_28(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const ::wxDataViewItem&, ::wxRect);
131
132 return sipVH__dataview_28(sipGILState, 0, sipPySelf, sipMeth, item, labelRect);
133 }
134
GetValueFromEditorCtrl(::wxWindow * editor,::wxVariant & value)135 bool sipwxDataViewSpinRenderer::GetValueFromEditorCtrl( ::wxWindow*editor, ::wxVariant& value)
136 {
137 sip_gilstate_t sipGILState;
138 PyObject *sipMeth;
139
140 sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[3],sipPySelf,SIP_NULLPTR,sipName_GetValueFromEditorCtrl);
141
142 if (!sipMeth)
143 return ::wxDataViewSpinRenderer::GetValueFromEditorCtrl(editor,value);
144
145 extern bool sipVH__dataview_29(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxWindow*, ::wxVariant&);
146
147 return sipVH__dataview_29(sipGILState, 0, sipPySelf, sipMeth, editor, value);
148 }
149
CreateEditorCtrl(::wxWindow * parent,::wxRect labelRect,const::wxVariant & value)150 ::wxWindow* sipwxDataViewSpinRenderer::CreateEditorCtrl( ::wxWindow*parent, ::wxRect labelRect,const ::wxVariant& value)
151 {
152 sip_gilstate_t sipGILState;
153 PyObject *sipMeth;
154
155 sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[4],sipPySelf,SIP_NULLPTR,sipName_CreateEditorCtrl);
156
157 if (!sipMeth)
158 return ::wxDataViewSpinRenderer::CreateEditorCtrl(parent,labelRect,value);
159
160 extern ::wxWindow* sipVH__dataview_26(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxWindow*, ::wxRect,const ::wxVariant&);
161
162 return sipVH__dataview_26(sipGILState, 0, sipPySelf, sipMeth, parent, labelRect, value);
163 }
164
HasEditorCtrl() const165 bool sipwxDataViewSpinRenderer::HasEditorCtrl() const
166 {
167 sip_gilstate_t sipGILState;
168 PyObject *sipMeth;
169
170 sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[5]),sipPySelf,SIP_NULLPTR,sipName_HasEditorCtrl);
171
172 if (!sipMeth)
173 return ::wxDataViewSpinRenderer::HasEditorCtrl();
174
175 extern bool sipVH__dataview_0(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);
176
177 return sipVH__dataview_0(sipGILState, 0, sipPySelf, sipMeth);
178 }
179
Validate(::wxDVCVariant & value)180 bool sipwxDataViewSpinRenderer::Validate( ::wxDVCVariant& value)
181 {
182 sip_gilstate_t sipGILState;
183 PyObject *sipMeth;
184
185 sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[6],sipPySelf,SIP_NULLPTR,sipName_Validate);
186
187 if (!sipMeth)
188 return ::wxDataViewSpinRenderer::Validate(value);
189
190 extern bool sipVH__dataview_25(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxDVCVariant&);
191
192 return sipVH__dataview_25(sipGILState, 0, sipPySelf, sipMeth, value);
193 }
194
SetValue(const::wxVariant & value)195 bool sipwxDataViewSpinRenderer::SetValue(const ::wxVariant& value)
196 {
197 sip_gilstate_t sipGILState;
198 PyObject *sipMeth;
199
200 sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[7],sipPySelf,SIP_NULLPTR,sipName_SetValue);
201
202 if (!sipMeth)
203 return ::wxDataViewSpinRenderer::SetValue(value);
204
205 extern bool sipVH__dataview_24(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const ::wxVariant&);
206
207 return sipVH__dataview_24(sipGILState, 0, sipPySelf, sipMeth, value);
208 }
209
SetAlignment(int align)210 void sipwxDataViewSpinRenderer::SetAlignment(int align)
211 {
212 sip_gilstate_t sipGILState;
213 PyObject *sipMeth;
214
215 sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[8],sipPySelf,SIP_NULLPTR,sipName_SetAlignment);
216
217 if (!sipMeth)
218 {
219 ::wxDataViewSpinRenderer::SetAlignment(align);
220 return;
221 }
222
223 extern void sipVH__dataview_23(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, int);
224
225 sipVH__dataview_23(sipGILState, 0, sipPySelf, sipMeth, align);
226 }
227
GetValue(::wxVariant & value) const228 bool sipwxDataViewSpinRenderer::GetValue( ::wxVariant& value) const
229 {
230 sip_gilstate_t sipGILState;
231 PyObject *sipMeth;
232
233 sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[9]),sipPySelf,SIP_NULLPTR,sipName_GetValue);
234
235 if (!sipMeth)
236 return ::wxDataViewSpinRenderer::GetValue(value);
237
238 extern bool sipVH__dataview_22(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxVariant&);
239
240 return sipVH__dataview_22(sipGILState, 0, sipPySelf, sipMeth, value);
241 }
242
GetMode() const243 ::wxDataViewCellMode sipwxDataViewSpinRenderer::GetMode() const
244 {
245 sip_gilstate_t sipGILState;
246 PyObject *sipMeth;
247
248 sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[10]),sipPySelf,SIP_NULLPTR,sipName_GetMode);
249
250 if (!sipMeth)
251 return ::wxDataViewSpinRenderer::GetMode();
252
253 extern ::wxDataViewCellMode sipVH__dataview_21(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);
254
255 return sipVH__dataview_21(sipGILState, 0, sipPySelf, sipMeth);
256 }
257
GetAlignment() const258 int sipwxDataViewSpinRenderer::GetAlignment() const
259 {
260 sip_gilstate_t sipGILState;
261 PyObject *sipMeth;
262
263 sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[11]),sipPySelf,SIP_NULLPTR,sipName_GetAlignment);
264
265 if (!sipMeth)
266 return ::wxDataViewSpinRenderer::GetAlignment();
267
268 extern int sipVH__dataview_20(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);
269
270 return sipVH__dataview_20(sipGILState, 0, sipPySelf, sipMeth);
271 }
272
ActivateCell(const::wxRect & cell,::wxDataViewModel * model,const::wxDataViewItem & item,uint col,const::wxMouseEvent * mouseEvent)273 bool sipwxDataViewSpinRenderer::ActivateCell(const ::wxRect& cell, ::wxDataViewModel*model,const ::wxDataViewItem& item,uint col,const ::wxMouseEvent*mouseEvent)
274 {
275 sip_gilstate_t sipGILState;
276 PyObject *sipMeth;
277
278 sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[12],sipPySelf,SIP_NULLPTR,sipName_ActivateCell);
279
280 if (!sipMeth)
281 return ::wxDataViewSpinRenderer::ActivateCell(cell,model,item,col,mouseEvent);
282
283 extern bool sipVH__dataview_30(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const ::wxRect&, ::wxDataViewModel*,const ::wxDataViewItem&,uint,const ::wxMouseEvent*);
284
285 return sipVH__dataview_30(sipGILState, 0, sipPySelf, sipMeth, cell, model, item, col, mouseEvent);
286 }
287
GetSize() const288 ::wxSize sipwxDataViewSpinRenderer::GetSize() const
289 {
290 sip_gilstate_t sipGILState;
291 PyObject *sipMeth;
292
293 sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[13]),sipPySelf,SIP_NULLPTR,sipName_GetSize);
294
295 if (!sipMeth)
296 return ::wxDataViewSpinRenderer::GetSize();
297
298 extern ::wxSize sipVH__dataview_31(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);
299
300 return sipVH__dataview_31(sipGILState, 0, sipPySelf, sipMeth);
301 }
302
LeftClick(::wxPoint cursor,::wxRect cell,::wxDataViewModel * model,const::wxDataViewItem & item,uint col)303 bool sipwxDataViewSpinRenderer::LeftClick( ::wxPoint cursor, ::wxRect cell, ::wxDataViewModel*model,const ::wxDataViewItem& item,uint col)
304 {
305 sip_gilstate_t sipGILState;
306 PyObject *sipMeth;
307
308 sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[14],sipPySelf,SIP_NULLPTR,sipName_LeftClick);
309
310 if (!sipMeth)
311 return ::wxDataViewSpinRenderer::LeftClick(cursor,cell,model,item,col);
312
313 extern bool sipVH__dataview_32(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxPoint, ::wxRect, ::wxDataViewModel*,const ::wxDataViewItem&,uint);
314
315 return sipVH__dataview_32(sipGILState, 0, sipPySelf, sipMeth, cursor, cell, model, item, col);
316 }
317
Activate(::wxRect cell,::wxDataViewModel * model,const::wxDataViewItem & item,uint col)318 bool sipwxDataViewSpinRenderer::Activate( ::wxRect cell, ::wxDataViewModel*model,const ::wxDataViewItem& item,uint col)
319 {
320 sip_gilstate_t sipGILState;
321 PyObject *sipMeth;
322
323 sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[15],sipPySelf,SIP_NULLPTR,sipName_Activate);
324
325 if (!sipMeth)
326 return ::wxDataViewSpinRenderer::Activate(cell,model,item,col);
327
328 extern bool sipVH__dataview_33(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxRect, ::wxDataViewModel*,const ::wxDataViewItem&,uint);
329
330 return sipVH__dataview_33(sipGILState, 0, sipPySelf, sipMeth, cell, model, item, col);
331 }
332
Render(::wxRect cell,::wxDC * dc,int state)333 bool sipwxDataViewSpinRenderer::Render( ::wxRect cell, ::wxDC*dc,int state)
334 {
335 sip_gilstate_t sipGILState;
336 PyObject *sipMeth;
337
338 sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[16],sipPySelf,SIP_NULLPTR,sipName_Render);
339
340 if (!sipMeth)
341 return ::wxDataViewSpinRenderer::Render(cell,dc,state);
342
343 extern bool sipVH__dataview_34(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxRect, ::wxDC*,int);
344
345 return sipVH__dataview_34(sipGILState, 0, sipPySelf, sipMeth, cell, dc, state);
346 }
347
StartDrag(const::wxPoint & cursor,const::wxRect & cell,::wxDataViewModel * model,const::wxDataViewItem & item,uint col)348 bool sipwxDataViewSpinRenderer::StartDrag(const ::wxPoint& cursor,const ::wxRect& cell, ::wxDataViewModel*model,const ::wxDataViewItem& item,uint col)
349 {
350 sip_gilstate_t sipGILState;
351 PyObject *sipMeth;
352
353 sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[17],sipPySelf,SIP_NULLPTR,sipName_StartDrag);
354
355 if (!sipMeth)
356 return ::wxDataViewSpinRenderer::StartDrag(cursor,cell,model,item,col);
357
358 extern bool sipVH__dataview_35(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const ::wxPoint&,const ::wxRect&, ::wxDataViewModel*,const ::wxDataViewItem&,uint);
359
360 return sipVH__dataview_35(sipGILState, 0, sipPySelf, sipMeth, cursor, cell, model, item, col);
361 }
362
sipProtect_GetView() const363 ::wxDataViewCtrl* sipwxDataViewSpinRenderer::sipProtect_GetView() const
364 {
365 return ::wxDataViewRenderer::GetView();
366 }
367
sipProtect_GetTextExtent(const::wxString & str) const368 ::wxSize sipwxDataViewSpinRenderer::sipProtect_GetTextExtent(const ::wxString& str) const
369 {
370 return ::wxDataViewCustomRenderer::GetTextExtent(str);
371 }
372
373
374 PyDoc_STRVAR(doc_wxDataViewSpinRenderer_GetView, "GetView() -> DataViewCtrl");
375
376 extern "C" {static PyObject *meth_wxDataViewSpinRenderer_GetView(PyObject *, PyObject *);}
meth_wxDataViewSpinRenderer_GetView(PyObject * sipSelf,PyObject * sipArgs)377 static PyObject *meth_wxDataViewSpinRenderer_GetView(PyObject *sipSelf, PyObject *sipArgs)
378 {
379 PyObject *sipParseErr = SIP_NULLPTR;
380
381 {
382 const sipwxDataViewSpinRenderer *sipCpp;
383
384 if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxDataViewSpinRenderer, &sipCpp))
385 {
386 ::wxDataViewCtrl*sipRes;
387
388 PyErr_Clear();
389
390 Py_BEGIN_ALLOW_THREADS
391 sipRes = sipCpp->sipProtect_GetView();
392 Py_END_ALLOW_THREADS
393
394 if (PyErr_Occurred())
395 return 0;
396
397 return sipConvertFromType(sipRes,sipType_wxDataViewCtrl,SIP_NULLPTR);
398 }
399 }
400
401 /* Raise an exception if the arguments couldn't be parsed. */
402 sipNoMethod(sipParseErr, sipName_DataViewSpinRenderer, sipName_GetView, SIP_NULLPTR);
403
404 return SIP_NULLPTR;
405 }
406
407
408 PyDoc_STRVAR(doc_wxDataViewSpinRenderer_GetTextExtent, "GetTextExtent(str) -> wx.Size\n"
409 "\n"
410 "Helper for GetSize() implementations, respects attributes.");
411
412 extern "C" {static PyObject *meth_wxDataViewSpinRenderer_GetTextExtent(PyObject *, PyObject *, PyObject *);}
meth_wxDataViewSpinRenderer_GetTextExtent(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)413 static PyObject *meth_wxDataViewSpinRenderer_GetTextExtent(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
414 {
415 PyObject *sipParseErr = SIP_NULLPTR;
416
417 {
418 const ::wxString* str;
419 int strState = 0;
420 const sipwxDataViewSpinRenderer *sipCpp;
421
422 static const char *sipKwdList[] = {
423 sipName_str,
424 };
425
426 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxDataViewSpinRenderer, &sipCpp, sipType_wxString,&str, &strState))
427 {
428 ::wxSize*sipRes;
429
430 PyErr_Clear();
431
432 Py_BEGIN_ALLOW_THREADS
433 sipRes = new ::wxSize(sipCpp->sipProtect_GetTextExtent(*str));
434 Py_END_ALLOW_THREADS
435 sipReleaseType(const_cast< ::wxString *>(str),sipType_wxString,strState);
436
437 if (PyErr_Occurred())
438 return 0;
439
440 return sipConvertFromNewType(sipRes,sipType_wxSize,SIP_NULLPTR);
441 }
442 }
443
444 /* Raise an exception if the arguments couldn't be parsed. */
445 sipNoMethod(sipParseErr, sipName_DataViewSpinRenderer, sipName_GetTextExtent, SIP_NULLPTR);
446
447 return SIP_NULLPTR;
448 }
449
450
451 PyDoc_STRVAR(doc_wxDataViewSpinRenderer_SetValue, "SetValue(self, value: object) -> bool");
452
453 extern "C" {static PyObject *meth_wxDataViewSpinRenderer_SetValue(PyObject *, PyObject *, PyObject *);}
meth_wxDataViewSpinRenderer_SetValue(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)454 static PyObject *meth_wxDataViewSpinRenderer_SetValue(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
455 {
456 PyObject *sipParseErr = SIP_NULLPTR;
457 bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
458
459 {
460 const ::wxDVCVariant* value;
461 int valueState = 0;
462 ::wxDataViewSpinRenderer *sipCpp;
463
464 static const char *sipKwdList[] = {
465 sipName_value,
466 };
467
468 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxDataViewSpinRenderer, &sipCpp, sipType_wxDVCVariant,&value, &valueState))
469 {
470 bool sipRes;
471
472 PyErr_Clear();
473
474 Py_BEGIN_ALLOW_THREADS
475 sipRes = (sipSelfWasArg ? sipCpp-> ::wxDataViewSpinRenderer::SetValue(*value) : sipCpp->SetValue(*value));
476 Py_END_ALLOW_THREADS
477 sipReleaseType(const_cast< ::wxDVCVariant *>(value),sipType_wxDVCVariant,valueState);
478
479 if (PyErr_Occurred())
480 return 0;
481
482 return PyBool_FromLong(sipRes);
483 }
484 }
485
486 /* Raise an exception if the arguments couldn't be parsed. */
487 sipNoMethod(sipParseErr, sipName_DataViewSpinRenderer, sipName_SetValue, doc_wxDataViewSpinRenderer_SetValue);
488
489 return SIP_NULLPTR;
490 }
491
492
493 PyDoc_STRVAR(doc_wxDataViewSpinRenderer_GetValue, "GetValue(self) -> object");
494
495 extern "C" {static PyObject *meth_wxDataViewSpinRenderer_GetValue(PyObject *, PyObject *, PyObject *);}
meth_wxDataViewSpinRenderer_GetValue(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)496 static PyObject *meth_wxDataViewSpinRenderer_GetValue(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
497 {
498 PyObject *sipParseErr = SIP_NULLPTR;
499 bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
500
501 {
502 ::wxDVCVariant* value;
503 const ::wxDataViewSpinRenderer *sipCpp;
504
505 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, SIP_NULLPTR, "B", &sipSelf, sipType_wxDataViewSpinRenderer, &sipCpp))
506 {
507 value = new ::wxDVCVariant();
508
509 PyErr_Clear();
510
511 Py_BEGIN_ALLOW_THREADS
512 (sipSelfWasArg ? sipCpp-> ::wxDataViewSpinRenderer::GetValue(*value) : sipCpp->GetValue(*value));
513 Py_END_ALLOW_THREADS
514
515 if (PyErr_Occurred())
516 return 0;
517
518 return sipConvertFromNewType(value,sipType_wxDVCVariant,SIP_NULLPTR);
519 }
520 }
521
522 /* Raise an exception if the arguments couldn't be parsed. */
523 sipNoMethod(sipParseErr, sipName_DataViewSpinRenderer, sipName_GetValue, doc_wxDataViewSpinRenderer_GetValue);
524
525 return SIP_NULLPTR;
526 }
527
528
529 PyDoc_STRVAR(doc_wxDataViewSpinRenderer_GetSize, "GetSize(self) -> Size");
530
531 extern "C" {static PyObject *meth_wxDataViewSpinRenderer_GetSize(PyObject *, PyObject *);}
meth_wxDataViewSpinRenderer_GetSize(PyObject * sipSelf,PyObject * sipArgs)532 static PyObject *meth_wxDataViewSpinRenderer_GetSize(PyObject *sipSelf, PyObject *sipArgs)
533 {
534 PyObject *sipParseErr = SIP_NULLPTR;
535 bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
536
537 {
538 const ::wxDataViewSpinRenderer *sipCpp;
539
540 if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxDataViewSpinRenderer, &sipCpp))
541 {
542 ::wxSize*sipRes;
543
544 PyErr_Clear();
545
546 Py_BEGIN_ALLOW_THREADS
547 sipRes = new ::wxSize((sipSelfWasArg ? sipCpp-> ::wxDataViewSpinRenderer::GetSize() : sipCpp->GetSize()));
548 Py_END_ALLOW_THREADS
549
550 if (PyErr_Occurred())
551 return 0;
552
553 return sipConvertFromNewType(sipRes,sipType_wxSize,SIP_NULLPTR);
554 }
555 }
556
557 /* Raise an exception if the arguments couldn't be parsed. */
558 sipNoMethod(sipParseErr, sipName_DataViewSpinRenderer, sipName_GetSize, doc_wxDataViewSpinRenderer_GetSize);
559
560 return SIP_NULLPTR;
561 }
562
563
564 PyDoc_STRVAR(doc_wxDataViewSpinRenderer_Render, "Render(self, cell: Rect, dc: DC, state: int) -> bool");
565
566 extern "C" {static PyObject *meth_wxDataViewSpinRenderer_Render(PyObject *, PyObject *, PyObject *);}
meth_wxDataViewSpinRenderer_Render(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)567 static PyObject *meth_wxDataViewSpinRenderer_Render(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
568 {
569 PyObject *sipParseErr = SIP_NULLPTR;
570 bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
571
572 {
573 ::wxRect* cell;
574 int cellState = 0;
575 ::wxDC* dc;
576 int state;
577 ::wxDataViewSpinRenderer *sipCpp;
578
579 static const char *sipKwdList[] = {
580 sipName_cell,
581 sipName_dc,
582 sipName_state,
583 };
584
585 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1J8i", &sipSelf, sipType_wxDataViewSpinRenderer, &sipCpp, sipType_wxRect, &cell, &cellState, sipType_wxDC, &dc, &state))
586 {
587 bool sipRes;
588
589 PyErr_Clear();
590
591 Py_BEGIN_ALLOW_THREADS
592 sipRes = (sipSelfWasArg ? sipCpp-> ::wxDataViewSpinRenderer::Render(*cell,dc,state) : sipCpp->Render(*cell,dc,state));
593 Py_END_ALLOW_THREADS
594 sipReleaseType(cell,sipType_wxRect,cellState);
595
596 if (PyErr_Occurred())
597 return 0;
598
599 return PyBool_FromLong(sipRes);
600 }
601 }
602
603 /* Raise an exception if the arguments couldn't be parsed. */
604 sipNoMethod(sipParseErr, sipName_DataViewSpinRenderer, sipName_Render, doc_wxDataViewSpinRenderer_Render);
605
606 return SIP_NULLPTR;
607 }
608
609
610 /* Cast a pointer to a type somewhere in its inheritance hierarchy. */
611 extern "C" {static void *cast_wxDataViewSpinRenderer(void *, const sipTypeDef *);}
cast_wxDataViewSpinRenderer(void * sipCppV,const sipTypeDef * targetType)612 static void *cast_wxDataViewSpinRenderer(void *sipCppV, const sipTypeDef *targetType)
613 {
614 ::wxDataViewSpinRenderer *sipCpp = reinterpret_cast< ::wxDataViewSpinRenderer *>(sipCppV);
615
616 if (targetType == sipType_wxDataViewCustomRenderer)
617 return static_cast< ::wxDataViewCustomRenderer *>(sipCpp);
618
619 if (targetType == sipType_wxDataViewRenderer)
620 return static_cast< ::wxDataViewRenderer *>(sipCpp);
621
622 if (targetType == sipType_wxObject)
623 return static_cast< ::wxObject *>(sipCpp);
624
625 return sipCppV;
626 }
627
628
629 /* Call the instance's destructor. */
630 extern "C" {static void release_wxDataViewSpinRenderer(void *, int);}
release_wxDataViewSpinRenderer(void * sipCppV,int sipState)631 static void release_wxDataViewSpinRenderer(void *sipCppV, int sipState)
632 {
633 Py_BEGIN_ALLOW_THREADS
634
635 if (sipState & SIP_DERIVED_CLASS)
636 delete reinterpret_cast<sipwxDataViewSpinRenderer *>(sipCppV);
637 else
638 delete reinterpret_cast< ::wxDataViewSpinRenderer *>(sipCppV);
639
640 Py_END_ALLOW_THREADS
641 }
642
643
644 extern "C" {static void dealloc_wxDataViewSpinRenderer(sipSimpleWrapper *);}
dealloc_wxDataViewSpinRenderer(sipSimpleWrapper * sipSelf)645 static void dealloc_wxDataViewSpinRenderer(sipSimpleWrapper *sipSelf)
646 {
647 if (sipIsDerivedClass(sipSelf))
648 reinterpret_cast<sipwxDataViewSpinRenderer *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;
649
650 if (sipIsOwnedByPython(sipSelf))
651 {
652 release_wxDataViewSpinRenderer(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
653 }
654 }
655
656
657 extern "C" {static void *init_type_wxDataViewSpinRenderer(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
init_type_wxDataViewSpinRenderer(sipSimpleWrapper * sipSelf,PyObject * sipArgs,PyObject * sipKwds,PyObject ** sipUnused,PyObject **,PyObject ** sipParseErr)658 static void *init_type_wxDataViewSpinRenderer(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
659 {
660 sipwxDataViewSpinRenderer *sipCpp = SIP_NULLPTR;
661
662 {
663 int min;
664 int max;
665 ::wxDataViewCellMode mode = wxDATAVIEW_CELL_EDITABLE;
666 int align = wxDVR_DEFAULT_ALIGNMENT;
667
668 static const char *sipKwdList[] = {
669 sipName_min,
670 sipName_max,
671 sipName_mode,
672 sipName_align,
673 };
674
675 if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "ii|Ei", &min, &max, sipType_wxDataViewCellMode, &mode, &align))
676 {
677 PyErr_Clear();
678
679 Py_BEGIN_ALLOW_THREADS
680 sipCpp = new sipwxDataViewSpinRenderer(min,max,mode,align);
681 Py_END_ALLOW_THREADS
682
683 if (PyErr_Occurred())
684 {
685 delete sipCpp;
686 return SIP_NULLPTR;
687 }
688
689 sipCpp->sipPySelf = sipSelf;
690
691 return sipCpp;
692 }
693 }
694
695 return SIP_NULLPTR;
696 }
697
698
699 /* Define this type's super-types. */
700 static sipEncodedTypeDef supers_wxDataViewSpinRenderer[] = {{8, 255, 1}};
701
702
703 static PyMethodDef methods_wxDataViewSpinRenderer[] = {
704 {SIP_MLNAME_CAST(sipName_GetSize), meth_wxDataViewSpinRenderer_GetSize, METH_VARARGS, SIP_MLDOC_CAST(doc_wxDataViewSpinRenderer_GetSize)},
705 {SIP_MLNAME_CAST(sipName_GetTextExtent), SIP_MLMETH_CAST(meth_wxDataViewSpinRenderer_GetTextExtent), METH_VARARGS|METH_KEYWORDS, SIP_NULLPTR},
706 {SIP_MLNAME_CAST(sipName_GetValue), SIP_MLMETH_CAST(meth_wxDataViewSpinRenderer_GetValue), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxDataViewSpinRenderer_GetValue)},
707 {SIP_MLNAME_CAST(sipName_GetView), meth_wxDataViewSpinRenderer_GetView, METH_VARARGS, SIP_NULLPTR},
708 {SIP_MLNAME_CAST(sipName_Render), SIP_MLMETH_CAST(meth_wxDataViewSpinRenderer_Render), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxDataViewSpinRenderer_Render)},
709 {SIP_MLNAME_CAST(sipName_SetValue), SIP_MLMETH_CAST(meth_wxDataViewSpinRenderer_SetValue), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxDataViewSpinRenderer_SetValue)}
710 };
711
712 sipVariableDef variables_wxDataViewSpinRenderer[] = {
713 {PropertyVariable, sipName_Value, &methods_wxDataViewSpinRenderer[2], &methods_wxDataViewSpinRenderer[5], SIP_NULLPTR, SIP_NULLPTR},
714 };
715
716 PyDoc_STRVAR(doc_wxDataViewSpinRenderer, "DataViewSpinRenderer(min, max, mode=DATAVIEW_CELL_EDITABLE, align=DVR_DEFAULT_ALIGNMENT)\n"
717 "\n"
718 "This is a specialized renderer for rendering integer values.");
719
720
721 sipClassTypeDef sipTypeDef__dataview_wxDataViewSpinRenderer = {
722 {
723 -1,
724 SIP_NULLPTR,
725 SIP_NULLPTR,
726 SIP_TYPE_SCC|SIP_TYPE_CLASS,
727 sipNameNr_wxDataViewSpinRenderer,
728 {SIP_NULLPTR},
729 SIP_NULLPTR
730 },
731 {
732 sipNameNr_DataViewSpinRenderer,
733 {0, 0, 1},
734 6, methods_wxDataViewSpinRenderer,
735 0, SIP_NULLPTR,
736 1, variables_wxDataViewSpinRenderer,
737 {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
738 },
739 doc_wxDataViewSpinRenderer,
740 -1,
741 -1,
742 supers_wxDataViewSpinRenderer,
743 SIP_NULLPTR,
744 init_type_wxDataViewSpinRenderer,
745 SIP_NULLPTR,
746 SIP_NULLPTR,
747 #if PY_MAJOR_VERSION >= 3
748 SIP_NULLPTR,
749 SIP_NULLPTR,
750 #else
751 SIP_NULLPTR,
752 SIP_NULLPTR,
753 SIP_NULLPTR,
754 SIP_NULLPTR,
755 #endif
756 dealloc_wxDataViewSpinRenderer,
757 SIP_NULLPTR,
758 SIP_NULLPTR,
759 SIP_NULLPTR,
760 release_wxDataViewSpinRenderer,
761 cast_wxDataViewSpinRenderer,
762 SIP_NULLPTR,
763 SIP_NULLPTR,
764 SIP_NULLPTR,
765 SIP_NULLPTR,
766 SIP_NULLPTR,
767 SIP_NULLPTR
768 };
769