From 02b455f2f4e03257d166a501740a865d6f6ec0a4 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 16 Apr 2005 05:55:37 +0000 Subject: [PATCH] reSWIGged git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33642 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/contrib/animate/gtk/animate_wrap.cpp | 3 +- wxPython/contrib/gizmos/gtk/gizmos_wrap.cpp | 3 +- .../contrib/glcanvas/gtk/glcanvas_wrap.cpp | 3 +- wxPython/contrib/stc/gtk/stc.py | 40 +- wxPython/contrib/stc/gtk/stc_wrap.cpp | 400 ++++++++++++++++-- wxPython/src/gtk/_controls_wrap.cpp | 3 +- wxPython/src/gtk/_core.py | 13 +- wxPython/src/gtk/_core_wrap.cpp | 3 +- wxPython/src/gtk/_gdi_wrap.cpp | 3 +- wxPython/src/gtk/_misc_wrap.cpp | 3 +- wxPython/src/gtk/_windows_wrap.cpp | 3 +- wxPython/src/gtk/calendar_wrap.cpp | 3 +- wxPython/src/gtk/grid_wrap.cpp | 3 +- wxPython/src/gtk/html_wrap.cpp | 3 +- wxPython/src/gtk/media_wrap.cpp | 3 +- wxPython/src/gtk/webkit_wrap.cpp | 3 +- wxPython/src/gtk/wizard_wrap.cpp | 3 +- wxPython/src/gtk/xrc_wrap.cpp | 3 +- 18 files changed, 430 insertions(+), 68 deletions(-) diff --git a/wxPython/contrib/animate/gtk/animate_wrap.cpp b/wxPython/contrib/animate/gtk/animate_wrap.cpp index 9c9a008dd4..62c8e3acd9 100644 --- a/wxPython/contrib/animate/gtk/animate_wrap.cpp +++ b/wxPython/contrib/animate/gtk/animate_wrap.cpp @@ -1037,7 +1037,8 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } - Py_DECREF(str); + if (str) + Py_DECREF(str); return; } } diff --git a/wxPython/contrib/gizmos/gtk/gizmos_wrap.cpp b/wxPython/contrib/gizmos/gtk/gizmos_wrap.cpp index a1be92de78..479d99f764 100644 --- a/wxPython/contrib/gizmos/gtk/gizmos_wrap.cpp +++ b/wxPython/contrib/gizmos/gtk/gizmos_wrap.cpp @@ -1037,7 +1037,8 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } - Py_DECREF(str); + if (str) + Py_DECREF(str); return; } } diff --git a/wxPython/contrib/glcanvas/gtk/glcanvas_wrap.cpp b/wxPython/contrib/glcanvas/gtk/glcanvas_wrap.cpp index cc3db6db8a..382f483148 100644 --- a/wxPython/contrib/glcanvas/gtk/glcanvas_wrap.cpp +++ b/wxPython/contrib/glcanvas/gtk/glcanvas_wrap.cpp @@ -1037,7 +1037,8 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } - Py_DECREF(str); + if (str) + Py_DECREF(str); return; } } diff --git a/wxPython/contrib/stc/gtk/stc.py b/wxPython/contrib/stc/gtk/stc.py index 481ac536fa..9d8b41ca36 100644 --- a/wxPython/contrib/stc/gtk/stc.py +++ b/wxPython/contrib/stc/gtk/stc.py @@ -1111,7 +1111,7 @@ class StyledTextCtrl(_core.Control): def Create(*args, **kwargs): """ Create(self, Window parent, int id=ID_ANY, Point pos=DefaultPosition, - Size size=DefaultSize, long style=0, String name=wxSTCNameStr) + Size size=DefaultSize, long style=0, String name=wxSTCNameStr) -> bool """ return _stc.StyledTextCtrl_Create(*args, **kwargs) @@ -2094,7 +2094,7 @@ class StyledTextCtrl(_core.Control): return _stc.StyledTextCtrl_GetUseVerticalScrollBar(*args, **kwargs) def AppendText(*args, **kwargs): - """AppendText(self, int length, String text)""" + """AppendText(self, String text)""" return _stc.StyledTextCtrl_AppendText(*args, **kwargs) def GetTwoPhaseDraw(*args, **kwargs): @@ -2848,6 +2848,42 @@ class StyledTextCtrl(_core.Control): """GetUseAntiAliasing(self) -> bool""" return _stc.StyledTextCtrl_GetUseAntiAliasing(*args, **kwargs) + def AddTextRaw(*args, **kwargs): + """AddTextRaw(self, char text)""" + return _stc.StyledTextCtrl_AddTextRaw(*args, **kwargs) + + def InsertTextRaw(*args, **kwargs): + """InsertTextRaw(self, int pos, char text)""" + return _stc.StyledTextCtrl_InsertTextRaw(*args, **kwargs) + + def GetCurLineRaw(*args, **kwargs): + """GetCurLineRaw(self, int OUTPUT) -> wxCharBuffer""" + return _stc.StyledTextCtrl_GetCurLineRaw(*args, **kwargs) + + def GetLineRaw(*args, **kwargs): + """GetLineRaw(self, int line) -> wxCharBuffer""" + return _stc.StyledTextCtrl_GetLineRaw(*args, **kwargs) + + def GetSelectedTextRaw(*args, **kwargs): + """GetSelectedTextRaw(self) -> wxCharBuffer""" + return _stc.StyledTextCtrl_GetSelectedTextRaw(*args, **kwargs) + + def GetTextRangeRaw(*args, **kwargs): + """GetTextRangeRaw(self, int startPos, int endPos) -> wxCharBuffer""" + return _stc.StyledTextCtrl_GetTextRangeRaw(*args, **kwargs) + + def SetTextRaw(*args, **kwargs): + """SetTextRaw(self, char text)""" + return _stc.StyledTextCtrl_SetTextRaw(*args, **kwargs) + + def GetTextRaw(*args, **kwargs): + """GetTextRaw(self) -> wxCharBuffer""" + return _stc.StyledTextCtrl_GetTextRaw(*args, **kwargs) + + def AppendTextRaw(*args, **kwargs): + """AppendTextRaw(self, char text)""" + return _stc.StyledTextCtrl_AppendTextRaw(*args, **kwargs) + class StyledTextCtrlPtr(StyledTextCtrl): def __init__(self, this): diff --git a/wxPython/contrib/stc/gtk/stc_wrap.cpp b/wxPython/contrib/stc/gtk/stc_wrap.cpp index 6facc5b511..8fccbcb215 100644 --- a/wxPython/contrib/stc/gtk/stc_wrap.cpp +++ b/wxPython/contrib/stc/gtk/stc_wrap.cpp @@ -1037,7 +1037,8 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } - Py_DECREF(str); + if (str) + Py_DECREF(str); return; } } @@ -1343,30 +1344,31 @@ SWIG_Python_GetTypeList() { #define SWIGTYPE_p_unsigned_char swig_types[2] #define SWIGTYPE_p_wxColour swig_types[3] #define SWIGTYPE_p_wxScrollBar swig_types[4] -#define SWIGTYPE_p_wxStyledTextEvent swig_types[5] -#define SWIGTYPE_p_wxWindow swig_types[6] -#define SWIGTYPE_p_wxCommandEvent swig_types[7] -#define SWIGTYPE_p_unsigned_long swig_types[8] -#define SWIGTYPE_p_wxBitmap swig_types[9] -#define SWIGTYPE_p_unsigned_int swig_types[10] -#define SWIGTYPE_unsigned_int swig_types[11] -#define SWIGTYPE_p_form_ops_t swig_types[12] -#define SWIGTYPE_p_wxDuplexMode swig_types[13] -#define SWIGTYPE_p_void swig_types[14] -#define SWIGTYPE_p_char swig_types[15] -#define SWIGTYPE_p_wxPoint swig_types[16] -#define SWIGTYPE_p_wxDC swig_types[17] -#define SWIGTYPE_p_wxEvtHandler swig_types[18] -#define SWIGTYPE_std__ptrdiff_t swig_types[19] -#define SWIGTYPE_ptrdiff_t swig_types[20] -#define SWIGTYPE_p_wxStyledTextCtrl swig_types[21] -#define SWIGTYPE_p_wxFont swig_types[22] -#define SWIGTYPE_p_wxControl swig_types[23] -#define SWIGTYPE_p_wxEvent swig_types[24] -#define SWIGTYPE_p_wxPaperSize swig_types[25] -#define SWIGTYPE_p_int swig_types[26] -#define SWIGTYPE_p_wxMemoryBuffer swig_types[27] -static swig_type_info *swig_types[29]; +#define SWIGTYPE_p_wxCharBuffer swig_types[5] +#define SWIGTYPE_p_wxStyledTextEvent swig_types[6] +#define SWIGTYPE_p_wxWindow swig_types[7] +#define SWIGTYPE_p_wxCommandEvent swig_types[8] +#define SWIGTYPE_p_unsigned_long swig_types[9] +#define SWIGTYPE_p_wxBitmap swig_types[10] +#define SWIGTYPE_p_unsigned_int swig_types[11] +#define SWIGTYPE_unsigned_int swig_types[12] +#define SWIGTYPE_p_form_ops_t swig_types[13] +#define SWIGTYPE_p_wxDuplexMode swig_types[14] +#define SWIGTYPE_p_void swig_types[15] +#define SWIGTYPE_p_char swig_types[16] +#define SWIGTYPE_p_wxPoint swig_types[17] +#define SWIGTYPE_p_wxDC swig_types[18] +#define SWIGTYPE_p_wxEvtHandler swig_types[19] +#define SWIGTYPE_std__ptrdiff_t swig_types[20] +#define SWIGTYPE_ptrdiff_t swig_types[21] +#define SWIGTYPE_p_wxStyledTextCtrl swig_types[22] +#define SWIGTYPE_p_wxFont swig_types[23] +#define SWIGTYPE_p_wxControl swig_types[24] +#define SWIGTYPE_p_wxEvent swig_types[25] +#define SWIGTYPE_p_wxPaperSize swig_types[26] +#define SWIGTYPE_p_int swig_types[27] +#define SWIGTYPE_p_wxMemoryBuffer swig_types[28] +static swig_type_info *swig_types[30]; /* -------- TYPES TABLE (END) -------- */ @@ -1764,6 +1766,7 @@ static PyObject *_wrap_StyledTextCtrl_Create(PyObject *, PyObject *args, PyObjec long arg6 = (long) 0 ; wxString const &arg7_defvalue = wxSTCNameStr ; wxString *arg7 = (wxString *) &arg7_defvalue ; + bool result; wxPoint temp4 ; wxSize temp5 ; bool temp7 = false ; @@ -1816,12 +1819,14 @@ static PyObject *_wrap_StyledTextCtrl_Create(PyObject *, PyObject *args, PyObjec } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - (arg1)->Create(arg2,arg3,(wxPoint const &)*arg4,(wxSize const &)*arg5,arg6,(wxString const &)*arg7); + result = (bool)(arg1)->Create(arg2,arg3,(wxPoint const &)*arg4,(wxSize const &)*arg5,arg6,(wxString const &)*arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - Py_INCREF(Py_None); resultobj = Py_None; + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } { if (temp7) delete arg7; @@ -9850,45 +9855,39 @@ static PyObject *_wrap_StyledTextCtrl_GetUseVerticalScrollBar(PyObject *, PyObje static PyObject *_wrap_StyledTextCtrl_AppendText(PyObject *, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxStyledTextCtrl *arg1 = (wxStyledTextCtrl *) 0 ; - int arg2 ; - wxString *arg3 = 0 ; - bool temp3 = false ; + wxString *arg2 = 0 ; + bool temp2 = false ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "length",(char *) "text", NULL + (char *) "self",(char *) "text", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:StyledTextCtrl_AppendText",kwnames,&obj0,&obj1,&obj2)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:StyledTextCtrl_AppendText",kwnames,&obj0,&obj1)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxStyledTextCtrl, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { - arg2 = (int)(SWIG_As_int(obj1)); - if (SWIG_arg_fail(2)) SWIG_fail; - } - { - arg3 = wxString_in_helper(obj2); - if (arg3 == NULL) SWIG_fail; - temp3 = true; + arg2 = wxString_in_helper(obj1); + if (arg2 == NULL) SWIG_fail; + temp2 = true; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - (arg1)->AppendText(arg2,(wxString const &)*arg3); + (arg1)->AppendText((wxString const &)*arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } Py_INCREF(Py_None); resultobj = Py_None; { - if (temp3) - delete arg3; + if (temp2) + delete arg2; } return resultobj; fail: { - if (temp3) - delete arg3; + if (temp2) + delete arg2; } return NULL; } @@ -15314,6 +15313,306 @@ static PyObject *_wrap_StyledTextCtrl_GetUseAntiAliasing(PyObject *, PyObject *a } +static PyObject *_wrap_StyledTextCtrl_AddTextRaw(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxStyledTextCtrl *arg1 = (wxStyledTextCtrl *) 0 ; + char *arg2 = (char *) 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "text", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:StyledTextCtrl_AddTextRaw",kwnames,&obj0,&obj1)) goto fail; + SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxStyledTextCtrl, SWIG_POINTER_EXCEPTION | 0); + if (SWIG_arg_fail(1)) SWIG_fail; + if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) { + SWIG_arg_fail(2);SWIG_fail; + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->AddTextRaw((char const *)arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_StyledTextCtrl_InsertTextRaw(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxStyledTextCtrl *arg1 = (wxStyledTextCtrl *) 0 ; + int arg2 ; + char *arg3 = (char *) 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "pos",(char *) "text", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:StyledTextCtrl_InsertTextRaw",kwnames,&obj0,&obj1,&obj2)) goto fail; + SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxStyledTextCtrl, SWIG_POINTER_EXCEPTION | 0); + if (SWIG_arg_fail(1)) SWIG_fail; + { + arg2 = (int)(SWIG_As_int(obj1)); + if (SWIG_arg_fail(2)) SWIG_fail; + } + if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) { + SWIG_arg_fail(3);SWIG_fail; + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->InsertTextRaw(arg2,(char const *)arg3); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_StyledTextCtrl_GetCurLineRaw(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxStyledTextCtrl *arg1 = (wxStyledTextCtrl *) 0 ; + int *arg2 = (int *) 0 ; + wxCharBuffer result; + int temp2 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + arg2 = &temp2; res2 = SWIG_NEWOBJ; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:StyledTextCtrl_GetCurLineRaw",kwnames,&obj0)) goto fail; + SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxStyledTextCtrl, SWIG_POINTER_EXCEPTION | 0); + if (SWIG_arg_fail(1)) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (arg1)->GetCurLineRaw(arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + wxCharBuffer * resultptr; + resultptr = new wxCharBuffer((wxCharBuffer &)(result)); + resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_wxCharBuffer, 1); + } + resultobj = t_output_helper(resultobj, ((res2 == SWIG_NEWOBJ) ? + SWIG_From_int((*arg2)) : SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, 0))); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_StyledTextCtrl_GetLineRaw(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxStyledTextCtrl *arg1 = (wxStyledTextCtrl *) 0 ; + int arg2 ; + wxCharBuffer result; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "line", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:StyledTextCtrl_GetLineRaw",kwnames,&obj0,&obj1)) goto fail; + SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxStyledTextCtrl, SWIG_POINTER_EXCEPTION | 0); + if (SWIG_arg_fail(1)) SWIG_fail; + { + arg2 = (int)(SWIG_As_int(obj1)); + if (SWIG_arg_fail(2)) SWIG_fail; + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (arg1)->GetLineRaw(arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + wxCharBuffer * resultptr; + resultptr = new wxCharBuffer((wxCharBuffer &)(result)); + resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_wxCharBuffer, 1); + } + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_StyledTextCtrl_GetSelectedTextRaw(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxStyledTextCtrl *arg1 = (wxStyledTextCtrl *) 0 ; + wxCharBuffer result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:StyledTextCtrl_GetSelectedTextRaw",kwnames,&obj0)) goto fail; + SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxStyledTextCtrl, SWIG_POINTER_EXCEPTION | 0); + if (SWIG_arg_fail(1)) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (arg1)->GetSelectedTextRaw(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + wxCharBuffer * resultptr; + resultptr = new wxCharBuffer((wxCharBuffer &)(result)); + resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_wxCharBuffer, 1); + } + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_StyledTextCtrl_GetTextRangeRaw(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxStyledTextCtrl *arg1 = (wxStyledTextCtrl *) 0 ; + int arg2 ; + int arg3 ; + wxCharBuffer result; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "startPos",(char *) "endPos", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:StyledTextCtrl_GetTextRangeRaw",kwnames,&obj0,&obj1,&obj2)) goto fail; + SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxStyledTextCtrl, SWIG_POINTER_EXCEPTION | 0); + if (SWIG_arg_fail(1)) SWIG_fail; + { + arg2 = (int)(SWIG_As_int(obj1)); + if (SWIG_arg_fail(2)) SWIG_fail; + } + { + arg3 = (int)(SWIG_As_int(obj2)); + if (SWIG_arg_fail(3)) SWIG_fail; + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (arg1)->GetTextRangeRaw(arg2,arg3); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + wxCharBuffer * resultptr; + resultptr = new wxCharBuffer((wxCharBuffer &)(result)); + resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_wxCharBuffer, 1); + } + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_StyledTextCtrl_SetTextRaw(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxStyledTextCtrl *arg1 = (wxStyledTextCtrl *) 0 ; + char *arg2 = (char *) 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "text", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:StyledTextCtrl_SetTextRaw",kwnames,&obj0,&obj1)) goto fail; + SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxStyledTextCtrl, SWIG_POINTER_EXCEPTION | 0); + if (SWIG_arg_fail(1)) SWIG_fail; + if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) { + SWIG_arg_fail(2);SWIG_fail; + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->SetTextRaw((char const *)arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_StyledTextCtrl_GetTextRaw(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxStyledTextCtrl *arg1 = (wxStyledTextCtrl *) 0 ; + wxCharBuffer result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:StyledTextCtrl_GetTextRaw",kwnames,&obj0)) goto fail; + SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxStyledTextCtrl, SWIG_POINTER_EXCEPTION | 0); + if (SWIG_arg_fail(1)) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (arg1)->GetTextRaw(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + wxCharBuffer * resultptr; + resultptr = new wxCharBuffer((wxCharBuffer &)(result)); + resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_wxCharBuffer, 1); + } + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_StyledTextCtrl_AppendTextRaw(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxStyledTextCtrl *arg1 = (wxStyledTextCtrl *) 0 ; + char *arg2 = (char *) 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "text", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:StyledTextCtrl_AppendTextRaw",kwnames,&obj0,&obj1)) goto fail; + SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxStyledTextCtrl, SWIG_POINTER_EXCEPTION | 0); + if (SWIG_arg_fail(1)) SWIG_fail; + if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) { + SWIG_arg_fail(2);SWIG_fail; + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->AppendTextRaw((char const *)arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + static PyObject * StyledTextCtrl_swigregister(PyObject *, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; @@ -17138,6 +17437,15 @@ static PyMethodDef SwigMethods[] = { { (char *)"StyledTextCtrl_DoDropText", (PyCFunction) _wrap_StyledTextCtrl_DoDropText, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"StyledTextCtrl_SetUseAntiAliasing", (PyCFunction) _wrap_StyledTextCtrl_SetUseAntiAliasing, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"StyledTextCtrl_GetUseAntiAliasing", (PyCFunction) _wrap_StyledTextCtrl_GetUseAntiAliasing, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"StyledTextCtrl_AddTextRaw", (PyCFunction) _wrap_StyledTextCtrl_AddTextRaw, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"StyledTextCtrl_InsertTextRaw", (PyCFunction) _wrap_StyledTextCtrl_InsertTextRaw, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"StyledTextCtrl_GetCurLineRaw", (PyCFunction) _wrap_StyledTextCtrl_GetCurLineRaw, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"StyledTextCtrl_GetLineRaw", (PyCFunction) _wrap_StyledTextCtrl_GetLineRaw, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"StyledTextCtrl_GetSelectedTextRaw", (PyCFunction) _wrap_StyledTextCtrl_GetSelectedTextRaw, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"StyledTextCtrl_GetTextRangeRaw", (PyCFunction) _wrap_StyledTextCtrl_GetTextRangeRaw, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"StyledTextCtrl_SetTextRaw", (PyCFunction) _wrap_StyledTextCtrl_SetTextRaw, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"StyledTextCtrl_GetTextRaw", (PyCFunction) _wrap_StyledTextCtrl_GetTextRaw, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"StyledTextCtrl_AppendTextRaw", (PyCFunction) _wrap_StyledTextCtrl_AppendTextRaw, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"StyledTextCtrl_swigregister", StyledTextCtrl_swigregister, METH_VARARGS, NULL}, { (char *)"new_StyledTextEvent", (PyCFunction) _wrap_new_StyledTextEvent, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"delete_StyledTextEvent", (PyCFunction) _wrap_delete_StyledTextEvent, METH_VARARGS | METH_KEYWORDS, NULL}, @@ -17659,6 +17967,7 @@ static swig_type_info _swigt__p_wxObject[] = {{"_p_wxObject", 0, "wxObject *", 0 static swig_type_info _swigt__p_unsigned_char[] = {{"_p_unsigned_char", 0, "unsigned char *|byte *", 0, 0, 0, 0},{"_p_unsigned_char", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxColour[] = {{"_p_wxColour", 0, "wxColour *", 0, 0, 0, 0},{"_p_wxColour", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxScrollBar[] = {{"_p_wxScrollBar", 0, "wxScrollBar *", 0, 0, 0, 0},{"_p_wxScrollBar", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxCharBuffer[] = {{"_p_wxCharBuffer", 0, "wxCharBuffer *", 0, 0, 0, 0},{"_p_wxCharBuffer", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxStyledTextEvent[] = {{"_p_wxStyledTextEvent", 0, "wxStyledTextEvent *", 0, 0, 0, 0},{"_p_wxStyledTextEvent", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxWindow[] = {{"_p_wxWindow", 0, "wxWindow *", 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxWindow", 0, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxStyledTextCtrl", _p_wxStyledTextCtrlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; static swig_type_info _swigt__p_wxCommandEvent[] = {{"_p_wxCommandEvent", 0, "wxCommandEvent *", 0, 0, 0, 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxCommandEvent, 0, 0, 0, 0, 0},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxCommandEvent, 0, 0, 0, 0, 0},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxCommandEvent, 0, 0, 0, 0, 0},{"_p_wxDateEvent", _p_wxDateEventTo_p_wxCommandEvent, 0, 0, 0, 0, 0},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxCommandEvent, 0, 0, 0, 0, 0},{"_p_wxStyledTextEvent", _p_wxStyledTextEventTo_p_wxCommandEvent, 0, 0, 0, 0, 0},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxCommandEvent, 0, 0, 0, 0, 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxCommandEvent, 0, 0, 0, 0, 0},{"_p_wxCommandEvent", 0, 0, 0, 0, 0, 0},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxCommandEvent, 0, 0, 0, 0, 0},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxCommandEvent, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; @@ -17689,6 +17998,7 @@ _swigt__p_wxObject, _swigt__p_unsigned_char, _swigt__p_wxColour, _swigt__p_wxScrollBar, +_swigt__p_wxCharBuffer, _swigt__p_wxStyledTextEvent, _swigt__p_wxWindow, _swigt__p_wxCommandEvent, diff --git a/wxPython/src/gtk/_controls_wrap.cpp b/wxPython/src/gtk/_controls_wrap.cpp index cb5d955e68..8f4a84db46 100644 --- a/wxPython/src/gtk/_controls_wrap.cpp +++ b/wxPython/src/gtk/_controls_wrap.cpp @@ -1037,7 +1037,8 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } - Py_DECREF(str); + if (str) + Py_DECREF(str); return; } } diff --git a/wxPython/src/gtk/_core.py b/wxPython/src/gtk/_core.py index ceb9755a86..6d9ccebf87 100644 --- a/wxPython/src/gtk/_core.py +++ b/wxPython/src/gtk/_core.py @@ -5691,11 +5691,9 @@ your Mac.""" self._BootstrapApp() - def __del__(self): - try: - self.RestoreStdio() # Just in case the MainLoop was overridden - finally: - wx.PyApp.__del__(self) + def __del__(self, destroy=wx.PyApp.__del__): + self.RestoreStdio() # Just in case the MainLoop was overridden + destroy(self) def Destroy(self): wx.PyApp.Destroy(self) @@ -5724,7 +5722,10 @@ your Mac.""" def RestoreStdio(self): - _sys.stdout, _sys.stderr = self.saveStdio + try: + _sys.stdout, _sys.stderr = self.saveStdio + except: + pass def SetOutputWindowAttributes(self, title=None, pos=None, size=None): diff --git a/wxPython/src/gtk/_core_wrap.cpp b/wxPython/src/gtk/_core_wrap.cpp index bc374b41f3..88cb06f693 100644 --- a/wxPython/src/gtk/_core_wrap.cpp +++ b/wxPython/src/gtk/_core_wrap.cpp @@ -1037,7 +1037,8 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } - Py_DECREF(str); + if (str) + Py_DECREF(str); return; } } diff --git a/wxPython/src/gtk/_gdi_wrap.cpp b/wxPython/src/gtk/_gdi_wrap.cpp index 7f7413f60f..025d6c864d 100644 --- a/wxPython/src/gtk/_gdi_wrap.cpp +++ b/wxPython/src/gtk/_gdi_wrap.cpp @@ -1037,7 +1037,8 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } - Py_DECREF(str); + if (str) + Py_DECREF(str); return; } } diff --git a/wxPython/src/gtk/_misc_wrap.cpp b/wxPython/src/gtk/_misc_wrap.cpp index a5a7c877ca..d1c40e7cf6 100644 --- a/wxPython/src/gtk/_misc_wrap.cpp +++ b/wxPython/src/gtk/_misc_wrap.cpp @@ -1037,7 +1037,8 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } - Py_DECREF(str); + if (str) + Py_DECREF(str); return; } } diff --git a/wxPython/src/gtk/_windows_wrap.cpp b/wxPython/src/gtk/_windows_wrap.cpp index 584cccd317..8b75d855dc 100644 --- a/wxPython/src/gtk/_windows_wrap.cpp +++ b/wxPython/src/gtk/_windows_wrap.cpp @@ -1037,7 +1037,8 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } - Py_DECREF(str); + if (str) + Py_DECREF(str); return; } } diff --git a/wxPython/src/gtk/calendar_wrap.cpp b/wxPython/src/gtk/calendar_wrap.cpp index 45d69abab5..2f1e3d24b9 100644 --- a/wxPython/src/gtk/calendar_wrap.cpp +++ b/wxPython/src/gtk/calendar_wrap.cpp @@ -1037,7 +1037,8 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } - Py_DECREF(str); + if (str) + Py_DECREF(str); return; } } diff --git a/wxPython/src/gtk/grid_wrap.cpp b/wxPython/src/gtk/grid_wrap.cpp index 110bc3ecfa..9ec9e0417b 100644 --- a/wxPython/src/gtk/grid_wrap.cpp +++ b/wxPython/src/gtk/grid_wrap.cpp @@ -1037,7 +1037,8 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } - Py_DECREF(str); + if (str) + Py_DECREF(str); return; } } diff --git a/wxPython/src/gtk/html_wrap.cpp b/wxPython/src/gtk/html_wrap.cpp index d27ac6326b..eeda8daba1 100644 --- a/wxPython/src/gtk/html_wrap.cpp +++ b/wxPython/src/gtk/html_wrap.cpp @@ -1037,7 +1037,8 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } - Py_DECREF(str); + if (str) + Py_DECREF(str); return; } } diff --git a/wxPython/src/gtk/media_wrap.cpp b/wxPython/src/gtk/media_wrap.cpp index 3757687f01..ff571e4e12 100644 --- a/wxPython/src/gtk/media_wrap.cpp +++ b/wxPython/src/gtk/media_wrap.cpp @@ -1037,7 +1037,8 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } - Py_DECREF(str); + if (str) + Py_DECREF(str); return; } } diff --git a/wxPython/src/gtk/webkit_wrap.cpp b/wxPython/src/gtk/webkit_wrap.cpp index 6927b2f5f2..659a749cea 100644 --- a/wxPython/src/gtk/webkit_wrap.cpp +++ b/wxPython/src/gtk/webkit_wrap.cpp @@ -1037,7 +1037,8 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } - Py_DECREF(str); + if (str) + Py_DECREF(str); return; } } diff --git a/wxPython/src/gtk/wizard_wrap.cpp b/wxPython/src/gtk/wizard_wrap.cpp index f0dc9c897e..a7ab75fcfa 100644 --- a/wxPython/src/gtk/wizard_wrap.cpp +++ b/wxPython/src/gtk/wizard_wrap.cpp @@ -1037,7 +1037,8 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } - Py_DECREF(str); + if (str) + Py_DECREF(str); return; } } diff --git a/wxPython/src/gtk/xrc_wrap.cpp b/wxPython/src/gtk/xrc_wrap.cpp index ef8ca47db0..c5e5990b95 100644 --- a/wxPython/src/gtk/xrc_wrap.cpp +++ b/wxPython/src/gtk/xrc_wrap.cpp @@ -1037,7 +1037,8 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } - Py_DECREF(str); + if (str) + Py_DECREF(str); return; } } -- 2.45.2