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