]> git.saurik.com Git - wxWidgets.git/blob - wxPython/contrib/glcanvas/msw/glcanvas.cpp
fix text scrolling in GTK2 (patch 703988)
[wxWidgets.git] / wxPython / contrib / glcanvas / msw / glcanvas.cpp
1 /*
2 * FILE : contrib/glcanvas/msw/glcanvas.cpp
3 *
4 * This file was automatically generated by :
5 * Simplified Wrapper and Interface Generator (SWIG)
6 * Version 1.1 (Build 883)
7 *
8 * Portions Copyright (c) 1995-1998
9 * The University of Utah and The Regents of the University of California.
10 * Permission is granted to distribute this file in any manner provided
11 * this notice remains intact.
12 *
13 * Do not make changes to this file--changes will be lost!
14 *
15 */
16
17
18 #define SWIGCODE
19 /* Implementation : PYTHON */
20
21 #define SWIGPYTHON
22 #include "Python.h"
23
24 #include <string.h>
25 #include <stdlib.h>
26 /* Definitions for Windows/Unix exporting */
27 #if defined(__WIN32__)
28 # if defined(_MSC_VER)
29 # define SWIGEXPORT(a) __declspec(dllexport) a
30 # else
31 # if defined(__BORLANDC__)
32 # define SWIGEXPORT(a) a _export
33 # else
34 # define SWIGEXPORT(a) a
35 # endif
36 # endif
37 #else
38 # define SWIGEXPORT(a) a
39 #endif
40
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 extern void SWIG_MakePtr(char *, void *, char *);
45 extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
46 extern char *SWIG_GetPtr(char *, void **, char *);
47 extern char *SWIG_GetPtrObj(PyObject *, void **, char *);
48 extern void SWIG_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *));
49 extern PyObject *SWIG_newvarlink(void);
50 #ifdef __cplusplus
51 }
52 #endif
53 #define SWIG_init initglcanvasc
54
55 #define SWIG_name "glcanvasc"
56
57 #include "wxPython.h"
58
59 #ifdef __WXMAC__ // avoid a bug in Carbon headers
60 #define scalb scalbn
61 #endif
62
63 #ifdef __WXMSW__
64 #include "myglcanvas.h"
65 #else
66 #include <wx/glcanvas.h>
67 #endif
68
69
70
71 static PyObject* t_output_helper(PyObject* target, PyObject* o) {
72 PyObject* o2;
73 PyObject* o3;
74
75 if (!target) {
76 target = o;
77 } else if (target == Py_None) {
78 Py_DECREF(Py_None);
79 target = o;
80 } else {
81 if (!PyTuple_Check(target)) {
82 o2 = target;
83 target = PyTuple_New(1);
84 PyTuple_SetItem(target, 0, o2);
85 }
86 o3 = PyTuple_New(1);
87 PyTuple_SetItem(o3, 0, o);
88
89 o2 = target;
90 target = PySequence_Concat(o2, o3);
91 Py_DECREF(o2);
92 Py_DECREF(o3);
93 }
94 return target;
95 }
96
97 // Put some wx default wxChar* values into wxStrings.
98 static const wxString wxPyGLCanvasNameStr(wxT("GLCanvas"));
99 static const wxString wxPyEmptyString(wxT(""));
100 #ifdef __cplusplus
101 extern "C" {
102 #endif
103 static void *SwigwxGLContextTowxObject(void *ptr) {
104 wxGLContext *src;
105 wxObject *dest;
106 src = (wxGLContext *) ptr;
107 dest = (wxObject *) src;
108 return (void *) dest;
109 }
110
111 #define new_wxGLContext(_swigarg0,_swigarg1,_swigarg2) (new wxGLContext(_swigarg0,_swigarg1,_swigarg2))
112 static PyObject *_wrap_new_wxGLContext(PyObject *self, PyObject *args, PyObject *kwargs) {
113 PyObject * _resultobj;
114 wxGLContext * _result;
115 bool _arg0;
116 wxGLCanvas * _arg1;
117 wxPalette * _arg2 = (wxPalette *) &wxNullPalette;
118 int tempbool0;
119 PyObject * _argo1 = 0;
120 PyObject * _argo2 = 0;
121 char *_kwnames[] = { "isRGB","win","palette", NULL };
122 char _ptemp[128];
123
124 self = self;
125 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"iO|O:new_wxGLContext",_kwnames,&tempbool0,&_argo1,&_argo2))
126 return NULL;
127 _arg0 = (bool ) tempbool0;
128 if (_argo1) {
129 if (_argo1 == Py_None) { _arg1 = NULL; }
130 else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxGLCanvas_p")) {
131 PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of new_wxGLContext. Expected _wxGLCanvas_p.");
132 return NULL;
133 }
134 }
135 if (_argo2) {
136 if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxPalette_p")) {
137 PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of new_wxGLContext. Expected _wxPalette_p.");
138 return NULL;
139 }
140 }
141 {
142 PyThreadState* __tstate = wxPyBeginAllowThreads();
143 _result = (wxGLContext *)new_wxGLContext(_arg0,_arg1,*_arg2);
144
145 wxPyEndAllowThreads(__tstate);
146 if (PyErr_Occurred()) return NULL;
147 } if (_result) {
148 SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLContext_p");
149 _resultobj = Py_BuildValue("s",_ptemp);
150 } else {
151 Py_INCREF(Py_None);
152 _resultobj = Py_None;
153 }
154 return _resultobj;
155 }
156
157 #define delete_wxGLContext(_swigobj) (delete _swigobj)
158 static PyObject *_wrap_delete_wxGLContext(PyObject *self, PyObject *args, PyObject *kwargs) {
159 PyObject * _resultobj;
160 wxGLContext * _arg0;
161 PyObject * _argo0 = 0;
162 char *_kwnames[] = { "self", NULL };
163
164 self = self;
165 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxGLContext",_kwnames,&_argo0))
166 return NULL;
167 if (_argo0) {
168 if (_argo0 == Py_None) { _arg0 = NULL; }
169 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
170 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxGLContext. Expected _wxGLContext_p.");
171 return NULL;
172 }
173 }
174 {
175 PyThreadState* __tstate = wxPyBeginAllowThreads();
176 delete_wxGLContext(_arg0);
177
178 wxPyEndAllowThreads(__tstate);
179 if (PyErr_Occurred()) return NULL;
180 } Py_INCREF(Py_None);
181 _resultobj = Py_None;
182 return _resultobj;
183 }
184
185 #define wxGLContext_SetCurrent(_swigobj) (_swigobj->SetCurrent())
186 static PyObject *_wrap_wxGLContext_SetCurrent(PyObject *self, PyObject *args, PyObject *kwargs) {
187 PyObject * _resultobj;
188 wxGLContext * _arg0;
189 PyObject * _argo0 = 0;
190 char *_kwnames[] = { "self", NULL };
191
192 self = self;
193 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_SetCurrent",_kwnames,&_argo0))
194 return NULL;
195 if (_argo0) {
196 if (_argo0 == Py_None) { _arg0 = NULL; }
197 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
198 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SetCurrent. Expected _wxGLContext_p.");
199 return NULL;
200 }
201 }
202 {
203 PyThreadState* __tstate = wxPyBeginAllowThreads();
204 wxGLContext_SetCurrent(_arg0);
205
206 wxPyEndAllowThreads(__tstate);
207 if (PyErr_Occurred()) return NULL;
208 } Py_INCREF(Py_None);
209 _resultobj = Py_None;
210 return _resultobj;
211 }
212
213 #define wxGLContext_SetColour(_swigobj,_swigarg0) (_swigobj->SetColour(_swigarg0))
214 static PyObject *_wrap_wxGLContext_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) {
215 PyObject * _resultobj;
216 wxGLContext * _arg0;
217 wxString * _arg1;
218 PyObject * _argo0 = 0;
219 PyObject * _obj1 = 0;
220 char *_kwnames[] = { "self","colour", NULL };
221
222 self = self;
223 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLContext_SetColour",_kwnames,&_argo0,&_obj1))
224 return NULL;
225 if (_argo0) {
226 if (_argo0 == Py_None) { _arg0 = NULL; }
227 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
228 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SetColour. Expected _wxGLContext_p.");
229 return NULL;
230 }
231 }
232 {
233 _arg1 = wxString_in_helper(_obj1);
234 if (_arg1 == NULL)
235 return NULL;
236 }
237 {
238 PyThreadState* __tstate = wxPyBeginAllowThreads();
239 wxGLContext_SetColour(_arg0,*_arg1);
240
241 wxPyEndAllowThreads(__tstate);
242 if (PyErr_Occurred()) return NULL;
243 } Py_INCREF(Py_None);
244 _resultobj = Py_None;
245 {
246 if (_obj1)
247 delete _arg1;
248 }
249 return _resultobj;
250 }
251
252 #define wxGLContext_SwapBuffers(_swigobj) (_swigobj->SwapBuffers())
253 static PyObject *_wrap_wxGLContext_SwapBuffers(PyObject *self, PyObject *args, PyObject *kwargs) {
254 PyObject * _resultobj;
255 wxGLContext * _arg0;
256 PyObject * _argo0 = 0;
257 char *_kwnames[] = { "self", NULL };
258
259 self = self;
260 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_SwapBuffers",_kwnames,&_argo0))
261 return NULL;
262 if (_argo0) {
263 if (_argo0 == Py_None) { _arg0 = NULL; }
264 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
265 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SwapBuffers. Expected _wxGLContext_p.");
266 return NULL;
267 }
268 }
269 {
270 PyThreadState* __tstate = wxPyBeginAllowThreads();
271 wxGLContext_SwapBuffers(_arg0);
272
273 wxPyEndAllowThreads(__tstate);
274 if (PyErr_Occurred()) return NULL;
275 } Py_INCREF(Py_None);
276 _resultobj = Py_None;
277 return _resultobj;
278 }
279
280 #define wxGLContext_GetWindow(_swigobj) (_swigobj->GetWindow())
281 static PyObject *_wrap_wxGLContext_GetWindow(PyObject *self, PyObject *args, PyObject *kwargs) {
282 PyObject * _resultobj;
283 wxWindow * _result;
284 wxGLContext * _arg0;
285 PyObject * _argo0 = 0;
286 char *_kwnames[] = { "self", NULL };
287
288 self = self;
289 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_GetWindow",_kwnames,&_argo0))
290 return NULL;
291 if (_argo0) {
292 if (_argo0 == Py_None) { _arg0 = NULL; }
293 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
294 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_GetWindow. Expected _wxGLContext_p.");
295 return NULL;
296 }
297 }
298 {
299 PyThreadState* __tstate = wxPyBeginAllowThreads();
300 _result = (wxWindow *)wxGLContext_GetWindow(_arg0);
301
302 wxPyEndAllowThreads(__tstate);
303 if (PyErr_Occurred()) return NULL;
304 }{ _resultobj = wxPyMake_wxObject(_result); }
305 return _resultobj;
306 }
307
308 static void *SwigwxGLCanvasTowxWindow(void *ptr) {
309 wxGLCanvas *src;
310 wxWindow *dest;
311 src = (wxGLCanvas *) ptr;
312 dest = (wxWindow *) src;
313 return (void *) dest;
314 }
315
316 static void *SwigwxGLCanvasTowxEvtHandler(void *ptr) {
317 wxGLCanvas *src;
318 wxEvtHandler *dest;
319 src = (wxGLCanvas *) ptr;
320 dest = (wxEvtHandler *) src;
321 return (void *) dest;
322 }
323
324 static void *SwigwxGLCanvasTowxObject(void *ptr) {
325 wxGLCanvas *src;
326 wxObject *dest;
327 src = (wxGLCanvas *) ptr;
328 dest = (wxObject *) src;
329 return (void *) dest;
330 }
331
332 #define new_wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7) (new wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7))
333 static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject *kwargs) {
334 PyObject * _resultobj;
335 wxGLCanvas * _result;
336 wxWindow * _arg0;
337 wxWindowID _arg1 = (wxWindowID ) -1;
338 wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition;
339 wxSize * _arg3 = (wxSize *) &wxDefaultSize;
340 long _arg4 = (long ) 0;
341 wxString * _arg5 = (wxString *) &wxPyGLCanvasNameStr;
342 int * _arg6 = (int *) NULL;
343 wxPalette * _arg7 = (wxPalette *) &wxNullPalette;
344 PyObject * _argo0 = 0;
345 wxPoint temp;
346 PyObject * _obj2 = 0;
347 wxSize temp0;
348 PyObject * _obj3 = 0;
349 PyObject * _obj5 = 0;
350 int * temp1;
351 PyObject * _obj6 = 0;
352 PyObject * _argo7 = 0;
353 char *_kwnames[] = { "parent","id","pos","size","style","name","attribList","palette", NULL };
354 char _ptemp[128];
355
356 self = self;
357 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlOOO:new_wxGLCanvas",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5,&_obj6,&_argo7))
358 return NULL;
359 if (_argo0) {
360 if (_argo0 == Py_None) { _arg0 = NULL; }
361 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
362 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxGLCanvas. Expected _wxWindow_p.");
363 return NULL;
364 }
365 }
366 if (_obj2)
367 {
368 _arg2 = &temp;
369 if (! wxPoint_helper(_obj2, &_arg2))
370 return NULL;
371 }
372 if (_obj3)
373 {
374 _arg3 = &temp0;
375 if (! wxSize_helper(_obj3, &_arg3))
376 return NULL;
377 }
378 if (_obj5)
379 {
380 _arg5 = wxString_in_helper(_obj5);
381 if (_arg5 == NULL)
382 return NULL;
383 }
384 if (_obj6)
385 {
386 int i;
387 if (PySequence_Check(_obj6)) {
388 int size = PyObject_Length(_obj6);
389 temp1 = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
390 for (i = 0; i < size; i++) {
391 temp1[i] = PyInt_AsLong(PySequence_GetItem(_obj6, i));
392 }
393 temp1[size] = 0;
394 _arg6 = temp1;
395 }
396 }
397 if (_argo7) {
398 if (SWIG_GetPtrObj(_argo7,(void **) &_arg7,"_wxPalette_p")) {
399 PyErr_SetString(PyExc_TypeError,"Type error in argument 8 of new_wxGLCanvas. Expected _wxPalette_p.");
400 return NULL;
401 }
402 }
403 {
404 PyThreadState* __tstate = wxPyBeginAllowThreads();
405 _result = (wxGLCanvas *)new_wxGLCanvas(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,_arg6,*_arg7);
406
407 wxPyEndAllowThreads(__tstate);
408 if (PyErr_Occurred()) return NULL;
409 } if (_result) {
410 SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
411 _resultobj = Py_BuildValue("s",_ptemp);
412 } else {
413 Py_INCREF(Py_None);
414 _resultobj = Py_None;
415 }
416 {
417 if (_obj5)
418 delete _arg5;
419 }
420 {
421 delete [] _arg6;
422 }
423 return _resultobj;
424 }
425
426 #define new_wxGLCanvasWithContext(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7,_swigarg8) (new wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7,_swigarg8))
427 static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args, PyObject *kwargs) {
428 PyObject * _resultobj;
429 wxGLCanvas * _result;
430 wxWindow * _arg0;
431 wxGLContext * _arg1 = (wxGLContext *) NULL;
432 wxWindowID _arg2 = (wxWindowID ) -1;
433 wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition;
434 wxSize * _arg4 = (wxSize *) &wxDefaultSize;
435 long _arg5 = (long ) 0;
436 wxString * _arg6 = (wxString *) &wxPyGLCanvasNameStr;
437 int * _arg7 = (int *) NULL;
438 wxPalette * _arg8 = (wxPalette *) &wxNullPalette;
439 PyObject * _argo0 = 0;
440 PyObject * _argo1 = 0;
441 wxPoint temp;
442 PyObject * _obj3 = 0;
443 wxSize temp0;
444 PyObject * _obj4 = 0;
445 PyObject * _obj6 = 0;
446 int * temp1;
447 PyObject * _obj7 = 0;
448 PyObject * _argo8 = 0;
449 char *_kwnames[] = { "parent","shared","id","pos","size","style","name","attribList","palette", NULL };
450 char _ptemp[128];
451
452 self = self;
453 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OiOOlOOO:new_wxGLCanvasWithContext",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6,&_obj7,&_argo8))
454 return NULL;
455 if (_argo0) {
456 if (_argo0 == Py_None) { _arg0 = NULL; }
457 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
458 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxGLCanvasWithContext. Expected _wxWindow_p.");
459 return NULL;
460 }
461 }
462 if (_argo1) {
463 if (_argo1 == Py_None) { _arg1 = NULL; }
464 else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxGLContext_p")) {
465 PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of new_wxGLCanvasWithContext. Expected _wxGLContext_p.");
466 return NULL;
467 }
468 }
469 if (_obj3)
470 {
471 _arg3 = &temp;
472 if (! wxPoint_helper(_obj3, &_arg3))
473 return NULL;
474 }
475 if (_obj4)
476 {
477 _arg4 = &temp0;
478 if (! wxSize_helper(_obj4, &_arg4))
479 return NULL;
480 }
481 if (_obj6)
482 {
483 _arg6 = wxString_in_helper(_obj6);
484 if (_arg6 == NULL)
485 return NULL;
486 }
487 if (_obj7)
488 {
489 int i;
490 if (PySequence_Check(_obj7)) {
491 int size = PyObject_Length(_obj7);
492 temp1 = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
493 for (i = 0; i < size; i++) {
494 temp1[i] = PyInt_AsLong(PySequence_GetItem(_obj7, i));
495 }
496 temp1[size] = 0;
497 _arg7 = temp1;
498 }
499 }
500 if (_argo8) {
501 if (SWIG_GetPtrObj(_argo8,(void **) &_arg8,"_wxPalette_p")) {
502 PyErr_SetString(PyExc_TypeError,"Type error in argument 9 of new_wxGLCanvasWithContext. Expected _wxPalette_p.");
503 return NULL;
504 }
505 }
506 {
507 PyThreadState* __tstate = wxPyBeginAllowThreads();
508 _result = (wxGLCanvas *)new_wxGLCanvasWithContext(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7,*_arg8);
509
510 wxPyEndAllowThreads(__tstate);
511 if (PyErr_Occurred()) return NULL;
512 } if (_result) {
513 SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
514 _resultobj = Py_BuildValue("s",_ptemp);
515 } else {
516 Py_INCREF(Py_None);
517 _resultobj = Py_None;
518 }
519 {
520 if (_obj6)
521 delete _arg6;
522 }
523 {
524 delete [] _arg7;
525 }
526 return _resultobj;
527 }
528
529 #define wxGLCanvas_SetCurrent(_swigobj) (_swigobj->SetCurrent())
530 static PyObject *_wrap_wxGLCanvas_SetCurrent(PyObject *self, PyObject *args, PyObject *kwargs) {
531 PyObject * _resultobj;
532 wxGLCanvas * _arg0;
533 PyObject * _argo0 = 0;
534 char *_kwnames[] = { "self", NULL };
535
536 self = self;
537 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_SetCurrent",_kwnames,&_argo0))
538 return NULL;
539 if (_argo0) {
540 if (_argo0 == Py_None) { _arg0 = NULL; }
541 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
542 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SetCurrent. Expected _wxGLCanvas_p.");
543 return NULL;
544 }
545 }
546 {
547 PyThreadState* __tstate = wxPyBeginAllowThreads();
548 wxGLCanvas_SetCurrent(_arg0);
549
550 wxPyEndAllowThreads(__tstate);
551 if (PyErr_Occurred()) return NULL;
552 } Py_INCREF(Py_None);
553 _resultobj = Py_None;
554 return _resultobj;
555 }
556
557 #define wxGLCanvas_SetColour(_swigobj,_swigarg0) (_swigobj->SetColour(_swigarg0))
558 static PyObject *_wrap_wxGLCanvas_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) {
559 PyObject * _resultobj;
560 wxGLCanvas * _arg0;
561 wxString * _arg1;
562 PyObject * _argo0 = 0;
563 PyObject * _obj1 = 0;
564 char *_kwnames[] = { "self","colour", NULL };
565
566 self = self;
567 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLCanvas_SetColour",_kwnames,&_argo0,&_obj1))
568 return NULL;
569 if (_argo0) {
570 if (_argo0 == Py_None) { _arg0 = NULL; }
571 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
572 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SetColour. Expected _wxGLCanvas_p.");
573 return NULL;
574 }
575 }
576 {
577 _arg1 = wxString_in_helper(_obj1);
578 if (_arg1 == NULL)
579 return NULL;
580 }
581 {
582 PyThreadState* __tstate = wxPyBeginAllowThreads();
583 wxGLCanvas_SetColour(_arg0,*_arg1);
584
585 wxPyEndAllowThreads(__tstate);
586 if (PyErr_Occurred()) return NULL;
587 } Py_INCREF(Py_None);
588 _resultobj = Py_None;
589 {
590 if (_obj1)
591 delete _arg1;
592 }
593 return _resultobj;
594 }
595
596 #define wxGLCanvas_SwapBuffers(_swigobj) (_swigobj->SwapBuffers())
597 static PyObject *_wrap_wxGLCanvas_SwapBuffers(PyObject *self, PyObject *args, PyObject *kwargs) {
598 PyObject * _resultobj;
599 wxGLCanvas * _arg0;
600 PyObject * _argo0 = 0;
601 char *_kwnames[] = { "self", NULL };
602
603 self = self;
604 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_SwapBuffers",_kwnames,&_argo0))
605 return NULL;
606 if (_argo0) {
607 if (_argo0 == Py_None) { _arg0 = NULL; }
608 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
609 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SwapBuffers. Expected _wxGLCanvas_p.");
610 return NULL;
611 }
612 }
613 {
614 PyThreadState* __tstate = wxPyBeginAllowThreads();
615 wxGLCanvas_SwapBuffers(_arg0);
616
617 wxPyEndAllowThreads(__tstate);
618 if (PyErr_Occurred()) return NULL;
619 } Py_INCREF(Py_None);
620 _resultobj = Py_None;
621 return _resultobj;
622 }
623
624 #define wxGLCanvas_GetContext(_swigobj) (_swigobj->GetContext())
625 static PyObject *_wrap_wxGLCanvas_GetContext(PyObject *self, PyObject *args, PyObject *kwargs) {
626 PyObject * _resultobj;
627 wxGLContext * _result;
628 wxGLCanvas * _arg0;
629 PyObject * _argo0 = 0;
630 char *_kwnames[] = { "self", NULL };
631 char _ptemp[128];
632
633 self = self;
634 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_GetContext",_kwnames,&_argo0))
635 return NULL;
636 if (_argo0) {
637 if (_argo0 == Py_None) { _arg0 = NULL; }
638 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
639 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_GetContext. Expected _wxGLCanvas_p.");
640 return NULL;
641 }
642 }
643 {
644 PyThreadState* __tstate = wxPyBeginAllowThreads();
645 _result = (wxGLContext *)wxGLCanvas_GetContext(_arg0);
646
647 wxPyEndAllowThreads(__tstate);
648 if (PyErr_Occurred()) return NULL;
649 } if (_result) {
650 SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLContext_p");
651 _resultobj = Py_BuildValue("s",_ptemp);
652 } else {
653 Py_INCREF(Py_None);
654 _resultobj = Py_None;
655 }
656 return _resultobj;
657 }
658
659 #define wxGLCanvas_SetupPixelFormat(_swigobj,_swigarg0) (_swigobj->SetupPixelFormat(_swigarg0))
660 static PyObject *_wrap_wxGLCanvas_SetupPixelFormat(PyObject *self, PyObject *args, PyObject *kwargs) {
661 PyObject * _resultobj;
662 wxGLCanvas * _arg0;
663 int * _arg1 = (int *) NULL;
664 PyObject * _argo0 = 0;
665 int * temp;
666 PyObject * _obj1 = 0;
667 char *_kwnames[] = { "self","attribList", NULL };
668
669 self = self;
670 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:wxGLCanvas_SetupPixelFormat",_kwnames,&_argo0,&_obj1))
671 return NULL;
672 if (_argo0) {
673 if (_argo0 == Py_None) { _arg0 = NULL; }
674 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
675 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SetupPixelFormat. Expected _wxGLCanvas_p.");
676 return NULL;
677 }
678 }
679 if (_obj1)
680 {
681 int i;
682 if (PySequence_Check(_obj1)) {
683 int size = PyObject_Length(_obj1);
684 temp = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
685 for (i = 0; i < size; i++) {
686 temp[i] = PyInt_AsLong(PySequence_GetItem(_obj1, i));
687 }
688 temp[size] = 0;
689 _arg1 = temp;
690 }
691 }
692 {
693 PyThreadState* __tstate = wxPyBeginAllowThreads();
694 wxGLCanvas_SetupPixelFormat(_arg0,_arg1);
695
696 wxPyEndAllowThreads(__tstate);
697 if (PyErr_Occurred()) return NULL;
698 } Py_INCREF(Py_None);
699 _resultobj = Py_None;
700 {
701 delete [] _arg1;
702 }
703 return _resultobj;
704 }
705
706 #define wxGLCanvas_SetupPalette(_swigobj,_swigarg0) (_swigobj->SetupPalette(_swigarg0))
707 static PyObject *_wrap_wxGLCanvas_SetupPalette(PyObject *self, PyObject *args, PyObject *kwargs) {
708 PyObject * _resultobj;
709 wxGLCanvas * _arg0;
710 wxPalette * _arg1;
711 PyObject * _argo0 = 0;
712 PyObject * _argo1 = 0;
713 char *_kwnames[] = { "self","palette", NULL };
714
715 self = self;
716 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLCanvas_SetupPalette",_kwnames,&_argo0,&_argo1))
717 return NULL;
718 if (_argo0) {
719 if (_argo0 == Py_None) { _arg0 = NULL; }
720 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
721 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SetupPalette. Expected _wxGLCanvas_p.");
722 return NULL;
723 }
724 }
725 if (_argo1) {
726 if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPalette_p")) {
727 PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxGLCanvas_SetupPalette. Expected _wxPalette_p.");
728 return NULL;
729 }
730 }
731 {
732 PyThreadState* __tstate = wxPyBeginAllowThreads();
733 wxGLCanvas_SetupPalette(_arg0,*_arg1);
734
735 wxPyEndAllowThreads(__tstate);
736 if (PyErr_Occurred()) return NULL;
737 } Py_INCREF(Py_None);
738 _resultobj = Py_None;
739 return _resultobj;
740 }
741
742 #define wxGLCanvas_CreateDefaultPalette(_swigobj) (_swigobj->CreateDefaultPalette())
743 static PyObject *_wrap_wxGLCanvas_CreateDefaultPalette(PyObject *self, PyObject *args, PyObject *kwargs) {
744 PyObject * _resultobj;
745 wxPalette * _result;
746 wxGLCanvas * _arg0;
747 PyObject * _argo0 = 0;
748 char *_kwnames[] = { "self", NULL };
749 char _ptemp[128];
750
751 self = self;
752 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_CreateDefaultPalette",_kwnames,&_argo0))
753 return NULL;
754 if (_argo0) {
755 if (_argo0 == Py_None) { _arg0 = NULL; }
756 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
757 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_CreateDefaultPalette. Expected _wxGLCanvas_p.");
758 return NULL;
759 }
760 }
761 {
762 PyThreadState* __tstate = wxPyBeginAllowThreads();
763 _result = new wxPalette (wxGLCanvas_CreateDefaultPalette(_arg0));
764
765 wxPyEndAllowThreads(__tstate);
766 if (PyErr_Occurred()) return NULL;
767 } SWIG_MakePtr(_ptemp, (void *) _result,"_wxPalette_p");
768 _resultobj = Py_BuildValue("s",_ptemp);
769 return _resultobj;
770 }
771
772 #define wxGLCanvas_GetPalette(_swigobj) (_swigobj->GetPalette())
773 static PyObject *_wrap_wxGLCanvas_GetPalette(PyObject *self, PyObject *args, PyObject *kwargs) {
774 PyObject * _resultobj;
775 wxPalette * _result;
776 wxGLCanvas * _arg0;
777 PyObject * _argo0 = 0;
778 char *_kwnames[] = { "self", NULL };
779 char _ptemp[128];
780
781 self = self;
782 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_GetPalette",_kwnames,&_argo0))
783 return NULL;
784 if (_argo0) {
785 if (_argo0 == Py_None) { _arg0 = NULL; }
786 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
787 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_GetPalette. Expected _wxGLCanvas_p.");
788 return NULL;
789 }
790 }
791 {
792 PyThreadState* __tstate = wxPyBeginAllowThreads();
793 _result = (wxPalette *)wxGLCanvas_GetPalette(_arg0);
794
795 wxPyEndAllowThreads(__tstate);
796 if (PyErr_Occurred()) return NULL;
797 } if (_result) {
798 SWIG_MakePtr(_ptemp, (char *) _result,"_wxPalette_p");
799 _resultobj = Py_BuildValue("s",_ptemp);
800 } else {
801 Py_INCREF(Py_None);
802 _resultobj = Py_None;
803 }
804 return _resultobj;
805 }
806
807 static PyMethodDef glcanvascMethods[] = {
808 { "wxGLCanvas_GetPalette", (PyCFunction) _wrap_wxGLCanvas_GetPalette, METH_VARARGS | METH_KEYWORDS },
809 { "wxGLCanvas_CreateDefaultPalette", (PyCFunction) _wrap_wxGLCanvas_CreateDefaultPalette, METH_VARARGS | METH_KEYWORDS },
810 { "wxGLCanvas_SetupPalette", (PyCFunction) _wrap_wxGLCanvas_SetupPalette, METH_VARARGS | METH_KEYWORDS },
811 { "wxGLCanvas_SetupPixelFormat", (PyCFunction) _wrap_wxGLCanvas_SetupPixelFormat, METH_VARARGS | METH_KEYWORDS },
812 { "wxGLCanvas_GetContext", (PyCFunction) _wrap_wxGLCanvas_GetContext, METH_VARARGS | METH_KEYWORDS },
813 { "wxGLCanvas_SwapBuffers", (PyCFunction) _wrap_wxGLCanvas_SwapBuffers, METH_VARARGS | METH_KEYWORDS },
814 { "wxGLCanvas_SetColour", (PyCFunction) _wrap_wxGLCanvas_SetColour, METH_VARARGS | METH_KEYWORDS },
815 { "wxGLCanvas_SetCurrent", (PyCFunction) _wrap_wxGLCanvas_SetCurrent, METH_VARARGS | METH_KEYWORDS },
816 { "new_wxGLCanvasWithContext", (PyCFunction) _wrap_new_wxGLCanvasWithContext, METH_VARARGS | METH_KEYWORDS },
817 { "new_wxGLCanvas", (PyCFunction) _wrap_new_wxGLCanvas, METH_VARARGS | METH_KEYWORDS },
818 { "wxGLContext_GetWindow", (PyCFunction) _wrap_wxGLContext_GetWindow, METH_VARARGS | METH_KEYWORDS },
819 { "wxGLContext_SwapBuffers", (PyCFunction) _wrap_wxGLContext_SwapBuffers, METH_VARARGS | METH_KEYWORDS },
820 { "wxGLContext_SetColour", (PyCFunction) _wrap_wxGLContext_SetColour, METH_VARARGS | METH_KEYWORDS },
821 { "wxGLContext_SetCurrent", (PyCFunction) _wrap_wxGLContext_SetCurrent, METH_VARARGS | METH_KEYWORDS },
822 { "delete_wxGLContext", (PyCFunction) _wrap_delete_wxGLContext, METH_VARARGS | METH_KEYWORDS },
823 { "new_wxGLContext", (PyCFunction) _wrap_new_wxGLContext, METH_VARARGS | METH_KEYWORDS },
824 { NULL, NULL }
825 };
826 #ifdef __cplusplus
827 }
828 #endif
829 /*
830 * This table is used by the pointer type-checker
831 */
832 static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
833 { "_signed_long","_long",0},
834 { "_wxPrintQuality","_wxCoord",0},
835 { "_wxPrintQuality","_int",0},
836 { "_wxPrintQuality","_signed_int",0},
837 { "_wxPrintQuality","_unsigned_int",0},
838 { "_wxPrintQuality","_wxWindowID",0},
839 { "_wxPrintQuality","_uint",0},
840 { "_wxPrintQuality","_EBool",0},
841 { "_wxPrintQuality","_size_t",0},
842 { "_wxPrintQuality","_time_t",0},
843 { "_byte","_unsigned_char",0},
844 { "_long","_unsigned_long",0},
845 { "_long","_signed_long",0},
846 { "_size_t","_wxCoord",0},
847 { "_size_t","_wxPrintQuality",0},
848 { "_size_t","_time_t",0},
849 { "_size_t","_unsigned_int",0},
850 { "_size_t","_int",0},
851 { "_size_t","_wxWindowID",0},
852 { "_size_t","_uint",0},
853 { "_uint","_wxCoord",0},
854 { "_uint","_wxPrintQuality",0},
855 { "_uint","_time_t",0},
856 { "_uint","_size_t",0},
857 { "_uint","_unsigned_int",0},
858 { "_uint","_int",0},
859 { "_uint","_wxWindowID",0},
860 { "_wxChar","_char",0},
861 { "_char","_wxChar",0},
862 { "_struct_wxNativeFontInfo","_wxNativeFontInfo",0},
863 { "_EBool","_wxCoord",0},
864 { "_EBool","_wxPrintQuality",0},
865 { "_EBool","_signed_int",0},
866 { "_EBool","_int",0},
867 { "_EBool","_wxWindowID",0},
868 { "_unsigned_long","_long",0},
869 { "_wxNativeFontInfo","_struct_wxNativeFontInfo",0},
870 { "_signed_int","_wxCoord",0},
871 { "_signed_int","_wxPrintQuality",0},
872 { "_signed_int","_EBool",0},
873 { "_signed_int","_wxWindowID",0},
874 { "_signed_int","_int",0},
875 { "_WXTYPE","_wxDateTime_t",0},
876 { "_WXTYPE","_short",0},
877 { "_WXTYPE","_signed_short",0},
878 { "_WXTYPE","_unsigned_short",0},
879 { "_unsigned_short","_wxDateTime_t",0},
880 { "_unsigned_short","_WXTYPE",0},
881 { "_unsigned_short","_short",0},
882 { "_wxObject","_wxGLCanvas",SwigwxGLCanvasTowxObject},
883 { "_wxObject","_wxGLContext",SwigwxGLContextTowxObject},
884 { "_signed_short","_WXTYPE",0},
885 { "_signed_short","_short",0},
886 { "_unsigned_char","_byte",0},
887 { "_unsigned_int","_wxCoord",0},
888 { "_unsigned_int","_wxPrintQuality",0},
889 { "_unsigned_int","_time_t",0},
890 { "_unsigned_int","_size_t",0},
891 { "_unsigned_int","_uint",0},
892 { "_unsigned_int","_wxWindowID",0},
893 { "_unsigned_int","_int",0},
894 { "_short","_wxDateTime_t",0},
895 { "_short","_WXTYPE",0},
896 { "_short","_unsigned_short",0},
897 { "_short","_signed_short",0},
898 { "_wxWindowID","_wxCoord",0},
899 { "_wxWindowID","_wxPrintQuality",0},
900 { "_wxWindowID","_time_t",0},
901 { "_wxWindowID","_size_t",0},
902 { "_wxWindowID","_EBool",0},
903 { "_wxWindowID","_uint",0},
904 { "_wxWindowID","_int",0},
905 { "_wxWindowID","_signed_int",0},
906 { "_wxWindowID","_unsigned_int",0},
907 { "_int","_wxCoord",0},
908 { "_int","_wxPrintQuality",0},
909 { "_int","_time_t",0},
910 { "_int","_size_t",0},
911 { "_int","_EBool",0},
912 { "_int","_uint",0},
913 { "_int","_wxWindowID",0},
914 { "_int","_unsigned_int",0},
915 { "_int","_signed_int",0},
916 { "_wxDateTime_t","_unsigned_short",0},
917 { "_wxDateTime_t","_short",0},
918 { "_wxDateTime_t","_WXTYPE",0},
919 { "_time_t","_wxCoord",0},
920 { "_time_t","_wxPrintQuality",0},
921 { "_time_t","_unsigned_int",0},
922 { "_time_t","_int",0},
923 { "_time_t","_wxWindowID",0},
924 { "_time_t","_uint",0},
925 { "_time_t","_size_t",0},
926 { "_wxCoord","_int",0},
927 { "_wxCoord","_signed_int",0},
928 { "_wxCoord","_unsigned_int",0},
929 { "_wxCoord","_wxWindowID",0},
930 { "_wxCoord","_uint",0},
931 { "_wxCoord","_EBool",0},
932 { "_wxCoord","_size_t",0},
933 { "_wxCoord","_time_t",0},
934 { "_wxCoord","_wxPrintQuality",0},
935 { "_wxEvtHandler","_wxGLCanvas",SwigwxGLCanvasTowxEvtHandler},
936 { "_wxWindow","_wxGLCanvas",SwigwxGLCanvasTowxWindow},
937 {0,0,0}};
938
939 static PyObject *SWIG_globals;
940 #ifdef __cplusplus
941 extern "C"
942 #endif
943 SWIGEXPORT(void) initglcanvasc() {
944 PyObject *m, *d;
945 SWIG_globals = SWIG_newvarlink();
946 m = Py_InitModule("glcanvasc", glcanvascMethods);
947 d = PyModule_GetDict(m);
948 PyDict_SetItemString(d,"WX_GL_RGBA", PyInt_FromLong((long) WX_GL_RGBA));
949 PyDict_SetItemString(d,"WX_GL_BUFFER_SIZE", PyInt_FromLong((long) WX_GL_BUFFER_SIZE));
950 PyDict_SetItemString(d,"WX_GL_LEVEL", PyInt_FromLong((long) WX_GL_LEVEL));
951 PyDict_SetItemString(d,"WX_GL_DOUBLEBUFFER", PyInt_FromLong((long) WX_GL_DOUBLEBUFFER));
952 PyDict_SetItemString(d,"WX_GL_STEREO", PyInt_FromLong((long) WX_GL_STEREO));
953 PyDict_SetItemString(d,"WX_GL_AUX_BUFFERS", PyInt_FromLong((long) WX_GL_AUX_BUFFERS));
954 PyDict_SetItemString(d,"WX_GL_MIN_RED", PyInt_FromLong((long) WX_GL_MIN_RED));
955 PyDict_SetItemString(d,"WX_GL_MIN_GREEN", PyInt_FromLong((long) WX_GL_MIN_GREEN));
956 PyDict_SetItemString(d,"WX_GL_MIN_BLUE", PyInt_FromLong((long) WX_GL_MIN_BLUE));
957 PyDict_SetItemString(d,"WX_GL_MIN_ALPHA", PyInt_FromLong((long) WX_GL_MIN_ALPHA));
958 PyDict_SetItemString(d,"WX_GL_DEPTH_SIZE", PyInt_FromLong((long) WX_GL_DEPTH_SIZE));
959 PyDict_SetItemString(d,"WX_GL_STENCIL_SIZE", PyInt_FromLong((long) WX_GL_STENCIL_SIZE));
960 PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_RED", PyInt_FromLong((long) WX_GL_MIN_ACCUM_RED));
961 PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_GREEN", PyInt_FromLong((long) WX_GL_MIN_ACCUM_GREEN));
962 PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_BLUE", PyInt_FromLong((long) WX_GL_MIN_ACCUM_BLUE));
963 PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_ALPHA", PyInt_FromLong((long) WX_GL_MIN_ACCUM_ALPHA));
964
965
966 {
967 int i;
968 for (i = 0; _swig_mapping[i].n1; i++)
969 SWIG_RegisterMapping(_swig_mapping[i].n1,_swig_mapping[i].n2,_swig_mapping[i].pcnv);
970 }
971 }