X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/121b9a6757c25f346416b6c0fb8ebefadbf3f713..b7aef858828222a05e57671fa01d3cac78aee3ac:/wxPython/src/gtk/_core_wrap.cpp diff --git a/wxPython/src/gtk/_core_wrap.cpp b/wxPython/src/gtk/_core_wrap.cpp index a6e430a505..f2f7aae54a 100644 --- a/wxPython/src/gtk/_core_wrap.cpp +++ b/wxPython/src/gtk/_core_wrap.cpp @@ -1094,15 +1094,12 @@ SWIG_CheckUnsignedChar(PyObject* obj) } } -wxImage *new_wxImage__SWIG_0(int width,int height,bool clear){ +wxImage *new_wxImage(int width,int height,bool clear){ if (width > 0 && height > 0) return new wxImage(width, height, clear); else return new wxImage; } -wxImage *new_wxImage__SWIG_1(wxSize const &size,bool clear){ - return new wxImage(size.x, size.y, clear); - } wxImage *new_wxImage(wxBitmap const &bitmap){ return new wxImage(bitmap.ConvertToImage()); } @@ -1345,15 +1342,13 @@ int PyApp_GetComCtl32Version(){ wxPyRaiseNotImplemented(); return 0; } } - wxPyApp* wxGetApp() { - return (wxPyApp*)wxTheApp; - } + wxPyApp* wxPyGetApp() { return (wxPyApp*)wxTheApp; } static const wxString wxPyPanelNameStr(wxPanelNameStr); wxVisualAttributes *new_wxVisualAttributes(){ return new wxVisualAttributes; } -void delete_wxVisualAttributes(wxVisualAttributes *self){} +void delete_wxVisualAttributes(wxVisualAttributes *self){ delete self; } PyObject *wxWindow_GetChildren(wxWindow *self){ wxWindowList& list = self->GetChildren(); return wxPy_ConvertList(&list); @@ -1650,6 +1645,19 @@ bool wxSizer_Remove(wxSizer *self,PyObject *item){ else return False; } +bool wxSizer_Detach(wxSizer *self,PyObject *item){ + bool blocked = wxPyBeginBlockThreads(); + wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, True); + wxPyEndBlockThreads(blocked); + if ( info.window ) + return self->Detach(info.window); + else if ( info.sizer ) + return self->Detach(info.sizer); + else if ( info.gotPos ) + return self->Detach(info.pos); + else + return False; + } void wxSizer__SetItemMinSize(wxSizer *self,PyObject *item,wxSize const &size){ bool blocked = wxPyBeginBlockThreads(); wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, True); @@ -1666,21 +1674,27 @@ PyObject *wxSizer_GetChildren(wxSizer *self){ return wxPy_ConvertList(&list); } void wxSizer_Show(wxSizer *self,PyObject *item,bool show){ + bool blocked = wxPyBeginBlockThreads(); wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, False); + wxPyEndBlockThreads(blocked); if ( info.window ) self->Show(info.window, show); else if ( info.sizer ) self->Show(info.sizer, show); } void wxSizer_Hide(wxSizer *self,PyObject *item){ + bool blocked = wxPyBeginBlockThreads(); wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, False); + wxPyEndBlockThreads(blocked); if ( info.window ) self->Hide(info.window); else if ( info.sizer ) self->Hide(info.sizer); } bool wxSizer_IsShown(wxSizer *self,PyObject *item){ + bool blocked = wxPyBeginBlockThreads(); wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, False); + wxPyEndBlockThreads(blocked); if ( info.window ) return self->IsShown(info.window); else if ( info.sizer ) @@ -8792,7 +8806,7 @@ static PyObject *_wrap_new_ImageFromStreamMime(PyObject *self, PyObject *args, P } -static PyObject *_wrap_new_EmptyImage__SWIG_0(PyObject *self, PyObject *args) { +static PyObject *_wrap_new_EmptyImage(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; int arg1 = (int) 0 ; int arg2 = (int) 0 ; @@ -8801,8 +8815,11 @@ static PyObject *_wrap_new_EmptyImage__SWIG_0(PyObject *self, PyObject *args) { PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; + char *kwnames[] = { + (char *) "width",(char *) "height",(char *) "clear", NULL + }; - if(!PyArg_ParseTuple(args,(char *)"|OOO:new_EmptyImage",&obj0,&obj1,&obj2)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"|OOO:new_EmptyImage",kwnames,&obj0,&obj1,&obj2)) goto fail; if (obj0) { arg1 = (int) SWIG_AsInt(obj0); if (PyErr_Occurred()) SWIG_fail; @@ -8817,39 +8834,7 @@ static PyObject *_wrap_new_EmptyImage__SWIG_0(PyObject *self, PyObject *args) { } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (wxImage *)new_wxImage__SWIG_0(arg1,arg2,arg3); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxImage, 1); - return resultobj; - fail: - return NULL; -} - - -static PyObject *_wrap_new_EmptyImage__SWIG_1(PyObject *self, PyObject *args) { - PyObject *resultobj; - wxSize *arg1 = 0 ; - bool arg2 = (bool) True ; - wxImage *result; - wxSize temp1 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if(!PyArg_ParseTuple(args,(char *)"O|O:new_EmptyImage",&obj0,&obj1)) goto fail; - { - arg1 = &temp1; - if ( ! wxSize_helper(obj0, &arg1)) SWIG_fail; - } - if (obj1) { - arg2 = (bool) SWIG_AsBool(obj1); - if (PyErr_Occurred()) SWIG_fail; - } - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (wxImage *)new_wxImage__SWIG_1((wxSize const &)*arg1,arg2); + result = (wxImage *)new_wxImage(arg1,arg2,arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -8861,58 +8846,6 @@ static PyObject *_wrap_new_EmptyImage__SWIG_1(PyObject *self, PyObject *args) { } -static PyObject *_wrap_new_EmptyImage(PyObject *self, PyObject *args) { - int argc; - PyObject *argv[4]; - int ii; - - argc = PyObject_Length(args); - for (ii = 0; (ii < argc) && (ii < 3); ii++) { - argv[ii] = PyTuple_GetItem(args,ii); - } - if ((argc >= 0) && (argc <= 3)) { - int _v; - if (argc <= 0) { - return _wrap_new_EmptyImage__SWIG_0(self,args); - } - _v = SWIG_CheckInt(argv[0]); - if (_v) { - if (argc <= 1) { - return _wrap_new_EmptyImage__SWIG_0(self,args); - } - _v = SWIG_CheckInt(argv[1]); - if (_v) { - if (argc <= 2) { - return _wrap_new_EmptyImage__SWIG_0(self,args); - } - _v = SWIG_CheckBool(argv[2]); - if (_v) { - return _wrap_new_EmptyImage__SWIG_0(self,args); - } - } - } - } - if ((argc >= 1) && (argc <= 2)) { - int _v; - { - _v = wxPySimple_typecheck(argv[0], wxT("wxSize"), 2); - } - if (_v) { - if (argc <= 1) { - return _wrap_new_EmptyImage__SWIG_1(self,args); - } - _v = SWIG_CheckBool(argv[1]); - if (_v) { - return _wrap_new_EmptyImage__SWIG_1(self,args); - } - } - } - - PyErr_SetString(PyExc_TypeError,"No matching function for overloaded 'new_EmptyImage'"); - return NULL; -} - - static PyObject *_wrap_new_ImageFromBitmap(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxBitmap *arg1 = 0 ; @@ -20842,7 +20775,7 @@ static PyObject *_wrap_GetApp(PyObject *self, PyObject *args, PyObject *kwargs) if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":GetApp",kwnames)) goto fail; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (wxPyApp *)wxGetApp(); + result = (wxPyApp *)wxPyGetApp(); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -20861,17 +20794,15 @@ static PyObject *_wrap_new_AcceleratorEntry(PyObject *self, PyObject *args, PyOb int arg1 = (int) 0 ; int arg2 = (int) 0 ; int arg3 = (int) 0 ; - wxMenuItem *arg4 = (wxMenuItem *) NULL ; wxAcceleratorEntry *result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; char *kwnames[] = { - (char *) "flags",(char *) "keyCode",(char *) "cmd",(char *) "item", NULL + (char *) "flags",(char *) "keyCode",(char *) "cmdID", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"|OOOO:new_AcceleratorEntry",kwnames,&obj0,&obj1,&obj2,&obj3)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"|OOO:new_AcceleratorEntry",kwnames,&obj0,&obj1,&obj2)) goto fail; if (obj0) { arg1 = (int) SWIG_AsInt(obj0); if (PyErr_Occurred()) SWIG_fail; @@ -20884,13 +20815,9 @@ static PyObject *_wrap_new_AcceleratorEntry(PyObject *self, PyObject *args, PyOb arg3 = (int) SWIG_AsInt(obj2); if (PyErr_Occurred()) SWIG_fail; } - if (obj3) { - if ((SWIG_ConvertPtr(obj3,(void **)(&arg4),SWIGTYPE_p_wxMenuItem, - SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (wxAcceleratorEntry *)new wxAcceleratorEntry(arg1,arg2,arg3,arg4); + result = (wxAcceleratorEntry *)new wxAcceleratorEntry(arg1,arg2,arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -20933,17 +20860,15 @@ static PyObject *_wrap_AcceleratorEntry_Set(PyObject *self, PyObject *args, PyOb int arg2 ; int arg3 ; int arg4 ; - wxMenuItem *arg5 = (wxMenuItem *) NULL ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "flags",(char *) "keyCode",(char *) "cmd",(char *) "item", NULL + (char *) "self",(char *) "flags",(char *) "keyCode",(char *) "cmd", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOO|O:AcceleratorEntry_Set",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOO:AcceleratorEntry_Set",kwnames,&obj0,&obj1,&obj2,&obj3)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxAcceleratorEntry, SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; arg2 = (int) SWIG_AsInt(obj1); @@ -20952,42 +20877,9 @@ static PyObject *_wrap_AcceleratorEntry_Set(PyObject *self, PyObject *args, PyOb if (PyErr_Occurred()) SWIG_fail; arg4 = (int) SWIG_AsInt(obj3); if (PyErr_Occurred()) SWIG_fail; - if (obj4) { - if ((SWIG_ConvertPtr(obj4,(void **)(&arg5),SWIGTYPE_p_wxMenuItem, - SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; - } - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - (arg1)->Set(arg2,arg3,arg4,arg5); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - Py_INCREF(Py_None); resultobj = Py_None; - return resultobj; - fail: - return NULL; -} - - -static PyObject *_wrap_AcceleratorEntry_SetMenuItem(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - wxAcceleratorEntry *arg1 = (wxAcceleratorEntry *) 0 ; - wxMenuItem *arg2 = (wxMenuItem *) 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char *kwnames[] = { - (char *) "self",(char *) "item", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:AcceleratorEntry_SetMenuItem",kwnames,&obj0,&obj1)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxAcceleratorEntry, - SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; - if ((SWIG_ConvertPtr(obj1,(void **)(&arg2),SWIGTYPE_p_wxMenuItem, - SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - (arg1)->SetMenuItem(arg2); + (arg1)->Set(arg2,arg3,arg4); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -20999,34 +20891,6 @@ static PyObject *_wrap_AcceleratorEntry_SetMenuItem(PyObject *self, PyObject *ar } -static PyObject *_wrap_AcceleratorEntry_GetMenuItem(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - wxAcceleratorEntry *arg1 = (wxAcceleratorEntry *) 0 ; - wxMenuItem *result; - PyObject * obj0 = 0 ; - char *kwnames[] = { - (char *) "self", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:AcceleratorEntry_GetMenuItem",kwnames,&obj0)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxAcceleratorEntry, - SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (wxMenuItem *)((wxAcceleratorEntry const *)arg1)->GetMenuItem(); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - { - resultobj = wxPyMake_wxObject(result); - } - return resultobj; - fail: - return NULL; -} - - static PyObject *_wrap_AcceleratorEntry_GetFlags(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxAcceleratorEntry *arg1 = (wxAcceleratorEntry *) 0 ; @@ -27083,7 +26947,7 @@ static PyObject *_wrap_Window_SetScrollbar(PyObject *self, PyObject *args, PyObj PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "orientation",(char *) "pos",(char *) "thumbvisible",(char *) "range",(char *) "refresh", NULL + (char *) "self",(char *) "orientation",(char *) "position",(char *) "thumbSize",(char *) "range",(char *) "refresh", NULL }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOOO|O:Window_SetScrollbar",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) goto fail; @@ -34862,6 +34726,37 @@ static PyObject *_wrap_Sizer_Remove(PyObject *self, PyObject *args, PyObject *kw } +static PyObject *_wrap_Sizer_Detach(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxSizer *arg1 = (wxSizer *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + bool result; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "item", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Sizer_Detach",kwnames,&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxSizer, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + arg2 = obj1; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)wxSizer_Detach(arg1,arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + return resultobj; + fail: + return NULL; +} + + static PyObject *_wrap_Sizer__SetItemMinSize(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxSizer *arg1 = (wxSizer *) 0 ; @@ -40498,7 +40393,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"new_ImageFromMime", (PyCFunction) _wrap_new_ImageFromMime, METH_VARARGS | METH_KEYWORDS }, { (char *)"new_ImageFromStream", (PyCFunction) _wrap_new_ImageFromStream, METH_VARARGS | METH_KEYWORDS }, { (char *)"new_ImageFromStreamMime", (PyCFunction) _wrap_new_ImageFromStreamMime, METH_VARARGS | METH_KEYWORDS }, - { (char *)"new_EmptyImage", _wrap_new_EmptyImage, METH_VARARGS }, + { (char *)"new_EmptyImage", (PyCFunction) _wrap_new_EmptyImage, METH_VARARGS | METH_KEYWORDS }, { (char *)"new_ImageFromBitmap", (PyCFunction) _wrap_new_ImageFromBitmap, METH_VARARGS | METH_KEYWORDS }, { (char *)"new_ImageFromData", (PyCFunction) _wrap_new_ImageFromData, METH_VARARGS | METH_KEYWORDS }, { (char *)"Image_Create", (PyCFunction) _wrap_Image_Create, METH_VARARGS | METH_KEYWORDS }, @@ -40945,8 +40840,6 @@ static PyMethodDef SwigMethods[] = { { (char *)"new_AcceleratorEntry", (PyCFunction) _wrap_new_AcceleratorEntry, METH_VARARGS | METH_KEYWORDS }, { (char *)"delete_AcceleratorEntry", (PyCFunction) _wrap_delete_AcceleratorEntry, METH_VARARGS | METH_KEYWORDS }, { (char *)"AcceleratorEntry_Set", (PyCFunction) _wrap_AcceleratorEntry_Set, METH_VARARGS | METH_KEYWORDS }, - { (char *)"AcceleratorEntry_SetMenuItem", (PyCFunction) _wrap_AcceleratorEntry_SetMenuItem, METH_VARARGS | METH_KEYWORDS }, - { (char *)"AcceleratorEntry_GetMenuItem", (PyCFunction) _wrap_AcceleratorEntry_GetMenuItem, METH_VARARGS | METH_KEYWORDS }, { (char *)"AcceleratorEntry_GetFlags", (PyCFunction) _wrap_AcceleratorEntry_GetFlags, METH_VARARGS | METH_KEYWORDS }, { (char *)"AcceleratorEntry_GetKeyCode", (PyCFunction) _wrap_AcceleratorEntry_GetKeyCode, METH_VARARGS | METH_KEYWORDS }, { (char *)"AcceleratorEntry_GetCommand", (PyCFunction) _wrap_AcceleratorEntry_GetCommand, METH_VARARGS | METH_KEYWORDS }, @@ -41355,6 +41248,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"Sizer_Insert", (PyCFunction) _wrap_Sizer_Insert, METH_VARARGS | METH_KEYWORDS }, { (char *)"Sizer_Prepend", (PyCFunction) _wrap_Sizer_Prepend, METH_VARARGS | METH_KEYWORDS }, { (char *)"Sizer_Remove", (PyCFunction) _wrap_Sizer_Remove, METH_VARARGS | METH_KEYWORDS }, + { (char *)"Sizer_Detach", (PyCFunction) _wrap_Sizer_Detach, METH_VARARGS | METH_KEYWORDS }, { (char *)"Sizer__SetItemMinSize", (PyCFunction) _wrap_Sizer__SetItemMinSize, METH_VARARGS | METH_KEYWORDS }, { (char *)"Sizer_AddItem", (PyCFunction) _wrap_Sizer_AddItem, METH_VARARGS | METH_KEYWORDS }, { (char *)"Sizer_InsertItem", (PyCFunction) _wrap_Sizer_InsertItem, METH_VARARGS | METH_KEYWORDS },