reSWIGged

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45511 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2007-04-16 19:43:08 +00:00
parent e6c222e712
commit a78303202f
22 changed files with 1295 additions and 936 deletions

View File

@@ -132,6 +132,10 @@ class GLCanvas(_core.Window):
"""
return _glcanvas.GLCanvas_SetCurrent(*args)
def InitVisual(*args, **kwargs):
"""InitVisual(self, int attribList) -> bool"""
return _glcanvas.GLCanvas_InitVisual(*args, **kwargs)
Context = property(GetContext,doc="See `GetContext`")
_glcanvas.GLCanvas_swigregister(GLCanvas)

View File

@@ -3447,6 +3447,59 @@ fail:
}
SWIGINTERN PyObject *_wrap_GLCanvas_InitVisual(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
PyObject *resultobj = 0;
wxGLCanvas *arg1 = (wxGLCanvas *) 0 ;
int *arg2 = (int *) 0 ;
bool result;
void *argp1 = 0 ;
int res1 = 0 ;
int *temp2 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
char * kwnames[] = {
(char *) "self",(char *) "attribList", NULL
};
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:GLCanvas_InitVisual",kwnames,&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxGLCanvas, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GLCanvas_InitVisual" "', expected argument " "1"" of type '" "wxGLCanvas *""'");
}
arg1 = reinterpret_cast< wxGLCanvas * >(argp1);
{
int i;
if (PySequence_Check(obj1)) {
int size = PyObject_Length(obj1);
temp2 = new int[size+1]; // (int*)malloc((size + 1) * sizeof(int));
for (i = 0; i < size; i++) {
temp2[i] = PyInt_AsLong(PySequence_GetItem(obj1, i));
}
temp2[size] = 0;
arg2 = temp2;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = (bool)(arg1)->InitVisual((int const *)arg2);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) SWIG_fail;
}
{
resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
}
{
delete [] arg2;
}
return resultobj;
fail:
{
delete [] arg2;
}
return NULL;
}
SWIGINTERN PyObject *GLCanvas_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!SWIG_Python_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
@@ -3471,6 +3524,7 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"GLCanvas_SwapBuffers", (PyCFunction)_wrap_GLCanvas_SwapBuffers, METH_O, NULL},
{ (char *)"GLCanvas_GetContext", (PyCFunction)_wrap_GLCanvas_GetContext, METH_O, NULL},
{ (char *)"GLCanvas_SetCurrent", _wrap_GLCanvas_SetCurrent, METH_VARARGS, NULL},
{ (char *)"GLCanvas_InitVisual", (PyCFunction) _wrap_GLCanvas_InitVisual, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"GLCanvas_swigregister", GLCanvas_swigregister, METH_VARARGS, NULL},
{ (char *)"GLCanvas_swiginit", GLCanvas_swiginit, METH_VARARGS, NULL},
{ NULL, NULL, 0, NULL }

View File

@@ -67,6 +67,10 @@ class GLContext(_core.Object):
_glcanvas.GLContext_swiginit(self,_glcanvas.new_GLContext(*args, **kwargs))
__swig_destroy__ = _glcanvas.delete_GLContext
__del__ = lambda self : None;
def SetCurrent(*args, **kwargs):
"""SetCurrent(self, GLCanvas win)"""
return _glcanvas.GLContext_SetCurrent(*args, **kwargs)
_glcanvas.GLContext_swigregister(GLContext)
cvar = _glcanvas.cvar
GLCanvasNameStr = cvar.GLCanvasNameStr

View File

@@ -2804,6 +2804,47 @@ fail:
}
SWIGINTERN PyObject *_wrap_GLContext_SetCurrent(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
PyObject *resultobj = 0;
wxGLContext *arg1 = (wxGLContext *) 0 ;
wxGLCanvas *arg2 = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
void *argp2 = 0 ;
int res2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
char * kwnames[] = {
(char *) "self",(char *) "win", NULL
};
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:GLContext_SetCurrent",kwnames,&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxGLContext, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GLContext_SetCurrent" "', expected argument " "1"" of type '" "wxGLContext *""'");
}
arg1 = reinterpret_cast< wxGLContext * >(argp1);
res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_wxGLCanvas, 0 | 0);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GLContext_SetCurrent" "', expected argument " "2"" of type '" "wxGLCanvas const &""'");
}
if (!argp2) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "GLContext_SetCurrent" "', expected argument " "2"" of type '" "wxGLCanvas const &""'");
}
arg2 = reinterpret_cast< wxGLCanvas * >(argp2);
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
(arg1)->SetCurrent((wxGLCanvas const &)*arg2);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) SWIG_fail;
}
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *GLContext_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!SWIG_Python_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
@@ -3420,6 +3461,7 @@ SWIGINTERN PyObject *GLCanvas_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject
static PyMethodDef SwigMethods[] = {
{ (char *)"new_GLContext", (PyCFunction) _wrap_new_GLContext, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"delete_GLContext", (PyCFunction)_wrap_delete_GLContext, METH_O, NULL},
{ (char *)"GLContext_SetCurrent", (PyCFunction) _wrap_GLContext_SetCurrent, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"GLContext_swigregister", GLContext_swigregister, METH_VARARGS, NULL},
{ (char *)"GLContext_swiginit", GLContext_swiginit, METH_VARARGS, NULL},
{ (char *)"new_GLCanvas", (PyCFunction) _wrap_new_GLCanvas, METH_VARARGS | METH_KEYWORDS, NULL},