From 059a841c9651ba15b1ecc7a8c35189a813a122eb Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 17 Sep 2001 21:47:20 +0000 Subject: [PATCH] Significantly changed how the Python interpreter lock and thread state are managed, which should fix the problem of running on a multi-processor machine. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11625 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/contrib/stc/stc_.cpp | 21 + wxPython/demo/Main.py | 2 +- wxPython/demo/wxComboBox.py | 19 +- wxPython/src/controls.i | 4 +- wxPython/src/gtk/clip_dnd.cpp | 22 +- wxPython/src/gtk/controls.cpp | 71 +- wxPython/src/gtk/controls.py | 6 - wxPython/src/gtk/controls2.cpp | 634 +++++++++++++++- wxPython/src/gtk/controls2.py | 105 ++- wxPython/src/gtk/gdi.cpp | 1258 ++++++++++++++++++++++++++------ wxPython/src/gtk/gdi.py | 146 +++- wxPython/src/gtk/grid.cpp | 1045 +++++++++++++++++--------- wxPython/src/gtk/grid.py | 70 ++ wxPython/src/gtk/html.cpp | 22 +- wxPython/src/gtk/html.py | 1 + wxPython/src/gtk/misc.cpp | 4 +- wxPython/src/gtk/misc2.cpp | 393 +++++----- wxPython/src/gtk/misc2.py | 40 +- wxPython/src/gtk/printfw.cpp | 12 +- wxPython/src/gtk/streams.cpp | 16 +- wxPython/src/gtk/windows.cpp | 10 +- wxPython/src/gtk/windows2.cpp | 40 + wxPython/src/gtk/windows2.py | 4 + wxPython/src/gtk/wx.cpp | 28 +- wxPython/src/gtk/wx.py | 171 ++--- wxPython/src/helpers.h | 34 +- wxPython/src/misc2.i | 8 +- 27 files changed, 3075 insertions(+), 1111 deletions(-) diff --git a/wxPython/contrib/stc/stc_.cpp b/wxPython/contrib/stc/stc_.cpp index 1ad2814880..67ba91300c 100644 --- a/wxPython/contrib/stc/stc_.cpp +++ b/wxPython/contrib/stc/stc_.cpp @@ -10119,6 +10119,7 @@ static PyMethodDef stc_cMethods[] = { * This table is used by the pointer type-checker */ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { + { "_wxEvent","_class_wxStyledTextEvent",SwigwxStyledTextEventTowxEvent}, { "_wxEvent","_wxStyledTextEvent",SwigwxStyledTextEventTowxEvent}, { "_signed_long","_long",0}, { "_wxPrintQuality","_wxCoord",0}, @@ -10130,9 +10131,15 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPrintQuality","_EBool",0}, { "_wxPrintQuality","_size_t",0}, { "_wxPrintQuality","_time_t",0}, + { "_class_wxEvtHandler","_class_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxEvtHandler}, + { "_class_wxEvtHandler","_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxEvtHandler}, { "_byte","_unsigned_char",0}, { "_long","_unsigned_long",0}, { "_long","_signed_long",0}, + { "_class_wxObject","_class_wxStyledTextEvent",SwigwxStyledTextEventTowxObject}, + { "_class_wxObject","_wxStyledTextEvent",SwigwxStyledTextEventTowxObject}, + { "_class_wxObject","_class_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxObject}, + { "_class_wxObject","_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxObject}, { "_size_t","_wxCoord",0}, { "_size_t","_wxPrintQuality",0}, { "_size_t","_time_t",0}, @@ -10148,6 +10155,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_uint","_int",0}, { "_uint","_wxWindowID",0}, { "_wxChar","_char",0}, + { "_class_wxEvent","_class_wxStyledTextEvent",SwigwxStyledTextEventTowxEvent}, + { "_class_wxEvent","_wxStyledTextEvent",SwigwxStyledTextEventTowxEvent}, + { "_wxCommandEvent","_class_wxStyledTextEvent",SwigwxStyledTextEventTowxCommandEvent}, { "_wxCommandEvent","_wxStyledTextEvent",SwigwxStyledTextEventTowxCommandEvent}, { "_char","_wxChar",0}, { "_struct_wxNativeFontInfo","_wxNativeFontInfo",0}, @@ -10170,11 +10180,16 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_unsigned_short","_wxDateTime_t",0}, { "_unsigned_short","_WXTYPE",0}, { "_unsigned_short","_short",0}, + { "_class_wxWindow","_class_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxWindow}, + { "_class_wxWindow","_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxWindow}, + { "_wxObject","_class_wxStyledTextEvent",SwigwxStyledTextEventTowxObject}, { "_wxObject","_wxStyledTextEvent",SwigwxStyledTextEventTowxObject}, + { "_wxObject","_class_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxObject}, { "_wxObject","_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxObject}, { "_signed_short","_WXTYPE",0}, { "_signed_short","_short",0}, { "_unsigned_char","_byte",0}, + { "_wxControl","_class_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxControl}, { "_wxControl","_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxControl}, { "_unsigned_int","_wxCoord",0}, { "_unsigned_int","_wxPrintQuality",0}, @@ -10215,6 +10230,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_time_t","_wxWindowID",0}, { "_time_t","_uint",0}, { "_time_t","_size_t",0}, + { "_class_wxControl","_class_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxControl}, + { "_class_wxControl","_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxControl}, { "_wxCoord","_int",0}, { "_wxCoord","_signed_int",0}, { "_wxCoord","_unsigned_int",0}, @@ -10224,7 +10241,11 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxCoord","_size_t",0}, { "_wxCoord","_time_t",0}, { "_wxCoord","_wxPrintQuality",0}, + { "_class_wxCommandEvent","_class_wxStyledTextEvent",SwigwxStyledTextEventTowxCommandEvent}, + { "_class_wxCommandEvent","_wxStyledTextEvent",SwigwxStyledTextEventTowxCommandEvent}, + { "_wxEvtHandler","_class_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxEvtHandler}, { "_wxEvtHandler","_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxEvtHandler}, + { "_wxWindow","_class_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxWindow}, { "_wxWindow","_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxWindow}, {0,0,0}}; diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index 3f0e2d3236..edcd378ee6 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -195,6 +195,7 @@ class wxPythonDemo(wxFrame): else: # hopefully I can remove this hacky code soon, see bug #216861 panel = wxPanel(self.nb, -1, style=wxCLIP_CHILDREN) self.ovr = wxHtmlWindow(panel, -1, size=(400, 400)) + self.ovr.SetFonts("", "", [7, 8, 10, 12, 16, 22, 30]) self.nb.AddPage(panel, "Overview") def OnOvrSize(evt, ovr=self.ovr): @@ -210,7 +211,6 @@ class wxPythonDemo(wxFrame): # Set up a TextCtrl on the Demo Code Notebook page self.txt = wxTextCtrl(self.nb, -1, style = wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL) - self.txt.SetFont(wxFont(9, wxMODERN, wxNORMAL, wxNORMAL, false)) self.nb.AddPage(self.txt, "Demo Code") diff --git a/wxPython/demo/wxComboBox.py b/wxPython/demo/wxComboBox.py index 1795e889b2..c2109a3d56 100644 --- a/wxPython/demo/wxComboBox.py +++ b/wxPython/demo/wxComboBox.py @@ -4,6 +4,13 @@ from wxPython.wx import * #--------------------------------------------------------------------------- class TestComboBox(wxPanel): + def OnSetFocus(self, evt): + print "OnSetFocus" + evt.Skip() + def OnKillFocus(self, evt): + print "OnKillFocus" + evt.Skip() + def __init__(self, parent, log): self.log = log wxPanel.__init__(self, parent, -1) @@ -15,10 +22,18 @@ class TestComboBox(wxPanel): wxPoint(8, 10)) wxStaticText(self, -1, "Select one:", wxPoint(15, 50), wxSize(75, 18)) - wxComboBox(self, 500, "default value", wxPoint(80, 50), wxSize(95, -1), - sampleList, wxCB_DROPDOWN) + cb = wxComboBox(self, 500, "default value", wxPoint(80, 50), wxSize(95, -1), + sampleList, wxCB_DROPDOWN) EVT_COMBOBOX(self, 500, self.EvtComboBox) EVT_TEXT(self, 500, self.EvtText) + EVT_SET_FOCUS(cb, self.OnSetFocus) + EVT_KILL_FOCUS(cb, self.OnKillFocus) + + + wxComboBox(self, 501, "default value", wxPoint(80, 80), wxSize(95, -1), + sampleList, wxCB_SIMPLE) + EVT_COMBOBOX(self, 501, self.EvtComboBox) + EVT_TEXT(self, 501, self.EvtText) def EvtComboBox(self, event): diff --git a/wxPython/src/controls.i b/wxPython/src/controls.i index cb5f78b5f2..b895044611 100644 --- a/wxPython/src/controls.i +++ b/wxPython/src/controls.i @@ -104,10 +104,10 @@ public: void SetDefault(); void SetBackgroundColour(const wxColour& colour); void SetForegroundColour(const wxColour& colour); - +#ifdef __WXMSW__ void SetImageLabel(const wxBitmap& bitmap); void SetImageMargins(wxCoord x, wxCoord y); - +#endif static wxSize GetDefaultSize(); }; diff --git a/wxPython/src/gtk/clip_dnd.cpp b/wxPython/src/gtk/clip_dnd.cpp index b018c612c9..bc0ea30299 100644 --- a/wxPython/src/gtk/clip_dnd.cpp +++ b/wxPython/src/gtk/clip_dnd.cpp @@ -119,7 +119,7 @@ bool wxPyDataObjectSimple::GetDataHere(void *buf) { // C++ version. bool rval = FALSE; - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (m_myInst.findCallback("GetDataHere")) { PyObject* ro; ro = m_myInst.callCallbackObj(Py_BuildValue("()")); @@ -130,7 +130,7 @@ bool wxPyDataObjectSimple::GetDataHere(void *buf) { Py_DECREF(ro); } } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return rval; } @@ -138,13 +138,13 @@ bool wxPyDataObjectSimple::SetData(size_t len, const void *buf) { // For this one we simply need to make a string from buf and len // and send it to the Python method. bool rval = FALSE; - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (m_myInst.findCallback("SetData")) { PyObject* data = PyString_FromStringAndSize((char*)buf, len); rval = m_myInst.callCallback(Py_BuildValue("(O)", data)); Py_DECREF(data); } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return rval; } // Create a new class for wxPython to use @@ -176,7 +176,7 @@ public: wxBitmap wxPyBitmapDataObject::GetBitmap() { wxBitmap* rval = &wxNullBitmap; - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (m_myInst.findCallback("GetBitmap")) { PyObject* ro; wxBitmap* ptr; @@ -187,17 +187,17 @@ wxBitmap wxPyBitmapDataObject::GetBitmap() { Py_DECREF(ro); } } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return *rval; } void wxPyBitmapDataObject::SetBitmap(const wxBitmap& bitmap) { - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (m_myInst.findCallback("SetBitmap")) { m_myInst.callCallback(Py_BuildValue("(O)", wxPyConstructObject((void*)&bitmap, "wxBitmap"))); } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); } // See below in the init function... @@ -293,7 +293,7 @@ public: bool wxPyFileDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames) { bool rval = FALSE; - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); PyObject* list = PyList_New(0); for (size_t i=0; iSetImageLabel(_swigarg0)) -static PyObject *_wrap_wxButton_SetImageLabel(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxButton * _arg0; - wxBitmap * _arg1; - PyObject * _argo0 = 0; - PyObject * _argo1 = 0; - char *_kwnames[] = { "self","bitmap", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxButton_SetImageLabel",_kwnames,&_argo0,&_argo1)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxButton_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxButton_SetImageLabel. Expected _wxButton_p."); - return NULL; - } - } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxBitmap_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxButton_SetImageLabel. Expected _wxBitmap_p."); - return NULL; - } - } -{ - wxPy_BEGIN_ALLOW_THREADS; - wxButton_SetImageLabel(_arg0,*_arg1); - - wxPy_END_ALLOW_THREADS; - if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - -#define wxButton_SetImageMargins(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetImageMargins(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxButton_SetImageMargins(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxButton * _arg0; - wxCoord _arg1; - wxCoord _arg2; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self","x","y", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxButton_SetImageMargins",_kwnames,&_argo0,&_arg1,&_arg2)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxButton_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxButton_SetImageMargins. Expected _wxButton_p."); - return NULL; - } - } -{ - wxPy_BEGIN_ALLOW_THREADS; - wxButton_SetImageMargins(_arg0,_arg1,_arg2); - - wxPy_END_ALLOW_THREADS; - if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - static PyObject *_wrap_wxButton_GetDefaultSize(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxSize * _result; @@ -11512,8 +11445,6 @@ static PyMethodDef controlscMethods[] = { { "new_wxPreBitmapButton", (PyCFunction) _wrap_new_wxPreBitmapButton, METH_VARARGS | METH_KEYWORDS }, { "new_wxBitmapButton", (PyCFunction) _wrap_new_wxBitmapButton, METH_VARARGS | METH_KEYWORDS }, { "wxButton_GetDefaultSize", (PyCFunction) _wrap_wxButton_GetDefaultSize, METH_VARARGS | METH_KEYWORDS }, - { "wxButton_SetImageMargins", (PyCFunction) _wrap_wxButton_SetImageMargins, METH_VARARGS | METH_KEYWORDS }, - { "wxButton_SetImageLabel", (PyCFunction) _wrap_wxButton_SetImageLabel, METH_VARARGS | METH_KEYWORDS }, { "wxButton_SetForegroundColour", (PyCFunction) _wrap_wxButton_SetForegroundColour, METH_VARARGS | METH_KEYWORDS }, { "wxButton_SetBackgroundColour", (PyCFunction) _wrap_wxButton_SetBackgroundColour, METH_VARARGS | METH_KEYWORDS }, { "wxButton_SetDefault", (PyCFunction) _wrap_wxButton_SetDefault, METH_VARARGS | METH_KEYWORDS }, @@ -11654,12 +11585,14 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_char","_wxChar",0}, { "_wxSpinButton","_class_wxSpinCtrl",SwigwxSpinCtrlTowxSpinButton}, { "_wxSpinButton","_wxSpinCtrl",SwigwxSpinCtrlTowxSpinButton}, + { "_struct_wxNativeFontInfo","_wxNativeFontInfo",0}, { "_EBool","_wxCoord",0}, { "_EBool","_wxPrintQuality",0}, { "_EBool","_signed_int",0}, { "_EBool","_int",0}, { "_EBool","_wxWindowID",0}, { "_unsigned_long","_long",0}, + { "_wxNativeFontInfo","_struct_wxNativeFontInfo",0}, { "_class_wxSpinButton","_class_wxSpinCtrl",SwigwxSpinCtrlTowxSpinButton}, { "_class_wxSpinButton","_wxSpinCtrl",SwigwxSpinCtrlTowxSpinButton}, { "_signed_int","_wxCoord",0}, diff --git a/wxPython/src/gtk/controls.py b/wxPython/src/gtk/controls.py index 34891bc084..0b2fa50326 100644 --- a/wxPython/src/gtk/controls.py +++ b/wxPython/src/gtk/controls.py @@ -58,12 +58,6 @@ class wxButtonPtr(wxControlPtr): def SetForegroundColour(self, *_args, **_kwargs): val = apply(controlsc.wxButton_SetForegroundColour,(self,) + _args, _kwargs) return val - def SetImageLabel(self, *_args, **_kwargs): - val = apply(controlsc.wxButton_SetImageLabel,(self,) + _args, _kwargs) - return val - def SetImageMargins(self, *_args, **_kwargs): - val = apply(controlsc.wxButton_SetImageMargins,(self,) + _args, _kwargs) - return val def __repr__(self): return "" % (self.this,) class wxButton(wxButtonPtr): diff --git a/wxPython/src/gtk/controls2.cpp b/wxPython/src/gtk/controls2.cpp index 48c78f13b6..20122f630c 100644 --- a/wxPython/src/gtk/controls2.cpp +++ b/wxPython/src/gtk/controls2.cpp @@ -129,11 +129,11 @@ IMPLEMENT_ABSTRACT_CLASS(wxPyListCtrl, wxListCtrl); IMP_PYCALLBACK_STRING_LONGLONG(wxPyListCtrl, wxListCtrl, OnGetItemText); IMP_PYCALLBACK_INT_LONG(wxPyListCtrl, wxListCtrl, OnGetItemImage); IMP_PYCALLBACK_LISTATTR_LONG(wxPyListCtrl, wxListCtrl, OnGetItemAttr); - + // Python aware sorting function for wxPyListCtrl int wxCALLBACK wxPyListCtrl_SortItems(long item1, long item2, long funcPtr) { int retval = 0; PyObject* func = (PyObject*)funcPtr; - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); PyObject* args = Py_BuildValue("(ii)", item1, item2); PyObject* result = PyEval_CallObject(func, args); @@ -143,7 +143,7 @@ IMP_PYCALLBACK_LISTATTR_LONG(wxPyListCtrl, wxListCtrl, OnGetItemAttr); Py_DECREF(result); } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return retval; } @@ -158,9 +158,9 @@ public: } ~wxPyTreeItemData() { - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); Py_DECREF(m_obj); - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); } PyObject* GetData() { @@ -169,9 +169,9 @@ public: } void SetData(PyObject* obj) { - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); Py_DECREF(m_obj); - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); m_obj = obj; Py_INCREF(obj); } @@ -204,15 +204,16 @@ public: int OnCompareItems(const wxTreeItemId& item1, const wxTreeItemId& item2) { int rval = 0; - bool doSave = wxPyRestoreThread(); - if (m_myInst.findCallback("OnCompareItems")) + bool found; + wxPyTState* state = wxPyBeginBlockThreads(); + if ((found = m_myInst.findCallback("OnCompareItems"))) rval = m_myInst.callCallback(Py_BuildValue( "(OO)", wxPyConstructObject((void*)&item1, "wxTreeItemId"), wxPyConstructObject((void*)&item2, "wxTreeItemId"))); - else + wxPyEndBlockThreads(state); + if (! found) rval = wxTreeCtrl::OnCompareItems(item1, item2); - wxPySaveThread(doSave); return rval; } PYPRIVATE; @@ -2154,6 +2155,34 @@ static void *SwigwxListEventTowxObject(void *ptr) { return (void *) dest; } +#define new_wxListEvent(_swigarg0,_swigarg1) (new wxListEvent(_swigarg0,_swigarg1)) +static PyObject *_wrap_new_wxListEvent(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxListEvent * _result; + wxEventType _arg0 = (wxEventType ) wxEVT_NULL; + int _arg1 = (int ) 0; + char *_kwnames[] = { "commandType","id", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|ii:new_wxListEvent",_kwnames,&_arg0,&_arg1)) + return NULL; +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxListEvent *)new_wxListEvent(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxListEvent_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + #define wxListEvent_m_code_set(_swigobj,_swigval) (_swigobj->m_code = _swigval,_swigval) static PyObject *_wrap_wxListEvent_m_code_set(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -2957,6 +2986,62 @@ static PyObject *_wrap_wxListEvent_GetItem(PyObject *self, PyObject *args, PyObj return _resultobj; } +#define wxListEvent_GetCacheFrom(_swigobj) (_swigobj->GetCacheFrom()) +static PyObject *_wrap_wxListEvent_GetCacheFrom(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + long _result; + wxListEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListEvent_GetCacheFrom",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListEvent_GetCacheFrom. Expected _wxListEvent_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (long )wxListEvent_GetCacheFrom(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("l",_result); + return _resultobj; +} + +#define wxListEvent_GetCacheTo(_swigobj) (_swigobj->GetCacheTo()) +static PyObject *_wrap_wxListEvent_GetCacheTo(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + long _result; + wxListEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListEvent_GetCacheTo",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListEvent_GetCacheTo. Expected _wxListEvent_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (long )wxListEvent_GetCacheTo(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("l",_result); + return _resultobj; +} + static void *SwigwxPyListCtrlTowxControl(void *ptr) { wxPyListCtrl *src; wxControl *dest; @@ -5131,6 +5216,486 @@ static PyObject *_wrap_wxListCtrl_SortItems(PyObject *self, PyObject *args, PyOb return _resultobj; } +static void *SwigwxListViewTowxPyListCtrl(void *ptr) { + wxListView *src; + wxPyListCtrl *dest; + src = (wxListView *) ptr; + dest = (wxPyListCtrl *) src; + return (void *) dest; +} + +static void *SwigwxListViewTowxControl(void *ptr) { + wxListView *src; + wxControl *dest; + src = (wxListView *) ptr; + dest = (wxControl *) src; + return (void *) dest; +} + +static void *SwigwxListViewTowxWindow(void *ptr) { + wxListView *src; + wxWindow *dest; + src = (wxListView *) ptr; + dest = (wxWindow *) src; + return (void *) dest; +} + +static void *SwigwxListViewTowxEvtHandler(void *ptr) { + wxListView *src; + wxEvtHandler *dest; + src = (wxListView *) ptr; + dest = (wxEvtHandler *) src; + return (void *) dest; +} + +static void *SwigwxListViewTowxObject(void *ptr) { + wxListView *src; + wxObject *dest; + src = (wxListView *) ptr; + dest = (wxObject *) src; + return (void *) dest; +} + +#define new_wxListView(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6) (new wxListView(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6)) +static PyObject *_wrap_new_wxListView(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxListView * _result; + wxWindow * _arg0; + wxWindowID _arg1 = (wxWindowID ) -1; + wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; + wxSize * _arg3 = (wxSize *) &wxDefaultSize; + long _arg4 = (long ) (wxLC_REPORT); + wxValidator * _arg5 = (wxValidator *) &wxDefaultValidator; + wxString * _arg6 = (wxString *) &"listctrl"; + PyObject * _argo0 = 0; + wxPoint temp; + PyObject * _obj2 = 0; + wxSize temp0; + PyObject * _obj3 = 0; + PyObject * _argo5 = 0; + PyObject * _obj6 = 0; + char *_kwnames[] = { "parent","id","pos","size","style","validator","name", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlOO:new_wxListView",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_argo5,&_obj6)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxListView. Expected _wxWindow_p."); + return NULL; + } + } + if (_obj2) +{ + _arg2 = &temp; + if (! wxPoint_helper(_obj2, &_arg2)) + return NULL; +} + if (_obj3) +{ + _arg3 = &temp0; + if (! wxSize_helper(_obj3, &_arg3)) + return NULL; +} + if (_argo5) { + if (_argo5 == Py_None) { _arg5 = NULL; } + else if (SWIG_GetPtrObj(_argo5,(void **) &_arg5,"_wxValidator_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 6 of new_wxListView. Expected _wxValidator_p."); + return NULL; + } + } + if (_obj6) +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj6) && !PyUnicode_Check(_obj6)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + if (PyString_AsStringAndSize(_obj6, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg6 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj6)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg6 = new wxString(PyString_AS_STRING(_obj6), PyString_GET_SIZE(_obj6)); +#endif +} +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxListView *)new_wxListView(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,*_arg6); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxListView_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } +{ + if (_obj6) + delete _arg6; +} + return _resultobj; +} + +#define new_wxPreListView() (new wxListView()) +static PyObject *_wrap_new_wxPreListView(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxListView * _result; + char *_kwnames[] = { NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxPreListView",_kwnames)) + return NULL; +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxListView *)new_wxPreListView(); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxListView_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define wxListView_Create(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6) (_swigobj->Create(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6)) +static PyObject *_wrap_wxListView_Create(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxListView * _arg0; + wxWindow * _arg1; + wxWindowID _arg2 = (wxWindowID ) -1; + wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; + wxSize * _arg4 = (wxSize *) &wxDefaultSize; + long _arg5 = (long ) (wxLC_REPORT); + wxValidator * _arg6 = (wxValidator *) &wxDefaultValidator; + wxString * _arg7 = (wxString *) &"listctrl"; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + wxPoint temp; + PyObject * _obj3 = 0; + wxSize temp0; + PyObject * _obj4 = 0; + PyObject * _argo6 = 0; + PyObject * _obj7 = 0; + char *_kwnames[] = { "self","parent","id","pos","size","style","validator","name", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|iOOlOO:wxListView_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_argo6,&_obj7)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListView_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListView_Create. Expected _wxListView_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxListView_Create. Expected _wxWindow_p."); + return NULL; + } + } + if (_obj3) +{ + _arg3 = &temp; + if (! wxPoint_helper(_obj3, &_arg3)) + return NULL; +} + if (_obj4) +{ + _arg4 = &temp0; + if (! wxSize_helper(_obj4, &_arg4)) + return NULL; +} + if (_argo6) { + if (_argo6 == Py_None) { _arg6 = NULL; } + else if (SWIG_GetPtrObj(_argo6,(void **) &_arg6,"_wxValidator_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 7 of wxListView_Create. Expected _wxValidator_p."); + return NULL; + } + } + if (_obj7) +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj7) && !PyUnicode_Check(_obj7)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + if (PyString_AsStringAndSize(_obj7, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg7 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj7)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg7 = new wxString(PyString_AS_STRING(_obj7), PyString_GET_SIZE(_obj7)); +#endif +} +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxListView_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,*_arg7); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj7) + delete _arg7; +} + return _resultobj; +} + +#define wxListView_Select(_swigobj,_swigarg0,_swigarg1) (_swigobj->Select(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxListView_Select(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxListView * _arg0; + long _arg1; + bool _arg2 = (bool ) TRUE; + PyObject * _argo0 = 0; + int tempbool2 = (int) TRUE; + char *_kwnames[] = { "self","n","on", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol|i:wxListView_Select",_kwnames,&_argo0,&_arg1,&tempbool2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListView_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListView_Select. Expected _wxListView_p."); + return NULL; + } + } + _arg2 = (bool ) tempbool2; +{ + wxPy_BEGIN_ALLOW_THREADS; + wxListView_Select(_arg0,_arg1,_arg2); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxListView_Focus(_swigobj,_swigarg0) (_swigobj->Focus(_swigarg0)) +static PyObject *_wrap_wxListView_Focus(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxListView * _arg0; + long _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","index", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxListView_Focus",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListView_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListView_Focus. Expected _wxListView_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxListView_Focus(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxListView_GetFocusedItem(_swigobj) (_swigobj->GetFocusedItem()) +static PyObject *_wrap_wxListView_GetFocusedItem(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + long _result; + wxListView * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListView_GetFocusedItem",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListView_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListView_GetFocusedItem. Expected _wxListView_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (long )wxListView_GetFocusedItem(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("l",_result); + return _resultobj; +} + +#define wxListView_GetNextSelected(_swigobj,_swigarg0) (_swigobj->GetNextSelected(_swigarg0)) +static PyObject *_wrap_wxListView_GetNextSelected(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + long _result; + wxListView * _arg0; + long _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","item", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxListView_GetNextSelected",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListView_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListView_GetNextSelected. Expected _wxListView_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (long )wxListView_GetNextSelected(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("l",_result); + return _resultobj; +} + +#define wxListView_GetFirstSelected(_swigobj) (_swigobj->GetFirstSelected()) +static PyObject *_wrap_wxListView_GetFirstSelected(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + long _result; + wxListView * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListView_GetFirstSelected",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListView_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListView_GetFirstSelected. Expected _wxListView_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (long )wxListView_GetFirstSelected(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("l",_result); + return _resultobj; +} + +#define wxListView_IsSelected(_swigobj,_swigarg0) (_swigobj->IsSelected(_swigarg0)) +static PyObject *_wrap_wxListView_IsSelected(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxListView * _arg0; + long _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","index", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxListView_IsSelected",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListView_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListView_IsSelected. Expected _wxListView_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxListView_IsSelected(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxListView_SetColumnImage(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetColumnImage(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxListView_SetColumnImage(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxListView * _arg0; + int _arg1; + int _arg2; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","col","image", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxListView_SetColumnImage",_kwnames,&_argo0,&_arg1,&_arg2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListView_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListView_SetColumnImage. Expected _wxListView_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxListView_SetColumnImage(_arg0,_arg1,_arg2); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxListView_ClearColumnImage(_swigobj,_swigarg0) (_swigobj->ClearColumnImage(_swigarg0)) +static PyObject *_wrap_wxListView_ClearColumnImage(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxListView * _arg0; + int _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","col", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxListView_ClearColumnImage",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListView_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListView_ClearColumnImage. Expected _wxListView_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxListView_ClearColumnImage(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define new_wxTreeItemAttr(_swigarg0,_swigarg1,_swigarg2) (new wxTreeItemAttr(_swigarg0,_swigarg1,_swigarg2)) static PyObject *_wrap_new_wxTreeItemAttr(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -7307,7 +7872,7 @@ static PyObject *_wrap_wxTreeCtrl_GetItemParent(PyObject *self, PyObject *args, } static PyObject * wxPyTreeCtrl_GetSelections(wxPyTreeCtrl *self) { - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); PyObject* rval = PyList_New(0); wxArrayTreeItemIds array; size_t num, x; @@ -7317,7 +7882,7 @@ static PyObject * wxPyTreeCtrl_GetSelections(wxPyTreeCtrl *self) { PyObject* item = wxPyConstructObject((void*)tii, "wxTreeItemId", TRUE); PyList_Append(rval, item); } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return rval; } static PyObject *_wrap_wxTreeCtrl_GetSelections(PyObject *self, PyObject *args, PyObject *kwargs) { @@ -8931,6 +9496,17 @@ static PyMethodDef controls2cMethods[] = { { "wxTreeItemAttr_SetBackgroundColour", (PyCFunction) _wrap_wxTreeItemAttr_SetBackgroundColour, METH_VARARGS | METH_KEYWORDS }, { "wxTreeItemAttr_SetTextColour", (PyCFunction) _wrap_wxTreeItemAttr_SetTextColour, METH_VARARGS | METH_KEYWORDS }, { "new_wxTreeItemAttr", (PyCFunction) _wrap_new_wxTreeItemAttr, METH_VARARGS | METH_KEYWORDS }, + { "wxListView_ClearColumnImage", (PyCFunction) _wrap_wxListView_ClearColumnImage, METH_VARARGS | METH_KEYWORDS }, + { "wxListView_SetColumnImage", (PyCFunction) _wrap_wxListView_SetColumnImage, METH_VARARGS | METH_KEYWORDS }, + { "wxListView_IsSelected", (PyCFunction) _wrap_wxListView_IsSelected, METH_VARARGS | METH_KEYWORDS }, + { "wxListView_GetFirstSelected", (PyCFunction) _wrap_wxListView_GetFirstSelected, METH_VARARGS | METH_KEYWORDS }, + { "wxListView_GetNextSelected", (PyCFunction) _wrap_wxListView_GetNextSelected, METH_VARARGS | METH_KEYWORDS }, + { "wxListView_GetFocusedItem", (PyCFunction) _wrap_wxListView_GetFocusedItem, METH_VARARGS | METH_KEYWORDS }, + { "wxListView_Focus", (PyCFunction) _wrap_wxListView_Focus, METH_VARARGS | METH_KEYWORDS }, + { "wxListView_Select", (PyCFunction) _wrap_wxListView_Select, METH_VARARGS | METH_KEYWORDS }, + { "wxListView_Create", (PyCFunction) _wrap_wxListView_Create, METH_VARARGS | METH_KEYWORDS }, + { "new_wxPreListView", (PyCFunction) _wrap_new_wxPreListView, METH_VARARGS | METH_KEYWORDS }, + { "new_wxListView", (PyCFunction) _wrap_new_wxListView, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_SortItems", (PyCFunction) _wrap_wxListCtrl_SortItems, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_ScrollList", (PyCFunction) _wrap_wxListCtrl_ScrollList, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_SetItemCount", (PyCFunction) _wrap_wxListCtrl_SetItemCount, METH_VARARGS | METH_KEYWORDS }, @@ -8991,6 +9567,8 @@ static PyMethodDef controls2cMethods[] = { { "wxListCtrl_Create", (PyCFunction) _wrap_wxListCtrl_Create, METH_VARARGS | METH_KEYWORDS }, { "new_wxPreListCtrl", (PyCFunction) _wrap_new_wxPreListCtrl, METH_VARARGS | METH_KEYWORDS }, { "new_wxListCtrl", (PyCFunction) _wrap_new_wxListCtrl, METH_VARARGS | METH_KEYWORDS }, + { "wxListEvent_GetCacheTo", (PyCFunction) _wrap_wxListEvent_GetCacheTo, METH_VARARGS | METH_KEYWORDS }, + { "wxListEvent_GetCacheFrom", (PyCFunction) _wrap_wxListEvent_GetCacheFrom, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_GetItem", (PyCFunction) _wrap_wxListEvent_GetItem, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_GetMask", (PyCFunction) _wrap_wxListEvent_GetMask, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_GetData", (PyCFunction) _wrap_wxListEvent_GetData, METH_VARARGS | METH_KEYWORDS }, @@ -9018,6 +9596,7 @@ static PyMethodDef controls2cMethods[] = { { "wxListEvent_m_itemIndex_set", (PyCFunction) _wrap_wxListEvent_m_itemIndex_set, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_m_code_get", (PyCFunction) _wrap_wxListEvent_m_code_get, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_m_code_set", (PyCFunction) _wrap_wxListEvent_m_code_set, METH_VARARGS | METH_KEYWORDS }, + { "new_wxListEvent", (PyCFunction) _wrap_new_wxListEvent, METH_VARARGS | METH_KEYWORDS }, { "wxListItem_m_width_get", (PyCFunction) _wrap_wxListItem_m_width_get, METH_VARARGS | METH_KEYWORDS }, { "wxListItem_m_width_set", (PyCFunction) _wrap_wxListItem_m_width_set, METH_VARARGS | METH_KEYWORDS }, { "wxListItem_m_format_get", (PyCFunction) _wrap_wxListItem_m_format_get, METH_VARARGS | METH_KEYWORDS }, @@ -9093,6 +9672,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxEvent","_class_wxListEvent",SwigwxListEventTowxEvent}, { "_wxEvent","_wxListEvent",SwigwxListEventTowxEvent}, { "_signed_long","_long",0}, + { "_class_wxPyListCtrl","_class_wxListView",SwigwxListViewTowxPyListCtrl}, + { "_class_wxPyListCtrl","_wxListView",SwigwxListViewTowxPyListCtrl}, { "_wxPrintQuality","_wxCoord",0}, { "_wxPrintQuality","_int",0}, { "_wxPrintQuality","_signed_int",0}, @@ -9104,6 +9685,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPrintQuality","_time_t",0}, { "_class_wxEvtHandler","_class_wxPyTreeCtrl",SwigwxPyTreeCtrlTowxEvtHandler}, { "_class_wxEvtHandler","_wxPyTreeCtrl",SwigwxPyTreeCtrlTowxEvtHandler}, + { "_class_wxEvtHandler","_class_wxListView",SwigwxListViewTowxEvtHandler}, + { "_class_wxEvtHandler","_wxListView",SwigwxListViewTowxEvtHandler}, { "_class_wxEvtHandler","_class_wxPyListCtrl",SwigwxPyListCtrlTowxEvtHandler}, { "_class_wxEvtHandler","_wxPyListCtrl",SwigwxPyListCtrlTowxEvtHandler}, { "_wxNotifyEvent","_class_wxTreeEvent",SwigwxTreeEventTowxNotifyEvent}, @@ -9119,6 +9702,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxObject","_wxTreeEvent",SwigwxTreeEventTowxObject}, { "_class_wxObject","_class_wxPyTreeItemData",SwigwxPyTreeItemDataTowxObject}, { "_class_wxObject","_wxPyTreeItemData",SwigwxPyTreeItemDataTowxObject}, + { "_class_wxObject","_class_wxListView",SwigwxListViewTowxObject}, + { "_class_wxObject","_wxListView",SwigwxListViewTowxObject}, { "_class_wxObject","_class_wxPyListCtrl",SwigwxPyListCtrlTowxObject}, { "_class_wxObject","_wxPyListCtrl",SwigwxPyListCtrlTowxObject}, { "_class_wxObject","_class_wxListEvent",SwigwxListEventTowxObject}, @@ -9153,12 +9738,14 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxNotifyEvent","_wxTreeEvent",SwigwxTreeEventTowxNotifyEvent}, { "_class_wxNotifyEvent","_class_wxListEvent",SwigwxListEventTowxNotifyEvent}, { "_class_wxNotifyEvent","_wxListEvent",SwigwxListEventTowxNotifyEvent}, + { "_struct_wxNativeFontInfo","_wxNativeFontInfo",0}, { "_EBool","_wxCoord",0}, { "_EBool","_wxPrintQuality",0}, { "_EBool","_signed_int",0}, { "_EBool","_int",0}, { "_EBool","_wxWindowID",0}, { "_unsigned_long","_long",0}, + { "_wxNativeFontInfo","_struct_wxNativeFontInfo",0}, { "_signed_int","_wxCoord",0}, { "_signed_int","_wxPrintQuality",0}, { "_signed_int","_EBool",0}, @@ -9171,6 +9758,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_unsigned_short","_short",0}, { "_class_wxWindow","_class_wxPyTreeCtrl",SwigwxPyTreeCtrlTowxWindow}, { "_class_wxWindow","_wxPyTreeCtrl",SwigwxPyTreeCtrlTowxWindow}, + { "_class_wxWindow","_class_wxListView",SwigwxListViewTowxWindow}, + { "_class_wxWindow","_wxListView",SwigwxListViewTowxWindow}, { "_class_wxWindow","_class_wxPyListCtrl",SwigwxPyListCtrlTowxWindow}, { "_class_wxWindow","_wxPyListCtrl",SwigwxPyListCtrlTowxWindow}, { "_wxObject","_class_wxPyTreeCtrl",SwigwxPyTreeCtrlTowxObject}, @@ -9179,6 +9768,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxObject","_wxTreeEvent",SwigwxTreeEventTowxObject}, { "_wxObject","_class_wxPyTreeItemData",SwigwxPyTreeItemDataTowxObject}, { "_wxObject","_wxPyTreeItemData",SwigwxPyTreeItemDataTowxObject}, + { "_wxObject","_class_wxListView",SwigwxListViewTowxObject}, + { "_wxObject","_wxListView",SwigwxListViewTowxObject}, { "_wxObject","_class_wxPyListCtrl",SwigwxPyListCtrlTowxObject}, { "_wxObject","_wxPyListCtrl",SwigwxPyListCtrlTowxObject}, { "_wxObject","_class_wxListEvent",SwigwxListEventTowxObject}, @@ -9190,6 +9781,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_unsigned_char","_byte",0}, { "_wxControl","_class_wxPyTreeCtrl",SwigwxPyTreeCtrlTowxControl}, { "_wxControl","_wxPyTreeCtrl",SwigwxPyTreeCtrlTowxControl}, + { "_wxControl","_class_wxListView",SwigwxListViewTowxControl}, + { "_wxControl","_wxListView",SwigwxListViewTowxControl}, { "_wxControl","_class_wxPyListCtrl",SwigwxPyListCtrlTowxControl}, { "_wxControl","_wxPyListCtrl",SwigwxPyListCtrlTowxControl}, { "_unsigned_int","_wxCoord",0}, @@ -9229,6 +9822,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_time_t","_size_t",0}, { "_class_wxControl","_class_wxPyTreeCtrl",SwigwxPyTreeCtrlTowxControl}, { "_class_wxControl","_wxPyTreeCtrl",SwigwxPyTreeCtrlTowxControl}, + { "_class_wxControl","_class_wxListView",SwigwxListViewTowxControl}, + { "_class_wxControl","_wxListView",SwigwxListViewTowxControl}, { "_class_wxControl","_class_wxPyListCtrl",SwigwxPyListCtrlTowxControl}, { "_class_wxControl","_wxPyListCtrl",SwigwxPyListCtrlTowxControl}, { "_wxCoord","_int",0}, @@ -9244,12 +9839,18 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxCommandEvent","_wxTreeEvent",SwigwxTreeEventTowxCommandEvent}, { "_class_wxCommandEvent","_class_wxListEvent",SwigwxListEventTowxCommandEvent}, { "_class_wxCommandEvent","_wxListEvent",SwigwxListEventTowxCommandEvent}, + { "_wxPyListCtrl","_class_wxListView",SwigwxListViewTowxPyListCtrl}, + { "_wxPyListCtrl","_wxListView",SwigwxListViewTowxPyListCtrl}, { "_wxEvtHandler","_class_wxPyTreeCtrl",SwigwxPyTreeCtrlTowxEvtHandler}, { "_wxEvtHandler","_wxPyTreeCtrl",SwigwxPyTreeCtrlTowxEvtHandler}, + { "_wxEvtHandler","_class_wxListView",SwigwxListViewTowxEvtHandler}, + { "_wxEvtHandler","_wxListView",SwigwxListViewTowxEvtHandler}, { "_wxEvtHandler","_class_wxPyListCtrl",SwigwxPyListCtrlTowxEvtHandler}, { "_wxEvtHandler","_wxPyListCtrl",SwigwxPyListCtrlTowxEvtHandler}, { "_wxWindow","_class_wxPyTreeCtrl",SwigwxPyTreeCtrlTowxWindow}, { "_wxWindow","_wxPyTreeCtrl",SwigwxPyTreeCtrlTowxWindow}, + { "_wxWindow","_class_wxListView",SwigwxListViewTowxWindow}, + { "_wxWindow","_wxListView",SwigwxListViewTowxWindow}, { "_wxWindow","_class_wxPyListCtrl",SwigwxPyListCtrlTowxWindow}, { "_wxWindow","_wxPyListCtrl",SwigwxPyListCtrlTowxWindow}, {0,0,0}}; @@ -9280,6 +9881,10 @@ SWIGEXPORT(void) initcontrols2c() { PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK)); PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_ACTIVATED", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_ACTIVATED)); PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_CACHE_HINT", PyInt_FromLong((long) wxEVT_COMMAND_LIST_CACHE_HINT)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_COL_RIGHT_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_LIST_COL_RIGHT_CLICK)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_COL_BEGIN_DRAG", PyInt_FromLong((long) wxEVT_COMMAND_LIST_COL_BEGIN_DRAG)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_COL_DRAGGING", PyInt_FromLong((long) wxEVT_COMMAND_LIST_COL_DRAGGING)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_COL_END_DRAG", PyInt_FromLong((long) wxEVT_COMMAND_LIST_COL_END_DRAG)); PyDict_SetItemString(d,"wxLC_VRULES", PyInt_FromLong((long) wxLC_VRULES)); PyDict_SetItemString(d,"wxLC_HRULES", PyInt_FromLong((long) wxLC_HRULES)); PyDict_SetItemString(d,"wxLC_ICON", PyInt_FromLong((long) wxLC_ICON)); @@ -9299,6 +9904,7 @@ SWIGEXPORT(void) initcontrols2c() { PyDict_SetItemString(d,"wxLC_MASK_TYPE", PyInt_FromLong((long) wxLC_MASK_TYPE)); PyDict_SetItemString(d,"wxLC_MASK_ALIGN", PyInt_FromLong((long) wxLC_MASK_ALIGN)); PyDict_SetItemString(d,"wxLC_MASK_SORT", PyInt_FromLong((long) wxLC_MASK_SORT)); + PyDict_SetItemString(d,"wxLC_USER_TEXT", PyInt_FromLong((long) wxLC_USER_TEXT)); PyDict_SetItemString(d,"wxLIST_MASK_STATE", PyInt_FromLong((long) wxLIST_MASK_STATE)); PyDict_SetItemString(d,"wxLIST_MASK_TEXT", PyInt_FromLong((long) wxLIST_MASK_TEXT)); PyDict_SetItemString(d,"wxLIST_MASK_IMAGE", PyInt_FromLong((long) wxLIST_MASK_IMAGE)); @@ -9395,8 +10001,10 @@ SWIGEXPORT(void) initcontrols2c() { PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK)); PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_END_DRAG", PyInt_FromLong((long) wxEVT_COMMAND_TREE_END_DRAG)); + // Map renamed classes back to their common name for OOR wxPyPtrTypeMap_Add("wxTreeItemData", "wxPyTreeItemData"); wxPyPtrTypeMap_Add("wxTreeCtrl", "wxPyTreeCtrl"); + wxPyPtrTypeMap_Add("wxListCtrl", "wxPyListCtrl"); { int i; for (i = 0; _swig_mapping[i].n1; i++) diff --git a/wxPython/src/gtk/controls2.py b/wxPython/src/gtk/controls2.py index e049e3449f..0b7f0d9f7c 100644 --- a/wxPython/src/gtk/controls2.py +++ b/wxPython/src/gtk/controls2.py @@ -53,6 +53,18 @@ def EVT_LIST_INSERT_ITEM(win, id, func): def EVT_LIST_COL_CLICK(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_LIST_COL_CLICK, func) +def EVT_LIST_COL_RIGHT_CLICK(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_COL_RIGHT_CLICK, func) + +def EVT_LIST_COL_BEGIN_DRAG(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_COL_BEGIN_DRAG, func) + +def EVT_LIST_COL_DRAGGING(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_COL_DRAGGING, func) + +def EVT_LIST_COL_END_DRAG(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_COL_END_DRAG, func) + def EVT_LIST_ITEM_RIGHT_CLICK(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, func) @@ -371,6 +383,12 @@ class wxListEventPtr(wxNotifyEventPtr): def GetItem(self, *_args, **_kwargs): val = apply(controls2c.wxListEvent_GetItem,(self,) + _args, _kwargs) return val + def GetCacheFrom(self, *_args, **_kwargs): + val = apply(controls2c.wxListEvent_GetCacheFrom,(self,) + _args, _kwargs) + return val + def GetCacheTo(self, *_args, **_kwargs): + val = apply(controls2c.wxListEvent_GetCacheTo,(self,) + _args, _kwargs) + return val def __setattr__(self,name,value): if name == "m_code" : controls2c.wxListEvent_m_code_set(self,value) @@ -413,8 +431,9 @@ class wxListEventPtr(wxNotifyEventPtr): def __repr__(self): return "" % (self.this,) class wxListEvent(wxListEventPtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = apply(controls2c.new_wxListEvent,_args,_kwargs) + self.thisown = 1 @@ -609,6 +628,37 @@ class wxListCtrlPtr(wxControlPtr): val.thisown = 1 return val + + # Some helpers... + + def Select(self, idx, on=1): + '''[de]select an item''' + if on: state = wxLIST_STATE_SELECTED + else: state = 0 + self.SetItemState(idx, state, wxLIST_STATE_SELECTED) + + def Focus(self, idx): + '''Focus and show the given item''' + self.SetItemState(idx, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED) + self.EnsureVisible(idx) + + def GetFocusedItem(self): + '''get the currently focused item or -1 if none''' + return self.GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_FOCUSED) + + def IsSelected(self, idx): + '''return TRUE if the item is selected''' + return self.GetItemState(idx, wxLIST_STATE_SELECTED) != 0 + + def SetColumnImage(self, col, image): + item = wxListItem() + item.SetMask(wxLIST_MASK_IMAGE) + item.SetImage(image) + self.SetColumn(col, item) + + def ClearColumnImage(self, col): + self.SetColumnImage(col, -1) + class wxListCtrl(wxListCtrlPtr): def __init__(self,*_args,**_kwargs): self.this = apply(controls2c.new_wxListCtrl,_args,_kwargs) @@ -623,6 +673,52 @@ def wxPreListCtrl(*_args,**_kwargs): return val +class wxListViewPtr(wxListCtrlPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def Create(self, *_args, **_kwargs): + val = apply(controls2c.wxListView_Create,(self,) + _args, _kwargs) + return val + def Select(self, *_args, **_kwargs): + val = apply(controls2c.wxListView_Select,(self,) + _args, _kwargs) + return val + def Focus(self, *_args, **_kwargs): + val = apply(controls2c.wxListView_Focus,(self,) + _args, _kwargs) + return val + def GetFocusedItem(self, *_args, **_kwargs): + val = apply(controls2c.wxListView_GetFocusedItem,(self,) + _args, _kwargs) + return val + def GetNextSelected(self, *_args, **_kwargs): + val = apply(controls2c.wxListView_GetNextSelected,(self,) + _args, _kwargs) + return val + def GetFirstSelected(self, *_args, **_kwargs): + val = apply(controls2c.wxListView_GetFirstSelected,(self,) + _args, _kwargs) + return val + def IsSelected(self, *_args, **_kwargs): + val = apply(controls2c.wxListView_IsSelected,(self,) + _args, _kwargs) + return val + def SetColumnImage(self, *_args, **_kwargs): + val = apply(controls2c.wxListView_SetColumnImage,(self,) + _args, _kwargs) + return val + def ClearColumnImage(self, *_args, **_kwargs): + val = apply(controls2c.wxListView_ClearColumnImage,(self,) + _args, _kwargs) + return val + def __repr__(self): + return "" % (self.this,) +class wxListView(wxListViewPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(controls2c.new_wxListView,_args,_kwargs) + self.thisown = 1 + + + +def wxPreListView(*_args,**_kwargs): + val = wxListViewPtr(apply(controls2c.new_wxPreListView,_args,_kwargs)) + val.thisown = 1 + return val + + class wxTreeItemAttrPtr : def __init__(self,this): self.this = this @@ -1027,6 +1123,10 @@ wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK = controls2c.wxEVT_COMMAND_LIST_ITEM_RIGHT_C wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK = controls2c.wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK wxEVT_COMMAND_LIST_ITEM_ACTIVATED = controls2c.wxEVT_COMMAND_LIST_ITEM_ACTIVATED wxEVT_COMMAND_LIST_CACHE_HINT = controls2c.wxEVT_COMMAND_LIST_CACHE_HINT +wxEVT_COMMAND_LIST_COL_RIGHT_CLICK = controls2c.wxEVT_COMMAND_LIST_COL_RIGHT_CLICK +wxEVT_COMMAND_LIST_COL_BEGIN_DRAG = controls2c.wxEVT_COMMAND_LIST_COL_BEGIN_DRAG +wxEVT_COMMAND_LIST_COL_DRAGGING = controls2c.wxEVT_COMMAND_LIST_COL_DRAGGING +wxEVT_COMMAND_LIST_COL_END_DRAG = controls2c.wxEVT_COMMAND_LIST_COL_END_DRAG wxLC_VRULES = controls2c.wxLC_VRULES wxLC_HRULES = controls2c.wxLC_HRULES wxLC_ICON = controls2c.wxLC_ICON @@ -1046,6 +1146,7 @@ wxLC_SORT_DESCENDING = controls2c.wxLC_SORT_DESCENDING wxLC_MASK_TYPE = controls2c.wxLC_MASK_TYPE wxLC_MASK_ALIGN = controls2c.wxLC_MASK_ALIGN wxLC_MASK_SORT = controls2c.wxLC_MASK_SORT +wxLC_USER_TEXT = controls2c.wxLC_USER_TEXT wxLIST_MASK_STATE = controls2c.wxLIST_MASK_STATE wxLIST_MASK_TEXT = controls2c.wxLIST_MASK_TEXT wxLIST_MASK_IMAGE = controls2c.wxLIST_MASK_IMAGE diff --git a/wxPython/src/gtk/gdi.cpp b/wxPython/src/gtk/gdi.cpp index 67dcd634ac..72bdcfc7b0 100644 --- a/wxPython/src/gtk/gdi.cpp +++ b/wxPython/src/gtk/gdi.cpp @@ -61,6 +61,10 @@ extern PyObject *SWIG_newvarlink(void); #ifndef __WXMSW__ #include #endif +#include +#include +#include +#include static PyObject* t_output_helper(PyObject* target, PyObject* o) { @@ -178,14 +182,6 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { wxCursor* wxPyStockCursor(int id) { return new wxCursor(id); } - - wxFontEncoding wxFont_GetDefaultEncoding() { - return wxFont::GetDefaultEncoding(); - } - - void wxFont_SetDefaultEncoding(wxFontEncoding encoding) { - wxFont::SetDefaultEncoding(encoding); - } // Alternate 'constructor' wxColour* wxNamedColour(const wxString& colorName) { return new wxColour(colorName); @@ -491,43 +487,6 @@ static PyObject *_wrap_wxStockCursor(PyObject *self, PyObject *args, PyObject *k return _resultobj; } -static PyObject *_wrap_wxFont_GetDefaultEncoding(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxFontEncoding _result; - char *_kwnames[] = { NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxFont_GetDefaultEncoding",_kwnames)) - return NULL; -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxFontEncoding )wxFont_GetDefaultEncoding(); - - wxPy_END_ALLOW_THREADS; - if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_wxFont_SetDefaultEncoding(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxFontEncoding _arg0; - char *_kwnames[] = { "encoding", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i:wxFont_SetDefaultEncoding",_kwnames,&_arg0)) - return NULL; -{ - wxPy_BEGIN_ALLOW_THREADS; - wxFont_SetDefaultEncoding(_arg0); - - wxPy_END_ALLOW_THREADS; - if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - static PyObject *_wrap_wxNamedColour(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxColour * _result; @@ -2533,249 +2492,934 @@ static PyObject *_wrap_wxCursor_Ok(PyObject *self, PyObject *args, PyObject *kwa return _resultobj; } -static void *SwigwxFontTowxGDIObject(void *ptr) { - wxFont *src; - wxGDIObject *dest; - src = (wxFont *) ptr; - dest = (wxGDIObject *) src; - return (void *) dest; -} - -static void *SwigwxFontTowxObject(void *ptr) { - wxFont *src; - wxObject *dest; - src = (wxFont *) ptr; - dest = (wxObject *) src; - return (void *) dest; -} - -#define new_wxFont(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6) (new wxFont(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6)) -static PyObject *_wrap_new_wxFont(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxNativeFontInfo_FromString(_swigobj,_swigarg0) (_swigobj->FromString(_swigarg0)) +static PyObject *_wrap_wxNativeFontInfo_FromString(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxFont * _result; - int _arg0; - int _arg1; - int _arg2; - int _arg3; - int _arg4 = (int ) FALSE; - char * _arg5 = (char *) ""; - wxFontEncoding _arg6 = (wxFontEncoding ) (wxFONTENCODING_DEFAULT); - char *_kwnames[] = { "pointSize","family","style","weight","underline","faceName","encoding", NULL }; - char _ptemp[128]; + bool _result; + wxNativeFontInfo * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","s", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"iiii|isi:new_wxFont",_kwnames,&_arg0,&_arg1,&_arg2,&_arg3,&_arg4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxNativeFontInfo_FromString",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxNativeFontInfo_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxNativeFontInfo_FromString. Expected _wxNativeFontInfo_p."); + return NULL; + } + } +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + 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 +} { wxPy_BEGIN_ALLOW_THREADS; - _result = (wxFont *)new_wxFont(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6); + _result = (bool )wxNativeFontInfo_FromString(_arg0,*_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxFont_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} return _resultobj; } -#define delete_wxFont(_swigobj) (delete _swigobj) -static PyObject *_wrap_delete_wxFont(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxNativeFontInfo_ToString(_swigobj) (_swigobj->ToString()) +static PyObject *_wrap_wxNativeFontInfo_ToString(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxFont * _arg0; + wxString * _result; + wxNativeFontInfo * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxFont",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxNativeFontInfo_ToString",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxFont. Expected _wxFont_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxNativeFontInfo_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxNativeFontInfo_ToString. Expected _wxNativeFontInfo_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - delete_wxFont(_arg0); + _result = new wxString (wxNativeFontInfo_ToString(_arg0)); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; +}{ + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +} +{ + delete _result; +} return _resultobj; } -#define wxFont_Ok(_swigobj) (_swigobj->Ok()) -static PyObject *_wrap_wxFont_Ok(PyObject *self, PyObject *args, PyObject *kwargs) { +static wxString wxNativeFontInfo___str__(wxNativeFontInfo *self) { + return self->ToString(); + } +static PyObject *_wrap_wxNativeFontInfo___str__(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - bool _result; - wxFont * _arg0; + wxString * _result; + wxNativeFontInfo * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFont_Ok",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxNativeFontInfo___str__",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_Ok. Expected _wxFont_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxNativeFontInfo_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxNativeFontInfo___str__. Expected _wxNativeFontInfo_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxFont_Ok(_arg0); + _result = new wxString (wxNativeFontInfo___str__(_arg0)); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); +}{ + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +} +{ + delete _result; +} return _resultobj; } -#define wxFont_GetFaceName(_swigobj) (_swigobj->GetFaceName()) -static PyObject *_wrap_wxFont_GetFaceName(PyObject *self, PyObject *args, PyObject *kwargs) { +#define new_wxFontMapper() (new wxFontMapper()) +static PyObject *_wrap_new_wxFontMapper(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxString * _result; - wxFont * _arg0; + wxFontMapper * _result; + char *_kwnames[] = { NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxFontMapper",_kwnames)) + return NULL; +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxFontMapper *)new_wxFontMapper(); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxFontMapper_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define delete_wxFontMapper(_swigobj) (delete _swigobj) +static PyObject *_wrap_delete_wxFontMapper(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxFontMapper * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFont_GetFaceName",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxFontMapper",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_GetFaceName. Expected _wxFont_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFontMapper_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxFontMapper. Expected _wxFontMapper_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = new wxString (wxFont_GetFaceName(_arg0)); + delete_wxFontMapper(_arg0); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -}{ - _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); -} -{ - delete _result; -} +} Py_INCREF(Py_None); + _resultobj = Py_None; return _resultobj; } -#define wxFont_GetFamily(_swigobj) (_swigobj->GetFamily()) -static PyObject *_wrap_wxFont_GetFamily(PyObject *self, PyObject *args, PyObject *kwargs) { +static PyObject * wxFontMapper_GetAltForEncoding(wxFontMapper *self,wxFontEncoding encoding,const wxString & facename,bool interactive) { + wxFontEncoding alt_enc; + if (self->GetAltForEncoding(encoding, &alt_enc, facename, interactive)) + return PyInt_FromLong(alt_enc); + else { + Py_INCREF(Py_None); + return Py_None; + } + } +static PyObject *_wrap_wxFontMapper_GetAltForEncoding(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - int _result; - wxFont * _arg0; + PyObject * _result; + wxFontMapper * _arg0; + wxFontEncoding _arg1; + wxString * _arg2 = (wxString *) &wxEmptyString; + bool _arg3 = (bool ) TRUE; PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; + PyObject * _obj2 = 0; + int tempbool3 = (int) TRUE; + char *_kwnames[] = { "self","encoding","facename","interactive", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFont_GetFamily",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|Oi:wxFontMapper_GetAltForEncoding",_kwnames,&_argo0,&_arg1,&_obj2,&tempbool3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_GetFamily. Expected _wxFont_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFontMapper_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFontMapper_GetAltForEncoding. Expected _wxFontMapper_p."); return NULL; } } + if (_obj2) +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + 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 +} + _arg3 = (bool ) tempbool3; { wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxFont_GetFamily(_arg0); + _result = (PyObject *)wxFontMapper_GetAltForEncoding(_arg0,_arg1,*_arg2,_arg3); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); +}{ + _resultobj = _result; +} +{ + if (_obj2) + delete _arg2; +} return _resultobj; } -#define wxFont_GetPointSize(_swigobj) (_swigobj->GetPointSize()) -static PyObject *_wrap_wxFont_GetPointSize(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxFontMapper_IsEncodingAvailable(_swigobj,_swigarg0,_swigarg1) (_swigobj->IsEncodingAvailable(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxFontMapper_IsEncodingAvailable(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - int _result; - wxFont * _arg0; + bool _result; + wxFontMapper * _arg0; + wxFontEncoding _arg1; + wxString * _arg2 = (wxString *) &wxEmptyString; PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; + PyObject * _obj2 = 0; + char *_kwnames[] = { "self","encoding","facename", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFont_GetPointSize",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|O:wxFontMapper_IsEncodingAvailable",_kwnames,&_argo0,&_arg1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_GetPointSize. Expected _wxFont_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFontMapper_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFontMapper_IsEncodingAvailable. Expected _wxFontMapper_p."); return NULL; } } + if (_obj2) +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + 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 +} { wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxFont_GetPointSize(_arg0); + _result = (bool )wxFontMapper_IsEncodingAvailable(_arg0,_arg1,*_arg2); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj2) + delete _arg2; +} return _resultobj; } -#define wxFont_GetStyle(_swigobj) (_swigobj->GetStyle()) -static PyObject *_wrap_wxFont_GetStyle(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxFontMapper_CharsetToEncoding(_swigobj,_swigarg0,_swigarg1) (_swigobj->CharsetToEncoding(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxFontMapper_CharsetToEncoding(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - int _result; - wxFont * _arg0; + wxFontEncoding _result; + wxFontMapper * _arg0; + wxString * _arg1; + bool _arg2 = (bool ) TRUE; PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; + PyObject * _obj1 = 0; + int tempbool2 = (int) TRUE; + char *_kwnames[] = { "self","charset","interactive", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFont_GetStyle",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxFontMapper_CharsetToEncoding",_kwnames,&_argo0,&_obj1,&tempbool2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_GetStyle. Expected _wxFont_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFontMapper_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFontMapper_CharsetToEncoding. Expected _wxFontMapper_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxFont_GetStyle(_arg0); - - wxPy_END_ALLOW_THREADS; - if (PyErr_Occurred()) return NULL; +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + 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; +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxFontEncoding )wxFontMapper_CharsetToEncoding(_arg0,*_arg1,_arg2); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +static PyObject *_wrap_wxFontMapper_GetEncodingName(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxFontEncoding _arg0; + char *_kwnames[] = { "encoding", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i:wxFontMapper_GetEncodingName",_kwnames,&_arg0)) + return NULL; +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = new wxString (wxFontMapper::GetEncodingName(_arg0)); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +}{ + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +} +{ + delete _result; +} + return _resultobj; +} + +static PyObject *_wrap_wxFontMapper_GetEncodingDescription(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxFontEncoding _arg0; + char *_kwnames[] = { "encoding", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i:wxFontMapper_GetEncodingDescription",_kwnames,&_arg0)) + return NULL; +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = new wxString (wxFontMapper::GetEncodingDescription(_arg0)); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +}{ + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +} +{ + delete _result; +} + return _resultobj; +} + +#define wxFontMapper_SetDialogParent(_swigobj,_swigarg0) (_swigobj->SetDialogParent(_swigarg0)) +static PyObject *_wrap_wxFontMapper_SetDialogParent(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxFontMapper * _arg0; + wxWindow * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","parent", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxFontMapper_SetDialogParent",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFontMapper_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFontMapper_SetDialogParent. Expected _wxFontMapper_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxFontMapper_SetDialogParent. Expected _wxWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxFontMapper_SetDialogParent(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxFontMapper_SetDialogTitle(_swigobj,_swigarg0) (_swigobj->SetDialogTitle(_swigarg0)) +static PyObject *_wrap_wxFontMapper_SetDialogTitle(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxFontMapper * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","title", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxFontMapper_SetDialogTitle",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFontMapper_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFontMapper_SetDialogTitle. Expected _wxFontMapper_p."); + return NULL; + } + } +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + 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 +} +{ + wxPy_BEGIN_ALLOW_THREADS; + wxFontMapper_SetDialogTitle(_arg0,*_arg1); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxFontMapper_SetConfig(_swigobj,_swigarg0) (_swigobj->SetConfig(_swigarg0)) +static PyObject *_wrap_wxFontMapper_SetConfig(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxFontMapper * _arg0; + wxConfigBase * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","config", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxFontMapper_SetConfig",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFontMapper_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFontMapper_SetConfig. Expected _wxFontMapper_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxConfigBase_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxFontMapper_SetConfig. Expected _wxConfigBase_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxFontMapper_SetConfig(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxFontMapper_SetConfigPath(_swigobj,_swigarg0) (_swigobj->SetConfigPath(_swigarg0)) +static PyObject *_wrap_wxFontMapper_SetConfigPath(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxFontMapper * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","prefix", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxFontMapper_SetConfigPath",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFontMapper_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFontMapper_SetConfigPath. Expected _wxFontMapper_p."); + return NULL; + } + } +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + 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 +} +{ + wxPy_BEGIN_ALLOW_THREADS; + wxFontMapper_SetConfigPath(_arg0,*_arg1); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +static PyObject *_wrap_wxFontMapper_GetDefaultConfigPath(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxChar * _result; + char *_kwnames[] = { NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxFontMapper_GetDefaultConfigPath",_kwnames)) + return NULL; +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxChar *)wxFontMapper::GetDefaultConfigPath(); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("s", _result); + return _resultobj; +} + +static void *SwigwxFontTowxGDIObject(void *ptr) { + wxFont *src; + wxGDIObject *dest; + src = (wxFont *) ptr; + dest = (wxGDIObject *) src; + return (void *) dest; +} + +static void *SwigwxFontTowxObject(void *ptr) { + wxFont *src; + wxObject *dest; + src = (wxFont *) ptr; + dest = (wxObject *) src; + return (void *) dest; +} + +#define new_wxFont(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6) (new wxFont(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6)) +static PyObject *_wrap_new_wxFont(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxFont * _result; + int _arg0; + int _arg1; + int _arg2; + int _arg3; + int _arg4 = (int ) FALSE; + char * _arg5 = (char *) ""; + wxFontEncoding _arg6 = (wxFontEncoding ) (wxFONTENCODING_DEFAULT); + char *_kwnames[] = { "pointSize","family","style","weight","underline","faceName","encoding", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"iiii|isi:new_wxFont",_kwnames,&_arg0,&_arg1,&_arg2,&_arg3,&_arg4,&_arg5,&_arg6)) + return NULL; +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxFont *)new_wxFont(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxFont_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define new_wxFontFromNativeInfo(_swigarg0) (new wxFont(_swigarg0)) +static PyObject *_wrap_new_wxFontFromNativeInfo(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxFont * _result; + wxNativeFontInfo * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "info", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:new_wxFontFromNativeInfo",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxNativeFontInfo_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxFontFromNativeInfo. Expected _wxNativeFontInfo_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxFont *)new_wxFontFromNativeInfo(*_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxFont_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define delete_wxFont(_swigobj) (delete _swigobj) +static PyObject *_wrap_delete_wxFont(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxFont * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxFont",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxFont. Expected _wxFont_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + delete_wxFont(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxFont_Ok(_swigobj) (_swigobj->Ok()) +static PyObject *_wrap_wxFont_Ok(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxFont * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFont_Ok",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_Ok. Expected _wxFont_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxFont_Ok(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxFont_GetPointSize(_swigobj) (_swigobj->GetPointSize()) +static PyObject *_wrap_wxFont_GetPointSize(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxFont * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFont_GetPointSize",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_GetPointSize. Expected _wxFont_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxFont_GetPointSize(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxFont_GetFamily(_swigobj) (_swigobj->GetFamily()) +static PyObject *_wrap_wxFont_GetFamily(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxFont * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFont_GetFamily",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_GetFamily. Expected _wxFont_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxFont_GetFamily(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxFont_GetStyle(_swigobj) (_swigobj->GetStyle()) +static PyObject *_wrap_wxFont_GetStyle(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxFont * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFont_GetStyle",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_GetStyle. Expected _wxFont_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxFont_GetStyle(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxFont_GetWeight(_swigobj) (_swigobj->GetWeight()) +static PyObject *_wrap_wxFont_GetWeight(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxFont * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFont_GetWeight",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_GetWeight. Expected _wxFont_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxFont_GetWeight(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxFont_GetUnderlined(_swigobj) (_swigobj->GetUnderlined()) +static PyObject *_wrap_wxFont_GetUnderlined(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxFont * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFont_GetUnderlined",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_GetUnderlined. Expected _wxFont_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxFont_GetUnderlined(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } -#define wxFont_GetUnderlined(_swigobj) (_swigobj->GetUnderlined()) -static PyObject *_wrap_wxFont_GetUnderlined(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxFont_GetFaceName(_swigobj) (_swigobj->GetFaceName()) +static PyObject *_wrap_wxFont_GetFaceName(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxFont * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFont_GetFaceName",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_GetFaceName. Expected _wxFont_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = new wxString (wxFont_GetFaceName(_arg0)); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +}{ + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +} +{ + delete _result; +} + return _resultobj; +} + +#define wxFont_GetEncoding(_swigobj) (_swigobj->GetEncoding()) +static PyObject *_wrap_wxFont_GetEncoding(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - bool _result; + wxFontEncoding _result; wxFont * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFont_GetUnderlined",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFont_GetEncoding",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_GetUnderlined. Expected _wxFont_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_GetEncoding. Expected _wxFont_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxFont_GetUnderlined(_arg0); + _result = (wxFontEncoding )wxFont_GetEncoding(_arg0); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -2783,135 +3427,120 @@ static PyObject *_wrap_wxFont_GetUnderlined(PyObject *self, PyObject *args, PyOb return _resultobj; } -#define wxFont_GetWeight(_swigobj) (_swigobj->GetWeight()) -static PyObject *_wrap_wxFont_GetWeight(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxFont_GetNativeFontInfo(_swigobj) (_swigobj->GetNativeFontInfo()) +static PyObject *_wrap_wxFont_GetNativeFontInfo(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - int _result; + wxNativeFontInfo * _result; wxFont * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFont_GetWeight",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFont_GetNativeFontInfo",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_GetWeight. Expected _wxFont_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_GetNativeFontInfo. Expected _wxFont_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxFont_GetWeight(_arg0); + _result = (wxNativeFontInfo *)wxFont_GetNativeFontInfo(_arg0); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxNativeFontInfo_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } return _resultobj; } -#define wxFont_GetEncoding(_swigobj) (_swigobj->GetEncoding()) -static PyObject *_wrap_wxFont_GetEncoding(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxFont_SetPointSize(_swigobj,_swigarg0) (_swigobj->SetPointSize(_swigarg0)) +static PyObject *_wrap_wxFont_SetPointSize(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxFontEncoding _result; wxFont * _arg0; + int _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; + char *_kwnames[] = { "self","pointSize", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFont_GetEncoding",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxFont_SetPointSize",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_GetEncoding. Expected _wxFont_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_SetPointSize. Expected _wxFont_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (wxFontEncoding )wxFont_GetEncoding(_arg0); + wxFont_SetPointSize(_arg0,_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); +} Py_INCREF(Py_None); + _resultobj = Py_None; return _resultobj; } -#define wxFont_SetFaceName(_swigobj,_swigarg0) (_swigobj->SetFaceName(_swigarg0)) -static PyObject *_wrap_wxFont_SetFaceName(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxFont_SetFamily(_swigobj,_swigarg0) (_swigobj->SetFamily(_swigarg0)) +static PyObject *_wrap_wxFont_SetFamily(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxFont * _arg0; - wxString * _arg1; + int _arg1; PyObject * _argo0 = 0; - PyObject * _obj1 = 0; - char *_kwnames[] = { "self","faceName", NULL }; + char *_kwnames[] = { "self","family", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxFont_SetFaceName",_kwnames,&_argo0,&_obj1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxFont_SetFamily",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_SetFaceName. Expected _wxFont_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_SetFamily. Expected _wxFont_p."); return NULL; } } -{ -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - 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 -} { wxPy_BEGIN_ALLOW_THREADS; - wxFont_SetFaceName(_arg0,*_arg1); + wxFont_SetFamily(_arg0,_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; -{ - if (_obj1) - delete _arg1; -} return _resultobj; } -#define wxFont_SetFamily(_swigobj,_swigarg0) (_swigobj->SetFamily(_swigarg0)) -static PyObject *_wrap_wxFont_SetFamily(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxFont_SetStyle(_swigobj,_swigarg0) (_swigobj->SetStyle(_swigarg0)) +static PyObject *_wrap_wxFont_SetStyle(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxFont * _arg0; int _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","family", NULL }; + char *_kwnames[] = { "self","style", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxFont_SetFamily",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxFont_SetStyle",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_SetFamily. Expected _wxFont_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_SetStyle. Expected _wxFont_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - wxFont_SetFamily(_arg0,_arg1); + wxFont_SetStyle(_arg0,_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -2920,27 +3549,27 @@ static PyObject *_wrap_wxFont_SetFamily(PyObject *self, PyObject *args, PyObject return _resultobj; } -#define wxFont_SetPointSize(_swigobj,_swigarg0) (_swigobj->SetPointSize(_swigarg0)) -static PyObject *_wrap_wxFont_SetPointSize(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxFont_SetWeight(_swigobj,_swigarg0) (_swigobj->SetWeight(_swigarg0)) +static PyObject *_wrap_wxFont_SetWeight(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxFont * _arg0; int _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","pointSize", NULL }; + char *_kwnames[] = { "self","weight", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxFont_SetPointSize",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxFont_SetWeight",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_SetPointSize. Expected _wxFont_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_SetWeight. Expected _wxFont_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - wxFont_SetPointSize(_arg0,_arg1); + wxFont_SetWeight(_arg0,_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -2949,32 +3578,55 @@ static PyObject *_wrap_wxFont_SetPointSize(PyObject *self, PyObject *args, PyObj return _resultobj; } -#define wxFont_SetStyle(_swigobj,_swigarg0) (_swigobj->SetStyle(_swigarg0)) -static PyObject *_wrap_wxFont_SetStyle(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxFont_SetFaceName(_swigobj,_swigarg0) (_swigobj->SetFaceName(_swigarg0)) +static PyObject *_wrap_wxFont_SetFaceName(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxFont * _arg0; - int _arg1; + wxString * _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","style", NULL }; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","faceName", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxFont_SetStyle",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxFont_SetFaceName",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_SetStyle. Expected _wxFont_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_SetFaceName. Expected _wxFont_p."); return NULL; } } +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + 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 +} { wxPy_BEGIN_ALLOW_THREADS; - wxFont_SetStyle(_arg0,_arg1); + wxFont_SetFaceName(_arg0,*_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} return _resultobj; } @@ -3009,27 +3661,27 @@ static PyObject *_wrap_wxFont_SetUnderlined(PyObject *self, PyObject *args, PyOb return _resultobj; } -#define wxFont_SetWeight(_swigobj,_swigarg0) (_swigobj->SetWeight(_swigarg0)) -static PyObject *_wrap_wxFont_SetWeight(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxFont_SetEncoding(_swigobj,_swigarg0) (_swigobj->SetEncoding(_swigarg0)) +static PyObject *_wrap_wxFont_SetEncoding(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxFont * _arg0; - int _arg1; + wxFontEncoding _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","weight", NULL }; + char *_kwnames[] = { "self","encoding", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxFont_SetWeight",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxFont_SetEncoding",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_SetWeight. Expected _wxFont_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_SetEncoding. Expected _wxFont_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - wxFont_SetWeight(_arg0,_arg1); + wxFont_SetEncoding(_arg0,_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -3038,27 +3690,35 @@ static PyObject *_wrap_wxFont_SetWeight(PyObject *self, PyObject *args, PyObject return _resultobj; } -#define wxFont_SetEncoding(_swigobj,_swigarg0) (_swigobj->SetEncoding(_swigarg0)) -static PyObject *_wrap_wxFont_SetEncoding(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxFont_SetNativeFontInfo(_swigobj,_swigarg0) (_swigobj->SetNativeFontInfo(_swigarg0)) +static PyObject *_wrap_wxFont_SetNativeFontInfo(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxFont * _arg0; - wxFontEncoding _arg1; + wxNativeFontInfo * _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","encoding", NULL }; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","info", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxFont_SetEncoding",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxFont_SetNativeFontInfo",_kwnames,&_argo0,&_argo1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFont_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_SetEncoding. Expected _wxFont_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_SetNativeFontInfo. Expected _wxFont_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxNativeFontInfo_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxFont_SetNativeFontInfo. Expected _wxNativeFontInfo_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - wxFont_SetEncoding(_arg0,_arg1); + wxFont_SetNativeFontInfo(_arg0,*_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -3166,6 +3826,43 @@ static PyObject *_wrap_wxFont_GetWeightString(PyObject *self, PyObject *args, Py return _resultobj; } +static PyObject *_wrap_wxFont_GetDefaultEncoding(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxFontEncoding _result; + char *_kwnames[] = { NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxFont_GetDefaultEncoding",_kwnames)) + return NULL; +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxFontEncoding )wxFont::GetDefaultEncoding(); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +static PyObject *_wrap_wxFont_SetDefaultEncoding(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxFontEncoding _arg0; + char *_kwnames[] = { "encoding", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i:wxFont_SetDefaultEncoding",_kwnames,&_arg0)) + return NULL; +{ + wxPy_BEGIN_ALLOW_THREADS; + wxFont::SetDefaultEncoding(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + static void *SwigwxFontListTowxObject(void *ptr) { wxFontList *src; wxObject *dest; @@ -6923,6 +7620,43 @@ static PyObject *_wrap_wxDC_SetClippingRegion(PyObject *self, PyObject *args, Py return _resultobj; } +#define wxDC_SetClippingRegionAsRegion(_swigobj,_swigarg0) (_swigobj->SetClippingRegion(_swigarg0)) +static PyObject *_wrap_wxDC_SetClippingRegionAsRegion(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxDC * _arg0; + wxRegion * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","region", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDC_SetClippingRegionAsRegion",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDC_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDC_SetClippingRegionAsRegion. Expected _wxDC_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxRegion_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDC_SetClippingRegionAsRegion. Expected _wxRegion_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxDC_SetClippingRegionAsRegion(_arg0,*_arg1); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define wxDC_SetPalette(_swigobj,_swigarg0) (_swigobj->SetPalette(_swigarg0)) static PyObject *_wrap_wxDC_SetPalette(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -9989,6 +10723,7 @@ static PyMethodDef gdicMethods[] = { { "wxDC_SetFont", (PyCFunction) _wrap_wxDC_SetFont, METH_VARARGS | METH_KEYWORDS }, { "wxDC_SetBrush", (PyCFunction) _wrap_wxDC_SetBrush, METH_VARARGS | METH_KEYWORDS }, { "wxDC_SetPalette", (PyCFunction) _wrap_wxDC_SetPalette, METH_VARARGS | METH_KEYWORDS }, + { "wxDC_SetClippingRegionAsRegion", (PyCFunction) _wrap_wxDC_SetClippingRegionAsRegion, METH_VARARGS | METH_KEYWORDS }, { "wxDC_SetClippingRegion", (PyCFunction) _wrap_wxDC_SetClippingRegion, METH_VARARGS | METH_KEYWORDS }, { "wxDC_SetBackgroundMode", (PyCFunction) _wrap_wxDC_SetBackgroundMode, METH_VARARGS | METH_KEYWORDS }, { "wxDC_SetBackground", (PyCFunction) _wrap_wxDC_SetBackground, METH_VARARGS | METH_KEYWORDS }, @@ -10094,26 +10829,46 @@ static PyMethodDef gdicMethods[] = { { "wxFontList_RemoveFont", (PyCFunction) _wrap_wxFontList_RemoveFont, METH_VARARGS | METH_KEYWORDS }, { "wxFontList_FindOrCreateFont", (PyCFunction) _wrap_wxFontList_FindOrCreateFont, METH_VARARGS | METH_KEYWORDS }, { "wxFontList_AddFont", (PyCFunction) _wrap_wxFontList_AddFont, METH_VARARGS | METH_KEYWORDS }, + { "wxFont_SetDefaultEncoding", (PyCFunction) _wrap_wxFont_SetDefaultEncoding, METH_VARARGS | METH_KEYWORDS }, + { "wxFont_GetDefaultEncoding", (PyCFunction) _wrap_wxFont_GetDefaultEncoding, METH_VARARGS | METH_KEYWORDS }, { "wxFont_GetWeightString", (PyCFunction) _wrap_wxFont_GetWeightString, METH_VARARGS | METH_KEYWORDS }, { "wxFont_GetStyleString", (PyCFunction) _wrap_wxFont_GetStyleString, METH_VARARGS | METH_KEYWORDS }, { "wxFont_GetFamilyString", (PyCFunction) _wrap_wxFont_GetFamilyString, METH_VARARGS | METH_KEYWORDS }, + { "wxFont_SetNativeFontInfo", (PyCFunction) _wrap_wxFont_SetNativeFontInfo, METH_VARARGS | METH_KEYWORDS }, { "wxFont_SetEncoding", (PyCFunction) _wrap_wxFont_SetEncoding, METH_VARARGS | METH_KEYWORDS }, - { "wxFont_SetWeight", (PyCFunction) _wrap_wxFont_SetWeight, METH_VARARGS | METH_KEYWORDS }, { "wxFont_SetUnderlined", (PyCFunction) _wrap_wxFont_SetUnderlined, METH_VARARGS | METH_KEYWORDS }, + { "wxFont_SetFaceName", (PyCFunction) _wrap_wxFont_SetFaceName, METH_VARARGS | METH_KEYWORDS }, + { "wxFont_SetWeight", (PyCFunction) _wrap_wxFont_SetWeight, METH_VARARGS | METH_KEYWORDS }, { "wxFont_SetStyle", (PyCFunction) _wrap_wxFont_SetStyle, METH_VARARGS | METH_KEYWORDS }, - { "wxFont_SetPointSize", (PyCFunction) _wrap_wxFont_SetPointSize, METH_VARARGS | METH_KEYWORDS }, { "wxFont_SetFamily", (PyCFunction) _wrap_wxFont_SetFamily, METH_VARARGS | METH_KEYWORDS }, - { "wxFont_SetFaceName", (PyCFunction) _wrap_wxFont_SetFaceName, METH_VARARGS | METH_KEYWORDS }, + { "wxFont_SetPointSize", (PyCFunction) _wrap_wxFont_SetPointSize, METH_VARARGS | METH_KEYWORDS }, + { "wxFont_GetNativeFontInfo", (PyCFunction) _wrap_wxFont_GetNativeFontInfo, METH_VARARGS | METH_KEYWORDS }, { "wxFont_GetEncoding", (PyCFunction) _wrap_wxFont_GetEncoding, METH_VARARGS | METH_KEYWORDS }, - { "wxFont_GetWeight", (PyCFunction) _wrap_wxFont_GetWeight, METH_VARARGS | METH_KEYWORDS }, + { "wxFont_GetFaceName", (PyCFunction) _wrap_wxFont_GetFaceName, METH_VARARGS | METH_KEYWORDS }, { "wxFont_GetUnderlined", (PyCFunction) _wrap_wxFont_GetUnderlined, METH_VARARGS | METH_KEYWORDS }, + { "wxFont_GetWeight", (PyCFunction) _wrap_wxFont_GetWeight, METH_VARARGS | METH_KEYWORDS }, { "wxFont_GetStyle", (PyCFunction) _wrap_wxFont_GetStyle, METH_VARARGS | METH_KEYWORDS }, - { "wxFont_GetPointSize", (PyCFunction) _wrap_wxFont_GetPointSize, METH_VARARGS | METH_KEYWORDS }, { "wxFont_GetFamily", (PyCFunction) _wrap_wxFont_GetFamily, METH_VARARGS | METH_KEYWORDS }, - { "wxFont_GetFaceName", (PyCFunction) _wrap_wxFont_GetFaceName, METH_VARARGS | METH_KEYWORDS }, + { "wxFont_GetPointSize", (PyCFunction) _wrap_wxFont_GetPointSize, METH_VARARGS | METH_KEYWORDS }, { "wxFont_Ok", (PyCFunction) _wrap_wxFont_Ok, METH_VARARGS | METH_KEYWORDS }, { "delete_wxFont", (PyCFunction) _wrap_delete_wxFont, METH_VARARGS | METH_KEYWORDS }, + { "new_wxFontFromNativeInfo", (PyCFunction) _wrap_new_wxFontFromNativeInfo, METH_VARARGS | METH_KEYWORDS }, { "new_wxFont", (PyCFunction) _wrap_new_wxFont, METH_VARARGS | METH_KEYWORDS }, + { "wxFontMapper_GetDefaultConfigPath", (PyCFunction) _wrap_wxFontMapper_GetDefaultConfigPath, METH_VARARGS | METH_KEYWORDS }, + { "wxFontMapper_SetConfigPath", (PyCFunction) _wrap_wxFontMapper_SetConfigPath, METH_VARARGS | METH_KEYWORDS }, + { "wxFontMapper_SetConfig", (PyCFunction) _wrap_wxFontMapper_SetConfig, METH_VARARGS | METH_KEYWORDS }, + { "wxFontMapper_SetDialogTitle", (PyCFunction) _wrap_wxFontMapper_SetDialogTitle, METH_VARARGS | METH_KEYWORDS }, + { "wxFontMapper_SetDialogParent", (PyCFunction) _wrap_wxFontMapper_SetDialogParent, METH_VARARGS | METH_KEYWORDS }, + { "wxFontMapper_GetEncodingDescription", (PyCFunction) _wrap_wxFontMapper_GetEncodingDescription, METH_VARARGS | METH_KEYWORDS }, + { "wxFontMapper_GetEncodingName", (PyCFunction) _wrap_wxFontMapper_GetEncodingName, METH_VARARGS | METH_KEYWORDS }, + { "wxFontMapper_CharsetToEncoding", (PyCFunction) _wrap_wxFontMapper_CharsetToEncoding, METH_VARARGS | METH_KEYWORDS }, + { "wxFontMapper_IsEncodingAvailable", (PyCFunction) _wrap_wxFontMapper_IsEncodingAvailable, METH_VARARGS | METH_KEYWORDS }, + { "wxFontMapper_GetAltForEncoding", (PyCFunction) _wrap_wxFontMapper_GetAltForEncoding, METH_VARARGS | METH_KEYWORDS }, + { "delete_wxFontMapper", (PyCFunction) _wrap_delete_wxFontMapper, METH_VARARGS | METH_KEYWORDS }, + { "new_wxFontMapper", (PyCFunction) _wrap_new_wxFontMapper, METH_VARARGS | METH_KEYWORDS }, + { "wxNativeFontInfo___str__", (PyCFunction) _wrap_wxNativeFontInfo___str__, METH_VARARGS | METH_KEYWORDS }, + { "wxNativeFontInfo_ToString", (PyCFunction) _wrap_wxNativeFontInfo_ToString, METH_VARARGS | METH_KEYWORDS }, + { "wxNativeFontInfo_FromString", (PyCFunction) _wrap_wxNativeFontInfo_FromString, METH_VARARGS | METH_KEYWORDS }, { "wxCursor_Ok", (PyCFunction) _wrap_wxCursor_Ok, METH_VARARGS | METH_KEYWORDS }, { "delete_wxCursor", (PyCFunction) _wrap_delete_wxCursor, METH_VARARGS | METH_KEYWORDS }, { "wxIcon_CopyFromBitmap", (PyCFunction) _wrap_wxIcon_CopyFromBitmap, METH_VARARGS | METH_KEYWORDS }, @@ -10151,8 +10906,6 @@ static PyMethodDef gdicMethods[] = { { "new_wxGDIObject", (PyCFunction) _wrap_new_wxGDIObject, METH_VARARGS | METH_KEYWORDS }, { "wxMemoryDCFromDC", (PyCFunction) _wrap_wxMemoryDCFromDC, METH_VARARGS | METH_KEYWORDS }, { "wxNamedColour", (PyCFunction) _wrap_wxNamedColour, METH_VARARGS | METH_KEYWORDS }, - { "wxFont_SetDefaultEncoding", (PyCFunction) _wrap_wxFont_SetDefaultEncoding, METH_VARARGS | METH_KEYWORDS }, - { "wxFont_GetDefaultEncoding", (PyCFunction) _wrap_wxFont_GetDefaultEncoding, METH_VARARGS | METH_KEYWORDS }, { "wxStockCursor", (PyCFunction) _wrap_wxStockCursor, METH_VARARGS | METH_KEYWORDS }, { "wxIconFromXPMData", (PyCFunction) _wrap_wxIconFromXPMData, METH_VARARGS | METH_KEYWORDS }, { "wxEmptyIcon", (PyCFunction) _wrap_wxEmptyIcon, METH_VARARGS | METH_KEYWORDS }, @@ -10273,6 +11026,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_uint","_wxWindowID",0}, { "_wxChar","_char",0}, { "_char","_wxChar",0}, + { "_struct_wxNativeFontInfo","_wxNativeFontInfo",0}, { "_EBool","_wxCoord",0}, { "_EBool","_wxPrintQuality",0}, { "_EBool","_signed_int",0}, @@ -10291,6 +11045,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxDC","_wxScreenDC",SwigwxScreenDCTowxDC}, { "_class_wxDC","_class_wxMemoryDC",SwigwxMemoryDCTowxDC}, { "_class_wxDC","_wxMemoryDC",SwigwxMemoryDCTowxDC}, + { "_wxNativeFontInfo","_struct_wxNativeFontInfo",0}, { "_signed_int","_wxCoord",0}, { "_signed_int","_wxPrintQuality",0}, { "_signed_int","_EBool",0}, @@ -10421,6 +11176,22 @@ SWIGEXPORT(void) initgdic() { SWIG_globals = SWIG_newvarlink(); m = Py_InitModule("gdic", gdicMethods); d = PyModule_GetDict(m); + PyDict_SetItemString(d,"wxFONTFAMILY_DEFAULT", PyInt_FromLong((long) wxFONTFAMILY_DEFAULT)); + PyDict_SetItemString(d,"wxFONTFAMILY_DECORATIVE", PyInt_FromLong((long) wxFONTFAMILY_DECORATIVE)); + PyDict_SetItemString(d,"wxFONTFAMILY_ROMAN", PyInt_FromLong((long) wxFONTFAMILY_ROMAN)); + PyDict_SetItemString(d,"wxFONTFAMILY_SCRIPT", PyInt_FromLong((long) wxFONTFAMILY_SCRIPT)); + PyDict_SetItemString(d,"wxFONTFAMILY_SWISS", PyInt_FromLong((long) wxFONTFAMILY_SWISS)); + PyDict_SetItemString(d,"wxFONTFAMILY_MODERN", PyInt_FromLong((long) wxFONTFAMILY_MODERN)); + PyDict_SetItemString(d,"wxFONTFAMILY_TELETYPE", PyInt_FromLong((long) wxFONTFAMILY_TELETYPE)); + PyDict_SetItemString(d,"wxFONTFAMILY_MAX", PyInt_FromLong((long) wxFONTFAMILY_MAX)); + PyDict_SetItemString(d,"wxFONTSTYLE_NORMAL", PyInt_FromLong((long) wxFONTSTYLE_NORMAL)); + PyDict_SetItemString(d,"wxFONTSTYLE_ITALIC", PyInt_FromLong((long) wxFONTSTYLE_ITALIC)); + PyDict_SetItemString(d,"wxFONTSTYLE_SLANT", PyInt_FromLong((long) wxFONTSTYLE_SLANT)); + PyDict_SetItemString(d,"wxFONTSTYLE_MAX", PyInt_FromLong((long) wxFONTSTYLE_MAX)); + PyDict_SetItemString(d,"wxFONTWEIGHT_NORMAL", PyInt_FromLong((long) wxFONTWEIGHT_NORMAL)); + PyDict_SetItemString(d,"wxFONTWEIGHT_LIGHT", PyInt_FromLong((long) wxFONTWEIGHT_LIGHT)); + PyDict_SetItemString(d,"wxFONTWEIGHT_BOLD", PyInt_FromLong((long) wxFONTWEIGHT_BOLD)); + PyDict_SetItemString(d,"wxFONTWEIGHT_MAX", PyInt_FromLong((long) wxFONTWEIGHT_MAX)); PyDict_SetItemString(d,"wxFONTENCODING_SYSTEM", PyInt_FromLong((long) wxFONTENCODING_SYSTEM)); PyDict_SetItemString(d,"wxFONTENCODING_DEFAULT", PyInt_FromLong((long) wxFONTENCODING_DEFAULT)); PyDict_SetItemString(d,"wxFONTENCODING_ISO8859_1", PyInt_FromLong((long) wxFONTENCODING_ISO8859_1)); @@ -10438,6 +11209,7 @@ SWIGEXPORT(void) initgdic() { PyDict_SetItemString(d,"wxFONTENCODING_ISO8859_13", PyInt_FromLong((long) wxFONTENCODING_ISO8859_13)); PyDict_SetItemString(d,"wxFONTENCODING_ISO8859_14", PyInt_FromLong((long) wxFONTENCODING_ISO8859_14)); PyDict_SetItemString(d,"wxFONTENCODING_ISO8859_15", PyInt_FromLong((long) wxFONTENCODING_ISO8859_15)); + PyDict_SetItemString(d,"wxFONTENCODING_ISO8859_MAX", PyInt_FromLong((long) wxFONTENCODING_ISO8859_MAX)); PyDict_SetItemString(d,"wxFONTENCODING_KOI8", PyInt_FromLong((long) wxFONTENCODING_KOI8)); PyDict_SetItemString(d,"wxFONTENCODING_ALTERNATIVE", PyInt_FromLong((long) wxFONTENCODING_ALTERNATIVE)); PyDict_SetItemString(d,"wxFONTENCODING_BULGARIAN", PyInt_FromLong((long) wxFONTENCODING_BULGARIAN)); @@ -10446,9 +11218,19 @@ SWIGEXPORT(void) initgdic() { PyDict_SetItemString(d,"wxFONTENCODING_CP852", PyInt_FromLong((long) wxFONTENCODING_CP852)); PyDict_SetItemString(d,"wxFONTENCODING_CP855", PyInt_FromLong((long) wxFONTENCODING_CP855)); PyDict_SetItemString(d,"wxFONTENCODING_CP866", PyInt_FromLong((long) wxFONTENCODING_CP866)); + PyDict_SetItemString(d,"wxFONTENCODING_CP874", PyInt_FromLong((long) wxFONTENCODING_CP874)); PyDict_SetItemString(d,"wxFONTENCODING_CP1250", PyInt_FromLong((long) wxFONTENCODING_CP1250)); PyDict_SetItemString(d,"wxFONTENCODING_CP1251", PyInt_FromLong((long) wxFONTENCODING_CP1251)); PyDict_SetItemString(d,"wxFONTENCODING_CP1252", PyInt_FromLong((long) wxFONTENCODING_CP1252)); + PyDict_SetItemString(d,"wxFONTENCODING_CP1253", PyInt_FromLong((long) wxFONTENCODING_CP1253)); + PyDict_SetItemString(d,"wxFONTENCODING_CP1254", PyInt_FromLong((long) wxFONTENCODING_CP1254)); + PyDict_SetItemString(d,"wxFONTENCODING_CP1255", PyInt_FromLong((long) wxFONTENCODING_CP1255)); + PyDict_SetItemString(d,"wxFONTENCODING_CP1256", PyInt_FromLong((long) wxFONTENCODING_CP1256)); + PyDict_SetItemString(d,"wxFONTENCODING_CP1257", PyInt_FromLong((long) wxFONTENCODING_CP1257)); + PyDict_SetItemString(d,"wxFONTENCODING_CP12_MAX", PyInt_FromLong((long) wxFONTENCODING_CP12_MAX)); + PyDict_SetItemString(d,"wxFONTENCODING_UTF7", PyInt_FromLong((long) wxFONTENCODING_UTF7)); + PyDict_SetItemString(d,"wxFONTENCODING_UTF8", PyInt_FromLong((long) wxFONTENCODING_UTF8)); + PyDict_SetItemString(d,"wxFONTENCODING_UNICODE", PyInt_FromLong((long) wxFONTENCODING_UNICODE)); PyDict_SetItemString(d,"wxFONTENCODING_MAX", PyInt_FromLong((long) wxFONTENCODING_MAX)); PyDict_SetItemString(d,"cvar", SWIG_globals); SWIG_addvarlink(SWIG_globals,"wxNORMAL_FONT",_wrap_wxNORMAL_FONT_get, _wrap_wxNORMAL_FONT_set); diff --git a/wxPython/src/gtk/gdi.py b/wxPython/src/gtk/gdi.py index 78eeff00ba..04dc027853 100644 --- a/wxPython/src/gtk/gdi.py +++ b/wxPython/src/gtk/gdi.py @@ -183,6 +183,66 @@ class wxCursor(wxCursorPtr): +class wxNativeFontInfoPtr : + def __init__(self,this): + self.this = this + self.thisown = 0 + def FromString(self, *_args, **_kwargs): + val = apply(gdic.wxNativeFontInfo_FromString,(self,) + _args, _kwargs) + return val + def ToString(self, *_args, **_kwargs): + val = apply(gdic.wxNativeFontInfo_ToString,(self,) + _args, _kwargs) + return val + def __str__(self, *_args, **_kwargs): + val = apply(gdic.wxNativeFontInfo___str__,(self,) + _args, _kwargs) + return val + def __repr__(self): + return "" % (self.this,) +class wxNativeFontInfo(wxNativeFontInfoPtr): + def __init__(self,this): + self.this = this + + + + +class wxFontMapperPtr : + def __init__(self,this): + self.this = this + self.thisown = 0 + def __del__(self,gdic=gdic): + if self.thisown == 1 : + gdic.delete_wxFontMapper(self) + def GetAltForEncoding(self, *_args, **_kwargs): + val = apply(gdic.wxFontMapper_GetAltForEncoding,(self,) + _args, _kwargs) + return val + def IsEncodingAvailable(self, *_args, **_kwargs): + val = apply(gdic.wxFontMapper_IsEncodingAvailable,(self,) + _args, _kwargs) + return val + def CharsetToEncoding(self, *_args, **_kwargs): + val = apply(gdic.wxFontMapper_CharsetToEncoding,(self,) + _args, _kwargs) + return val + def SetDialogParent(self, *_args, **_kwargs): + val = apply(gdic.wxFontMapper_SetDialogParent,(self,) + _args, _kwargs) + return val + def SetDialogTitle(self, *_args, **_kwargs): + val = apply(gdic.wxFontMapper_SetDialogTitle,(self,) + _args, _kwargs) + return val + def SetConfig(self, *_args, **_kwargs): + val = apply(gdic.wxFontMapper_SetConfig,(self,) + _args, _kwargs) + return val + def SetConfigPath(self, *_args, **_kwargs): + val = apply(gdic.wxFontMapper_SetConfigPath,(self,) + _args, _kwargs) + return val + def __repr__(self): + return "" % (self.this,) +class wxFontMapper(wxFontMapperPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(gdic.new_wxFontMapper,_args,_kwargs) + self.thisown = 1 + + + + class wxFontPtr(wxGDIObjectPtr): def __init__(self,this): self.this = this @@ -193,48 +253,55 @@ class wxFontPtr(wxGDIObjectPtr): def Ok(self, *_args, **_kwargs): val = apply(gdic.wxFont_Ok,(self,) + _args, _kwargs) return val - def GetFaceName(self, *_args, **_kwargs): - val = apply(gdic.wxFont_GetFaceName,(self,) + _args, _kwargs) + def GetPointSize(self, *_args, **_kwargs): + val = apply(gdic.wxFont_GetPointSize,(self,) + _args, _kwargs) return val def GetFamily(self, *_args, **_kwargs): val = apply(gdic.wxFont_GetFamily,(self,) + _args, _kwargs) return val - def GetPointSize(self, *_args, **_kwargs): - val = apply(gdic.wxFont_GetPointSize,(self,) + _args, _kwargs) - return val def GetStyle(self, *_args, **_kwargs): val = apply(gdic.wxFont_GetStyle,(self,) + _args, _kwargs) return val + def GetWeight(self, *_args, **_kwargs): + val = apply(gdic.wxFont_GetWeight,(self,) + _args, _kwargs) + return val def GetUnderlined(self, *_args, **_kwargs): val = apply(gdic.wxFont_GetUnderlined,(self,) + _args, _kwargs) return val - def GetWeight(self, *_args, **_kwargs): - val = apply(gdic.wxFont_GetWeight,(self,) + _args, _kwargs) + def GetFaceName(self, *_args, **_kwargs): + val = apply(gdic.wxFont_GetFaceName,(self,) + _args, _kwargs) return val def GetEncoding(self, *_args, **_kwargs): val = apply(gdic.wxFont_GetEncoding,(self,) + _args, _kwargs) return val - def SetFaceName(self, *_args, **_kwargs): - val = apply(gdic.wxFont_SetFaceName,(self,) + _args, _kwargs) - return val - def SetFamily(self, *_args, **_kwargs): - val = apply(gdic.wxFont_SetFamily,(self,) + _args, _kwargs) + def GetNativeFontInfo(self, *_args, **_kwargs): + val = apply(gdic.wxFont_GetNativeFontInfo,(self,) + _args, _kwargs) + if val: val = wxNativeFontInfoPtr(val) return val def SetPointSize(self, *_args, **_kwargs): val = apply(gdic.wxFont_SetPointSize,(self,) + _args, _kwargs) return val + def SetFamily(self, *_args, **_kwargs): + val = apply(gdic.wxFont_SetFamily,(self,) + _args, _kwargs) + return val def SetStyle(self, *_args, **_kwargs): val = apply(gdic.wxFont_SetStyle,(self,) + _args, _kwargs) return val - def SetUnderlined(self, *_args, **_kwargs): - val = apply(gdic.wxFont_SetUnderlined,(self,) + _args, _kwargs) - return val def SetWeight(self, *_args, **_kwargs): val = apply(gdic.wxFont_SetWeight,(self,) + _args, _kwargs) return val + def SetFaceName(self, *_args, **_kwargs): + val = apply(gdic.wxFont_SetFaceName,(self,) + _args, _kwargs) + return val + def SetUnderlined(self, *_args, **_kwargs): + val = apply(gdic.wxFont_SetUnderlined,(self,) + _args, _kwargs) + return val def SetEncoding(self, *_args, **_kwargs): val = apply(gdic.wxFont_SetEncoding,(self,) + _args, _kwargs) return val + def SetNativeFontInfo(self, *_args, **_kwargs): + val = apply(gdic.wxFont_SetNativeFontInfo,(self,) + _args, _kwargs) + return val def GetFamilyString(self, *_args, **_kwargs): val = apply(gdic.wxFont_GetFamilyString,(self,) + _args, _kwargs) return val @@ -253,6 +320,11 @@ class wxFont(wxFontPtr): +def wxFontFromNativeInfo(*_args,**_kwargs): + val = wxFontPtr(apply(gdic.new_wxFontFromNativeInfo,_args,_kwargs)) + val.thisown = 1 + return val + class wxFontListPtr(wxObjectPtr): def __init__(self,this): @@ -677,6 +749,9 @@ class wxDCPtr(wxObjectPtr): def SetClippingRegion(self, *_args, **_kwargs): val = apply(gdic.wxDC_SetClippingRegion,(self,) + _args, _kwargs) return val + def SetClippingRegionAsRegion(self, *_args, **_kwargs): + val = apply(gdic.wxDC_SetClippingRegionAsRegion,(self,) + _args, _kwargs) + return val def SetPalette(self, *_args, **_kwargs): val = apply(gdic.wxDC_SetPalette,(self,) + _args, _kwargs) return val @@ -1092,10 +1167,6 @@ def wxStockCursor(*_args, **_kwargs): if val: val = wxCursorPtr(val); val.thisown = 1 return val -wxFont_GetDefaultEncoding = gdic.wxFont_GetDefaultEncoding - -wxFont_SetDefaultEncoding = gdic.wxFont_SetDefaultEncoding - def wxNamedColour(*_args, **_kwargs): val = apply(gdic.wxNamedColour,_args,_kwargs) if val: val = wxColourPtr(val); val.thisown = 1 @@ -1106,10 +1177,36 @@ def wxMemoryDCFromDC(*_args, **_kwargs): if val: val = wxMemoryDCPtr(val); val.thisown = 1 return val +wxFontMapper_GetEncodingName = gdic.wxFontMapper_GetEncodingName + +wxFontMapper_GetEncodingDescription = gdic.wxFontMapper_GetEncodingDescription + +wxFontMapper_GetDefaultConfigPath = gdic.wxFontMapper_GetDefaultConfigPath + +wxFont_GetDefaultEncoding = gdic.wxFont_GetDefaultEncoding + +wxFont_SetDefaultEncoding = gdic.wxFont_SetDefaultEncoding + #-------------- VARIABLE WRAPPERS ------------------ +wxFONTFAMILY_DEFAULT = gdic.wxFONTFAMILY_DEFAULT +wxFONTFAMILY_DECORATIVE = gdic.wxFONTFAMILY_DECORATIVE +wxFONTFAMILY_ROMAN = gdic.wxFONTFAMILY_ROMAN +wxFONTFAMILY_SCRIPT = gdic.wxFONTFAMILY_SCRIPT +wxFONTFAMILY_SWISS = gdic.wxFONTFAMILY_SWISS +wxFONTFAMILY_MODERN = gdic.wxFONTFAMILY_MODERN +wxFONTFAMILY_TELETYPE = gdic.wxFONTFAMILY_TELETYPE +wxFONTFAMILY_MAX = gdic.wxFONTFAMILY_MAX +wxFONTSTYLE_NORMAL = gdic.wxFONTSTYLE_NORMAL +wxFONTSTYLE_ITALIC = gdic.wxFONTSTYLE_ITALIC +wxFONTSTYLE_SLANT = gdic.wxFONTSTYLE_SLANT +wxFONTSTYLE_MAX = gdic.wxFONTSTYLE_MAX +wxFONTWEIGHT_NORMAL = gdic.wxFONTWEIGHT_NORMAL +wxFONTWEIGHT_LIGHT = gdic.wxFONTWEIGHT_LIGHT +wxFONTWEIGHT_BOLD = gdic.wxFONTWEIGHT_BOLD +wxFONTWEIGHT_MAX = gdic.wxFONTWEIGHT_MAX wxFONTENCODING_SYSTEM = gdic.wxFONTENCODING_SYSTEM wxFONTENCODING_DEFAULT = gdic.wxFONTENCODING_DEFAULT wxFONTENCODING_ISO8859_1 = gdic.wxFONTENCODING_ISO8859_1 @@ -1127,6 +1224,7 @@ wxFONTENCODING_ISO8859_12 = gdic.wxFONTENCODING_ISO8859_12 wxFONTENCODING_ISO8859_13 = gdic.wxFONTENCODING_ISO8859_13 wxFONTENCODING_ISO8859_14 = gdic.wxFONTENCODING_ISO8859_14 wxFONTENCODING_ISO8859_15 = gdic.wxFONTENCODING_ISO8859_15 +wxFONTENCODING_ISO8859_MAX = gdic.wxFONTENCODING_ISO8859_MAX wxFONTENCODING_KOI8 = gdic.wxFONTENCODING_KOI8 wxFONTENCODING_ALTERNATIVE = gdic.wxFONTENCODING_ALTERNATIVE wxFONTENCODING_BULGARIAN = gdic.wxFONTENCODING_BULGARIAN @@ -1135,9 +1233,19 @@ wxFONTENCODING_CP850 = gdic.wxFONTENCODING_CP850 wxFONTENCODING_CP852 = gdic.wxFONTENCODING_CP852 wxFONTENCODING_CP855 = gdic.wxFONTENCODING_CP855 wxFONTENCODING_CP866 = gdic.wxFONTENCODING_CP866 +wxFONTENCODING_CP874 = gdic.wxFONTENCODING_CP874 wxFONTENCODING_CP1250 = gdic.wxFONTENCODING_CP1250 wxFONTENCODING_CP1251 = gdic.wxFONTENCODING_CP1251 wxFONTENCODING_CP1252 = gdic.wxFONTENCODING_CP1252 +wxFONTENCODING_CP1253 = gdic.wxFONTENCODING_CP1253 +wxFONTENCODING_CP1254 = gdic.wxFONTENCODING_CP1254 +wxFONTENCODING_CP1255 = gdic.wxFONTENCODING_CP1255 +wxFONTENCODING_CP1256 = gdic.wxFONTENCODING_CP1256 +wxFONTENCODING_CP1257 = gdic.wxFONTENCODING_CP1257 +wxFONTENCODING_CP12_MAX = gdic.wxFONTENCODING_CP12_MAX +wxFONTENCODING_UTF7 = gdic.wxFONTENCODING_UTF7 +wxFONTENCODING_UTF8 = gdic.wxFONTENCODING_UTF8 +wxFONTENCODING_UNICODE = gdic.wxFONTENCODING_UNICODE wxFONTENCODING_MAX = gdic.wxFONTENCODING_MAX cvar = gdic.cvar wxNORMAL_FONT = wxFontPtr(gdic.cvar.wxNORMAL_FONT) diff --git a/wxPython/src/gtk/grid.cpp b/wxPython/src/gtk/grid.cpp index 0b1bb73b21..b32d7a19db 100644 --- a/wxPython/src/gtk/grid.cpp +++ b/wxPython/src/gtk/grid.cpp @@ -57,6 +57,7 @@ extern PyObject *SWIG_newvarlink(void); #include "export.h" #include +#include static PyObject* t_output_helper(PyObject* target, PyObject* o) { @@ -94,8 +95,9 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { #define PYCALLBACK_GCA_INTINTKIND(PCLASS, CBNAME) \ wxGridCellAttr* CBNAME(int a, int b, wxGridCellAttr::wxAttrKind c) { \ wxGridCellAttr* rval = NULL; \ - bool doSave = wxPyRestoreThread(); \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ + bool found; \ + wxPyTState* state = wxPyBeginBlockThreads(); \ + if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \ PyObject* ro; \ wxGridCellAttr* ptr; \ ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(iii)", a, b, c)); \ @@ -105,9 +107,9 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { Py_DECREF(ro); \ } \ } \ - else \ + wxPyEndBlockThreads(state); \ + if (! found) \ rval = PCLASS::CBNAME(a, b, c); \ - wxPySaveThread(doSave); \ return rval; \ } \ wxGridCellAttr *base_##CBNAME(int a, int b, wxGridCellAttr::wxAttrKind c) { \ @@ -116,356 +118,376 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { -#define PYCALLBACK__GCAINTINT(PCLASS, CBNAME) \ - void CBNAME(wxGridCellAttr *attr, int a, int b) { \ - bool doSave = wxPyRestoreThread(); \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ +#define PYCALLBACK__GCAINTINT(PCLASS, CBNAME) \ + void CBNAME(wxGridCellAttr *attr, int a, int b) { \ + wxPyTState* state = wxPyBeginBlockThreads(); \ + bool found; \ + if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \ PyObject* obj = wxPyConstructObject((void*)attr, "wxGridCellAttr", 0);\ wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oii)", obj, a, b)); \ - Py_DECREF(obj); \ - } \ - else \ - PCLASS::CBNAME(attr, a, b); \ - wxPySaveThread(doSave); \ - } \ - void base_##CBNAME(wxGridCellAttr *attr, int a, int b) { \ - PCLASS::CBNAME(attr, a, b); \ + Py_DECREF(obj); \ + } \ + wxPyEndBlockThreads(state); \ + if (! found) \ + PCLASS::CBNAME(attr, a, b); \ + } \ + void base_##CBNAME(wxGridCellAttr *attr, int a, int b) { \ + PCLASS::CBNAME(attr, a, b); \ } -#define PYCALLBACK__GCAINT(PCLASS, CBNAME) \ - void CBNAME(wxGridCellAttr *attr, int val) { \ - bool doSave = wxPyRestoreThread(); \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ +#define PYCALLBACK__GCAINT(PCLASS, CBNAME) \ + void CBNAME(wxGridCellAttr *attr, int val) { \ + wxPyTState* state = wxPyBeginBlockThreads(); \ + bool found; \ + if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \ PyObject* obj = wxPyConstructObject((void*)attr, "wxGridCellAttr", 0);\ - wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, val)); \ - Py_DECREF(obj); \ - } \ - else \ - PCLASS::CBNAME(attr, val); \ - wxPySaveThread(doSave); \ - } \ - void base_##CBNAME(wxGridCellAttr *attr, int val) { \ - PCLASS::CBNAME(attr, val); \ + wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, val)); \ + Py_DECREF(obj); \ + } \ + wxPyEndBlockThreads(state); \ + if (! found) \ + PCLASS::CBNAME(attr, val); \ + } \ + void base_##CBNAME(wxGridCellAttr *attr, int val) { \ + PCLASS::CBNAME(attr, val); \ } -#define PYCALLBACK_INT__pure(CBNAME) \ - int CBNAME() { \ - bool doSave = wxPyRestoreThread(); \ - int rval = 0; \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ - rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()")); \ - wxPySaveThread(doSave); \ - return rval; \ +#define PYCALLBACK_INT__pure(CBNAME) \ + int CBNAME() { \ + wxPyTState* state = wxPyBeginBlockThreads(); \ + int rval = 0; \ + if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ + rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()")); \ + wxPyEndBlockThreads(state); \ + return rval; \ } -#define PYCALLBACK_BOOL_INTINT_pure(CBNAME) \ - bool CBNAME(int a, int b) { \ - bool doSave = wxPyRestoreThread(); \ - bool rval = 0; \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ - rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)",a,b)); \ - wxPySaveThread(doSave); \ - return rval; \ - } - - - -#define PYCALLBACK_STRING_INTINT_pure(CBNAME) \ - wxString CBNAME(int a, int b) { \ - bool doSave = wxPyRestoreThread(); \ - wxString rval; \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ - PyObject* ro; \ - ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)",a,b)); \ - if (ro) { \ - PyObject* str = PyObject_Str(ro); \ - rval = PyString_AsString(str); \ - Py_DECREF(ro); Py_DECREF(str); \ - } \ - } \ - wxPySaveThread(doSave); \ - return rval; \ - } - - - -#define PYCALLBACK__INTINTSTRING_pure(CBNAME) \ - void CBNAME(int a, int b, const wxString& c) { \ - bool doSave = wxPyRestoreThread(); \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ - wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iis)",a,b,c.c_str())); \ - wxPySaveThread(doSave); \ +#define PYCALLBACK_BOOL_INTINT_pure(CBNAME) \ + bool CBNAME(int a, int b) { \ + wxPyTState* state = wxPyBeginBlockThreads(); \ + bool rval = 0; \ + if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ + rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)",a,b)); \ + wxPyEndBlockThreads(state); \ + return rval; \ } - - -#define PYCALLBACK_STRING_INTINT(PCLASS, CBNAME) \ - wxString CBNAME(int a, int b) { \ - bool doSave = wxPyRestoreThread(); \ - wxString rval; \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ - PyObject* ro; \ - ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)",a,b)); \ - if (ro) { \ - PyObject* str = PyObject_Str(ro); \ - rval = PyString_AsString(str); \ - Py_DECREF(ro); Py_DECREF(str); \ - } \ - } else \ - rval = PCLASS::CBNAME(a, b); \ - wxPySaveThread(doSave); \ - return rval; \ - } \ - wxString base_##CBNAME(int a, int b) { \ - return PCLASS::CBNAME(a, b); \ - } - - - -#define PYCALLBACK_BOOL_INTINTSTRING(PCLASS, CBNAME) \ - bool CBNAME(int a, int b, const wxString& c) { \ - bool rval; \ - bool doSave = wxPyRestoreThread(); \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ - rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iis)", a,b,c.c_str())); \ - else \ - rval = PCLASS::CBNAME(a,b,c); \ - wxPySaveThread(doSave); \ - return rval; \ - } \ - bool base_##CBNAME(int a, int b, const wxString& c) { \ - return PCLASS::CBNAME(a,b,c); \ - } - - - - -#define PYCALLBACK_LONG_INTINT(PCLASS, CBNAME) \ - long CBNAME(int a, int b) { \ - long rval; \ - bool doSave = wxPyRestoreThread(); \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ - rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)", a,b)); \ - else \ - rval = PCLASS::CBNAME(a,b); \ - wxPySaveThread(doSave); \ - return rval; \ - } \ - long base_##CBNAME(int a, int b) { \ - return PCLASS::CBNAME(a,b); \ - } - - - -#define PYCALLBACK_BOOL_INTINT(PCLASS, CBNAME) \ - bool CBNAME(int a, int b) { \ - bool rval; \ - bool doSave = wxPyRestoreThread(); \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ - rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)", a,b)); \ - else \ - rval = PCLASS::CBNAME(a,b); \ - wxPySaveThread(doSave); \ - return rval; \ - } \ - bool base_##CBNAME(int a, int b) { \ - return PCLASS::CBNAME(a,b); \ - } - - - -#define PYCALLBACK_DOUBLE_INTINT(PCLASS, CBNAME) \ - double CBNAME(int a, int b) { \ - bool doSave = wxPyRestoreThread(); \ - double rval; \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ - PyObject* ro; \ - ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)",a,b)); \ - if (ro) { \ - PyObject* str = PyObject_Str(ro); \ - rval = PyFloat_AsDouble(str); \ - Py_DECREF(ro); Py_DECREF(str); \ - } \ - } else \ - rval = PCLASS::CBNAME(a, b); \ - wxPySaveThread(doSave); \ - return rval; \ - } \ - double base_##CBNAME(int a, int b) { \ - return PCLASS::CBNAME(a, b); \ - } - - - -#define PYCALLBACK__(PCLASS, CBNAME) \ - void CBNAME() { \ - bool doSave = wxPyRestoreThread(); \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ - wxPyCBH_callCallback(m_myInst, Py_BuildValue("()")); \ - else \ - PCLASS::CBNAME(); \ - wxPySaveThread(doSave); \ - } \ - void base_##CBNAME() { \ - PCLASS::CBNAME(); \ - } - - - - -#define PYCALLBACK_BOOL_SIZETSIZET(PCLASS, CBNAME) \ - bool CBNAME(size_t a, size_t b) { \ - bool rval; \ - bool doSave = wxPyRestoreThread(); \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ - rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)", a,b)); \ - else \ - rval = PCLASS::CBNAME(a,b); \ - wxPySaveThread(doSave); \ - return rval; \ - } \ - bool base_##CBNAME(size_t a, size_t b) { \ - return PCLASS::CBNAME(a,b); \ - } - - - -#define PYCALLBACK_BOOL_SIZET(PCLASS, CBNAME) \ - bool CBNAME(size_t a) { \ - bool rval; \ - bool doSave = wxPyRestoreThread(); \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ - rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)", a)); \ - else \ - rval = PCLASS::CBNAME(a); \ - wxPySaveThread(doSave); \ - return rval; \ - } \ - bool base_##CBNAME(size_t a) { \ - return PCLASS::CBNAME(a); \ - } - - - -#define PYCALLBACK_STRING_INT(PCLASS, CBNAME) \ - wxString CBNAME(int a) { \ - bool doSave = wxPyRestoreThread(); \ - wxString rval; \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ - PyObject* ro; \ - ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(i)",a)); \ - if (ro) { \ - PyObject* str = PyObject_Str(ro); \ - rval = PyString_AsString(str); \ - Py_DECREF(ro); Py_DECREF(str); \ - } \ - } else \ - rval = PCLASS::CBNAME(a); \ - wxPySaveThread(doSave); \ - return rval; \ - } \ - wxString base_##CBNAME(int a) { \ - return PCLASS::CBNAME(a); \ + + + +#define PYCALLBACK_STRING_INTINT_pure(CBNAME) \ + wxString CBNAME(int a, int b) { \ + wxPyTState* state = wxPyBeginBlockThreads(); \ + wxString rval; \ + if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ + PyObject* ro; \ + ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)",a,b)); \ + if (ro) { \ + PyObject* str = PyObject_Str(ro); \ + rval = PyString_AsString(str); \ + Py_DECREF(ro); Py_DECREF(str); \ + } \ + } \ + wxPyEndBlockThreads(state); \ + return rval; \ } -#define PYCALLBACK__INTSTRING(PCLASS, CBNAME) \ - void CBNAME(int a, const wxString& c) { \ - bool doSave = wxPyRestoreThread(); \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ - wxPyCBH_callCallback(m_myInst, Py_BuildValue("(is)", a,c.c_str())); \ - else \ - PCLASS::CBNAME(a,c); \ - wxPySaveThread(doSave); \ - } \ - void base_##CBNAME(int a, const wxString& c) { \ - PCLASS::CBNAME(a,c); \ +#define PYCALLBACK__INTINTSTRING_pure(CBNAME) \ + void CBNAME(int a, int b, const wxString& c) { \ + wxPyTState* state = wxPyBeginBlockThreads(); \ + if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ + wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iis)",a,b,c.c_str()));\ + wxPyEndBlockThreads(state); \ } +#define PYCALLBACK_STRING_INTINT(PCLASS, CBNAME) \ + wxString CBNAME(int a, int b) { \ + bool found; \ + wxPyTState* state = wxPyBeginBlockThreads(); \ + wxString rval; \ + if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \ + PyObject* ro; \ + ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)",a,b)); \ + if (ro) { \ + PyObject* str = PyObject_Str(ro); \ + rval = PyString_AsString(str); \ + Py_DECREF(ro); Py_DECREF(str); \ + } \ + } \ + wxPyEndBlockThreads(state); \ + if (! found) \ + rval = PCLASS::CBNAME(a, b); \ + return rval; \ + } \ + wxString base_##CBNAME(int a, int b) { \ + return PCLASS::CBNAME(a, b); \ + } + -#define PYCALLBACK_BOOL_(PCLASS, CBNAME) \ - bool CBNAME() { \ - bool rval; \ - bool doSave = wxPyRestoreThread(); \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ - rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()")); \ - else \ - rval = PCLASS::CBNAME(); \ - wxPySaveThread(doSave); \ - return rval; \ - } \ - bool base_##CBNAME() { \ - return PCLASS::CBNAME(); \ +#define PYCALLBACK_BOOL_INTINTSTRING(PCLASS, CBNAME) \ + bool CBNAME(int a, int b, const wxString& c) { \ + bool rval; \ + bool found; \ + wxPyTState* state = wxPyBeginBlockThreads(); \ + if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ + rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iis)", a,b,c.c_str()));\ + wxPyEndBlockThreads(state); \ + if (! found) \ + rval = PCLASS::CBNAME(a,b,c); \ + return rval; \ + } \ + bool base_##CBNAME(int a, int b, const wxString& c) { \ + return PCLASS::CBNAME(a,b,c); \ } -#define PYCALLBACK__SIZETINT(PCLASS, CBNAME) \ - void CBNAME(size_t a, int b) { \ - bool doSave = wxPyRestoreThread(); \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ - wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)", a,b)); \ - else \ - PCLASS::CBNAME(a,b); \ - wxPySaveThread(doSave); \ - } \ - void base_##CBNAME(size_t a, int b) { \ - PCLASS::CBNAME(a,b); \ + +#define PYCALLBACK_LONG_INTINT(PCLASS, CBNAME) \ + long CBNAME(int a, int b) { \ + long rval; \ + bool found; \ + wxPyTState* state = wxPyBeginBlockThreads(); \ + if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ + rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)", a,b)); \ + wxPyEndBlockThreads(state); \ + if (! found) \ + rval = PCLASS::CBNAME(a,b); \ + return rval; \ + } \ + long base_##CBNAME(int a, int b) { \ + return PCLASS::CBNAME(a,b); \ } +#define PYCALLBACK_BOOL_INTINT(PCLASS, CBNAME) \ + bool CBNAME(int a, int b) { \ + bool rval; \ + bool found; \ + wxPyTState* state = wxPyBeginBlockThreads(); \ + if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ + rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)", a,b)); \ + wxPyEndBlockThreads(state); \ + if (! found) \ + rval = PCLASS::CBNAME(a,b); \ + return rval; \ + } \ + bool base_##CBNAME(int a, int b) { \ + return PCLASS::CBNAME(a,b); \ + } + -#define PYCALLBACK__INTINTLONG(PCLASS, CBNAME) \ - void CBNAME(int a, int b, long c) { \ - bool doSave = wxPyRestoreThread(); \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ - wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", a,b,c)); \ - else \ - PCLASS::CBNAME(a,b,c); \ - wxPySaveThread(doSave); \ - } \ - void base_##CBNAME(int a, int b, long c) { \ - PCLASS::CBNAME(a,b,c); \ + +#define PYCALLBACK_DOUBLE_INTINT(PCLASS, CBNAME) \ + double CBNAME(int a, int b) { \ + bool found; \ + wxPyTState* state = wxPyBeginBlockThreads(); \ + double rval; \ + if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \ + PyObject* ro; \ + ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)",a,b)); \ + if (ro) { \ + PyObject* str = PyObject_Str(ro); \ + rval = PyFloat_AsDouble(str); \ + Py_DECREF(ro); Py_DECREF(str); \ + } \ + } \ + wxPyEndBlockThreads(state); \ + if (! found) \ + rval = PCLASS::CBNAME(a, b); \ + return rval; \ + } \ + double base_##CBNAME(int a, int b) { \ + return PCLASS::CBNAME(a, b); \ + } + + + +#define PYCALLBACK__(PCLASS, CBNAME) \ + void CBNAME() { \ + bool found; \ + wxPyTState* state = wxPyBeginBlockThreads(); \ + if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ + wxPyCBH_callCallback(m_myInst, Py_BuildValue("()")); \ + wxPyEndBlockThreads(state); \ + if (! found) \ + PCLASS::CBNAME(); \ + } \ + void base_##CBNAME() { \ + PCLASS::CBNAME(); \ + } + + + + +#define PYCALLBACK_BOOL_SIZETSIZET(PCLASS, CBNAME) \ + bool CBNAME(size_t a, size_t b) { \ + bool rval; \ + bool found; \ + wxPyTState* state = wxPyBeginBlockThreads(); \ + if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ + rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)", a,b)); \ + wxPyEndBlockThreads(state); \ + if (! found) \ + rval = PCLASS::CBNAME(a,b); \ + return rval; \ + } \ + bool base_##CBNAME(size_t a, size_t b) { \ + return PCLASS::CBNAME(a,b); \ + } + + + +#define PYCALLBACK_BOOL_SIZET(PCLASS, CBNAME) \ + bool CBNAME(size_t a) { \ + bool rval; \ + bool found; \ + wxPyTState* state = wxPyBeginBlockThreads(); \ + if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ + rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)", a)); \ + wxPyEndBlockThreads(state); \ + if (! found) \ + rval = PCLASS::CBNAME(a); \ + return rval; \ + } \ + bool base_##CBNAME(size_t a) { \ + return PCLASS::CBNAME(a); \ } +#define PYCALLBACK_STRING_INT(PCLASS, CBNAME) \ + wxString CBNAME(int a) { \ + bool found; \ + wxPyTState* state = wxPyBeginBlockThreads(); \ + wxString rval; \ + if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \ + PyObject* ro; \ + ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(i)",a)); \ + if (ro) { \ + PyObject* str = PyObject_Str(ro); \ + rval = PyString_AsString(str); \ + Py_DECREF(ro); Py_DECREF(str); \ + } \ + } \ + wxPyEndBlockThreads(state); \ + if (! found) \ + rval = PCLASS::CBNAME(a); \ + return rval; \ + } \ + wxString base_##CBNAME(int a) { \ + return PCLASS::CBNAME(a); \ + } + + -#define PYCALLBACK__INTINTDOUBLE(PCLASS, CBNAME) \ - void CBNAME(int a, int b, double c) { \ - bool doSave = wxPyRestoreThread(); \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ - wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iif)", a,b,c)); \ - else \ - PCLASS::CBNAME(a,b,c); \ - wxPySaveThread(doSave); \ - } \ - void base_##CBNAME(int a, int b, double c) { \ - PCLASS::CBNAME(a,b,c); \ +#define PYCALLBACK__INTSTRING(PCLASS, CBNAME) \ + void CBNAME(int a, const wxString& c) { \ + bool found; \ + wxPyTState* state = wxPyBeginBlockThreads(); \ + if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ + wxPyCBH_callCallback(m_myInst, Py_BuildValue("(is)", a,c.c_str())); \ + wxPyEndBlockThreads(state); \ + if (! found) \ + PCLASS::CBNAME(a,c); \ + } \ + void base_##CBNAME(int a, const wxString& c) { \ + PCLASS::CBNAME(a,c); \ } -#define PYCALLBACK__INTINTBOOL(PCLASS, CBNAME) \ - void CBNAME(int a, int b, bool c) { \ - bool doSave = wxPyRestoreThread(); \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ - wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", a,b,c)); \ - else \ - PCLASS::CBNAME(a,b,c); \ - wxPySaveThread(doSave); \ - } \ - void base_##CBNAME(int a, int b, bool c) { \ - PCLASS::CBNAME(a,b,c); \ + +#define PYCALLBACK_BOOL_(PCLASS, CBNAME) \ + bool CBNAME() { \ + bool rval; \ + bool found; \ + wxPyTState* state = wxPyBeginBlockThreads(); \ + if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ + rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()")); \ + wxPyEndBlockThreads(state); \ + if (! found) \ + rval = PCLASS::CBNAME(); \ + return rval; \ + } \ + bool base_##CBNAME() { \ + return PCLASS::CBNAME(); \ + } + + + +#define PYCALLBACK__SIZETINT(PCLASS, CBNAME) \ + void CBNAME(size_t a, int b) { \ + bool found; \ + wxPyTState* state = wxPyBeginBlockThreads(); \ + if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ + wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)", a,b)); \ + wxPyEndBlockThreads(state); \ + if (! found) \ + PCLASS::CBNAME(a,b); \ + } \ + void base_##CBNAME(size_t a, int b) { \ + PCLASS::CBNAME(a,b); \ + } + + + + +#define PYCALLBACK__INTINTLONG(PCLASS, CBNAME) \ + void CBNAME(int a, int b, long c) { \ + bool found; \ + wxPyTState* state = wxPyBeginBlockThreads(); \ + if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ + wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", a,b,c)); \ + wxPyEndBlockThreads(state); \ + if (! found) \ + PCLASS::CBNAME(a,b,c); \ + } \ + void base_##CBNAME(int a, int b, long c) { \ + PCLASS::CBNAME(a,b,c); \ + } + + + + +#define PYCALLBACK__INTINTDOUBLE(PCLASS, CBNAME) \ + void CBNAME(int a, int b, double c) { \ + bool found; \ + wxPyTState* state = wxPyBeginBlockThreads(); \ + if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ + wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iif)", a,b,c)); \ + wxPyEndBlockThreads(state); \ + if (! found) \ + PCLASS::CBNAME(a,b,c); \ + } \ + void base_##CBNAME(int a, int b, double c) { \ + PCLASS::CBNAME(a,b,c); \ + } + + + +#define PYCALLBACK__INTINTBOOL(PCLASS, CBNAME) \ + void CBNAME(int a, int b, bool c) { \ + bool found; \ + wxPyTState* state = wxPyBeginBlockThreads(); \ + if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ + wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", a,b,c)); \ + wxPyEndBlockThreads(state); \ + if (! found) \ + PCLASS::CBNAME(a,b,c); \ + } \ + void base_##CBNAME(int a, int b, bool c) { \ + PCLASS::CBNAME(a,b,c); \ } @@ -481,7 +503,7 @@ public: void Draw(wxGrid& grid, wxGridCellAttr& attr, wxDC& dc, const wxRect& rect, int row, int col, bool isSelected) { - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (wxPyCBH_findCallback(m_myInst, "Draw")) { wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOOOiii)", @@ -491,13 +513,13 @@ public: wxPyConstructObject((void*)&rect, "wxRect", 0), row, col, isSelected)); } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); } wxSize GetBestSize(wxGrid& grid, wxGridCellAttr& attr, wxDC& dc, int row, int col) { wxSize rval; - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (wxPyCBH_findCallback(m_myInst, "GetBestSize")) { PyObject* ro; wxSize* ptr; @@ -513,14 +535,14 @@ public: Py_DECREF(ro); } } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return rval; } wxGridCellRenderer *Clone() const { wxGridCellRenderer* rval = NULL; - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (wxPyCBH_findCallback(m_myInst, "Clone")) { PyObject* ro; wxGridCellRenderer* ptr; @@ -531,7 +553,7 @@ public: Py_DECREF(ro); } } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return rval; } @@ -549,7 +571,7 @@ public: wxPyGridCellEditor() : wxGridCellEditor() {} void Create(wxWindow* parent, wxWindowID id, wxEvtHandler* evtHandler) { - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (wxPyCBH_findCallback(m_myInst, "Create")) { wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OiO)", @@ -557,37 +579,37 @@ public: id, wxPyConstructObject((void*)evtHandler, "wxEvtHandler", 0))); } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); } void BeginEdit(int row, int col, wxGrid* grid) { - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (wxPyCBH_findCallback(m_myInst, "BeginEdit")) { wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iiO)", row, col, wxPyConstructObject((void*)grid, "wxGrid", 0))); } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); } bool EndEdit(int row, int col, wxGrid* grid) { bool rv = FALSE; - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (wxPyCBH_findCallback(m_myInst, "EndEdit")) { rv = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iiO)", row, col, wxPyConstructObject((void*)grid, "wxGrid", 0))); } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return rv; } wxGridCellEditor*Clone() const { wxGridCellEditor* rval = NULL; - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (wxPyCBH_findCallback(m_myInst, "Clone")) { PyObject* ro; wxGridCellEditor* ptr; @@ -598,20 +620,21 @@ public: Py_DECREF(ro); } } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return rval; } void Show(bool show, wxGridCellAttr *attr) { - bool doSave = wxPyRestoreThread(); - if (wxPyCBH_findCallback(m_myInst, "Show")) + bool found; + wxPyTState* state = wxPyBeginBlockThreads(); + if ((found = wxPyCBH_findCallback(m_myInst, "Show"))) wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iO)", show, wxPyConstructObject((void*)attr, "wxGridCellAttr", 0))); - else + wxPyEndBlockThreads(state); + if (! found) wxGridCellEditor::Show(show, attr); - wxPySaveThread(doSave); } void base_Show(bool show, wxGridCellAttr *attr) { wxGridCellEditor::Show(show, attr); @@ -619,15 +642,16 @@ public: void PaintBackground(const wxRect& rectCell, wxGridCellAttr *attr) { - bool doSave = wxPyRestoreThread(); - if (wxPyCBH_findCallback(m_myInst, "PaintBackground")) + bool found; \ + wxPyTState* state = wxPyBeginBlockThreads(); + if ((found = wxPyCBH_findCallback(m_myInst, "PaintBackground)"))) wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OO)", wxPyConstructObject((void*)&rectCell, "wxRect", 0), wxPyConstructObject((void*)attr, "wxGridCellAttr", 0))); - else + wxPyEndBlockThreads(state); + if (! found) wxGridCellEditor::PaintBackground(rectCell, attr); - wxPySaveThread(doSave); } void base_PaintBackground(const wxRect& rectCell, wxGridCellAttr *attr) { wxGridCellEditor::PaintBackground(rectCell, attr); @@ -700,7 +724,7 @@ public: wxString GetValue(int row, int col) { - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); wxString rval; if (wxPyCBH_findCallback(m_myInst, "GetValue")) { PyObject* ro; @@ -712,15 +736,15 @@ public: Py_DECREF(str); } } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return rval; } void SetValue(int row, int col, const wxString& val) { - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (wxPyCBH_findCallback(m_myInst, "SetValue")) wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iis)",row,col,val.c_str())); - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); } @@ -728,7 +752,7 @@ public: // the GetValue and SetValue python methods. long GetValueAsLong( int row, int col ) { long rval = 0; - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (wxPyCBH_findCallback(m_myInst, "GetValue")) { PyObject* ro; PyObject* num; @@ -742,13 +766,13 @@ public: Py_DECREF(ro); } } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return rval; } double GetValueAsDouble( int row, int col ) { double rval = 0.0; - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (wxPyCBH_findCallback(m_myInst, "GetValue")) { PyObject* ro; PyObject* num; @@ -762,7 +786,7 @@ public: Py_DECREF(ro); } } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return rval; } @@ -771,19 +795,19 @@ public: } void SetValueAsLong( int row, int col, long value ) { - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (wxPyCBH_findCallback(m_myInst, "SetValue")) { wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", row, col, value)); } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); } void SetValueAsDouble( int row, int col, double value ) { - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (wxPyCBH_findCallback(m_myInst, "SetValue")) { wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iid)", row, col, value)); } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); } void SetValueAsBool( int row, int col, bool value ) { @@ -1513,6 +1537,194 @@ static PyObject *_wrap_new_wxGridCellBoolRenderer(PyObject *self, PyObject *args return _resultobj; } +static void *SwigwxGridCellDateTimeRendererTowxGridCellStringRenderer(void *ptr) { + wxGridCellDateTimeRenderer *src; + wxGridCellStringRenderer *dest; + src = (wxGridCellDateTimeRenderer *) ptr; + dest = (wxGridCellStringRenderer *) src; + return (void *) dest; +} + +static void *SwigwxGridCellDateTimeRendererTowxGridCellRenderer(void *ptr) { + wxGridCellDateTimeRenderer *src; + wxGridCellRenderer *dest; + src = (wxGridCellDateTimeRenderer *) ptr; + dest = (wxGridCellRenderer *) src; + return (void *) dest; +} + +#define new_wxGridCellDateTimeRenderer(_swigarg0,_swigarg1) (new wxGridCellDateTimeRenderer(_swigarg0,_swigarg1)) +static PyObject *_wrap_new_wxGridCellDateTimeRenderer(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxGridCellDateTimeRenderer * _result; + wxString * _arg0 = (wxString *) &"%c"; + wxString * _arg1 = (wxString *) &"%c"; + PyObject * _obj0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "outformat","informat", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|OO:new_wxGridCellDateTimeRenderer",_kwnames,&_obj0,&_obj1)) + return NULL; + if (_obj0) +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif +} + if (_obj1) +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + 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 +} +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxGridCellDateTimeRenderer *)new_wxGridCellDateTimeRenderer(*_arg0,*_arg1); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellDateTimeRenderer_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } +{ + if (_obj0) + delete _arg0; +} +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +static void *SwigwxGridCellEnumRendererTowxGridCellStringRenderer(void *ptr) { + wxGridCellEnumRenderer *src; + wxGridCellStringRenderer *dest; + src = (wxGridCellEnumRenderer *) ptr; + dest = (wxGridCellStringRenderer *) src; + return (void *) dest; +} + +static void *SwigwxGridCellEnumRendererTowxGridCellRenderer(void *ptr) { + wxGridCellEnumRenderer *src; + wxGridCellRenderer *dest; + src = (wxGridCellEnumRenderer *) ptr; + dest = (wxGridCellRenderer *) src; + return (void *) dest; +} + +#define new_wxGridCellEnumRenderer(_swigarg0) (new wxGridCellEnumRenderer(_swigarg0)) +static PyObject *_wrap_new_wxGridCellEnumRenderer(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxGridCellEnumRenderer * _result; + wxString * _arg0 = (wxString *) &""; + PyObject * _obj0 = 0; + char *_kwnames[] = { "choices", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|O:new_wxGridCellEnumRenderer",_kwnames,&_obj0)) + return NULL; + if (_obj0) +{ + _arg0 = wxString_LIST_helper(_obj0); + if (_arg0 == NULL) { + return NULL; + } +} +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxGridCellEnumRenderer *)new_wxGridCellEnumRenderer(*_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellEnumRenderer_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } +{ + delete [] _arg0; +} + return _resultobj; +} + +static void *SwigwxGridCellAutoWrapStringRendererTowxGridCellStringRenderer(void *ptr) { + wxGridCellAutoWrapStringRenderer *src; + wxGridCellStringRenderer *dest; + src = (wxGridCellAutoWrapStringRenderer *) ptr; + dest = (wxGridCellStringRenderer *) src; + return (void *) dest; +} + +static void *SwigwxGridCellAutoWrapStringRendererTowxGridCellRenderer(void *ptr) { + wxGridCellAutoWrapStringRenderer *src; + wxGridCellRenderer *dest; + src = (wxGridCellAutoWrapStringRenderer *) ptr; + dest = (wxGridCellRenderer *) src; + return (void *) dest; +} + +#define new_wxGridCellAutoWrapStringRenderer() (new wxGridCellAutoWrapStringRenderer()) +static PyObject *_wrap_new_wxGridCellAutoWrapStringRenderer(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxGridCellAutoWrapStringRenderer * _result; + char *_kwnames[] = { NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxGridCellAutoWrapStringRenderer",_kwnames)) + return NULL; +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxGridCellAutoWrapStringRenderer *)new_wxGridCellAutoWrapStringRenderer(); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellAutoWrapStringRenderer_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + #define wxGridCellEditor_IsCreated(_swigobj) (_swigobj->IsCreated()) static PyObject *_wrap_wxGridCellEditor_IsCreated(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -2814,6 +3026,102 @@ static PyObject *_wrap_new_wxGridCellChoiceEditor(PyObject *self, PyObject *args return _resultobj; } +static void *SwigwxGridCellEnumEditorTowxGridCellChoiceEditor(void *ptr) { + wxGridCellEnumEditor *src; + wxGridCellChoiceEditor *dest; + src = (wxGridCellEnumEditor *) ptr; + dest = (wxGridCellChoiceEditor *) src; + return (void *) dest; +} + +static void *SwigwxGridCellEnumEditorTowxGridCellEditor(void *ptr) { + wxGridCellEnumEditor *src; + wxGridCellEditor *dest; + src = (wxGridCellEnumEditor *) ptr; + dest = (wxGridCellEditor *) src; + return (void *) dest; +} + +#define new_wxGridCellEnumEditor(_swigarg0) (new wxGridCellEnumEditor(_swigarg0)) +static PyObject *_wrap_new_wxGridCellEnumEditor(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxGridCellEnumEditor * _result; + wxString * _arg0 = (wxString *) &""; + PyObject * _obj0 = 0; + char *_kwnames[] = { "choices", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|O:new_wxGridCellEnumEditor",_kwnames,&_obj0)) + return NULL; + if (_obj0) +{ + _arg0 = wxString_LIST_helper(_obj0); + if (_arg0 == NULL) { + return NULL; + } +} +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxGridCellEnumEditor *)new_wxGridCellEnumEditor(*_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellEnumEditor_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } +{ + delete [] _arg0; +} + return _resultobj; +} + +static void *SwigwxGridCellAutoWrapStringEditorTowxGridCellTextEditor(void *ptr) { + wxGridCellAutoWrapStringEditor *src; + wxGridCellTextEditor *dest; + src = (wxGridCellAutoWrapStringEditor *) ptr; + dest = (wxGridCellTextEditor *) src; + return (void *) dest; +} + +static void *SwigwxGridCellAutoWrapStringEditorTowxGridCellEditor(void *ptr) { + wxGridCellAutoWrapStringEditor *src; + wxGridCellEditor *dest; + src = (wxGridCellAutoWrapStringEditor *) ptr; + dest = (wxGridCellEditor *) src; + return (void *) dest; +} + +#define new_wxGridCellAutoWrapStringEditor() (new wxGridCellAutoWrapStringEditor()) +static PyObject *_wrap_new_wxGridCellAutoWrapStringEditor(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxGridCellAutoWrapStringEditor * _result; + char *_kwnames[] = { NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxGridCellAutoWrapStringEditor",_kwnames)) + return NULL; +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxGridCellAutoWrapStringEditor *)new_wxGridCellAutoWrapStringEditor(); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellAutoWrapStringEditor_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + #define new_wxGridCellAttr() (new wxGridCellAttr()) static PyObject *_wrap_new_wxGridCellAttr(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -14002,6 +14310,8 @@ static PyMethodDef gridcMethods[] = { { "wxGridCellAttr_MergeWith", (PyCFunction) _wrap_wxGridCellAttr_MergeWith, METH_VARARGS | METH_KEYWORDS }, { "wxGridCellAttr_Clone", (PyCFunction) _wrap_wxGridCellAttr_Clone, METH_VARARGS | METH_KEYWORDS }, { "new_wxGridCellAttr", (PyCFunction) _wrap_new_wxGridCellAttr, METH_VARARGS | METH_KEYWORDS }, + { "new_wxGridCellAutoWrapStringEditor", (PyCFunction) _wrap_new_wxGridCellAutoWrapStringEditor, METH_VARARGS | METH_KEYWORDS }, + { "new_wxGridCellEnumEditor", (PyCFunction) _wrap_new_wxGridCellEnumEditor, METH_VARARGS | METH_KEYWORDS }, { "new_wxGridCellChoiceEditor", (PyCFunction) _wrap_new_wxGridCellChoiceEditor, METH_VARARGS | METH_KEYWORDS }, { "new_wxGridCellBoolEditor", (PyCFunction) _wrap_new_wxGridCellBoolEditor, METH_VARARGS | METH_KEYWORDS }, { "new_wxGridCellFloatEditor", (PyCFunction) _wrap_new_wxGridCellFloatEditor, METH_VARARGS | METH_KEYWORDS }, @@ -14037,6 +14347,9 @@ static PyMethodDef gridcMethods[] = { { "wxGridCellEditor_SetControl", (PyCFunction) _wrap_wxGridCellEditor_SetControl, METH_VARARGS | METH_KEYWORDS }, { "wxGridCellEditor_GetControl", (PyCFunction) _wrap_wxGridCellEditor_GetControl, METH_VARARGS | METH_KEYWORDS }, { "wxGridCellEditor_IsCreated", (PyCFunction) _wrap_wxGridCellEditor_IsCreated, METH_VARARGS | METH_KEYWORDS }, + { "new_wxGridCellAutoWrapStringRenderer", (PyCFunction) _wrap_new_wxGridCellAutoWrapStringRenderer, METH_VARARGS | METH_KEYWORDS }, + { "new_wxGridCellEnumRenderer", (PyCFunction) _wrap_new_wxGridCellEnumRenderer, METH_VARARGS | METH_KEYWORDS }, + { "new_wxGridCellDateTimeRenderer", (PyCFunction) _wrap_new_wxGridCellDateTimeRenderer, METH_VARARGS | METH_KEYWORDS }, { "new_wxGridCellBoolRenderer", (PyCFunction) _wrap_new_wxGridCellBoolRenderer, METH_VARARGS | METH_KEYWORDS }, { "wxGridCellFloatRenderer_SetPrecision", (PyCFunction) _wrap_wxGridCellFloatRenderer_SetPrecision, METH_VARARGS | METH_KEYWORDS }, { "wxGridCellFloatRenderer_GetPrecision", (PyCFunction) _wrap_wxGridCellFloatRenderer_GetPrecision, METH_VARARGS | METH_KEYWORDS }, @@ -14072,6 +14385,12 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxEvent","_class_wxGridEvent",SwigwxGridEventTowxEvent}, { "_wxEvent","_wxGridEvent",SwigwxGridEventTowxEvent}, { "_signed_long","_long",0}, + { "_class_wxGridCellRenderer","_class_wxGridCellAutoWrapStringRenderer",SwigwxGridCellAutoWrapStringRendererTowxGridCellRenderer}, + { "_class_wxGridCellRenderer","_wxGridCellAutoWrapStringRenderer",SwigwxGridCellAutoWrapStringRendererTowxGridCellRenderer}, + { "_class_wxGridCellRenderer","_class_wxGridCellEnumRenderer",SwigwxGridCellEnumRendererTowxGridCellRenderer}, + { "_class_wxGridCellRenderer","_wxGridCellEnumRenderer",SwigwxGridCellEnumRendererTowxGridCellRenderer}, + { "_class_wxGridCellRenderer","_class_wxGridCellDateTimeRenderer",SwigwxGridCellDateTimeRendererTowxGridCellRenderer}, + { "_class_wxGridCellRenderer","_wxGridCellDateTimeRenderer",SwigwxGridCellDateTimeRendererTowxGridCellRenderer}, { "_class_wxGridCellRenderer","_class_wxGridCellBoolRenderer",SwigwxGridCellBoolRendererTowxGridCellRenderer}, { "_class_wxGridCellRenderer","_wxGridCellBoolRenderer",SwigwxGridCellBoolRendererTowxGridCellRenderer}, { "_class_wxGridCellRenderer","_class_wxGridCellFloatRenderer",SwigwxGridCellFloatRendererTowxGridCellRenderer}, @@ -14082,6 +14401,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxGridCellRenderer","_wxGridCellStringRenderer",SwigwxGridCellStringRendererTowxGridCellRenderer}, { "_class_wxGridCellRenderer","_class_wxPyGridCellRenderer",SwigwxPyGridCellRendererTowxGridCellRenderer}, { "_class_wxGridCellRenderer","_wxPyGridCellRenderer",SwigwxPyGridCellRendererTowxGridCellRenderer}, + { "_wxGridCellChoiceEditor","_class_wxGridCellEnumEditor",SwigwxGridCellEnumEditorTowxGridCellChoiceEditor}, + { "_wxGridCellChoiceEditor","_wxGridCellEnumEditor",SwigwxGridCellEnumEditorTowxGridCellChoiceEditor}, { "_wxPrintQuality","_WXGRIDSELECTIONMODES",0}, { "_wxPrintQuality","_wxCoord",0}, { "_wxPrintQuality","_int",0}, @@ -14146,6 +14467,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxEvent","_wxGridSizeEvent",SwigwxGridSizeEventTowxEvent}, { "_class_wxEvent","_class_wxGridEvent",SwigwxGridEventTowxEvent}, { "_class_wxEvent","_wxGridEvent",SwigwxGridEventTowxEvent}, + { "_class_wxGridCellChoiceEditor","_class_wxGridCellEnumEditor",SwigwxGridCellEnumEditorTowxGridCellChoiceEditor}, + { "_class_wxGridCellChoiceEditor","_wxGridCellEnumEditor",SwigwxGridCellEnumEditorTowxGridCellChoiceEditor}, { "_wxCommandEvent","_class_wxGridEditorCreatedEvent",SwigwxGridEditorCreatedEventTowxCommandEvent}, { "_wxCommandEvent","_wxGridEditorCreatedEvent",SwigwxGridEditorCreatedEventTowxCommandEvent}, { "_wxCommandEvent","_class_wxGridRangeSelectEvent",SwigwxGridRangeSelectEventTowxCommandEvent}, @@ -14155,6 +14478,12 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxCommandEvent","_class_wxGridEvent",SwigwxGridEventTowxCommandEvent}, { "_wxCommandEvent","_wxGridEvent",SwigwxGridEventTowxCommandEvent}, { "_char","_wxChar",0}, + { "_wxGridCellStringRenderer","_class_wxGridCellAutoWrapStringRenderer",SwigwxGridCellAutoWrapStringRendererTowxGridCellStringRenderer}, + { "_wxGridCellStringRenderer","_wxGridCellAutoWrapStringRenderer",SwigwxGridCellAutoWrapStringRendererTowxGridCellStringRenderer}, + { "_wxGridCellStringRenderer","_class_wxGridCellEnumRenderer",SwigwxGridCellEnumRendererTowxGridCellStringRenderer}, + { "_wxGridCellStringRenderer","_wxGridCellEnumRenderer",SwigwxGridCellEnumRendererTowxGridCellStringRenderer}, + { "_wxGridCellStringRenderer","_class_wxGridCellDateTimeRenderer",SwigwxGridCellDateTimeRendererTowxGridCellStringRenderer}, + { "_wxGridCellStringRenderer","_wxGridCellDateTimeRenderer",SwigwxGridCellDateTimeRendererTowxGridCellStringRenderer}, { "_wxGridCellStringRenderer","_class_wxGridCellFloatRenderer",SwigwxGridCellFloatRendererTowxGridCellStringRenderer}, { "_wxGridCellStringRenderer","_wxGridCellFloatRenderer",SwigwxGridCellFloatRendererTowxGridCellStringRenderer}, { "_wxGridCellStringRenderer","_class_wxGridCellNumberRenderer",SwigwxGridCellNumberRendererTowxGridCellStringRenderer}, @@ -14165,6 +14494,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxNotifyEvent","_wxGridSizeEvent",SwigwxGridSizeEventTowxNotifyEvent}, { "_class_wxNotifyEvent","_class_wxGridEvent",SwigwxGridEventTowxNotifyEvent}, { "_class_wxNotifyEvent","_wxGridEvent",SwigwxGridEventTowxNotifyEvent}, + { "_struct_wxNativeFontInfo","_wxNativeFontInfo",0}, { "_wxGridTableBase","_class_wxGridStringTable",SwigwxGridStringTableTowxGridTableBase}, { "_wxGridTableBase","_wxGridStringTable",SwigwxGridStringTableTowxGridTableBase}, { "_wxGridTableBase","_class_wxPyGridTableBase",SwigwxPyGridTableBaseTowxGridTableBase}, @@ -14175,6 +14505,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_EBool","_signed_int",0}, { "_EBool","_int",0}, { "_EBool","_wxWindowID",0}, + { "_class_wxGridCellTextEditor","_class_wxGridCellAutoWrapStringEditor",SwigwxGridCellAutoWrapStringEditorTowxGridCellTextEditor}, + { "_class_wxGridCellTextEditor","_wxGridCellAutoWrapStringEditor",SwigwxGridCellAutoWrapStringEditorTowxGridCellTextEditor}, { "_class_wxGridCellTextEditor","_class_wxGridCellFloatEditor",SwigwxGridCellFloatEditorTowxGridCellTextEditor}, { "_class_wxGridCellTextEditor","_wxGridCellFloatEditor",SwigwxGridCellFloatEditorTowxGridCellTextEditor}, { "_class_wxGridCellTextEditor","_class_wxGridCellNumberEditor",SwigwxGridCellNumberEditorTowxGridCellTextEditor}, @@ -14190,6 +14522,13 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_WXGRIDSELECTIONMODES","_time_t",0}, { "_WXGRIDSELECTIONMODES","_wxPrintQuality",0}, { "_WXGRIDSELECTIONMODES","_wxCoord",0}, + { "_wxNativeFontInfo","_struct_wxNativeFontInfo",0}, + { "_class_wxGridCellStringRenderer","_class_wxGridCellAutoWrapStringRenderer",SwigwxGridCellAutoWrapStringRendererTowxGridCellStringRenderer}, + { "_class_wxGridCellStringRenderer","_wxGridCellAutoWrapStringRenderer",SwigwxGridCellAutoWrapStringRendererTowxGridCellStringRenderer}, + { "_class_wxGridCellStringRenderer","_class_wxGridCellEnumRenderer",SwigwxGridCellEnumRendererTowxGridCellStringRenderer}, + { "_class_wxGridCellStringRenderer","_wxGridCellEnumRenderer",SwigwxGridCellEnumRendererTowxGridCellStringRenderer}, + { "_class_wxGridCellStringRenderer","_class_wxGridCellDateTimeRenderer",SwigwxGridCellDateTimeRendererTowxGridCellStringRenderer}, + { "_class_wxGridCellStringRenderer","_wxGridCellDateTimeRenderer",SwigwxGridCellDateTimeRendererTowxGridCellStringRenderer}, { "_class_wxGridCellStringRenderer","_class_wxGridCellFloatRenderer",SwigwxGridCellFloatRendererTowxGridCellStringRenderer}, { "_class_wxGridCellStringRenderer","_wxGridCellFloatRenderer",SwigwxGridCellFloatRendererTowxGridCellStringRenderer}, { "_class_wxGridCellStringRenderer","_class_wxGridCellNumberRenderer",SwigwxGridCellNumberRendererTowxGridCellStringRenderer}, @@ -14202,6 +14541,10 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_signed_int","_EBool",0}, { "_signed_int","_wxWindowID",0}, { "_signed_int","_int",0}, + { "_wxGridCellEditor","_class_wxGridCellAutoWrapStringEditor",SwigwxGridCellAutoWrapStringEditorTowxGridCellEditor}, + { "_wxGridCellEditor","_wxGridCellAutoWrapStringEditor",SwigwxGridCellAutoWrapStringEditorTowxGridCellEditor}, + { "_wxGridCellEditor","_class_wxGridCellEnumEditor",SwigwxGridCellEnumEditorTowxGridCellEditor}, + { "_wxGridCellEditor","_wxGridCellEnumEditor",SwigwxGridCellEnumEditorTowxGridCellEditor}, { "_wxGridCellEditor","_class_wxGridCellChoiceEditor",SwigwxGridCellChoiceEditorTowxGridCellEditor}, { "_wxGridCellEditor","_wxGridCellChoiceEditor",SwigwxGridCellChoiceEditorTowxGridCellEditor}, { "_wxGridCellEditor","_class_wxGridCellBoolEditor",SwigwxGridCellBoolEditorTowxGridCellEditor}, @@ -14287,6 +14630,10 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_time_t","_wxWindowID",0}, { "_time_t","_uint",0}, { "_time_t","_size_t",0}, + { "_class_wxGridCellEditor","_class_wxGridCellAutoWrapStringEditor",SwigwxGridCellAutoWrapStringEditorTowxGridCellEditor}, + { "_class_wxGridCellEditor","_wxGridCellAutoWrapStringEditor",SwigwxGridCellAutoWrapStringEditorTowxGridCellEditor}, + { "_class_wxGridCellEditor","_class_wxGridCellEnumEditor",SwigwxGridCellEnumEditorTowxGridCellEditor}, + { "_class_wxGridCellEditor","_wxGridCellEnumEditor",SwigwxGridCellEnumEditorTowxGridCellEditor}, { "_class_wxGridCellEditor","_class_wxGridCellChoiceEditor",SwigwxGridCellChoiceEditorTowxGridCellEditor}, { "_class_wxGridCellEditor","_wxGridCellChoiceEditor",SwigwxGridCellChoiceEditorTowxGridCellEditor}, { "_class_wxGridCellEditor","_class_wxGridCellBoolEditor",SwigwxGridCellBoolEditorTowxGridCellEditor}, @@ -14311,6 +14658,12 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxCoord","_size_t",0}, { "_wxCoord","_time_t",0}, { "_wxCoord","_wxPrintQuality",0}, + { "_wxGridCellRenderer","_class_wxGridCellAutoWrapStringRenderer",SwigwxGridCellAutoWrapStringRendererTowxGridCellRenderer}, + { "_wxGridCellRenderer","_wxGridCellAutoWrapStringRenderer",SwigwxGridCellAutoWrapStringRendererTowxGridCellRenderer}, + { "_wxGridCellRenderer","_class_wxGridCellEnumRenderer",SwigwxGridCellEnumRendererTowxGridCellRenderer}, + { "_wxGridCellRenderer","_wxGridCellEnumRenderer",SwigwxGridCellEnumRendererTowxGridCellRenderer}, + { "_wxGridCellRenderer","_class_wxGridCellDateTimeRenderer",SwigwxGridCellDateTimeRendererTowxGridCellRenderer}, + { "_wxGridCellRenderer","_wxGridCellDateTimeRenderer",SwigwxGridCellDateTimeRendererTowxGridCellRenderer}, { "_wxGridCellRenderer","_class_wxGridCellBoolRenderer",SwigwxGridCellBoolRendererTowxGridCellRenderer}, { "_wxGridCellRenderer","_wxGridCellBoolRenderer",SwigwxGridCellBoolRendererTowxGridCellRenderer}, { "_wxGridCellRenderer","_class_wxGridCellFloatRenderer",SwigwxGridCellFloatRendererTowxGridCellRenderer}, @@ -14321,6 +14674,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxGridCellRenderer","_wxGridCellStringRenderer",SwigwxGridCellStringRendererTowxGridCellRenderer}, { "_wxGridCellRenderer","_class_wxPyGridCellRenderer",SwigwxPyGridCellRendererTowxGridCellRenderer}, { "_wxGridCellRenderer","_wxPyGridCellRenderer",SwigwxPyGridCellRendererTowxGridCellRenderer}, + { "_wxGridCellTextEditor","_class_wxGridCellAutoWrapStringEditor",SwigwxGridCellAutoWrapStringEditorTowxGridCellTextEditor}, + { "_wxGridCellTextEditor","_wxGridCellAutoWrapStringEditor",SwigwxGridCellAutoWrapStringEditorTowxGridCellTextEditor}, { "_wxGridCellTextEditor","_class_wxGridCellFloatEditor",SwigwxGridCellFloatEditorTowxGridCellTextEditor}, { "_wxGridCellTextEditor","_wxGridCellFloatEditor",SwigwxGridCellFloatEditorTowxGridCellTextEditor}, { "_wxGridCellTextEditor","_class_wxGridCellNumberEditor",SwigwxGridCellNumberEditorTowxGridCellTextEditor}, diff --git a/wxPython/src/gtk/grid.py b/wxPython/src/gtk/grid.py index 04c9de468f..69fa227da9 100644 --- a/wxPython/src/gtk/grid.py +++ b/wxPython/src/gtk/grid.py @@ -185,6 +185,48 @@ class wxGridCellBoolRenderer(wxGridCellBoolRendererPtr): +class wxGridCellDateTimeRendererPtr(wxGridCellStringRendererPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def __repr__(self): + return "" % (self.this,) +class wxGridCellDateTimeRenderer(wxGridCellDateTimeRendererPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(gridc.new_wxGridCellDateTimeRenderer,_args,_kwargs) + self.thisown = 1 + + + + +class wxGridCellEnumRendererPtr(wxGridCellStringRendererPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def __repr__(self): + return "" % (self.this,) +class wxGridCellEnumRenderer(wxGridCellEnumRendererPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(gridc.new_wxGridCellEnumRenderer,_args,_kwargs) + self.thisown = 1 + + + + +class wxGridCellAutoWrapStringRendererPtr(wxGridCellStringRendererPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def __repr__(self): + return "" % (self.this,) +class wxGridCellAutoWrapStringRenderer(wxGridCellAutoWrapStringRendererPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(gridc.new_wxGridCellAutoWrapStringRenderer,_args,_kwargs) + self.thisown = 1 + + + + class wxGridCellEditorPtr : def __init__(self,this): self.this = this @@ -371,6 +413,34 @@ class wxGridCellChoiceEditor(wxGridCellChoiceEditorPtr): +class wxGridCellEnumEditorPtr(wxGridCellChoiceEditorPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def __repr__(self): + return "" % (self.this,) +class wxGridCellEnumEditor(wxGridCellEnumEditorPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(gridc.new_wxGridCellEnumEditor,_args,_kwargs) + self.thisown = 1 + + + + +class wxGridCellAutoWrapStringEditorPtr(wxGridCellTextEditorPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def __repr__(self): + return "" % (self.this,) +class wxGridCellAutoWrapStringEditor(wxGridCellAutoWrapStringEditorPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(gridc.new_wxGridCellAutoWrapStringEditor,_args,_kwargs) + self.thisown = 1 + + + + class wxGridCellAttrPtr : Any = gridc.wxGridCellAttr_Any Default = gridc.wxGridCellAttr_Default diff --git a/wxPython/src/gtk/html.cpp b/wxPython/src/gtk/html.cpp index a8e0417fb9..052944c555 100644 --- a/wxPython/src/gtk/html.cpp +++ b/wxPython/src/gtk/html.cpp @@ -148,25 +148,25 @@ public: } void OnExit() { - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); Py_DECREF(m_tagHandlerClass); m_tagHandlerClass = NULL; for (size_t x=0; x < m_objArray.GetCount(); x++) { PyObject* obj = (PyObject*)m_objArray.Item(x); Py_DECREF(obj); } - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); }; void FillHandlersTable(wxHtmlWinParser *parser) { // Wave our magic wand... (if it works it's a miracle! ;-) // First, make a new instance of the tag handler - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); PyObject* arg = Py_BuildValue("()"); PyObject* obj = PyInstance_New(m_tagHandlerClass, arg, NULL); Py_DECREF(arg); - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); // now figure out where it's C++ object is... wxPyHtmlWinTagHandler* thPtr; @@ -193,6 +193,7 @@ private: } class wxPyHtmlWindow : public wxHtmlWindow { + DECLARE_ABSTRACT_CLASS(wxPyHtmlWindow); public: wxPyHtmlWindow(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, @@ -208,19 +209,20 @@ public: PYPRIVATE; }; - +IMPLEMENT_ABSTRACT_CLASS( wxPyHtmlWindow, wxHtmlWindow ); IMP_PYCALLBACK__STRING(wxPyHtmlWindow, wxHtmlWindow, OnSetTitle); void wxPyHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link) { - bool doSave = wxPyRestoreThread(); - if (wxPyCBH_findCallback(m_myInst, "OnLinkClicked")) { + bool found; + wxPyTState* state = wxPyBeginBlockThreads(); + if ((found = wxPyCBH_findCallback(m_myInst, "OnLinkClicked)"))) { PyObject* obj = wxPyConstructObject((void*)&link, "wxHtmlLinkInfo", 0); wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); Py_DECREF(obj); } - else + wxPyEndBlockThreads(state); + if (! found) wxHtmlWindow::OnLinkClicked(link); - wxPySaveThread(doSave); } void wxPyHtmlWindow::base_OnLinkClicked(const wxHtmlLinkInfo& link) { wxHtmlWindow::OnLinkClicked(link); @@ -6316,6 +6318,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxHtmlCell","_class_wxHtmlWordCell",SwigwxHtmlWordCellTowxHtmlCell}, { "_wxHtmlCell","_wxHtmlWordCell",SwigwxHtmlWordCellTowxHtmlCell}, { "_char","_wxChar",0}, + { "_struct_wxNativeFontInfo","_wxNativeFontInfo",0}, { "_wxPyHtmlTagHandler","_class_wxPyHtmlWinTagHandler",SwigwxPyHtmlWinTagHandlerTowxPyHtmlTagHandler}, { "_wxPyHtmlTagHandler","_wxPyHtmlWinTagHandler",SwigwxPyHtmlWinTagHandlerTowxPyHtmlTagHandler}, { "_EBool","_wxCoord",0}, @@ -6324,6 +6327,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_EBool","_int",0}, { "_EBool","_wxWindowID",0}, { "_unsigned_long","_long",0}, + { "_wxNativeFontInfo","_struct_wxNativeFontInfo",0}, { "_class_wxPanel","_class_wxPyHtmlWindow",SwigwxPyHtmlWindowTowxPanel}, { "_class_wxPanel","_wxPyHtmlWindow",SwigwxPyHtmlWindowTowxPanel}, { "_signed_int","_wxCoord",0}, diff --git a/wxPython/src/gtk/html.py b/wxPython/src/gtk/html.py index ba5cd8f56e..9f06c597e8 100644 --- a/wxPython/src/gtk/html.py +++ b/wxPython/src/gtk/html.py @@ -756,3 +756,4 @@ wx.wxHtmlContainerCellPtr = wxHtmlContainerCellPtr wx.wxHtmlWidgetCellPtr = wxHtmlWidgetCellPtr wx.wxHtmlWindowPtr = wxHtmlWindowPtr wx.wxHtmlLinkInfoPtr = wxHtmlLinkInfoPtr + diff --git a/wxPython/src/gtk/misc.cpp b/wxPython/src/gtk/misc.cpp index 4b65fa797b..db54d16b16 100644 --- a/wxPython/src/gtk/misc.cpp +++ b/wxPython/src/gtk/misc.cpp @@ -105,13 +105,13 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { dest = reg1.GetBox(); if (dest != wxRect(0,0,0,0)) { - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); wxRect* newRect = new wxRect(dest); obj = wxPyConstructObject((void*)newRect, "wxRect"); PyObject* one = PyInt_FromLong(1); PyObject_SetAttrString(obj, "thisown", one); Py_DECREF(one); - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return obj; } Py_INCREF(Py_None); diff --git a/wxPython/src/gtk/misc2.cpp b/wxPython/src/gtk/misc2.cpp index fe0455a4c3..b0553ab9c9 100644 --- a/wxPython/src/gtk/misc2.cpp +++ b/wxPython/src/gtk/misc2.cpp @@ -160,26 +160,6 @@ IMP_PYCALLBACK_STRING__pure( wxPyTipProvider, wxTipProvider, GetTip); #include - - -wxGenericDragImage* wxDragIcon(const wxIcon& image, - const wxCursor& cursor) { - return new wxGenericDragImage(image, cursor); -} - -wxGenericDragImage* wxDragString(const wxString& str, - const wxCursor& cursor) { - return new wxGenericDragImage(str, cursor); -} - -wxGenericDragImage* wxDragTreeItem(const wxTreeCtrl& treeCtrl, wxTreeItemId& id) { - return new wxGenericDragImage(treeCtrl, id); -} - -wxGenericDragImage* wxDragListItem(const wxListCtrl& listCtrl, long id) { - return new wxGenericDragImage(listCtrl, id); -} - // C++ version of wxProcess derived class class wxPyProcess : public wxProcess { @@ -195,6 +175,7 @@ public: IMP_PYCALLBACK_VOID_INTINT( wxPyProcess, wxProcess, OnTerminate); + #if !wxUSE_JOYSTICK && !defined(__WXMSW__) // A C++ stub class for wxJoystick for platforms that don't have it. class wxJoystick : public wxObject { @@ -258,14 +239,14 @@ class wxWave : public wxObject { public: wxWave(const wxString& fileName, bool isResource = FALSE) { - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); PyErr_SetString(PyExc_NotImplementedError, "wxWave is not available on this platform."); - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); } wxWave(int size, const wxByte* data) { - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); PyErr_SetString(PyExc_NotImplementedError, "wxWave is not available on this platform."); - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); } ~wxWave() {} @@ -1893,181 +1874,6 @@ static PyObject *_wrap_wxCreateFileTipProvider(PyObject *self, PyObject *args, P return _resultobj; } -static PyObject *_wrap_wxDragIcon(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxGenericDragImage * _result; - wxIcon * _arg0; - wxCursor * _arg1 = (wxCursor *) &wxNullCursor; - PyObject * _argo0 = 0; - PyObject * _argo1 = 0; - char *_kwnames[] = { "image","cursor", NULL }; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:wxDragIcon",_kwnames,&_argo0,&_argo1)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIcon_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDragIcon. Expected _wxIcon_p."); - return NULL; - } - } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxCursor_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDragIcon. Expected _wxCursor_p."); - return NULL; - } - } -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxGenericDragImage *)wxDragIcon(*_arg0,*_arg1); - - wxPy_END_ALLOW_THREADS; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxGenericDragImage_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } - return _resultobj; -} - -static PyObject *_wrap_wxDragString(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxGenericDragImage * _result; - wxString * _arg0; - wxCursor * _arg1 = (wxCursor *) &wxNullCursor; - PyObject * _obj0 = 0; - PyObject * _argo1 = 0; - char *_kwnames[] = { "str","cursor", NULL }; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:wxDragString",_kwnames,&_obj0,&_argo1)) - return NULL; -{ -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg0 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj0)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); -#endif -} - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxCursor_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDragString. Expected _wxCursor_p."); - return NULL; - } - } -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxGenericDragImage *)wxDragString(*_arg0,*_arg1); - - wxPy_END_ALLOW_THREADS; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxGenericDragImage_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } -{ - if (_obj0) - delete _arg0; -} - return _resultobj; -} - -static PyObject *_wrap_wxDragTreeItem(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxGenericDragImage * _result; - wxTreeCtrl * _arg0; - wxTreeItemId * _arg1; - PyObject * _argo0 = 0; - PyObject * _argo1 = 0; - char *_kwnames[] = { "treeCtrl","id", NULL }; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDragTreeItem",_kwnames,&_argo0,&_argo1)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTreeCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDragTreeItem. Expected _wxTreeCtrl_p."); - return NULL; - } - } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTreeItemId_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDragTreeItem. Expected _wxTreeItemId_p."); - return NULL; - } - } -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxGenericDragImage *)wxDragTreeItem(*_arg0,*_arg1); - - wxPy_END_ALLOW_THREADS; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxGenericDragImage_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } - return _resultobj; -} - -static PyObject *_wrap_wxDragListItem(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxGenericDragImage * _result; - wxListCtrl * _arg0; - long _arg1; - PyObject * _argo0 = 0; - char *_kwnames[] = { "listCtrl","id", NULL }; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxDragListItem",_kwnames,&_argo0,&_arg1)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDragListItem. Expected _wxListCtrl_p."); - return NULL; - } - } -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxGenericDragImage *)wxDragListItem(*_arg0,_arg1); - - wxPy_END_ALLOW_THREADS; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxGenericDragImage_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } - return _resultobj; -} - static PyObject *_wrap_wxSysErrorCode(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; unsigned long _result; @@ -3626,6 +3432,185 @@ static PyObject *_wrap_new_wxDragImage(PyObject *self, PyObject *args, PyObject return _resultobj; } +#define new_wxDragIcon(_swigarg0,_swigarg1) (new wxGenericDragImage(_swigarg0,_swigarg1)) +static PyObject *_wrap_new_wxDragIcon(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxGenericDragImage * _result; + wxIcon * _arg0; + wxCursor * _arg1 = (wxCursor *) &wxNullCursor; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "image","cursor", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:new_wxDragIcon",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIcon_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxDragIcon. Expected _wxIcon_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxCursor_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of new_wxDragIcon. Expected _wxCursor_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxGenericDragImage *)new_wxDragIcon(*_arg0,*_arg1); + + wxPy_END_ALLOW_THREADS; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxGenericDragImage_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define new_wxDragString(_swigarg0,_swigarg1) (new wxGenericDragImage(_swigarg0,_swigarg1)) +static PyObject *_wrap_new_wxDragString(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxGenericDragImage * _result; + wxString * _arg0; + wxCursor * _arg1 = (wxCursor *) &wxNullCursor; + PyObject * _obj0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "str","cursor", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:new_wxDragString",_kwnames,&_obj0,&_argo1)) + return NULL; +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif +} + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxCursor_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of new_wxDragString. Expected _wxCursor_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxGenericDragImage *)new_wxDragString(*_arg0,*_arg1); + + wxPy_END_ALLOW_THREADS; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxGenericDragImage_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } +{ + if (_obj0) + delete _arg0; +} + return _resultobj; +} + +#define new_wxDragTreeItem(_swigarg0,_swigarg1) (new wxGenericDragImage(_swigarg0,_swigarg1)) +static PyObject *_wrap_new_wxDragTreeItem(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxGenericDragImage * _result; + wxTreeCtrl * _arg0; + wxTreeItemId * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "treeCtrl","id", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:new_wxDragTreeItem",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTreeCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxDragTreeItem. Expected _wxTreeCtrl_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTreeItemId_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of new_wxDragTreeItem. Expected _wxTreeItemId_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxGenericDragImage *)new_wxDragTreeItem(*_arg0,*_arg1); + + wxPy_END_ALLOW_THREADS; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxGenericDragImage_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define new_wxDragListItem(_swigarg0,_swigarg1) (new wxGenericDragImage(_swigarg0,_swigarg1)) +static PyObject *_wrap_new_wxDragListItem(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxGenericDragImage * _result; + wxListCtrl * _arg0; + long _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "listCtrl","id", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:new_wxDragListItem",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxDragListItem. Expected _wxListCtrl_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxGenericDragImage *)new_wxDragListItem(*_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxGenericDragImage_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + #define delete_wxGenericDragImage(_swigobj) (delete _swigobj) static PyObject *_wrap_delete_wxDragImage(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -7104,6 +7089,10 @@ static PyMethodDef misc2cMethods[] = { { "wxDragImage_BeginDrag", (PyCFunction) _wrap_wxDragImage_BeginDrag, METH_VARARGS | METH_KEYWORDS }, { "wxDragImage_SetBackingBitmap", (PyCFunction) _wrap_wxDragImage_SetBackingBitmap, METH_VARARGS | METH_KEYWORDS }, { "delete_wxDragImage", (PyCFunction) _wrap_delete_wxDragImage, METH_VARARGS | METH_KEYWORDS }, + { "new_wxDragListItem", (PyCFunction) _wrap_new_wxDragListItem, METH_VARARGS | METH_KEYWORDS }, + { "new_wxDragTreeItem", (PyCFunction) _wrap_new_wxDragTreeItem, METH_VARARGS | METH_KEYWORDS }, + { "new_wxDragString", (PyCFunction) _wrap_new_wxDragString, METH_VARARGS | METH_KEYWORDS }, + { "new_wxDragIcon", (PyCFunction) _wrap_new_wxDragIcon, METH_VARARGS | METH_KEYWORDS }, { "new_wxDragImage", (PyCFunction) _wrap_new_wxDragImage, METH_VARARGS | METH_KEYWORDS }, { "new_wxPyTipProvider", (PyCFunction) _wrap_new_wxPyTipProvider, METH_VARARGS | METH_KEYWORDS }, { "wxTipProvider_GetCurrentTip", (PyCFunction) _wrap_wxTipProvider_GetCurrentTip, METH_VARARGS | METH_KEYWORDS }, @@ -7156,10 +7145,6 @@ static PyMethodDef misc2cMethods[] = { { "wxLogFatalError", (PyCFunction) _wrap_wxLogFatalError, METH_VARARGS | METH_KEYWORDS }, { "wxSysErrorMsg", (PyCFunction) _wrap_wxSysErrorMsg, METH_VARARGS | METH_KEYWORDS }, { "wxSysErrorCode", (PyCFunction) _wrap_wxSysErrorCode, METH_VARARGS | METH_KEYWORDS }, - { "wxDragListItem", (PyCFunction) _wrap_wxDragListItem, METH_VARARGS | METH_KEYWORDS }, - { "wxDragTreeItem", (PyCFunction) _wrap_wxDragTreeItem, METH_VARARGS | METH_KEYWORDS }, - { "wxDragString", (PyCFunction) _wrap_wxDragString, METH_VARARGS | METH_KEYWORDS }, - { "wxDragIcon", (PyCFunction) _wrap_wxDragIcon, METH_VARARGS | METH_KEYWORDS }, { "wxCreateFileTipProvider", (PyCFunction) _wrap_wxCreateFileTipProvider, METH_VARARGS | METH_KEYWORDS }, { "wxShowTip", (PyCFunction) _wrap_wxShowTip, METH_VARARGS | METH_KEYWORDS }, { "wxThread_IsMain", (PyCFunction) _wrap_wxThread_IsMain, METH_VARARGS | METH_KEYWORDS }, @@ -7271,12 +7256,14 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxEvent","_class_wxProcessEvent",SwigwxProcessEventTowxEvent}, { "_class_wxEvent","_wxProcessEvent",SwigwxProcessEventTowxEvent}, { "_char","_wxChar",0}, + { "_struct_wxNativeFontInfo","_wxNativeFontInfo",0}, { "_EBool","_wxCoord",0}, { "_EBool","_wxPrintQuality",0}, { "_EBool","_signed_int",0}, { "_EBool","_int",0}, { "_EBool","_wxWindowID",0}, { "_unsigned_long","_long",0}, + { "_wxNativeFontInfo","_struct_wxNativeFontInfo",0}, { "_signed_int","_wxCoord",0}, { "_signed_int","_wxPrintQuality",0}, { "_signed_int","_EBool",0}, diff --git a/wxPython/src/gtk/misc2.py b/wxPython/src/gtk/misc2.py index 674695385c..0d80f8658f 100644 --- a/wxPython/src/gtk/misc2.py +++ b/wxPython/src/gtk/misc2.py @@ -257,6 +257,26 @@ class wxDragImage(wxDragImagePtr): +def wxDragIcon(*_args,**_kwargs): + val = wxDragImagePtr(apply(misc2c.new_wxDragIcon,_args,_kwargs)) + val.thisown = 1 + return val + +def wxDragString(*_args,**_kwargs): + val = wxDragImagePtr(apply(misc2c.new_wxDragString,_args,_kwargs)) + val.thisown = 1 + return val + +def wxDragTreeItem(*_args,**_kwargs): + val = wxDragImagePtr(apply(misc2c.new_wxDragTreeItem,_args,_kwargs)) + val.thisown = 1 + return val + +def wxDragListItem(*_args,**_kwargs): + val = wxDragImagePtr(apply(misc2c.new_wxDragListItem,_args,_kwargs)) + val.thisown = 1 + return val + class wxPyTimerPtr(wxObjectPtr): def __init__(self,this): @@ -785,26 +805,6 @@ def wxCreateFileTipProvider(*_args, **_kwargs): if val: val = wxTipProviderPtr(val); val.thisown = 1 return val -def wxDragIcon(*_args, **_kwargs): - val = apply(misc2c.wxDragIcon,_args,_kwargs) - if val: val = wxDragImagePtr(val); val.thisown = 1 - return val - -def wxDragString(*_args, **_kwargs): - val = apply(misc2c.wxDragString,_args,_kwargs) - if val: val = wxDragImagePtr(val); val.thisown = 1 - return val - -def wxDragTreeItem(*_args, **_kwargs): - val = apply(misc2c.wxDragTreeItem,_args,_kwargs) - if val: val = wxDragImagePtr(val); val.thisown = 1 - return val - -def wxDragListItem(*_args, **_kwargs): - val = apply(misc2c.wxDragListItem,_args,_kwargs) - if val: val = wxDragImagePtr(val); val.thisown = 1 - return val - wxSysErrorCode = misc2c.wxSysErrorCode wxSysErrorMsg = misc2c.wxSysErrorMsg diff --git a/wxPython/src/gtk/printfw.cpp b/wxPython/src/gtk/printfw.cpp index ccb1ae22c2..8d1240b77c 100644 --- a/wxPython/src/gtk/printfw.cpp +++ b/wxPython/src/gtk/printfw.cpp @@ -99,9 +99,10 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { // Since this one would be tough and ugly to do with the Macros... void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) { bool hadErr = FALSE; + bool found; - bool doSave = wxPyRestoreThread(); - if (m_myInst.findCallback("GetPageInfo")) { + wxPyTState* state = wxPyBeginBlockThreads(); + if ((found = m_myInst.findCallback("GetPageInfo"))) { PyObject* result = m_myInst.callCallbackObj(Py_BuildValue("()")); if (result && PyTuple_Check(result) && PyTuple_Size(result) == 4) { PyObject* val; @@ -131,10 +132,9 @@ void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *p } Py_DECREF(result); } - else + wxPyEndBlockThreads(state); + if (! found) wxPrintout::GetPageInfo(minPage, maxPage, pageFrom, pageTo); - - wxPySaveThread(doSave); } void wxPyPrintout::base_GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) { @@ -5349,12 +5349,14 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_uint","_wxWindowID",0}, { "_wxChar","_char",0}, { "_char","_wxChar",0}, + { "_struct_wxNativeFontInfo","_wxNativeFontInfo",0}, { "_EBool","_wxCoord",0}, { "_EBool","_wxPrintQuality",0}, { "_EBool","_signed_int",0}, { "_EBool","_int",0}, { "_EBool","_wxWindowID",0}, { "_unsigned_long","_long",0}, + { "_wxNativeFontInfo","_struct_wxNativeFontInfo",0}, { "_class_wxPanel","_class_wxPrintDialog",SwigwxPrintDialogTowxPanel}, { "_class_wxPanel","_wxPrintDialog",SwigwxPrintDialogTowxPanel}, { "_class_wxPanel","_class_wxPageSetupDialog",SwigwxPageSetupDialogTowxPanel}, diff --git a/wxPython/src/gtk/streams.cpp b/wxPython/src/gtk/streams.cpp index e90e39ce0d..da63611e8a 100644 --- a/wxPython/src/gtk/streams.cpp +++ b/wxPython/src/gtk/streams.cpp @@ -279,7 +279,7 @@ protected: if (bufsize == 0) return 0; - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); PyObject* arglist = Py_BuildValue("(i)", bufsize); PyObject* result = PyEval_CallObject(read, arglist); Py_DECREF(arglist); @@ -297,7 +297,7 @@ protected: } else m_lasterror = wxSTREAM_READ_ERROR; - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); m_lastcount = o; return o; } @@ -308,17 +308,17 @@ protected: } virtual off_t OnSysSeek(off_t off, wxSeekMode mode){ - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); PyObject*arglist = Py_BuildValue("(ii)", off, mode); PyObject*result = PyEval_CallObject(seek, arglist); Py_DECREF(arglist); Py_XDECREF(result); - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return OnSysTell(); } virtual off_t OnSysTell() const{ - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); PyObject* arglist = Py_BuildValue("()"); PyObject* result = PyEval_CallObject(tell, arglist); Py_DECREF(arglist); @@ -327,7 +327,7 @@ protected: o = PyInt_AsLong(result); Py_DECREF(result); }; - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); return o; } @@ -337,12 +337,12 @@ protected: public: ~wxPyCBInputStream() { - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); Py_XDECREF(py); Py_XDECREF(read); Py_XDECREF(seek); Py_XDECREF(tell); - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); } virtual size_t GetSize() { diff --git a/wxPython/src/gtk/windows.cpp b/wxPython/src/gtk/windows.cpp index 948e122882..3eb82643a9 100644 --- a/wxPython/src/gtk/windows.cpp +++ b/wxPython/src/gtk/windows.cpp @@ -103,11 +103,11 @@ public: ~wxPyValidator() { } - wxObject* wxPyValidator::Clone() const { + wxObject* Clone() const { wxPyValidator* ptr = NULL; wxPyValidator* self = (wxPyValidator*)this; - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); if (self->m_myInst.findCallback("Clone")) { PyObject* ro; ro = self->m_myInst.callCallbackObj(Py_BuildValue("()")); @@ -116,13 +116,13 @@ public: Py_DECREF(ro); } } + wxPyEndBlockThreads(state); + // This is very dangerous!!! But is the only way I could find // to squash a memory leak. Currently it is okay, but if the // validator architecture in wxWindows ever changes, problems // could arise. delete self; - - wxPySaveThread(doSave); return ptr; } @@ -10911,12 +10911,14 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_char","_wxChar",0}, { "_class_wxValidator","_class_wxPyValidator",SwigwxPyValidatorTowxValidator}, { "_class_wxValidator","_wxPyValidator",SwigwxPyValidatorTowxValidator}, + { "_struct_wxNativeFontInfo","_wxNativeFontInfo",0}, { "_EBool","_wxCoord",0}, { "_EBool","_wxPrintQuality",0}, { "_EBool","_signed_int",0}, { "_EBool","_int",0}, { "_EBool","_wxWindowID",0}, { "_unsigned_long","_long",0}, + { "_wxNativeFontInfo","_struct_wxNativeFontInfo",0}, { "_class_wxPanel","_class_wxScrolledWindow",SwigwxScrolledWindowTowxPanel}, { "_class_wxPanel","_wxScrolledWindow",SwigwxScrolledWindowTowxPanel}, { "_class_wxPanel","_class_wxDialog",SwigwxDialogTowxPanel}, diff --git a/wxPython/src/gtk/windows2.cpp b/wxPython/src/gtk/windows2.cpp index 3e42bd7416..01af15bc9f 100644 --- a/wxPython/src/gtk/windows2.cpp +++ b/wxPython/src/gtk/windows2.cpp @@ -689,6 +689,43 @@ static PyObject *_wrap_wxNotebook_SetImageList(PyObject *self, PyObject *args, P return _resultobj; } +#define wxNotebook_AssignImageList(_swigobj,_swigarg0) (_swigobj->AssignImageList(_swigarg0)) +static PyObject *_wrap_wxNotebook_AssignImageList(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxNotebook * _arg0; + wxImageList * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","imageList", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxNotebook_AssignImageList",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxNotebook_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxNotebook_AssignImageList. Expected _wxNotebook_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxImageList_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxNotebook_AssignImageList. Expected _wxImageList_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxNotebook_AssignImageList(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define wxNotebook_GetImageList(_swigobj) (_swigobj->GetImageList()) static PyObject *_wrap_wxNotebook_GetImageList(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -2143,6 +2180,7 @@ static PyMethodDef windows2cMethods[] = { { "wxNotebook_SetPageImage", (PyCFunction) _wrap_wxNotebook_SetPageImage, METH_VARARGS | METH_KEYWORDS }, { "wxNotebook_GetPageImage", (PyCFunction) _wrap_wxNotebook_GetPageImage, METH_VARARGS | METH_KEYWORDS }, { "wxNotebook_GetImageList", (PyCFunction) _wrap_wxNotebook_GetImageList, METH_VARARGS | METH_KEYWORDS }, + { "wxNotebook_AssignImageList", (PyCFunction) _wrap_wxNotebook_AssignImageList, METH_VARARGS | METH_KEYWORDS }, { "wxNotebook_SetImageList", (PyCFunction) _wrap_wxNotebook_SetImageList, METH_VARARGS | METH_KEYWORDS }, { "wxNotebook_GetPageText", (PyCFunction) _wrap_wxNotebook_GetPageText, METH_VARARGS | METH_KEYWORDS }, { "wxNotebook_SetPageText", (PyCFunction) _wrap_wxNotebook_SetPageText, METH_VARARGS | METH_KEYWORDS }, @@ -2224,12 +2262,14 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_char","_wxChar",0}, { "_class_wxNotifyEvent","_class_wxNotebookEvent",SwigwxNotebookEventTowxNotifyEvent}, { "_class_wxNotifyEvent","_wxNotebookEvent",SwigwxNotebookEventTowxNotifyEvent}, + { "_struct_wxNativeFontInfo","_wxNativeFontInfo",0}, { "_EBool","_wxCoord",0}, { "_EBool","_wxPrintQuality",0}, { "_EBool","_signed_int",0}, { "_EBool","_int",0}, { "_EBool","_wxWindowID",0}, { "_unsigned_long","_long",0}, + { "_wxNativeFontInfo","_struct_wxNativeFontInfo",0}, { "_signed_int","_wxCoord",0}, { "_signed_int","_wxPrintQuality",0}, { "_signed_int","_EBool",0}, diff --git a/wxPython/src/gtk/windows2.py b/wxPython/src/gtk/windows2.py index 8d7b419673..4753124d69 100644 --- a/wxPython/src/gtk/windows2.py +++ b/wxPython/src/gtk/windows2.py @@ -67,6 +67,10 @@ class wxNotebookPtr(wxControlPtr): def SetImageList(self, *_args, **_kwargs): val = apply(windows2c.wxNotebook_SetImageList,(self,) + _args, _kwargs) return val + def AssignImageList(self, *_args, **_kwargs): + val = apply(windows2c.wxNotebook_AssignImageList,(self,) + _args, _kwargs) + _args[0].thisown = 0 + return val def GetImageList(self, *_args, **_kwargs): val = apply(windows2c.wxNotebook_GetImageList,(self,) + _args, _kwargs) return val diff --git a/wxPython/src/gtk/wx.cpp b/wxPython/src/gtk/wx.cpp index 7ecfa961fa..d32db341e8 100644 --- a/wxPython/src/gtk/wx.cpp +++ b/wxPython/src/gtk/wx.cpp @@ -643,8 +643,9 @@ static wxPyCoreAPI API = { SWIG_addvarlink, SWIG_newvarlink, - wxPySaveThread, - wxPyRestoreThread, + wxPyBeginBlockThreads, + wxPyEndBlockThreads, + wxPyConstructObject, wxPy_ConvertList, @@ -1755,12 +1756,14 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_uint","_wxWindowID",0}, { "_wxChar","_char",0}, { "_char","_wxChar",0}, + { "_struct_wxNativeFontInfo","_wxNativeFontInfo",0}, { "_EBool","_wxCoord",0}, { "_EBool","_wxPrintQuality",0}, { "_EBool","_signed_int",0}, { "_EBool","_int",0}, { "_EBool","_wxWindowID",0}, { "_unsigned_long","_long",0}, + { "_wxNativeFontInfo","_struct_wxNativeFontInfo",0}, { "_signed_int","_wxCoord",0}, { "_signed_int","_wxPrintQuality",0}, { "_signed_int","_EBool",0}, @@ -1885,7 +1888,6 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxFRAME_FLOAT_ON_PARENT", PyInt_FromLong((long) wxFRAME_FLOAT_ON_PARENT)); PyDict_SetItemString(d,"wxFRAME_NO_WINDOW_MENU", PyInt_FromLong((long) wxFRAME_NO_WINDOW_MENU)); PyDict_SetItemString(d,"wxFRAME_NO_TASKBAR", PyInt_FromLong((long) wxFRAME_NO_TASKBAR)); - PyDict_SetItemString(d,"wxFRAME_EX_CONTEXTHELP", PyInt_FromLong((long) wxFRAME_EX_CONTEXTHELP)); PyDict_SetItemString(d,"wxED_CLIENT_MARGIN", PyInt_FromLong((long) wxED_CLIENT_MARGIN)); PyDict_SetItemString(d,"wxED_BUTTONS_BOTTOM", PyInt_FromLong((long) wxED_BUTTONS_BOTTOM)); PyDict_SetItemString(d,"wxED_BUTTONS_RIGHT", PyInt_FromLong((long) wxED_BUTTONS_RIGHT)); @@ -1932,6 +1934,7 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxTE_MULTILINE", PyInt_FromLong((long) wxTE_MULTILINE)); PyDict_SetItemString(d,"wxTE_AUTO_SCROLL", PyInt_FromLong((long) wxTE_AUTO_SCROLL)); PyDict_SetItemString(d,"wxTE_NO_VSCROLL", PyInt_FromLong((long) wxTE_NO_VSCROLL)); + PyDict_SetItemString(d,"wxTE_AUTO_URL", PyInt_FromLong((long) wxTE_AUTO_URL)); PyDict_SetItemString(d,"wxCB_SIMPLE", PyInt_FromLong((long) wxCB_SIMPLE)); PyDict_SetItemString(d,"wxCB_DROPDOWN", PyInt_FromLong((long) wxCB_DROPDOWN)); PyDict_SetItemString(d,"wxCB_SORT", PyInt_FromLong((long) wxCB_SORT)); @@ -1961,12 +1964,6 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxST_NO_AUTORESIZE", PyInt_FromLong((long) wxST_NO_AUTORESIZE)); PyDict_SetItemString(d,"wxBU_AUTODRAW", PyInt_FromLong((long) wxBU_AUTODRAW)); PyDict_SetItemString(d,"wxBU_NOAUTODRAW", PyInt_FromLong((long) wxBU_NOAUTODRAW)); - PyDict_SetItemString(d,"wxTR_HAS_BUTTONS", PyInt_FromLong((long) wxTR_HAS_BUTTONS)); - PyDict_SetItemString(d,"wxTR_EDIT_LABELS", PyInt_FromLong((long) wxTR_EDIT_LABELS)); - PyDict_SetItemString(d,"wxTR_LINES_AT_ROOT", PyInt_FromLong((long) wxTR_LINES_AT_ROOT)); - PyDict_SetItemString(d,"wxTR_MULTIPLE", PyInt_FromLong((long) wxTR_MULTIPLE)); - PyDict_SetItemString(d,"wxTR_SINGLE", PyInt_FromLong((long) wxTR_SINGLE)); - PyDict_SetItemString(d,"wxTR_HAS_VARIABLE_ROW_HEIGHT", PyInt_FromLong((long) wxTR_HAS_VARIABLE_ROW_HEIGHT)); PyDict_SetItemString(d,"wxSP_VERTICAL", PyInt_FromLong((long) wxSP_VERTICAL)); PyDict_SetItemString(d,"wxSP_HORIZONTAL", PyInt_FromLong((long) wxSP_HORIZONTAL)); PyDict_SetItemString(d,"wxSP_ARROW_KEYS", PyInt_FromLong((long) wxSP_ARROW_KEYS)); @@ -2390,6 +2387,8 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxEVT_COMMAND_SPINCTRL_UPDATED", PyInt_FromLong((long) wxEVT_COMMAND_SPINCTRL_UPDATED)); PyDict_SetItemString(d,"wxEVT_COMMAND_TEXT_UPDATED", PyInt_FromLong((long) wxEVT_COMMAND_TEXT_UPDATED)); PyDict_SetItemString(d,"wxEVT_COMMAND_TEXT_ENTER", PyInt_FromLong((long) wxEVT_COMMAND_TEXT_ENTER)); + PyDict_SetItemString(d,"wxEVT_COMMAND_TEXT_URL", PyInt_FromLong((long) wxEVT_COMMAND_TEXT_URL)); + PyDict_SetItemString(d,"wxEVT_COMMAND_TEXT_MAXLEN", PyInt_FromLong((long) wxEVT_COMMAND_TEXT_MAXLEN)); PyDict_SetItemString(d,"wxEVT_COMMAND_MENU_SELECTED", PyInt_FromLong((long) wxEVT_COMMAND_MENU_SELECTED)); PyDict_SetItemString(d,"wxEVT_COMMAND_SLIDER_UPDATED", PyInt_FromLong((long) wxEVT_COMMAND_SLIDER_UPDATED)); PyDict_SetItemString(d,"wxEVT_COMMAND_RADIOBOX_SELECTED", PyInt_FromLong((long) wxEVT_COMMAND_RADIOBOX_SELECTED)); @@ -2469,7 +2468,6 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxEVT_MENU_INIT", PyInt_FromLong((long) wxEVT_MENU_INIT)); PyDict_SetItemString(d,"wxEVT_MENU_HIGHLIGHT", PyInt_FromLong((long) wxEVT_MENU_HIGHLIGHT)); PyDict_SetItemString(d,"wxEVT_POPUP_MENU_INIT", PyInt_FromLong((long) wxEVT_POPUP_MENU_INIT)); - PyDict_SetItemString(d,"wxEVT_CONTEXT_MENU", PyInt_FromLong((long) wxEVT_CONTEXT_MENU)); PyDict_SetItemString(d,"wxEVT_SYS_COLOUR_CHANGED", PyInt_FromLong((long) wxEVT_SYS_COLOUR_CHANGED)); PyDict_SetItemString(d,"wxEVT_SETTING_CHANGED", PyInt_FromLong((long) wxEVT_SETTING_CHANGED)); PyDict_SetItemString(d,"wxEVT_QUERY_NEW_PALETTE", PyInt_FromLong((long) wxEVT_QUERY_NEW_PALETTE)); @@ -2483,8 +2481,6 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxEVT_MEASURE_ITEM", PyInt_FromLong((long) wxEVT_MEASURE_ITEM)); PyDict_SetItemString(d,"wxEVT_COMPARE_ITEM", PyInt_FromLong((long) wxEVT_COMPARE_ITEM)); PyDict_SetItemString(d,"wxEVT_INIT_DIALOG", PyInt_FromLong((long) wxEVT_INIT_DIALOG)); - PyDict_SetItemString(d,"wxEVT_HELP", PyInt_FromLong((long) wxEVT_HELP)); - PyDict_SetItemString(d,"wxEVT_DETAILED_HELP", PyInt_FromLong((long) wxEVT_DETAILED_HELP)); PyDict_SetItemString(d,"wxEVT_IDLE", PyInt_FromLong((long) wxEVT_IDLE)); PyDict_SetItemString(d,"wxEVT_UPDATE_UI", PyInt_FromLong((long) wxEVT_UPDATE_UI)); PyDict_SetItemString(d,"wxEVT_COMMAND_LEFT_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_LEFT_CLICK)); @@ -2534,6 +2530,14 @@ SWIGEXPORT(void) initwxc() { initstreamsc(); initfilesysc(); + + PyDict_SetItemString(d,"wxMAJOR_VERSION", PyInt_FromLong((long)wxMAJOR_VERSION )); + PyDict_SetItemString(d,"wxMINOR_VERSION", PyInt_FromLong((long)wxMINOR_VERSION )); + PyDict_SetItemString(d,"wxRELEASE_NUMBER", PyInt_FromLong((long)wxRELEASE_NUMBER )); + PyDict_SetItemString(d,"wxVERSION_NUMBER", PyInt_FromLong((long)wxVERSION_NUMBER )); + PyDict_SetItemString(d,"wxVERSION_STRING", PyString_FromString(wxVERSION_STRING)); + + { int i; for (i = 0; _swig_mapping[i].n1; i++) diff --git a/wxPython/src/gtk/wx.py b/wxPython/src/gtk/wx.py index 8f91e29748..85298b7917 100644 --- a/wxPython/src/gtk/wx.py +++ b/wxPython/src/gtk/wx.py @@ -200,7 +200,6 @@ wxFRAME_TOOL_WINDOW = wxc.wxFRAME_TOOL_WINDOW wxFRAME_FLOAT_ON_PARENT = wxc.wxFRAME_FLOAT_ON_PARENT wxFRAME_NO_WINDOW_MENU = wxc.wxFRAME_NO_WINDOW_MENU wxFRAME_NO_TASKBAR = wxc.wxFRAME_NO_TASKBAR -wxFRAME_EX_CONTEXTHELP = wxc.wxFRAME_EX_CONTEXTHELP wxED_CLIENT_MARGIN = wxc.wxED_CLIENT_MARGIN wxED_BUTTONS_BOTTOM = wxc.wxED_BUTTONS_BOTTOM wxED_BUTTONS_RIGHT = wxc.wxED_BUTTONS_RIGHT @@ -247,6 +246,7 @@ wxTE_RICH = wxc.wxTE_RICH wxTE_MULTILINE = wxc.wxTE_MULTILINE wxTE_AUTO_SCROLL = wxc.wxTE_AUTO_SCROLL wxTE_NO_VSCROLL = wxc.wxTE_NO_VSCROLL +wxTE_AUTO_URL = wxc.wxTE_AUTO_URL wxCB_SIMPLE = wxc.wxCB_SIMPLE wxCB_DROPDOWN = wxc.wxCB_DROPDOWN wxCB_SORT = wxc.wxCB_SORT @@ -276,12 +276,6 @@ wxST_SIZEGRIP = wxc.wxST_SIZEGRIP wxST_NO_AUTORESIZE = wxc.wxST_NO_AUTORESIZE wxBU_AUTODRAW = wxc.wxBU_AUTODRAW wxBU_NOAUTODRAW = wxc.wxBU_NOAUTODRAW -wxTR_HAS_BUTTONS = wxc.wxTR_HAS_BUTTONS -wxTR_EDIT_LABELS = wxc.wxTR_EDIT_LABELS -wxTR_LINES_AT_ROOT = wxc.wxTR_LINES_AT_ROOT -wxTR_MULTIPLE = wxc.wxTR_MULTIPLE -wxTR_SINGLE = wxc.wxTR_SINGLE -wxTR_HAS_VARIABLE_ROW_HEIGHT = wxc.wxTR_HAS_VARIABLE_ROW_HEIGHT wxSP_VERTICAL = wxc.wxSP_VERTICAL wxSP_HORIZONTAL = wxc.wxSP_HORIZONTAL wxSP_ARROW_KEYS = wxc.wxSP_ARROW_KEYS @@ -705,6 +699,8 @@ wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = wxc.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED wxEVT_COMMAND_SPINCTRL_UPDATED = wxc.wxEVT_COMMAND_SPINCTRL_UPDATED wxEVT_COMMAND_TEXT_UPDATED = wxc.wxEVT_COMMAND_TEXT_UPDATED wxEVT_COMMAND_TEXT_ENTER = wxc.wxEVT_COMMAND_TEXT_ENTER +wxEVT_COMMAND_TEXT_URL = wxc.wxEVT_COMMAND_TEXT_URL +wxEVT_COMMAND_TEXT_MAXLEN = wxc.wxEVT_COMMAND_TEXT_MAXLEN wxEVT_COMMAND_MENU_SELECTED = wxc.wxEVT_COMMAND_MENU_SELECTED wxEVT_COMMAND_SLIDER_UPDATED = wxc.wxEVT_COMMAND_SLIDER_UPDATED wxEVT_COMMAND_RADIOBOX_SELECTED = wxc.wxEVT_COMMAND_RADIOBOX_SELECTED @@ -784,7 +780,6 @@ wxEVT_MENU_CHAR = wxc.wxEVT_MENU_CHAR wxEVT_MENU_INIT = wxc.wxEVT_MENU_INIT wxEVT_MENU_HIGHLIGHT = wxc.wxEVT_MENU_HIGHLIGHT wxEVT_POPUP_MENU_INIT = wxc.wxEVT_POPUP_MENU_INIT -wxEVT_CONTEXT_MENU = wxc.wxEVT_CONTEXT_MENU wxEVT_SYS_COLOUR_CHANGED = wxc.wxEVT_SYS_COLOUR_CHANGED wxEVT_SETTING_CHANGED = wxc.wxEVT_SETTING_CHANGED wxEVT_QUERY_NEW_PALETTE = wxc.wxEVT_QUERY_NEW_PALETTE @@ -798,8 +793,6 @@ wxEVT_DRAW_ITEM = wxc.wxEVT_DRAW_ITEM wxEVT_MEASURE_ITEM = wxc.wxEVT_MEASURE_ITEM wxEVT_COMPARE_ITEM = wxc.wxEVT_COMPARE_ITEM wxEVT_INIT_DIALOG = wxc.wxEVT_INIT_DIALOG -wxEVT_HELP = wxc.wxEVT_HELP -wxEVT_DETAILED_HELP = wxc.wxEVT_DETAILED_HELP wxEVT_IDLE = wxc.wxEVT_IDLE wxEVT_UPDATE_UI = wxc.wxEVT_UPDATE_UI wxEVT_COMMAND_LEFT_CLICK = wxc.wxEVT_COMMAND_LEFT_CLICK @@ -1183,6 +1176,12 @@ def EVT_TEXT(win, id, func): def EVT_TEXT_ENTER(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_TEXT_ENTER, func) +def EVT_TEXT_URL(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_TEXT_URL, func) + +def EVT_TEXT_MAXLEN(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_TEXT_MAXLEN, func) + def EVT_MENU(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_MENU_SELECTED, func) @@ -1259,62 +1258,6 @@ def EVT_NOTEBOOK_PAGE_CHANGING(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, func) -# wxTreeCtrl events -def EVT_TREE_BEGIN_DRAG(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_TREE_BEGIN_DRAG, func) - -def EVT_TREE_BEGIN_RDRAG(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_TREE_BEGIN_RDRAG, func) - -def EVT_TREE_END_DRAG(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_TREE_END_DRAG, func) - -def EVT_TREE_BEGIN_LABEL_EDIT(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, func) - -def EVT_TREE_END_LABEL_EDIT(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_TREE_END_LABEL_EDIT, func) - -def EVT_TREE_GET_INFO(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_TREE_GET_INFO, func) - -def EVT_TREE_SET_INFO(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_TREE_SET_INFO, func) - -def EVT_TREE_ITEM_EXPANDED(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_EXPANDED, func) - -def EVT_TREE_ITEM_EXPANDING(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_EXPANDING, func) - -def EVT_TREE_ITEM_COLLAPSED(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_COLLAPSED, func) - -def EVT_TREE_ITEM_COLLAPSING(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_COLLAPSING, func) - -def EVT_TREE_SEL_CHANGED(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_TREE_SEL_CHANGED, func) - -def EVT_TREE_SEL_CHANGING(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_TREE_SEL_CHANGING, func) - -def EVT_TREE_KEY_DOWN(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_TREE_KEY_DOWN, func) - -def EVT_TREE_DELETE_ITEM(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_TREE_DELETE_ITEM, func) - -def EVT_TREE_ITEM_ACTIVATED(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_ACTIVATED, func) - -def EVT_TREE_ITEM_RIGHT_CLICK(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, func) - -def EVT_TREE_ITEM_MIDDLE_CLICK(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK, func) - - # wxSpinButton def EVT_SPIN_UP(win, id, func): win.Connect(id, -1, wxEVT_SCROLL_LINEUP, func) @@ -1326,8 +1269,6 @@ def EVT_SPIN(win, id, func): win.Connect(id, -1, wxEVT_SCROLL_THUMBTRACK,func) - - # wxTaskBarIcon def EVT_TASKBAR_MOVE(win, func): win.Connect(-1, -1, wxEVT_TASKBAR_MOVE, func) @@ -1365,58 +1306,6 @@ def EVT_CALCULATE_LAYOUT(win, func): win.Connect(-1, -1, wxEVT_EVT_CALCULATE_LAYOUT, func) -# wxListCtrl -def EVT_LIST_BEGIN_DRAG(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_BEGIN_DRAG, func) - -def EVT_LIST_BEGIN_RDRAG(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_BEGIN_RDRAG, func) - -def EVT_LIST_BEGIN_LABEL_EDIT(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, func) - -def EVT_LIST_END_LABEL_EDIT(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_END_LABEL_EDIT, func) - -def EVT_LIST_DELETE_ITEM(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_DELETE_ITEM, func) - -def EVT_LIST_DELETE_ALL_ITEMS(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, func) - -def EVT_LIST_GET_INFO(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_GET_INFO, func) - -def EVT_LIST_SET_INFO(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_SET_INFO, func) - -def EVT_LIST_ITEM_SELECTED(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_SELECTED, func) - -def EVT_LIST_ITEM_DESELECTED(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_DESELECTED, func) - -def EVT_LIST_KEY_DOWN(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_KEY_DOWN, func) - -def EVT_LIST_INSERT_ITEM(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_INSERT_ITEM, func) - -def EVT_LIST_COL_CLICK(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_COL_CLICK, func) - -def EVT_LIST_ITEM_RIGHT_CLICK(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, func) - -def EVT_LIST_ITEM_MIDDLE_CLICK(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, func) - -def EVT_LIST_ITEM_ACTIVATED(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_ACTIVATED, func) - - - - #wxSplitterWindow def EVT_SPLITTER_SASH_POS_CHANGING(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING, func) @@ -1464,6 +1353,24 @@ def EVT_TOGGLEBUTTON(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, func) + +# Help events +def EVT_HELP(win, id, func): + win.Connect(id, -1, wxEVT_HELP, func) + +def EVT_HELP_RANGE(win, id, id2, func): + win.Connect(id, id2, wxEVT_HELP, func) + +def EVT_DETAILED_HELP(win, id, func): + win.Connect(id, -1, wxEVT_DETAILED_HELP, func) + +def EVT_DETAILED_HELP_RANGE(win, id, id2, func): + win.Connect(id, id2, wxEVT_DETAILED_HELP, func) + +def EVT_CONTEXT_MENU(win, func): + win.Connect(-1, -1, wxEVT_CONTEXT_MENU, func) + + #---------------------------------------------------------------------- class wxTimer(wxPyTimer): @@ -1493,6 +1400,30 @@ wxNoRefBitmap = wxBitmap wxPyDefaultPosition = wxDefaultPosition wxPyDefaultSize = wxDefaultSize + +#---------------------------------------------------------------------- +# wxGTK sets the locale when initialized. Doing this at the Python +# level should set it up to match what GTK is doing at the C level. +try: + import locale + locale.setlocale(locale.LC_ALL, "") +except: + pass + + + +#---------------------------------------------------------------------- +# wxWindows version numbers. wxPython version is in __version__. + +wxMAJOR_VERSION = wxc.wxMAJOR_VERSION +wxMINOR_VERSION = wxc.wxMINOR_VERSION +wxRELEASE_NUMBER = wxc.wxRELEASE_NUMBER +wxVERSION_STRING = wxc.wxVERSION_STRING +wxVERSION_NUMBER = wxc.wxVERSION_NUMBER + +wxVERSION = (wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER) + + #---------------------------------------------------------------------- # This helper function will take a wxPython object and convert it to # another wxPython object type. This will not be able to create objects diff --git a/wxPython/src/helpers.h b/wxPython/src/helpers.h index 1d503a2046..cae2b86d8f 100644 --- a/wxPython/src/helpers.h +++ b/wxPython/src/helpers.h @@ -393,7 +393,7 @@ public: #define IMP_PYCALLBACK_BOOL_INTINT(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(int a, int b) { \ - bool rval, found; \ + bool rval=FALSE, found; \ wxPyTState* state = wxPyBeginBlockThreads(); \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)",a,b)); \ @@ -436,10 +436,10 @@ public: #define IMP_PYCALLBACK_BOOL_INT(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(int a) { \ - bool rval, found; \ + bool rval=FALSE, found; \ wxPyTState* state = wxPyBeginBlockThreads(); \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ - rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)",a)); \ + rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)",a));\ wxPyEndBlockThreads(state); \ if (! found) \ rval = PCLASS::CBNAME(a); \ @@ -457,7 +457,7 @@ public: #define IMP_PYCALLBACK_BOOL_INT_pure(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(int a) { \ - bool rval; \ + bool rval=FALSE; \ wxPyTState* state = wxPyBeginBlockThreads(); \ if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)",a)); \ @@ -619,7 +619,7 @@ public: bool CLASS::CBNAME(wxDC& a, double b, double c, double d, double e, bool f) { \ bool found; \ wxPyTState* state = wxPyBeginBlockThreads(); \ - bool rval; \ + bool rval=FALSE; \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \ PyObject* obj = wxPyMake_wxObject(&a); \ rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oddddi)", obj, b, c, d, e, (int)f));\ @@ -828,7 +828,7 @@ public: #define IMP_PYCALLBACK_BOOL_STRING(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(const wxString& a) { \ - bool rval; \ + bool rval=FALSE; \ bool found; \ wxPyTState* state = wxPyBeginBlockThreads(); \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ @@ -849,7 +849,7 @@ public: \ #define IMP_PYCALLBACK_BOOL_STRING_pure(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(const wxString& a) { \ - bool rval; \ + bool rval=FALSE; \ wxPyTState* state = wxPyBeginBlockThreads(); \ if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(s)", a.c_str())); \ @@ -910,7 +910,7 @@ public: #define IMP_PYCALLBACK_BOOL_STRINGSTRING(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(const wxString& a, const wxString& b) { \ - bool rval; \ + bool rval=FALSE; \ bool found; \ wxPyTState* state = wxPyBeginBlockThreads(); \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ @@ -986,7 +986,7 @@ public: #define IMP_PYCALLBACK_BOOL_TAG_pure(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(const wxHtmlTag& a) { \ - bool rval = FALSE; \ + bool rval=FALSE; \ wxPyTState* state = wxPyBeginBlockThreads(); \ if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ PyObject* obj = wxPyConstructObject((void*)&a, "wxHtmlTag", 0); \ @@ -1044,7 +1044,7 @@ public: #define IMP_PYCALLBACK_BOOL_WXWIN(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(wxWindow* a) { \ - bool rval; \ + bool rval=FALSE; \ bool found; \ wxPyTState* state = wxPyBeginBlockThreads(); \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \ @@ -1070,7 +1070,7 @@ public: #define IMP_PYCALLBACK_BOOL_(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME() { \ - bool rval; \ + bool rval=FALSE; \ bool found; \ wxPyTState* state = wxPyBeginBlockThreads(); \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ @@ -1093,9 +1093,9 @@ public: #define IMP_PYCALLBACK_DR_2WXCDR(CLASS, PCLASS, CBNAME) \ wxDragResult CLASS::CBNAME(wxCoord a, wxCoord b, wxDragResult c) { \ + int rval=0; \ bool found; \ wxPyTState* state = wxPyBeginBlockThreads(); \ - int rval; \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", a,b,c));\ wxPyEndBlockThreads(state); \ @@ -1140,9 +1140,9 @@ public: #define IMP_PYCALLBACK_BOOL_DR(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(wxDragResult a) { \ + bool rval=FALSE; \ bool found; \ wxPyTState* state = wxPyBeginBlockThreads(); \ - bool rval; \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)", a));\ wxPyEndBlockThreads(state); \ @@ -1163,7 +1163,7 @@ public: #define IMP_PYCALLBACK_DR_2WXCDR_pure(CLASS, PCLASS, CBNAME) \ wxDragResult CLASS::CBNAME(wxCoord a, wxCoord b, wxDragResult c) { \ wxPyTState* state = wxPyBeginBlockThreads(); \ - int rval; \ + int rval=0; \ if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", a,b,c));\ wxPyEndBlockThreads(state); \ @@ -1178,7 +1178,7 @@ public: #define IMP_PYCALLBACK_BOOL_INTINTSTR_pure(CLASS, PCLASS, CBNAME) \ bool CLASS::CBNAME(int a, int b, const wxString& c) { \ - bool rval; \ + bool rval=FALSE; \ wxPyTState* state = wxPyBeginBlockThreads(); \ if (wxPyCBH_findCallback(m_myInst, #CBNAME)) \ rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iis)",a,b,c.c_str()));\ @@ -1195,7 +1195,7 @@ public: #define IMP_PYCALLBACK_SIZET_(CLASS, PCLASS, CBNAME) \ size_t CLASS::CBNAME() { \ - size_t rval; \ + size_t rval=0; \ bool found; \ wxPyTState* state = wxPyBeginBlockThreads(); \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) \ @@ -1218,7 +1218,7 @@ public: #define IMP_PYCALLBACK_DATAFMT_SIZET(CLASS, PCLASS, CBNAME) \ wxDataFormat CLASS::CBNAME(size_t a) { \ - wxDataFormat rval; \ + wxDataFormat rval=0; \ bool found; \ wxPyTState* state = wxPyBeginBlockThreads(); \ if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \ diff --git a/wxPython/src/misc2.i b/wxPython/src/misc2.i index ece14692a1..7cea032de8 100644 --- a/wxPython/src/misc2.i +++ b/wxPython/src/misc2.i @@ -813,14 +813,14 @@ class wxWave : public wxObject { public: wxWave(const wxString& fileName, bool isResource = FALSE) { - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); PyErr_SetString(PyExc_NotImplementedError, "wxWave is not available on this platform."); - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); } wxWave(int size, const wxByte* data) { - bool doSave = wxPyRestoreThread(); + wxPyTState* state = wxPyBeginBlockThreads(); PyErr_SetString(PyExc_NotImplementedError, "wxWave is not available on this platform."); - wxPySaveThread(doSave); + wxPyEndBlockThreads(state); } ~wxWave() {} -- 2.45.2