Applied and merged patch 486364, which enables wxPython to be built in

unicode mode.  There are a number of things still missing in it and
not everything is converted correctly...  But it now builds and
functions properly again in non-unicode mode so this is a good time to
check in everything.  The previous version of all of wxPython sources
is tagged wxPy_B4_UNICODE.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14534 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-03-10 00:29:04 +00:00
parent 3b7bc64a2a
commit c8bc7bb84d
78 changed files with 13138 additions and 23720 deletions

View File

@@ -88,12 +88,6 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
return target;
}
#if PYTHON_API_VERSION >= 1009
static char* wxStringErrorMsg = "String or Unicode type required";
#else
static char* wxStringErrorMsg = "String type required";
#endif
typedef wxTreeCtrl wxPyTreeCtrl;
class wxPyTreeCompanionWindow: public wxTreeCompanionWindow
@@ -173,7 +167,7 @@ static PyObject *_wrap_new_wxDynamicSashSplitEvent(PyObject *self, PyObject *arg
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxDynamicSashSplitEvent *)new_wxDynamicSashSplitEvent(_arg0);
_result = (wxDynamicSashSplitEvent *)new_wxDynamicSashSplitEvent(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -232,7 +226,7 @@ static PyObject *_wrap_new_wxDynamicSashUnifyEvent(PyObject *self, PyObject *arg
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxDynamicSashUnifyEvent *)new_wxDynamicSashUnifyEvent(_arg0);
_result = (wxDynamicSashUnifyEvent *)new_wxDynamicSashUnifyEvent(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -312,7 +306,7 @@ static PyObject *_wrap_new_wxDynamicSashWindow(PyObject *self, PyObject *args, P
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxDynamicSashWindow *)new_wxDynamicSashWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5);
_result = (wxDynamicSashWindow *)new_wxDynamicSashWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -338,7 +332,7 @@ static PyObject *_wrap_new_wxPreDynamicSashWindow(PyObject *self, PyObject *args
return NULL;
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxDynamicSashWindow *)new_wxPreDynamicSashWindow();
_result = (wxDynamicSashWindow *)new_wxPreDynamicSashWindow();
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -402,7 +396,7 @@ static PyObject *_wrap_wxDynamicSashWindow_Create(PyObject *self, PyObject *args
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (bool )wxDynamicSashWindow_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6);
_result = (bool )wxDynamicSashWindow_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -440,7 +434,7 @@ static PyObject *_wrap_wxDynamicSashWindow_GetHScrollBar(PyObject *self, PyObjec
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxScrollBar *)wxDynamicSashWindow_GetHScrollBar(_arg0,_arg1);
_result = (wxScrollBar *)wxDynamicSashWindow_GetHScrollBar(_arg0,_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -484,7 +478,7 @@ static PyObject *_wrap_wxDynamicSashWindow_GetVScrollBar(PyObject *self, PyObjec
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxScrollBar *)wxDynamicSashWindow_GetVScrollBar(_arg0,_arg1);
_result = (wxScrollBar *)wxDynamicSashWindow_GetVScrollBar(_arg0,_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -561,22 +555,9 @@ static PyObject *_wrap_new_wxEditableListBox(PyObject *self, PyObject *args, PyO
}
}
{
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
_arg2 = wxString_in_helper(_obj2);
if (_arg2 == NULL)
return NULL;
}
if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1)
return NULL;
_arg2 = new wxString(tmpPtr, tmpSize);
#else
if (!PyString_Check(_obj2)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
return NULL;
}
_arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2));
#endif
}
if (_obj3)
{
@@ -592,7 +573,7 @@ static PyObject *_wrap_new_wxEditableListBox(PyObject *self, PyObject *args, PyO
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxEditableListBox *)new_wxEditableListBox(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,_arg6);
_result = (wxEditableListBox *)new_wxEditableListBox(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,_arg6);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -638,15 +619,20 @@ static PyObject *_wrap_wxEditableListBox_SetStrings(PyObject *self, PyObject *ar
int i, len=PySequence_Length(_obj1);
for (i=0; i<len; i++) {
PyObject* item = PySequence_GetItem(_obj1, i);
#if wxUSE_UNICODE
PyObject* str = PyObject_Unicode(item);
_arg1->Add(PyUnicode_AsUnicode(str));
#else
PyObject* str = PyObject_Str(item);
_arg1->Add(PyString_AsString(str));
#endif
Py_DECREF(item);
Py_DECREF(str);
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxEditableListBox_SetStrings(_arg0,*_arg1);
wxEditableListBox_SetStrings(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -683,7 +669,7 @@ static PyObject *_wrap_wxEditableListBox_GetStrings(PyObject *self, PyObject *ar
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (PyObject *)wxEditableListBox_GetStrings(_arg0);
_result = (PyObject *)wxEditableListBox_GetStrings(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -774,7 +760,7 @@ static PyObject *_wrap_new_wxRemotelyScrolledTreeCtrl(PyObject *self, PyObject *
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxRemotelyScrolledTreeCtrl *)new_wxRemotelyScrolledTreeCtrl(_arg0,_arg1,*_arg2,*_arg3,_arg4);
_result = (wxRemotelyScrolledTreeCtrl *)new_wxRemotelyScrolledTreeCtrl(_arg0,_arg1,*_arg2,*_arg3,_arg4);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -807,7 +793,7 @@ static PyObject *_wrap_wxRemotelyScrolledTreeCtrl_HideVScrollbar(PyObject *self,
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxRemotelyScrolledTreeCtrl_HideVScrollbar(_arg0);
wxRemotelyScrolledTreeCtrl_HideVScrollbar(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -835,7 +821,7 @@ static PyObject *_wrap_wxRemotelyScrolledTreeCtrl_AdjustRemoteScrollbars(PyObjec
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxRemotelyScrolledTreeCtrl_AdjustRemoteScrollbars(_arg0);
wxRemotelyScrolledTreeCtrl_AdjustRemoteScrollbars(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -865,7 +851,7 @@ static PyObject *_wrap_wxRemotelyScrolledTreeCtrl_GetScrolledWindow(PyObject *se
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxScrolledWindow *)wxRemotelyScrolledTreeCtrl_GetScrolledWindow(_arg0);
_result = (wxScrolledWindow *)wxRemotelyScrolledTreeCtrl_GetScrolledWindow(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -900,7 +886,7 @@ static PyObject *_wrap_wxRemotelyScrolledTreeCtrl_ScrollToLine(PyObject *self, P
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxRemotelyScrolledTreeCtrl_ScrollToLine(_arg0,_arg1,_arg2);
wxRemotelyScrolledTreeCtrl_ScrollToLine(_arg0,_arg1,_arg2);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -937,7 +923,7 @@ static PyObject *_wrap_wxRemotelyScrolledTreeCtrl_SetCompanionWindow(PyObject *s
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxRemotelyScrolledTreeCtrl_SetCompanionWindow(_arg0,_arg1);
wxRemotelyScrolledTreeCtrl_SetCompanionWindow(_arg0,_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -966,7 +952,7 @@ static PyObject *_wrap_wxRemotelyScrolledTreeCtrl_GetCompanionWindow(PyObject *s
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxWindow *)wxRemotelyScrolledTreeCtrl_GetCompanionWindow(_arg0);
_result = (wxWindow *)wxRemotelyScrolledTreeCtrl_GetCompanionWindow(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -1039,7 +1025,7 @@ static PyObject *_wrap_new_wxTreeCompanionWindow(PyObject *self, PyObject *args,
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxPyTreeCompanionWindow *)new_wxTreeCompanionWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4);
_result = (wxPyTreeCompanionWindow *)new_wxTreeCompanionWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -1082,7 +1068,7 @@ static PyObject *_wrap_wxTreeCompanionWindow__setCallbackInfo(PyObject *self, Py
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxTreeCompanionWindow__setCallbackInfo(_arg0,_arg1,_arg2);
wxTreeCompanionWindow__setCallbackInfo(_arg0,_arg1,_arg2);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -1112,7 +1098,7 @@ static PyObject *_wrap_wxTreeCompanionWindow_GetTreeCtrl(PyObject *self, PyObjec
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxRemotelyScrolledTreeCtrl *)wxTreeCompanionWindow_GetTreeCtrl(_arg0);
_result = (wxRemotelyScrolledTreeCtrl *)wxTreeCompanionWindow_GetTreeCtrl(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -1154,7 +1140,7 @@ static PyObject *_wrap_wxTreeCompanionWindow_SetTreeCtrl(PyObject *self, PyObjec
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxTreeCompanionWindow_SetTreeCtrl(_arg0,_arg1);
wxTreeCompanionWindow_SetTreeCtrl(_arg0,_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -1236,7 +1222,7 @@ static PyObject *_wrap_new_wxThinSplitterWindow(PyObject *self, PyObject *args,
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxThinSplitterWindow *)new_wxThinSplitterWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4);
_result = (wxThinSplitterWindow *)new_wxThinSplitterWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -1331,7 +1317,7 @@ static PyObject *_wrap_new_wxSplitterScrolledWindow(PyObject *self, PyObject *ar
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxSplitterScrolledWindow *)new_wxSplitterScrolledWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4);
_result = (wxSplitterScrolledWindow *)new_wxSplitterScrolledWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -1418,7 +1404,7 @@ static PyObject *_wrap_new_wxLEDNumberCtrl(PyObject *self, PyObject *args, PyObj
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxLEDNumberCtrl *)new_wxLEDNumberCtrl(_arg0,_arg1,*_arg2,*_arg3,_arg4);
_result = (wxLEDNumberCtrl *)new_wxLEDNumberCtrl(_arg0,_arg1,*_arg2,*_arg3,_arg4);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -1444,7 +1430,7 @@ static PyObject *_wrap_new_wxPreLEDNumberCtrl(PyObject *self, PyObject *args, Py
return NULL;
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxLEDNumberCtrl *)new_wxPreLEDNumberCtrl();
_result = (wxLEDNumberCtrl *)new_wxPreLEDNumberCtrl();
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -1507,7 +1493,7 @@ static PyObject *_wrap_wxLEDNumberCtrl_Create(PyObject *self, PyObject *args, Py
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (bool )wxLEDNumberCtrl_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5);
_result = (bool )wxLEDNumberCtrl_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -1535,7 +1521,7 @@ static PyObject *_wrap_wxLEDNumberCtrl_GetAlignment(PyObject *self, PyObject *ar
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxLEDValueAlign )wxLEDNumberCtrl_GetAlignment(_arg0);
_result = (wxLEDValueAlign )wxLEDNumberCtrl_GetAlignment(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -1563,7 +1549,7 @@ static PyObject *_wrap_wxLEDNumberCtrl_GetDrawFaded(PyObject *self, PyObject *ar
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (bool )wxLEDNumberCtrl_GetDrawFaded(_arg0);
_result = (bool )wxLEDNumberCtrl_GetDrawFaded(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -1591,13 +1577,17 @@ static PyObject *_wrap_wxLEDNumberCtrl_GetValue(PyObject *self, PyObject *args,
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
const wxString & _result_ref = wxLEDNumberCtrl_GetValue(_arg0);
const wxString & _result_ref = wxLEDNumberCtrl_GetValue(_arg0);
_result = (wxString *) &_result_ref;
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
}
return _resultobj;
}
@@ -1625,7 +1615,7 @@ static PyObject *_wrap_wxLEDNumberCtrl_SetAlignment(PyObject *self, PyObject *ar
_arg2 = (bool ) tempbool2;
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxLEDNumberCtrl_SetAlignment(_arg0,_arg1,_arg2);
wxLEDNumberCtrl_SetAlignment(_arg0,_arg1,_arg2);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -1659,7 +1649,7 @@ static PyObject *_wrap_wxLEDNumberCtrl_SetDrawFaded(PyObject *self, PyObject *ar
_arg2 = (bool ) tempbool2;
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxLEDNumberCtrl_SetDrawFaded(_arg0,_arg1,_arg2);
wxLEDNumberCtrl_SetDrawFaded(_arg0,_arg1,_arg2);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -1690,27 +1680,14 @@ static PyObject *_wrap_wxLEDNumberCtrl_SetValue(PyObject *self, PyObject *args,
}
}
{
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
_arg1 = wxString_in_helper(_obj1);
if (_arg1 == NULL)
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
return NULL;
_arg1 = new wxString(tmpPtr, tmpSize);
#else
if (!PyString_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
return NULL;
}
_arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1));
#endif
}
_arg2 = (bool ) tempbool2;
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxLEDNumberCtrl_SetValue(_arg0,*_arg1,_arg2);
wxLEDNumberCtrl_SetValue(_arg0,*_arg1,_arg2);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;