From 66af7a75406831dfcbae81728dce709efe2ed628 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 16 Apr 2005 06:29:58 +0000 Subject: [PATCH] reSWIGged git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33646 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/contrib/activex/activex_wrap.cpp | 3 +- wxPython/contrib/animate/mac/animate_wrap.cpp | 3 +- wxPython/contrib/animate/msw/animate_wrap.cpp | 3 +- wxPython/contrib/gizmos/mac/gizmos_wrap.cpp | 3 +- wxPython/contrib/gizmos/msw/gizmos_wrap.cpp | 3 +- .../contrib/glcanvas/mac/glcanvas_wrap.cpp | 3 +- .../contrib/glcanvas/msw/glcanvas_wrap.cpp | 3 +- wxPython/contrib/stc/mac/stc.py | 40 ++- wxPython/contrib/stc/mac/stc_wrap.cpp | 339 ++++++++++++++++-- wxPython/contrib/stc/msw/stc.py | 40 ++- wxPython/contrib/stc/msw/stc_wrap.cpp | 339 ++++++++++++++++-- wxPython/src/mac/_controls_wrap.cpp | 3 +- wxPython/src/mac/_core.py | 13 +- wxPython/src/mac/_core_wrap.cpp | 3 +- wxPython/src/mac/_gdi_wrap.cpp | 3 +- wxPython/src/mac/_misc_wrap.cpp | 3 +- wxPython/src/mac/_windows_wrap.cpp | 3 +- wxPython/src/mac/calendar_wrap.cpp | 3 +- wxPython/src/mac/grid_wrap.cpp | 3 +- wxPython/src/mac/html_wrap.cpp | 3 +- wxPython/src/mac/media_wrap.cpp | 3 +- wxPython/src/mac/webkit_wrap.cpp | 3 +- wxPython/src/mac/wizard_wrap.cpp | 3 +- wxPython/src/mac/xrc_wrap.cpp | 3 +- wxPython/src/msw/_controls_wrap.cpp | 3 +- wxPython/src/msw/_core.py | 13 +- wxPython/src/msw/_core_wrap.cpp | 3 +- wxPython/src/msw/_gdi_wrap.cpp | 3 +- wxPython/src/msw/_misc_wrap.cpp | 3 +- wxPython/src/msw/_windows_wrap.cpp | 3 +- wxPython/src/msw/calendar_wrap.cpp | 3 +- wxPython/src/msw/grid_wrap.cpp | 3 +- wxPython/src/msw/html_wrap.cpp | 3 +- wxPython/src/msw/media_wrap.cpp | 3 +- wxPython/src/msw/webkit_wrap.cpp | 3 +- wxPython/src/msw/wizard_wrap.cpp | 3 +- wxPython/src/msw/xrc_wrap.cpp | 3 +- 37 files changed, 788 insertions(+), 89 deletions(-) diff --git a/wxPython/contrib/activex/activex_wrap.cpp b/wxPython/contrib/activex/activex_wrap.cpp index 7a53c1a3fa..47062750ee 100644 --- a/wxPython/contrib/activex/activex_wrap.cpp +++ b/wxPython/contrib/activex/activex_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/animate/mac/animate_wrap.cpp b/wxPython/contrib/animate/mac/animate_wrap.cpp index 9c9a008dd4..62c8e3acd9 100644 --- a/wxPython/contrib/animate/mac/animate_wrap.cpp +++ b/wxPython/contrib/animate/mac/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/animate/msw/animate_wrap.cpp b/wxPython/contrib/animate/msw/animate_wrap.cpp index ae429bbf4a..eb706b719b 100644 --- a/wxPython/contrib/animate/msw/animate_wrap.cpp +++ b/wxPython/contrib/animate/msw/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/mac/gizmos_wrap.cpp b/wxPython/contrib/gizmos/mac/gizmos_wrap.cpp index 53fb2803fa..ede7518ad6 100644 --- a/wxPython/contrib/gizmos/mac/gizmos_wrap.cpp +++ b/wxPython/contrib/gizmos/mac/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/gizmos/msw/gizmos_wrap.cpp b/wxPython/contrib/gizmos/msw/gizmos_wrap.cpp index 0479e98f0e..c2af961191 100644 --- a/wxPython/contrib/gizmos/msw/gizmos_wrap.cpp +++ b/wxPython/contrib/gizmos/msw/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/mac/glcanvas_wrap.cpp b/wxPython/contrib/glcanvas/mac/glcanvas_wrap.cpp index b11e400d5f..4f6cc91276 100644 --- a/wxPython/contrib/glcanvas/mac/glcanvas_wrap.cpp +++ b/wxPython/contrib/glcanvas/mac/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/glcanvas/msw/glcanvas_wrap.cpp b/wxPython/contrib/glcanvas/msw/glcanvas_wrap.cpp index 1219c4c603..e591f961a1 100644 --- a/wxPython/contrib/glcanvas/msw/glcanvas_wrap.cpp +++ b/wxPython/contrib/glcanvas/msw/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/mac/stc.py b/wxPython/contrib/stc/mac/stc.py index 481ac536fa..9d8b41ca36 100644 --- a/wxPython/contrib/stc/mac/stc.py +++ b/wxPython/contrib/stc/mac/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/mac/stc_wrap.cpp b/wxPython/contrib/stc/mac/stc_wrap.cpp index 6facc5b511..898088076d 100644 --- a/wxPython/contrib/stc/mac/stc_wrap.cpp +++ b/wxPython/contrib/stc/mac/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; } } @@ -1764,6 +1765,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 +1818,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 +9854,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 +15312,296 @@ 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; + } + { + resultobj = PyString_FromString((char*)(&result)->data()); + } + 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; + } + { + resultobj = PyString_FromString((char*)(&result)->data()); + } + 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; + } + { + resultobj = PyString_FromString((char*)(&result)->data()); + } + 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; + } + { + resultobj = PyString_FromString((char*)(&result)->data()); + } + 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; + } + { + resultobj = PyString_FromString((char*)(&result)->data()); + } + 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 +17426,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}, diff --git a/wxPython/contrib/stc/msw/stc.py b/wxPython/contrib/stc/msw/stc.py index 481ac536fa..9d8b41ca36 100644 --- a/wxPython/contrib/stc/msw/stc.py +++ b/wxPython/contrib/stc/msw/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/msw/stc_wrap.cpp b/wxPython/contrib/stc/msw/stc_wrap.cpp index 832196dfb8..3608dffdc9 100644 --- a/wxPython/contrib/stc/msw/stc_wrap.cpp +++ b/wxPython/contrib/stc/msw/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; } } @@ -1764,6 +1765,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 +1818,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 +9854,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 +15312,296 @@ 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; + } + { + resultobj = PyString_FromString((char*)(&result)->data()); + } + 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; + } + { + resultobj = PyString_FromString((char*)(&result)->data()); + } + 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; + } + { + resultobj = PyString_FromString((char*)(&result)->data()); + } + 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; + } + { + resultobj = PyString_FromString((char*)(&result)->data()); + } + 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; + } + { + resultobj = PyString_FromString((char*)(&result)->data()); + } + 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 +17426,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}, diff --git a/wxPython/src/mac/_controls_wrap.cpp b/wxPython/src/mac/_controls_wrap.cpp index 551f5a3828..d5959d4d2d 100644 --- a/wxPython/src/mac/_controls_wrap.cpp +++ b/wxPython/src/mac/_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/mac/_core.py b/wxPython/src/mac/_core.py index ceb9755a86..6d9ccebf87 100644 --- a/wxPython/src/mac/_core.py +++ b/wxPython/src/mac/_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/mac/_core_wrap.cpp b/wxPython/src/mac/_core_wrap.cpp index bc374b41f3..88cb06f693 100644 --- a/wxPython/src/mac/_core_wrap.cpp +++ b/wxPython/src/mac/_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/mac/_gdi_wrap.cpp b/wxPython/src/mac/_gdi_wrap.cpp index 04a73f8729..7456895c53 100644 --- a/wxPython/src/mac/_gdi_wrap.cpp +++ b/wxPython/src/mac/_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/mac/_misc_wrap.cpp b/wxPython/src/mac/_misc_wrap.cpp index 026c59240c..7689111ac0 100644 --- a/wxPython/src/mac/_misc_wrap.cpp +++ b/wxPython/src/mac/_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/mac/_windows_wrap.cpp b/wxPython/src/mac/_windows_wrap.cpp index 3f1bc6c67c..37e22b4833 100644 --- a/wxPython/src/mac/_windows_wrap.cpp +++ b/wxPython/src/mac/_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/mac/calendar_wrap.cpp b/wxPython/src/mac/calendar_wrap.cpp index 45d69abab5..2f1e3d24b9 100644 --- a/wxPython/src/mac/calendar_wrap.cpp +++ b/wxPython/src/mac/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/mac/grid_wrap.cpp b/wxPython/src/mac/grid_wrap.cpp index e38ab821c2..febd80dfc0 100644 --- a/wxPython/src/mac/grid_wrap.cpp +++ b/wxPython/src/mac/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/mac/html_wrap.cpp b/wxPython/src/mac/html_wrap.cpp index d561a80f88..0ddc129617 100644 --- a/wxPython/src/mac/html_wrap.cpp +++ b/wxPython/src/mac/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/mac/media_wrap.cpp b/wxPython/src/mac/media_wrap.cpp index 3757687f01..ff571e4e12 100644 --- a/wxPython/src/mac/media_wrap.cpp +++ b/wxPython/src/mac/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/mac/webkit_wrap.cpp b/wxPython/src/mac/webkit_wrap.cpp index 6927b2f5f2..659a749cea 100644 --- a/wxPython/src/mac/webkit_wrap.cpp +++ b/wxPython/src/mac/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/mac/wizard_wrap.cpp b/wxPython/src/mac/wizard_wrap.cpp index 2e0e6cd348..df538ba99e 100644 --- a/wxPython/src/mac/wizard_wrap.cpp +++ b/wxPython/src/mac/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/mac/xrc_wrap.cpp b/wxPython/src/mac/xrc_wrap.cpp index ef8ca47db0..c5e5990b95 100644 --- a/wxPython/src/mac/xrc_wrap.cpp +++ b/wxPython/src/mac/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; } } diff --git a/wxPython/src/msw/_controls_wrap.cpp b/wxPython/src/msw/_controls_wrap.cpp index 5c803a74ae..479d15b971 100644 --- a/wxPython/src/msw/_controls_wrap.cpp +++ b/wxPython/src/msw/_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/msw/_core.py b/wxPython/src/msw/_core.py index 231894d435..64189b5da8 100644 --- a/wxPython/src/msw/_core.py +++ b/wxPython/src/msw/_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/msw/_core_wrap.cpp b/wxPython/src/msw/_core_wrap.cpp index f70e1ab64c..e72e48bdb5 100644 --- a/wxPython/src/msw/_core_wrap.cpp +++ b/wxPython/src/msw/_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/msw/_gdi_wrap.cpp b/wxPython/src/msw/_gdi_wrap.cpp index f32ac6e86e..3de1de56ee 100644 --- a/wxPython/src/msw/_gdi_wrap.cpp +++ b/wxPython/src/msw/_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/msw/_misc_wrap.cpp b/wxPython/src/msw/_misc_wrap.cpp index 5002d66339..f58232461c 100644 --- a/wxPython/src/msw/_misc_wrap.cpp +++ b/wxPython/src/msw/_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/msw/_windows_wrap.cpp b/wxPython/src/msw/_windows_wrap.cpp index 47e89bd55e..efe52bc572 100644 --- a/wxPython/src/msw/_windows_wrap.cpp +++ b/wxPython/src/msw/_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/msw/calendar_wrap.cpp b/wxPython/src/msw/calendar_wrap.cpp index 14e1248f67..0afdad34fc 100644 --- a/wxPython/src/msw/calendar_wrap.cpp +++ b/wxPython/src/msw/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/msw/grid_wrap.cpp b/wxPython/src/msw/grid_wrap.cpp index 8e51aeb8c1..8e03991bad 100644 --- a/wxPython/src/msw/grid_wrap.cpp +++ b/wxPython/src/msw/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/msw/html_wrap.cpp b/wxPython/src/msw/html_wrap.cpp index 68e13af46e..11eb115304 100644 --- a/wxPython/src/msw/html_wrap.cpp +++ b/wxPython/src/msw/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/msw/media_wrap.cpp b/wxPython/src/msw/media_wrap.cpp index 747ec17e34..9508a24630 100644 --- a/wxPython/src/msw/media_wrap.cpp +++ b/wxPython/src/msw/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/msw/webkit_wrap.cpp b/wxPython/src/msw/webkit_wrap.cpp index c8d8d0c061..722dd84ce4 100644 --- a/wxPython/src/msw/webkit_wrap.cpp +++ b/wxPython/src/msw/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/msw/wizard_wrap.cpp b/wxPython/src/msw/wizard_wrap.cpp index 481e692a1d..b4a17d785b 100644 --- a/wxPython/src/msw/wizard_wrap.cpp +++ b/wxPython/src/msw/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/msw/xrc_wrap.cpp b/wxPython/src/msw/xrc_wrap.cpp index c0159f9434..de198811ab 100644 --- a/wxPython/src/msw/xrc_wrap.cpp +++ b/wxPython/src/msw/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