]> git.saurik.com Git - wxWidgets.git/blob - wxPython/contrib/glcanvas/mac/glcanvas.cpp
Work around a bug in the Carbon headers
[wxWidgets.git] / wxPython / contrib / glcanvas / mac / glcanvas.cpp
1 /*
2 * FILE : contrib/glcanvas/mac/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 delete_wxGLContext(_swigobj) (delete _swigobj)
112 static PyObject *_wrap_delete_wxGLContext(PyObject *self, PyObject *args, PyObject *kwargs) {
113 PyObject * _resultobj;
114 wxGLContext * _arg0;
115 PyObject * _argo0 = 0;
116 char *_kwnames[] = { "self", NULL };
117
118 self = self;
119 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxGLContext",_kwnames,&_argo0))
120 return NULL;
121 if (_argo0) {
122 if (_argo0 == Py_None) { _arg0 = NULL; }
123 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
124 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxGLContext. Expected _wxGLContext_p.");
125 return NULL;
126 }
127 }
128 {
129 PyThreadState* __tstate = wxPyBeginAllowThreads();
130 delete_wxGLContext(_arg0);
131
132 wxPyEndAllowThreads(__tstate);
133 if (PyErr_Occurred()) return NULL;
134 } Py_INCREF(Py_None);
135 _resultobj = Py_None;
136 return _resultobj;
137 }
138
139 #define wxGLContext_SetCurrent(_swigobj) (_swigobj->SetCurrent())
140 static PyObject *_wrap_wxGLContext_SetCurrent(PyObject *self, PyObject *args, PyObject *kwargs) {
141 PyObject * _resultobj;
142 wxGLContext * _arg0;
143 PyObject * _argo0 = 0;
144 char *_kwnames[] = { "self", NULL };
145
146 self = self;
147 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_SetCurrent",_kwnames,&_argo0))
148 return NULL;
149 if (_argo0) {
150 if (_argo0 == Py_None) { _arg0 = NULL; }
151 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
152 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SetCurrent. Expected _wxGLContext_p.");
153 return NULL;
154 }
155 }
156 {
157 PyThreadState* __tstate = wxPyBeginAllowThreads();
158 wxGLContext_SetCurrent(_arg0);
159
160 wxPyEndAllowThreads(__tstate);
161 if (PyErr_Occurred()) return NULL;
162 } Py_INCREF(Py_None);
163 _resultobj = Py_None;
164 return _resultobj;
165 }
166
167 #define wxGLContext_SetColour(_swigobj,_swigarg0) (_swigobj->SetColour(_swigarg0))
168 static PyObject *_wrap_wxGLContext_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) {
169 PyObject * _resultobj;
170 wxGLContext * _arg0;
171 wxString * _arg1;
172 PyObject * _argo0 = 0;
173 PyObject * _obj1 = 0;
174 char *_kwnames[] = { "self","colour", NULL };
175
176 self = self;
177 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLContext_SetColour",_kwnames,&_argo0,&_obj1))
178 return NULL;
179 if (_argo0) {
180 if (_argo0 == Py_None) { _arg0 = NULL; }
181 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
182 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SetColour. Expected _wxGLContext_p.");
183 return NULL;
184 }
185 }
186 {
187 _arg1 = wxString_in_helper(_obj1);
188 if (_arg1 == NULL)
189 return NULL;
190 }
191 {
192 PyThreadState* __tstate = wxPyBeginAllowThreads();
193 wxGLContext_SetColour(_arg0,*_arg1);
194
195 wxPyEndAllowThreads(__tstate);
196 if (PyErr_Occurred()) return NULL;
197 } Py_INCREF(Py_None);
198 _resultobj = Py_None;
199 {
200 if (_obj1)
201 delete _arg1;
202 }
203 return _resultobj;
204 }
205
206 #define wxGLContext_SwapBuffers(_swigobj) (_swigobj->SwapBuffers())
207 static PyObject *_wrap_wxGLContext_SwapBuffers(PyObject *self, PyObject *args, PyObject *kwargs) {
208 PyObject * _resultobj;
209 wxGLContext * _arg0;
210 PyObject * _argo0 = 0;
211 char *_kwnames[] = { "self", NULL };
212
213 self = self;
214 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_SwapBuffers",_kwnames,&_argo0))
215 return NULL;
216 if (_argo0) {
217 if (_argo0 == Py_None) { _arg0 = NULL; }
218 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
219 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_SwapBuffers. Expected _wxGLContext_p.");
220 return NULL;
221 }
222 }
223 {
224 PyThreadState* __tstate = wxPyBeginAllowThreads();
225 wxGLContext_SwapBuffers(_arg0);
226
227 wxPyEndAllowThreads(__tstate);
228 if (PyErr_Occurred()) return NULL;
229 } Py_INCREF(Py_None);
230 _resultobj = Py_None;
231 return _resultobj;
232 }
233
234 #define wxGLContext_GetWindow(_swigobj) (_swigobj->GetWindow())
235 static PyObject *_wrap_wxGLContext_GetWindow(PyObject *self, PyObject *args, PyObject *kwargs) {
236 PyObject * _resultobj;
237 wxWindow * _result;
238 wxGLContext * _arg0;
239 PyObject * _argo0 = 0;
240 char *_kwnames[] = { "self", NULL };
241
242 self = self;
243 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLContext_GetWindow",_kwnames,&_argo0))
244 return NULL;
245 if (_argo0) {
246 if (_argo0 == Py_None) { _arg0 = NULL; }
247 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLContext_p")) {
248 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLContext_GetWindow. Expected _wxGLContext_p.");
249 return NULL;
250 }
251 }
252 {
253 PyThreadState* __tstate = wxPyBeginAllowThreads();
254 _result = (wxWindow *)wxGLContext_GetWindow(_arg0);
255
256 wxPyEndAllowThreads(__tstate);
257 if (PyErr_Occurred()) return NULL;
258 }{ _resultobj = wxPyMake_wxObject(_result); }
259 return _resultobj;
260 }
261
262 static void *SwigwxGLCanvasTowxWindow(void *ptr) {
263 wxGLCanvas *src;
264 wxWindow *dest;
265 src = (wxGLCanvas *) ptr;
266 dest = (wxWindow *) src;
267 return (void *) dest;
268 }
269
270 static void *SwigwxGLCanvasTowxEvtHandler(void *ptr) {
271 wxGLCanvas *src;
272 wxEvtHandler *dest;
273 src = (wxGLCanvas *) ptr;
274 dest = (wxEvtHandler *) src;
275 return (void *) dest;
276 }
277
278 static void *SwigwxGLCanvasTowxObject(void *ptr) {
279 wxGLCanvas *src;
280 wxObject *dest;
281 src = (wxGLCanvas *) ptr;
282 dest = (wxObject *) src;
283 return (void *) dest;
284 }
285
286 #define new_wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7) (new wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7))
287 static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject *kwargs) {
288 PyObject * _resultobj;
289 wxGLCanvas * _result;
290 wxWindow * _arg0;
291 wxWindowID _arg1 = (wxWindowID ) -1;
292 wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition;
293 wxSize * _arg3 = (wxSize *) &wxDefaultSize;
294 long _arg4 = (long ) 0;
295 wxString * _arg5 = (wxString *) &wxPyGLCanvasNameStr;
296 int * _arg6 = (int *) NULL;
297 wxPalette * _arg7 = (wxPalette *) &wxNullPalette;
298 PyObject * _argo0 = 0;
299 wxPoint temp;
300 PyObject * _obj2 = 0;
301 wxSize temp0;
302 PyObject * _obj3 = 0;
303 PyObject * _obj5 = 0;
304 int * temp1;
305 PyObject * _obj6 = 0;
306 PyObject * _argo7 = 0;
307 char *_kwnames[] = { "parent","id","pos","size","style","name","attribList","palette", NULL };
308 char _ptemp[128];
309
310 self = self;
311 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlOOO:new_wxGLCanvas",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5,&_obj6,&_argo7))
312 return NULL;
313 if (_argo0) {
314 if (_argo0 == Py_None) { _arg0 = NULL; }
315 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
316 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxGLCanvas. Expected _wxWindow_p.");
317 return NULL;
318 }
319 }
320 if (_obj2)
321 {
322 _arg2 = &temp;
323 if (! wxPoint_helper(_obj2, &_arg2))
324 return NULL;
325 }
326 if (_obj3)
327 {
328 _arg3 = &temp0;
329 if (! wxSize_helper(_obj3, &_arg3))
330 return NULL;
331 }
332 if (_obj5)
333 {
334 _arg5 = wxString_in_helper(_obj5);
335 if (_arg5 == NULL)
336 return NULL;
337 }
338 if (_obj6)
339 {
340 int i;
341 if (PySequence_Check(_obj6)) {
342 int size = PyObject_Length(_obj6);
343 temp1 = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
344 for (i = 0; i < size; i++) {
345 temp1[i] = PyInt_AsLong(PySequence_GetItem(_obj6, i));
346 }
347 temp1[size] = 0;
348 _arg6 = temp1;
349 }
350 }
351 if (_argo7) {
352 if (SWIG_GetPtrObj(_argo7,(void **) &_arg7,"_wxPalette_p")) {
353 PyErr_SetString(PyExc_TypeError,"Type error in argument 8 of new_wxGLCanvas. Expected _wxPalette_p.");
354 return NULL;
355 }
356 }
357 {
358 PyThreadState* __tstate = wxPyBeginAllowThreads();
359 _result = (wxGLCanvas *)new_wxGLCanvas(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,_arg6,*_arg7);
360
361 wxPyEndAllowThreads(__tstate);
362 if (PyErr_Occurred()) return NULL;
363 } if (_result) {
364 SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
365 _resultobj = Py_BuildValue("s",_ptemp);
366 } else {
367 Py_INCREF(Py_None);
368 _resultobj = Py_None;
369 }
370 {
371 if (_obj5)
372 delete _arg5;
373 }
374 {
375 delete [] _arg6;
376 }
377 return _resultobj;
378 }
379
380 #define new_wxGLCanvasWithContext(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7,_swigarg8) (new wxGLCanvas(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7,_swigarg8))
381 static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args, PyObject *kwargs) {
382 PyObject * _resultobj;
383 wxGLCanvas * _result;
384 wxWindow * _arg0;
385 wxGLContext * _arg1 = (wxGLContext *) NULL;
386 wxWindowID _arg2 = (wxWindowID ) -1;
387 wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition;
388 wxSize * _arg4 = (wxSize *) &wxDefaultSize;
389 long _arg5 = (long ) 0;
390 wxString * _arg6 = (wxString *) &wxPyGLCanvasNameStr;
391 int * _arg7 = (int *) NULL;
392 wxPalette * _arg8 = (wxPalette *) &wxNullPalette;
393 PyObject * _argo0 = 0;
394 PyObject * _argo1 = 0;
395 wxPoint temp;
396 PyObject * _obj3 = 0;
397 wxSize temp0;
398 PyObject * _obj4 = 0;
399 PyObject * _obj6 = 0;
400 int * temp1;
401 PyObject * _obj7 = 0;
402 PyObject * _argo8 = 0;
403 char *_kwnames[] = { "parent","shared","id","pos","size","style","name","attribList","palette", NULL };
404 char _ptemp[128];
405
406 self = self;
407 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OiOOlOOO:new_wxGLCanvasWithContext",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6,&_obj7,&_argo8))
408 return NULL;
409 if (_argo0) {
410 if (_argo0 == Py_None) { _arg0 = NULL; }
411 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
412 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxGLCanvasWithContext. Expected _wxWindow_p.");
413 return NULL;
414 }
415 }
416 if (_argo1) {
417 if (_argo1 == Py_None) { _arg1 = NULL; }
418 else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxGLContext_p")) {
419 PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of new_wxGLCanvasWithContext. Expected _wxGLContext_p.");
420 return NULL;
421 }
422 }
423 if (_obj3)
424 {
425 _arg3 = &temp;
426 if (! wxPoint_helper(_obj3, &_arg3))
427 return NULL;
428 }
429 if (_obj4)
430 {
431 _arg4 = &temp0;
432 if (! wxSize_helper(_obj4, &_arg4))
433 return NULL;
434 }
435 if (_obj6)
436 {
437 _arg6 = wxString_in_helper(_obj6);
438 if (_arg6 == NULL)
439 return NULL;
440 }
441 if (_obj7)
442 {
443 int i;
444 if (PySequence_Check(_obj7)) {
445 int size = PyObject_Length(_obj7);
446 temp1 = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
447 for (i = 0; i < size; i++) {
448 temp1[i] = PyInt_AsLong(PySequence_GetItem(_obj7, i));
449 }
450 temp1[size] = 0;
451 _arg7 = temp1;
452 }
453 }
454 if (_argo8) {
455 if (SWIG_GetPtrObj(_argo8,(void **) &_arg8,"_wxPalette_p")) {
456 PyErr_SetString(PyExc_TypeError,"Type error in argument 9 of new_wxGLCanvasWithContext. Expected _wxPalette_p.");
457 return NULL;
458 }
459 }
460 {
461 PyThreadState* __tstate = wxPyBeginAllowThreads();
462 _result = (wxGLCanvas *)new_wxGLCanvasWithContext(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7,*_arg8);
463
464 wxPyEndAllowThreads(__tstate);
465 if (PyErr_Occurred()) return NULL;
466 } if (_result) {
467 SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLCanvas_p");
468 _resultobj = Py_BuildValue("s",_ptemp);
469 } else {
470 Py_INCREF(Py_None);
471 _resultobj = Py_None;
472 }
473 {
474 if (_obj6)
475 delete _arg6;
476 }
477 {
478 delete [] _arg7;
479 }
480 return _resultobj;
481 }
482
483 #define wxGLCanvas_SetCurrent(_swigobj) (_swigobj->SetCurrent())
484 static PyObject *_wrap_wxGLCanvas_SetCurrent(PyObject *self, PyObject *args, PyObject *kwargs) {
485 PyObject * _resultobj;
486 wxGLCanvas * _arg0;
487 PyObject * _argo0 = 0;
488 char *_kwnames[] = { "self", NULL };
489
490 self = self;
491 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_SetCurrent",_kwnames,&_argo0))
492 return NULL;
493 if (_argo0) {
494 if (_argo0 == Py_None) { _arg0 = NULL; }
495 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
496 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SetCurrent. Expected _wxGLCanvas_p.");
497 return NULL;
498 }
499 }
500 {
501 PyThreadState* __tstate = wxPyBeginAllowThreads();
502 wxGLCanvas_SetCurrent(_arg0);
503
504 wxPyEndAllowThreads(__tstate);
505 if (PyErr_Occurred()) return NULL;
506 } Py_INCREF(Py_None);
507 _resultobj = Py_None;
508 return _resultobj;
509 }
510
511 #define wxGLCanvas_SetColour(_swigobj,_swigarg0) (_swigobj->SetColour(_swigarg0))
512 static PyObject *_wrap_wxGLCanvas_SetColour(PyObject *self, PyObject *args, PyObject *kwargs) {
513 PyObject * _resultobj;
514 wxGLCanvas * _arg0;
515 wxString * _arg1;
516 PyObject * _argo0 = 0;
517 PyObject * _obj1 = 0;
518 char *_kwnames[] = { "self","colour", NULL };
519
520 self = self;
521 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGLCanvas_SetColour",_kwnames,&_argo0,&_obj1))
522 return NULL;
523 if (_argo0) {
524 if (_argo0 == Py_None) { _arg0 = NULL; }
525 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
526 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SetColour. Expected _wxGLCanvas_p.");
527 return NULL;
528 }
529 }
530 {
531 _arg1 = wxString_in_helper(_obj1);
532 if (_arg1 == NULL)
533 return NULL;
534 }
535 {
536 PyThreadState* __tstate = wxPyBeginAllowThreads();
537 wxGLCanvas_SetColour(_arg0,*_arg1);
538
539 wxPyEndAllowThreads(__tstate);
540 if (PyErr_Occurred()) return NULL;
541 } Py_INCREF(Py_None);
542 _resultobj = Py_None;
543 {
544 if (_obj1)
545 delete _arg1;
546 }
547 return _resultobj;
548 }
549
550 #define wxGLCanvas_SwapBuffers(_swigobj) (_swigobj->SwapBuffers())
551 static PyObject *_wrap_wxGLCanvas_SwapBuffers(PyObject *self, PyObject *args, PyObject *kwargs) {
552 PyObject * _resultobj;
553 wxGLCanvas * _arg0;
554 PyObject * _argo0 = 0;
555 char *_kwnames[] = { "self", NULL };
556
557 self = self;
558 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_SwapBuffers",_kwnames,&_argo0))
559 return NULL;
560 if (_argo0) {
561 if (_argo0 == Py_None) { _arg0 = NULL; }
562 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
563 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_SwapBuffers. Expected _wxGLCanvas_p.");
564 return NULL;
565 }
566 }
567 {
568 PyThreadState* __tstate = wxPyBeginAllowThreads();
569 wxGLCanvas_SwapBuffers(_arg0);
570
571 wxPyEndAllowThreads(__tstate);
572 if (PyErr_Occurred()) return NULL;
573 } Py_INCREF(Py_None);
574 _resultobj = Py_None;
575 return _resultobj;
576 }
577
578 #define wxGLCanvas_GetContext(_swigobj) (_swigobj->GetContext())
579 static PyObject *_wrap_wxGLCanvas_GetContext(PyObject *self, PyObject *args, PyObject *kwargs) {
580 PyObject * _resultobj;
581 wxGLContext * _result;
582 wxGLCanvas * _arg0;
583 PyObject * _argo0 = 0;
584 char *_kwnames[] = { "self", NULL };
585 char _ptemp[128];
586
587 self = self;
588 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGLCanvas_GetContext",_kwnames,&_argo0))
589 return NULL;
590 if (_argo0) {
591 if (_argo0 == Py_None) { _arg0 = NULL; }
592 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGLCanvas_p")) {
593 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGLCanvas_GetContext. Expected _wxGLCanvas_p.");
594 return NULL;
595 }
596 }
597 {
598 PyThreadState* __tstate = wxPyBeginAllowThreads();
599 _result = (wxGLContext *)wxGLCanvas_GetContext(_arg0);
600
601 wxPyEndAllowThreads(__tstate);
602 if (PyErr_Occurred()) return NULL;
603 } if (_result) {
604 SWIG_MakePtr(_ptemp, (char *) _result,"_wxGLContext_p");
605 _resultobj = Py_BuildValue("s",_ptemp);
606 } else {
607 Py_INCREF(Py_None);
608 _resultobj = Py_None;
609 }
610 return _resultobj;
611 }
612
613 static PyMethodDef glcanvascMethods[] = {
614 { "wxGLCanvas_GetContext", (PyCFunction) _wrap_wxGLCanvas_GetContext, METH_VARARGS | METH_KEYWORDS },
615 { "wxGLCanvas_SwapBuffers", (PyCFunction) _wrap_wxGLCanvas_SwapBuffers, METH_VARARGS | METH_KEYWORDS },
616 { "wxGLCanvas_SetColour", (PyCFunction) _wrap_wxGLCanvas_SetColour, METH_VARARGS | METH_KEYWORDS },
617 { "wxGLCanvas_SetCurrent", (PyCFunction) _wrap_wxGLCanvas_SetCurrent, METH_VARARGS | METH_KEYWORDS },
618 { "new_wxGLCanvasWithContext", (PyCFunction) _wrap_new_wxGLCanvasWithContext, METH_VARARGS | METH_KEYWORDS },
619 { "new_wxGLCanvas", (PyCFunction) _wrap_new_wxGLCanvas, METH_VARARGS | METH_KEYWORDS },
620 { "wxGLContext_GetWindow", (PyCFunction) _wrap_wxGLContext_GetWindow, METH_VARARGS | METH_KEYWORDS },
621 { "wxGLContext_SwapBuffers", (PyCFunction) _wrap_wxGLContext_SwapBuffers, METH_VARARGS | METH_KEYWORDS },
622 { "wxGLContext_SetColour", (PyCFunction) _wrap_wxGLContext_SetColour, METH_VARARGS | METH_KEYWORDS },
623 { "wxGLContext_SetCurrent", (PyCFunction) _wrap_wxGLContext_SetCurrent, METH_VARARGS | METH_KEYWORDS },
624 { "delete_wxGLContext", (PyCFunction) _wrap_delete_wxGLContext, METH_VARARGS | METH_KEYWORDS },
625 { NULL, NULL }
626 };
627 #ifdef __cplusplus
628 }
629 #endif
630 /*
631 * This table is used by the pointer type-checker
632 */
633 static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
634 { "_signed_long","_long",0},
635 { "_wxPrintQuality","_wxCoord",0},
636 { "_wxPrintQuality","_int",0},
637 { "_wxPrintQuality","_signed_int",0},
638 { "_wxPrintQuality","_unsigned_int",0},
639 { "_wxPrintQuality","_wxWindowID",0},
640 { "_wxPrintQuality","_uint",0},
641 { "_wxPrintQuality","_EBool",0},
642 { "_wxPrintQuality","_size_t",0},
643 { "_wxPrintQuality","_time_t",0},
644 { "_byte","_unsigned_char",0},
645 { "_long","_unsigned_long",0},
646 { "_long","_signed_long",0},
647 { "_size_t","_wxCoord",0},
648 { "_size_t","_wxPrintQuality",0},
649 { "_size_t","_time_t",0},
650 { "_size_t","_unsigned_int",0},
651 { "_size_t","_int",0},
652 { "_size_t","_wxWindowID",0},
653 { "_size_t","_uint",0},
654 { "_uint","_wxCoord",0},
655 { "_uint","_wxPrintQuality",0},
656 { "_uint","_time_t",0},
657 { "_uint","_size_t",0},
658 { "_uint","_unsigned_int",0},
659 { "_uint","_int",0},
660 { "_uint","_wxWindowID",0},
661 { "_wxChar","_char",0},
662 { "_char","_wxChar",0},
663 { "_struct_wxNativeFontInfo","_wxNativeFontInfo",0},
664 { "_EBool","_wxCoord",0},
665 { "_EBool","_wxPrintQuality",0},
666 { "_EBool","_signed_int",0},
667 { "_EBool","_int",0},
668 { "_EBool","_wxWindowID",0},
669 { "_unsigned_long","_long",0},
670 { "_wxNativeFontInfo","_struct_wxNativeFontInfo",0},
671 { "_signed_int","_wxCoord",0},
672 { "_signed_int","_wxPrintQuality",0},
673 { "_signed_int","_EBool",0},
674 { "_signed_int","_wxWindowID",0},
675 { "_signed_int","_int",0},
676 { "_WXTYPE","_wxDateTime_t",0},
677 { "_WXTYPE","_short",0},
678 { "_WXTYPE","_signed_short",0},
679 { "_WXTYPE","_unsigned_short",0},
680 { "_unsigned_short","_wxDateTime_t",0},
681 { "_unsigned_short","_WXTYPE",0},
682 { "_unsigned_short","_short",0},
683 { "_wxObject","_wxGLCanvas",SwigwxGLCanvasTowxObject},
684 { "_wxObject","_wxGLContext",SwigwxGLContextTowxObject},
685 { "_signed_short","_WXTYPE",0},
686 { "_signed_short","_short",0},
687 { "_unsigned_char","_byte",0},
688 { "_unsigned_int","_wxCoord",0},
689 { "_unsigned_int","_wxPrintQuality",0},
690 { "_unsigned_int","_time_t",0},
691 { "_unsigned_int","_size_t",0},
692 { "_unsigned_int","_uint",0},
693 { "_unsigned_int","_wxWindowID",0},
694 { "_unsigned_int","_int",0},
695 { "_short","_wxDateTime_t",0},
696 { "_short","_WXTYPE",0},
697 { "_short","_unsigned_short",0},
698 { "_short","_signed_short",0},
699 { "_wxWindowID","_wxCoord",0},
700 { "_wxWindowID","_wxPrintQuality",0},
701 { "_wxWindowID","_time_t",0},
702 { "_wxWindowID","_size_t",0},
703 { "_wxWindowID","_EBool",0},
704 { "_wxWindowID","_uint",0},
705 { "_wxWindowID","_int",0},
706 { "_wxWindowID","_signed_int",0},
707 { "_wxWindowID","_unsigned_int",0},
708 { "_int","_wxCoord",0},
709 { "_int","_wxPrintQuality",0},
710 { "_int","_time_t",0},
711 { "_int","_size_t",0},
712 { "_int","_EBool",0},
713 { "_int","_uint",0},
714 { "_int","_wxWindowID",0},
715 { "_int","_unsigned_int",0},
716 { "_int","_signed_int",0},
717 { "_wxDateTime_t","_unsigned_short",0},
718 { "_wxDateTime_t","_short",0},
719 { "_wxDateTime_t","_WXTYPE",0},
720 { "_time_t","_wxCoord",0},
721 { "_time_t","_wxPrintQuality",0},
722 { "_time_t","_unsigned_int",0},
723 { "_time_t","_int",0},
724 { "_time_t","_wxWindowID",0},
725 { "_time_t","_uint",0},
726 { "_time_t","_size_t",0},
727 { "_wxCoord","_int",0},
728 { "_wxCoord","_signed_int",0},
729 { "_wxCoord","_unsigned_int",0},
730 { "_wxCoord","_wxWindowID",0},
731 { "_wxCoord","_uint",0},
732 { "_wxCoord","_EBool",0},
733 { "_wxCoord","_size_t",0},
734 { "_wxCoord","_time_t",0},
735 { "_wxCoord","_wxPrintQuality",0},
736 { "_wxEvtHandler","_wxGLCanvas",SwigwxGLCanvasTowxEvtHandler},
737 { "_wxWindow","_wxGLCanvas",SwigwxGLCanvasTowxWindow},
738 {0,0,0}};
739
740 static PyObject *SWIG_globals;
741 #ifdef __cplusplus
742 extern "C"
743 #endif
744 SWIGEXPORT(void) initglcanvasc() {
745 PyObject *m, *d;
746 SWIG_globals = SWIG_newvarlink();
747 m = Py_InitModule("glcanvasc", glcanvascMethods);
748 d = PyModule_GetDict(m);
749 PyDict_SetItemString(d,"WX_GL_RGBA", PyInt_FromLong((long) WX_GL_RGBA));
750 PyDict_SetItemString(d,"WX_GL_BUFFER_SIZE", PyInt_FromLong((long) WX_GL_BUFFER_SIZE));
751 PyDict_SetItemString(d,"WX_GL_LEVEL", PyInt_FromLong((long) WX_GL_LEVEL));
752 PyDict_SetItemString(d,"WX_GL_DOUBLEBUFFER", PyInt_FromLong((long) WX_GL_DOUBLEBUFFER));
753 PyDict_SetItemString(d,"WX_GL_STEREO", PyInt_FromLong((long) WX_GL_STEREO));
754 PyDict_SetItemString(d,"WX_GL_AUX_BUFFERS", PyInt_FromLong((long) WX_GL_AUX_BUFFERS));
755 PyDict_SetItemString(d,"WX_GL_MIN_RED", PyInt_FromLong((long) WX_GL_MIN_RED));
756 PyDict_SetItemString(d,"WX_GL_MIN_GREEN", PyInt_FromLong((long) WX_GL_MIN_GREEN));
757 PyDict_SetItemString(d,"WX_GL_MIN_BLUE", PyInt_FromLong((long) WX_GL_MIN_BLUE));
758 PyDict_SetItemString(d,"WX_GL_MIN_ALPHA", PyInt_FromLong((long) WX_GL_MIN_ALPHA));
759 PyDict_SetItemString(d,"WX_GL_DEPTH_SIZE", PyInt_FromLong((long) WX_GL_DEPTH_SIZE));
760 PyDict_SetItemString(d,"WX_GL_STENCIL_SIZE", PyInt_FromLong((long) WX_GL_STENCIL_SIZE));
761 PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_RED", PyInt_FromLong((long) WX_GL_MIN_ACCUM_RED));
762 PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_GREEN", PyInt_FromLong((long) WX_GL_MIN_ACCUM_GREEN));
763 PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_BLUE", PyInt_FromLong((long) WX_GL_MIN_ACCUM_BLUE));
764 PyDict_SetItemString(d,"WX_GL_MIN_ACCUM_ALPHA", PyInt_FromLong((long) WX_GL_MIN_ACCUM_ALPHA));
765
766
767 {
768 int i;
769 for (i = 0; _swig_mapping[i].n1; i++)
770 SWIG_RegisterMapping(_swig_mapping[i].n1,_swig_mapping[i].n2,_swig_mapping[i].pcnv);
771 }
772 }