From: Robin Dunn Date: Sat, 24 Aug 2002 02:29:34 +0000 (+0000) Subject: Added wxXmlResourceHandler to wxPython and enabled it's virtuals to be X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/628c7f79d4f177b18349c9c10d49db6c9c4bc56c Added wxXmlResourceHandler to wxPython and enabled it's virtuals to be Python Callbacks. Added a sample to the demo to show how to do it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16721 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/CHANGES.txt b/wxPython/CHANGES.txt index 721f50a619..3ac422e634 100644 --- a/wxPython/CHANGES.txt +++ b/wxPython/CHANGES.txt @@ -166,6 +166,10 @@ displays the details of the event. Added wxWizard, wxWizardPage, wxWizardPageSimple and wxPyWizardPage. +Added wxXmlResourceHandler which allows you to create custom handlers +for nonstandard class types in XRC resources. See the demo for an +example. + diff --git a/wxPython/contrib/xrc/_xrcextras.py b/wxPython/contrib/xrc/_xrcextras.py index 2f06e83a95..e4cd16f562 100644 --- a/wxPython/contrib/xrc/_xrcextras.py +++ b/wxPython/contrib/xrc/_xrcextras.py @@ -2,3 +2,5 @@ # The global was removed in favor of static accessor functions. This is for # backwards compatibility: wxTheXmlResource = wxXmlResource_Get() + +wx.wxXmlNodePtr = wxXmlNodePtr diff --git a/wxPython/contrib/xrc/xrc.cpp b/wxPython/contrib/xrc/xrc.cpp index e408c71f00..f4753bcce1 100644 --- a/wxPython/contrib/xrc/xrc.cpp +++ b/wxPython/contrib/xrc/xrc.cpp @@ -56,6 +56,8 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "xrcc" #include "wxPython.h" +#include "pyistream.h" +#include "wx/xrc/xml.h" #include "wx/xrc/xmlres.h" #include #include @@ -86,6 +88,158 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { } return target; } + + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyEmptyString(wxT("")); + static const wxString wxPyUTF8String(wxT("UTF-8")); + static const wxString wxPyStyleString(wxT("style")); + static const wxString wxPySizeString(wxT("size")); + static const wxString wxPyPosString(wxT("pos")); + static const wxString wxPyBitmapString(wxT("bitmap")); + static const wxString wxPyIconString(wxT("icon")); + static const wxString wxPyFontString(wxT("font")); + // C++ version of Python aware wxXmlResourceHandler, for the pure virtual + // callbacks, as well as to make some protected things public so they can + // be wrapped. +class wxPyXmlResourceHandler : public wxXmlResourceHandler { +public: + wxPyXmlResourceHandler() : wxXmlResourceHandler() {} + //~wxPyXmlResourceHandler(); + + // Base class virtuals + + DEC_PYCALLBACK_OBJECT__pure(DoCreateResource); + DEC_PYCALLBACK_BOOL_NODE_pure(CanHandle); + +// wxObject* DoCreateResource() { +// wxObject* rv = NULL; +// wxPyBeginBlockThreads(); +// if (wxPyCBH_findCallback(m_myInst, "DoCreateResource")) { +// PyObject* ro; +// ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()")); +// if (ro) { +// SWIG_GetPtrObj(ro, (void **)&rv, "_wxObject_p"); +// Py_DECREF(ro); +// } +// } +// wxPyEndBlockThreads(); +// return rv; +// } + +// bool CanHandle(wxXmlNode* a) { +// bool rv=FALSE; +// wxPyBeginBlockThreads(); +// if (wxPyCBH_findCallback(m_myInst, "CanHandle")) { +// PyObject* obj = wxPyConstructObject((void*)a, "wxXmlNode", 0); +// rv = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); +// Py_DECREF(obj); +// } +// wxPyEndBlockThreads(); +// return rv; +// } + + + + // accessors for protected members + + wxXmlResource* GetResource() { return m_resource; } + wxXmlNode* GetNode() { return m_node; } + wxString GetClass() { return m_class; } + wxObject* GetParent() { return m_parent; } + wxObject* GetInstance() { return m_instance; } + wxWindow* GetParentAsWindow() { return m_parentAsWindow; } + wxWindow* GetInstanceAsWindow() { return m_instanceAsWindow; } + + + // turn some protected methods into public via delegation + + bool IsOfClass(wxXmlNode *node, const wxString& classname) + { return wxXmlResourceHandler::IsOfClass(node, classname); } + + wxString GetNodeContent(wxXmlNode *node) + { return wxXmlResourceHandler::GetNodeContent(node); } + + bool HasParam(const wxString& param) + { return wxXmlResourceHandler::HasParam(param); } + + wxXmlNode *GetParamNode(const wxString& param) + { return wxXmlResourceHandler::GetParamNode(param); } + + wxString GetParamValue(const wxString& param) + { return wxXmlResourceHandler::GetParamValue(param); } + + void AddStyle(const wxString& name, int value) + { wxXmlResourceHandler::AddStyle(name, value); } + + void AddWindowStyles() + { wxXmlResourceHandler::AddWindowStyles(); } + + int GetStyle(const wxString& param = wxT("style"), int defaults = 0) + { return wxXmlResourceHandler::GetStyle(param, defaults); } + + wxString GetText(const wxString& param, bool translate = TRUE) + { return wxXmlResourceHandler::GetText(param, translate); } + + int GetID() + { return wxXmlResourceHandler::GetID(); } + + wxString GetName() + { return wxXmlResourceHandler::GetName(); } + + bool GetBool(const wxString& param, bool defaultv = FALSE) + { return wxXmlResourceHandler::GetBool(param, defaultv); } + + long GetLong( const wxString& param, long defaultv = 0 ) + { return wxXmlResourceHandler::GetLong(param, defaultv); } + + wxColour GetColour(const wxString& param) + { return wxXmlResourceHandler::GetColour(param); } + + wxSize GetSize(const wxString& param = wxT("size")) + { return wxXmlResourceHandler::GetSize(param); } + + wxPoint GetPosition(const wxString& param = wxT("pos")) + { return wxXmlResourceHandler::GetPosition(param); } + + wxCoord GetDimension(const wxString& param, wxCoord defaultv = 0) + { return wxXmlResourceHandler::GetDimension(param, defaultv); } + + wxBitmap GetBitmap(const wxString& param = wxT("bitmap"), + const wxArtClient& defaultArtClient = wxART_OTHER, + wxSize size = wxDefaultSize) + { return wxXmlResourceHandler::GetBitmap(param, defaultArtClient, size); } + + wxIcon GetIcon(const wxString& param = wxT("icon"), + const wxArtClient& defaultArtClient = wxART_OTHER, + wxSize size = wxDefaultSize) + { return wxXmlResourceHandler::GetIcon(param, defaultArtClient, size); } + + wxFont GetFont(const wxString& param = wxT("font")) + { return wxXmlResourceHandler::GetFont(param); } + + void SetupWindow(wxWindow *wnd) + { wxXmlResourceHandler::SetupWindow(wnd); } + + void CreateChildren(wxObject *parent, bool this_hnd_only = FALSE) + { wxXmlResourceHandler::CreateChildren(parent, this_hnd_only); } + + void CreateChildrenPrivately(wxObject *parent, wxXmlNode *rootnode = NULL) + { wxXmlResourceHandler::CreateChildrenPrivately(parent, rootnode); } + + wxObject *CreateResFromNode(wxXmlNode *node, + wxObject *parent, wxObject *instance = NULL) + { return wxXmlResourceHandler::CreateResFromNode(node, parent, instance); } + + wxFileSystem& GetCurFileSystem() + { return wxXmlResourceHandler::GetCurFileSystem(); } + + + PYPRIVATE; +}; + +IMP_PYCALLBACK_OBJECT__pure(wxPyXmlResourceHandler, wxXmlResourceHandler, DoCreateResource); +IMP_PYCALLBACK_BOOL_NODE_pure(wxPyXmlResourceHandler, wxXmlResourceHandler, CanHandle); + #ifdef __cplusplus extern "C" { #endif @@ -324,7 +478,7 @@ static PyObject *_wrap_wxXmlResource_InitAllHandlers(PyObject *self, PyObject *a static PyObject *_wrap_wxXmlResource_AddHandler(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxXmlResource * _arg0; - wxXmlResourceHandler * _arg1; + wxPyXmlResourceHandler * _arg1; PyObject * _argo0 = 0; PyObject * _argo1 = 0; char *_kwnames[] = { "self","handler", NULL }; @@ -341,8 +495,8 @@ static PyObject *_wrap_wxXmlResource_AddHandler(PyObject *self, PyObject *args, } if (_argo1) { if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxXmlResourceHandler_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlResource_AddHandler. Expected _wxXmlResourceHandler_p."); + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlResource_AddHandler. Expected _wxPyXmlResourceHandler_p."); return NULL; } } @@ -357,6 +511,43 @@ static PyObject *_wrap_wxXmlResource_AddHandler(PyObject *self, PyObject *args, return _resultobj; } +#define wxXmlResource_InsertHandler(_swigobj,_swigarg0) (_swigobj->InsertHandler(_swigarg0)) +static PyObject *_wrap_wxXmlResource_InsertHandler(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlResource * _arg0; + wxPyXmlResourceHandler * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","handler", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlResource_InsertHandler",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlResource_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResource_InsertHandler. Expected _wxXmlResource_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlResource_InsertHandler. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlResource_InsertHandler(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define wxXmlResource_ClearHandlers(_swigobj) (_swigobj->ClearHandlers()) static PyObject *_wrap_wxXmlResource_ClearHandlers(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -783,8 +974,56 @@ static PyObject *_wrap_wxXmlResource_LoadOnPanel(PyObject *self, PyObject *args, return _resultobj; } -#define wxXmlResource_LoadFrame(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->LoadFrame(_swigarg0,_swigarg1,_swigarg2)) +#define wxXmlResource_LoadFrame(_swigobj,_swigarg0,_swigarg1) (_swigobj->LoadFrame(_swigarg0,_swigarg1)) static PyObject *_wrap_wxXmlResource_LoadFrame(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxFrame * _result; + wxXmlResource * _arg0; + wxWindow * _arg1; + wxString * _arg2; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + PyObject * _obj2 = 0; + char *_kwnames[] = { "self","parent","name", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxXmlResource_LoadFrame",_kwnames,&_argo0,&_argo1,&_obj2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlResource_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResource_LoadFrame. Expected _wxXmlResource_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 wxXmlResource_LoadFrame. Expected _wxWindow_p."); + return NULL; + } + } +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxFrame *)wxXmlResource_LoadFrame(_arg0,_arg1,*_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ _resultobj = wxPyMake_wxObject(_result); } +{ + if (_obj2) + delete _arg2; +} + return _resultobj; +} + +#define wxXmlResource_LoadOnFrame(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->LoadFrame(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_wxXmlResource_LoadOnFrame(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; bool _result; wxXmlResource * _arg0; @@ -798,26 +1037,144 @@ static PyObject *_wrap_wxXmlResource_LoadFrame(PyObject *self, PyObject *args, P char *_kwnames[] = { "self","frame","parent","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOOO:wxXmlResource_LoadFrame",_kwnames,&_argo0,&_argo1,&_argo2,&_obj3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOOO:wxXmlResource_LoadOnFrame",_kwnames,&_argo0,&_argo1,&_argo2,&_obj3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlResource_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResource_LoadFrame. Expected _wxXmlResource_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResource_LoadOnFrame. Expected _wxXmlResource_p."); return NULL; } } if (_argo1) { if (_argo1 == Py_None) { _arg1 = NULL; } else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxFrame_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlResource_LoadFrame. Expected _wxFrame_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlResource_LoadOnFrame. Expected _wxFrame_p."); + return NULL; + } + } + if (_argo2) { + if (_argo2 == Py_None) { _arg2 = NULL; } + else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxXmlResource_LoadOnFrame. Expected _wxWindow_p."); + return NULL; + } + } +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxXmlResource_LoadOnFrame(_arg0,_arg1,_arg2,*_arg3); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj3) + delete _arg3; +} + return _resultobj; +} + +#define wxXmlResource_LoadObject(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->LoadObject(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_wxXmlResource_LoadObject(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxObject * _result; + wxXmlResource * _arg0; + wxWindow * _arg1; + wxString * _arg2; + wxString * _arg3; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + PyObject * _obj2 = 0; + PyObject * _obj3 = 0; + char *_kwnames[] = { "self","parent","name","classname", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOOO:wxXmlResource_LoadObject",_kwnames,&_argo0,&_argo1,&_obj2,&_obj3)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlResource_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResource_LoadObject. Expected _wxXmlResource_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 wxXmlResource_LoadObject. Expected _wxWindow_p."); + return NULL; + } + } +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxObject *)wxXmlResource_LoadObject(_arg0,_arg1,*_arg2,*_arg3); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ _resultobj = wxPyMake_wxObject(_result); } +{ + if (_obj2) + delete _arg2; +} +{ + if (_obj3) + delete _arg3; +} + return _resultobj; +} + +#define wxXmlResource_LoadOnObject(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->LoadObject(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) +static PyObject *_wrap_wxXmlResource_LoadOnObject(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxXmlResource * _arg0; + wxObject * _arg1; + wxWindow * _arg2; + wxString * _arg3; + wxString * _arg4; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + PyObject * _argo2 = 0; + PyObject * _obj3 = 0; + PyObject * _obj4 = 0; + char *_kwnames[] = { "self","instance","parent","name","classname", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOOOO:wxXmlResource_LoadOnObject",_kwnames,&_argo0,&_argo1,&_argo2,&_obj3,&_obj4)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlResource_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResource_LoadOnObject. Expected _wxXmlResource_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxObject_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlResource_LoadOnObject. Expected _wxObject_p."); return NULL; } } if (_argo2) { if (_argo2 == Py_None) { _arg2 = NULL; } else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxWindow_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxXmlResource_LoadFrame. Expected _wxWindow_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxXmlResource_LoadOnObject. Expected _wxWindow_p."); return NULL; } } @@ -826,9 +1183,14 @@ static PyObject *_wrap_wxXmlResource_LoadFrame(PyObject *self, PyObject *args, P if (_arg3 == NULL) return NULL; } +{ + _arg4 = wxString_in_helper(_obj4); + if (_arg4 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxXmlResource_LoadFrame(_arg0,_arg1,_arg2,*_arg3); + _result = (bool )wxXmlResource_LoadOnObject(_arg0,_arg1,_arg2,*_arg3,*_arg4); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -836,6 +1198,10 @@ static PyObject *_wrap_wxXmlResource_LoadFrame(PyObject *self, PyObject *args, P { if (_obj3) delete _arg3; +} +{ + if (_obj4) + delete _arg4; } return _resultobj; } @@ -1127,7 +1493,3475 @@ static PyObject *_wrap_wxXmlResource_Set(PyObject *self, PyObject *args, PyObjec return _resultobj; } +#define new_wxXmlProperty(_swigarg0,_swigarg1,_swigarg2) (new wxXmlProperty(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_new_wxXmlProperty(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlProperty * _result; + wxString * _arg0 = (wxString *) &wxPyEmptyString; + wxString * _arg1 = (wxString *) &wxPyEmptyString; + wxXmlProperty * _arg2 = (wxXmlProperty *) NULL; + PyObject * _obj0 = 0; + PyObject * _obj1 = 0; + PyObject * _argo2 = 0; + char *_kwnames[] = { "name","value","next", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|OOO:new_wxXmlProperty",_kwnames,&_obj0,&_obj1,&_argo2)) + return NULL; + if (_obj0) +{ + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) + return NULL; +} + if (_obj1) +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} + if (_argo2) { + if (_argo2 == Py_None) { _arg2 = NULL; } + else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxXmlProperty_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of new_wxXmlProperty. Expected _wxXmlProperty_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxXmlProperty *)new_wxXmlProperty(*_arg0,*_arg1,_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxXmlProperty_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } +{ + if (_obj0) + delete _arg0; +} +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxXmlProperty_GetName(_swigobj) (_swigobj->GetName()) +static PyObject *_wrap_wxXmlProperty_GetName(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxXmlProperty * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlProperty_GetName",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlProperty_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlProperty_GetName. Expected _wxXmlProperty_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxXmlProperty_GetName(_arg0)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + delete _result; +} + return _resultobj; +} + +#define wxXmlProperty_GetValue(_swigobj) (_swigobj->GetValue()) +static PyObject *_wrap_wxXmlProperty_GetValue(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxXmlProperty * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlProperty_GetValue",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlProperty_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlProperty_GetValue. Expected _wxXmlProperty_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxXmlProperty_GetValue(_arg0)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + delete _result; +} + return _resultobj; +} + +#define wxXmlProperty_GetNext(_swigobj) (_swigobj->GetNext()) +static PyObject *_wrap_wxXmlProperty_GetNext(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlProperty * _result; + wxXmlProperty * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlProperty_GetNext",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlProperty_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlProperty_GetNext. Expected _wxXmlProperty_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxXmlProperty *)wxXmlProperty_GetNext(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxXmlProperty_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define wxXmlProperty_SetName(_swigobj,_swigarg0) (_swigobj->SetName(_swigarg0)) +static PyObject *_wrap_wxXmlProperty_SetName(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlProperty * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","name", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlProperty_SetName",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlProperty_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlProperty_SetName. Expected _wxXmlProperty_p."); + return NULL; + } + } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlProperty_SetName(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxXmlProperty_SetValue(_swigobj,_swigarg0) (_swigobj->SetValue(_swigarg0)) +static PyObject *_wrap_wxXmlProperty_SetValue(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlProperty * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","value", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlProperty_SetValue",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlProperty_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlProperty_SetValue. Expected _wxXmlProperty_p."); + return NULL; + } + } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlProperty_SetValue(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxXmlProperty_SetNext(_swigobj,_swigarg0) (_swigobj->SetNext(_swigarg0)) +static PyObject *_wrap_wxXmlProperty_SetNext(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlProperty * _arg0; + wxXmlProperty * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","next", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlProperty_SetNext",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlProperty_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlProperty_SetNext. Expected _wxXmlProperty_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxXmlProperty_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlProperty_SetNext. Expected _wxXmlProperty_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlProperty_SetNext(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define new_wxXmlNode(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5) (new wxXmlNode(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5)) +static PyObject *_wrap_new_wxXmlNode(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlNode * _result; + wxXmlNode * _arg0 = (wxXmlNode *) NULL; + wxXmlNodeType _arg1 = (wxXmlNodeType ) 0; + wxString * _arg2 = (wxString *) &wxPyEmptyString; + wxString * _arg3 = (wxString *) &wxPyEmptyString; + wxXmlProperty * _arg4 = (wxXmlProperty *) NULL; + wxXmlNode * _arg5 = (wxXmlNode *) NULL; + PyObject * _argo0 = 0; + PyObject * _obj2 = 0; + PyObject * _obj3 = 0; + PyObject * _argo4 = 0; + PyObject * _argo5 = 0; + char *_kwnames[] = { "parent","type","name","content","props","next", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|OiOOOO:new_wxXmlNode",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_argo4,&_argo5)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxXmlNode. Expected _wxXmlNode_p."); + return NULL; + } + } + if (_obj2) +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} + if (_obj3) +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) + return NULL; +} + if (_argo4) { + if (_argo4 == Py_None) { _arg4 = NULL; } + else if (SWIG_GetPtrObj(_argo4,(void **) &_arg4,"_wxXmlProperty_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 5 of new_wxXmlNode. Expected _wxXmlProperty_p."); + return NULL; + } + } + if (_argo5) { + if (_argo5 == Py_None) { _arg5 = NULL; } + else if (SWIG_GetPtrObj(_argo5,(void **) &_arg5,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 6 of new_wxXmlNode. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxXmlNode *)new_wxXmlNode(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxXmlNode_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } +{ + if (_obj2) + delete _arg2; +} +{ + if (_obj3) + delete _arg3; +} + return _resultobj; +} + +#define delete_wxXmlNode(_swigobj) (delete _swigobj) +static PyObject *_wrap_delete_wxXmlNode(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlNode * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxXmlNode",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxXmlNode. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + delete_wxXmlNode(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define new_wxXmlNodeEasy(_swigarg0,_swigarg1,_swigarg2) (new wxXmlNode(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_new_wxXmlNodeEasy(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlNode * _result; + wxXmlNodeType _arg0; + wxString * _arg1; + wxString * _arg2 = (wxString *) &wxPyEmptyString; + PyObject * _obj1 = 0; + PyObject * _obj2 = 0; + char *_kwnames[] = { "type","name","content", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"iO|O:new_wxXmlNodeEasy",_kwnames,&_arg0,&_obj1,&_obj2)) + return NULL; +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} + if (_obj2) +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxXmlNode *)new_wxXmlNodeEasy(_arg0,*_arg1,*_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxXmlNode_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } +{ + if (_obj1) + delete _arg1; +} +{ + if (_obj2) + delete _arg2; +} + return _resultobj; +} + +#define wxXmlNode_AddChild(_swigobj,_swigarg0) (_swigobj->AddChild(_swigarg0)) +static PyObject *_wrap_wxXmlNode_AddChild(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlNode * _arg0; + wxXmlNode * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","child", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlNode_AddChild",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlNode_AddChild. Expected _wxXmlNode_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlNode_AddChild. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlNode_AddChild(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxXmlNode_InsertChild(_swigobj,_swigarg0,_swigarg1) (_swigobj->InsertChild(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxXmlNode_InsertChild(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlNode * _arg0; + wxXmlNode * _arg1; + wxXmlNode * _arg2; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + PyObject * _argo2 = 0; + char *_kwnames[] = { "self","child","before_node", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxXmlNode_InsertChild",_kwnames,&_argo0,&_argo1,&_argo2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlNode_InsertChild. Expected _wxXmlNode_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlNode_InsertChild. Expected _wxXmlNode_p."); + return NULL; + } + } + if (_argo2) { + if (_argo2 == Py_None) { _arg2 = NULL; } + else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxXmlNode_InsertChild. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlNode_InsertChild(_arg0,_arg1,_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxXmlNode_RemoveChild(_swigobj,_swigarg0) (_swigobj->RemoveChild(_swigarg0)) +static PyObject *_wrap_wxXmlNode_RemoveChild(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxXmlNode * _arg0; + wxXmlNode * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","child", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlNode_RemoveChild",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlNode_RemoveChild. Expected _wxXmlNode_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlNode_RemoveChild. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxXmlNode_RemoveChild(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxXmlNode_AddProperty(_swigobj,_swigarg0) (_swigobj->AddProperty(_swigarg0)) +static PyObject *_wrap_wxXmlNode_AddProperty(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlNode * _arg0; + wxXmlProperty * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","prop", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlNode_AddProperty",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlNode_AddProperty. Expected _wxXmlNode_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxXmlProperty_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlNode_AddProperty. Expected _wxXmlProperty_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlNode_AddProperty(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxXmlNode_AddPropertyName(_swigobj,_swigarg0,_swigarg1) (_swigobj->AddProperty(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxXmlNode_AddPropertyName(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlNode * _arg0; + wxString * _arg1; + wxString * _arg2; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + PyObject * _obj2 = 0; + char *_kwnames[] = { "self","name","value", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxXmlNode_AddPropertyName",_kwnames,&_argo0,&_obj1,&_obj2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlNode_AddPropertyName. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlNode_AddPropertyName(_arg0,*_arg1,*_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} +{ + if (_obj2) + delete _arg2; +} + return _resultobj; +} + +#define wxXmlNode_DeleteProperty(_swigobj,_swigarg0) (_swigobj->DeleteProperty(_swigarg0)) +static PyObject *_wrap_wxXmlNode_DeleteProperty(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxXmlNode * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","name", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlNode_DeleteProperty",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlNode_DeleteProperty. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxXmlNode_DeleteProperty(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxXmlNode_GetType(_swigobj) (_swigobj->GetType()) +static PyObject *_wrap_wxXmlNode_GetType(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlNodeType _result; + wxXmlNode * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlNode_GetType",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlNode_GetType. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxXmlNodeType )wxXmlNode_GetType(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxXmlNode_GetName(_swigobj) (_swigobj->GetName()) +static PyObject *_wrap_wxXmlNode_GetName(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxXmlNode * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlNode_GetName",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlNode_GetName. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxXmlNode_GetName(_arg0)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + delete _result; +} + return _resultobj; +} + +#define wxXmlNode_GetContent(_swigobj) (_swigobj->GetContent()) +static PyObject *_wrap_wxXmlNode_GetContent(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxXmlNode * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlNode_GetContent",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlNode_GetContent. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxXmlNode_GetContent(_arg0)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + delete _result; +} + return _resultobj; +} + +#define wxXmlNode_GetParent(_swigobj) (_swigobj->GetParent()) +static PyObject *_wrap_wxXmlNode_GetParent(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlNode * _result; + wxXmlNode * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlNode_GetParent",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlNode_GetParent. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxXmlNode *)wxXmlNode_GetParent(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxXmlNode_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define wxXmlNode_GetNext(_swigobj) (_swigobj->GetNext()) +static PyObject *_wrap_wxXmlNode_GetNext(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlNode * _result; + wxXmlNode * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlNode_GetNext",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlNode_GetNext. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxXmlNode *)wxXmlNode_GetNext(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxXmlNode_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define wxXmlNode_GetChildren(_swigobj) (_swigobj->GetChildren()) +static PyObject *_wrap_wxXmlNode_GetChildren(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlNode * _result; + wxXmlNode * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlNode_GetChildren",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlNode_GetChildren. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxXmlNode *)wxXmlNode_GetChildren(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxXmlNode_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define wxXmlNode_GetProperties(_swigobj) (_swigobj->GetProperties()) +static PyObject *_wrap_wxXmlNode_GetProperties(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlProperty * _result; + wxXmlNode * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlNode_GetProperties",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlNode_GetProperties. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxXmlProperty *)wxXmlNode_GetProperties(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxXmlProperty_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define wxXmlNode_GetPropVal(_swigobj,_swigarg0,_swigarg1) (_swigobj->GetPropVal(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxXmlNode_GetPropVal(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxXmlNode * _arg0; + wxString * _arg1; + wxString * _arg2; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + PyObject * _obj2 = 0; + char *_kwnames[] = { "self","propName","defaultVal", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxXmlNode_GetPropVal",_kwnames,&_argo0,&_obj1,&_obj2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlNode_GetPropVal. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxXmlNode_GetPropVal(_arg0,*_arg1,*_arg2)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + if (_obj1) + delete _arg1; +} +{ + if (_obj2) + delete _arg2; +} +{ + delete _result; +} + return _resultobj; +} + +#define wxXmlNode_HasProp(_swigobj,_swigarg0) (_swigobj->HasProp(_swigarg0)) +static PyObject *_wrap_wxXmlNode_HasProp(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxXmlNode * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","propName", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlNode_HasProp",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlNode_HasProp. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxXmlNode_HasProp(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxXmlNode_SetType(_swigobj,_swigarg0) (_swigobj->SetType(_swigarg0)) +static PyObject *_wrap_wxXmlNode_SetType(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlNode * _arg0; + wxXmlNodeType _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","type", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxXmlNode_SetType",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlNode_SetType. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlNode_SetType(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxXmlNode_SetName(_swigobj,_swigarg0) (_swigobj->SetName(_swigarg0)) +static PyObject *_wrap_wxXmlNode_SetName(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlNode * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","name", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlNode_SetName",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlNode_SetName. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlNode_SetName(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxXmlNode_SetContent(_swigobj,_swigarg0) (_swigobj->SetContent(_swigarg0)) +static PyObject *_wrap_wxXmlNode_SetContent(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlNode * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","con", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlNode_SetContent",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlNode_SetContent. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlNode_SetContent(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxXmlNode_SetParent(_swigobj,_swigarg0) (_swigobj->SetParent(_swigarg0)) +static PyObject *_wrap_wxXmlNode_SetParent(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlNode * _arg0; + wxXmlNode * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","parent", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlNode_SetParent",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlNode_SetParent. Expected _wxXmlNode_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlNode_SetParent. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlNode_SetParent(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxXmlNode_SetNext(_swigobj,_swigarg0) (_swigobj->SetNext(_swigarg0)) +static PyObject *_wrap_wxXmlNode_SetNext(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlNode * _arg0; + wxXmlNode * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","next", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlNode_SetNext",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlNode_SetNext. Expected _wxXmlNode_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlNode_SetNext. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlNode_SetNext(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxXmlNode_SetChildren(_swigobj,_swigarg0) (_swigobj->SetChildren(_swigarg0)) +static PyObject *_wrap_wxXmlNode_SetChildren(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlNode * _arg0; + wxXmlNode * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","child", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlNode_SetChildren",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlNode_SetChildren. Expected _wxXmlNode_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlNode_SetChildren. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlNode_SetChildren(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxXmlNode_SetProperties(_swigobj,_swigarg0) (_swigobj->SetProperties(_swigarg0)) +static PyObject *_wrap_wxXmlNode_SetProperties(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlNode * _arg0; + wxXmlProperty * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","prop", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlNode_SetProperties",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlNode_SetProperties. Expected _wxXmlNode_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxXmlProperty_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlNode_SetProperties. Expected _wxXmlProperty_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlNode_SetProperties(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +static void *SwigwxXmlDocumentTowxObject(void *ptr) { + wxXmlDocument *src; + wxObject *dest; + src = (wxXmlDocument *) ptr; + dest = (wxObject *) src; + return (void *) dest; +} + +#define new_wxXmlDocument(_swigarg0,_swigarg1) (new wxXmlDocument(_swigarg0,_swigarg1)) +static PyObject *_wrap_new_wxXmlDocument(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlDocument * _result; + wxString * _arg0; + wxString * _arg1 = (wxString *) &wxPyUTF8String; + PyObject * _obj0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "filename","encoding", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:new_wxXmlDocument",_kwnames,&_obj0,&_obj1)) + return NULL; +{ + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) + return NULL; +} + if (_obj1) +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxXmlDocument *)new_wxXmlDocument(*_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxXmlDocument_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } +{ + if (_obj0) + delete _arg0; +} +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define new_wxXmlDocumentFromStream(_swigarg0,_swigarg1) (new wxXmlDocument(_swigarg0,_swigarg1)) +static PyObject *_wrap_new_wxXmlDocumentFromStream(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlDocument * _result; + wxInputStream * _arg0; + wxString * _arg1 = (wxString *) &wxPyUTF8String; + wxPyInputStream * temp; + bool created; + PyObject * _obj0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "stream","encoding", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:new_wxXmlDocumentFromStream",_kwnames,&_obj0,&_obj1)) + return NULL; +{ + if (SWIG_GetPtrObj(_obj0, (void **) &temp, "_wxPyInputStream_p") == 0) { + _arg0 = temp->m_wxis; + created = FALSE; + } else { + _arg0 = wxPyCBInputStream_create(_obj0, FALSE); + if (_arg0 == NULL) { + PyErr_SetString(PyExc_TypeError,"Expected _wxInputStream_p or Python file-like object."); + return NULL; + } + created = TRUE; + } +} + if (_obj1) +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxXmlDocument *)new_wxXmlDocumentFromStream(*_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxXmlDocument_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } +{ + if (created) + delete _arg0; +} +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define new_wxEmptyXmlDocument() (new wxXmlDocument()) +static PyObject *_wrap_new_wxEmptyXmlDocument(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlDocument * _result; + char *_kwnames[] = { NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxEmptyXmlDocument",_kwnames)) + return NULL; +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxXmlDocument *)new_wxEmptyXmlDocument(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxXmlDocument_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define delete_wxXmlDocument(_swigobj) (delete _swigobj) +static PyObject *_wrap_delete_wxXmlDocument(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlDocument * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxXmlDocument",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlDocument_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxXmlDocument. Expected _wxXmlDocument_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + delete_wxXmlDocument(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxXmlDocument_Load(_swigobj,_swigarg0,_swigarg1) (_swigobj->Load(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxXmlDocument_Load(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxXmlDocument * _arg0; + wxString * _arg1; + wxString * _arg2 = (wxString *) &wxPyUTF8String; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + PyObject * _obj2 = 0; + char *_kwnames[] = { "self","filename","encoding", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|O:wxXmlDocument_Load",_kwnames,&_argo0,&_obj1,&_obj2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlDocument_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlDocument_Load. Expected _wxXmlDocument_p."); + return NULL; + } + } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} + if (_obj2) +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxXmlDocument_Load(_arg0,*_arg1,*_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} +{ + if (_obj2) + delete _arg2; +} + return _resultobj; +} + +#define wxXmlDocument_LoadFromStream(_swigobj,_swigarg0,_swigarg1) (_swigobj->Load(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxXmlDocument_LoadFromStream(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxXmlDocument * _arg0; + wxInputStream * _arg1; + wxString * _arg2 = (wxString *) &wxPyUTF8String; + PyObject * _argo0 = 0; + wxPyInputStream * temp; + bool created; + PyObject * _obj1 = 0; + PyObject * _obj2 = 0; + char *_kwnames[] = { "self","stream","encoding", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|O:wxXmlDocument_LoadFromStream",_kwnames,&_argo0,&_obj1,&_obj2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlDocument_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlDocument_LoadFromStream. Expected _wxXmlDocument_p."); + return NULL; + } + } +{ + if (SWIG_GetPtrObj(_obj1, (void **) &temp, "_wxPyInputStream_p") == 0) { + _arg1 = temp->m_wxis; + created = FALSE; + } else { + _arg1 = wxPyCBInputStream_create(_obj1, FALSE); + if (_arg1 == NULL) { + PyErr_SetString(PyExc_TypeError,"Expected _wxInputStream_p or Python file-like object."); + return NULL; + } + created = TRUE; + } +} + if (_obj2) +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxXmlDocument_LoadFromStream(_arg0,*_arg1,*_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (created) + delete _arg1; +} +{ + if (_obj2) + delete _arg2; +} + return _resultobj; +} + +#define wxXmlDocument_Save(_swigobj,_swigarg0) (_swigobj->Save(_swigarg0)) +static PyObject *_wrap_wxXmlDocument_Save(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxXmlDocument * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","filename", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlDocument_Save",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlDocument_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlDocument_Save. Expected _wxXmlDocument_p."); + return NULL; + } + } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxXmlDocument_Save(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxXmlDocument_SaveToStream(_swigobj,_swigarg0) (_swigobj->Save(_swigarg0)) +static PyObject *_wrap_wxXmlDocument_SaveToStream(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxXmlDocument * _arg0; + wxOutputStream * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","stream", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlDocument_SaveToStream",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlDocument_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlDocument_SaveToStream. Expected _wxXmlDocument_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxOutputStream_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlDocument_SaveToStream. Expected _wxOutputStream_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxXmlDocument_SaveToStream(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxXmlDocument_IsOk(_swigobj) (_swigobj->IsOk()) +static PyObject *_wrap_wxXmlDocument_IsOk(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxXmlDocument * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlDocument_IsOk",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlDocument_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlDocument_IsOk. Expected _wxXmlDocument_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxXmlDocument_IsOk(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxXmlDocument_GetRoot(_swigobj) (_swigobj->GetRoot()) +static PyObject *_wrap_wxXmlDocument_GetRoot(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlNode * _result; + wxXmlDocument * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlDocument_GetRoot",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlDocument_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlDocument_GetRoot. Expected _wxXmlDocument_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxXmlNode *)wxXmlDocument_GetRoot(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxXmlNode_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define wxXmlDocument_GetVersion(_swigobj) (_swigobj->GetVersion()) +static PyObject *_wrap_wxXmlDocument_GetVersion(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxXmlDocument * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlDocument_GetVersion",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlDocument_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlDocument_GetVersion. Expected _wxXmlDocument_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxXmlDocument_GetVersion(_arg0)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + delete _result; +} + return _resultobj; +} + +#define wxXmlDocument_GetFileEncoding(_swigobj) (_swigobj->GetFileEncoding()) +static PyObject *_wrap_wxXmlDocument_GetFileEncoding(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxXmlDocument * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlDocument_GetFileEncoding",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlDocument_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlDocument_GetFileEncoding. Expected _wxXmlDocument_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxXmlDocument_GetFileEncoding(_arg0)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + delete _result; +} + return _resultobj; +} + +#define wxXmlDocument_SetRoot(_swigobj,_swigarg0) (_swigobj->SetRoot(_swigarg0)) +static PyObject *_wrap_wxXmlDocument_SetRoot(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlDocument * _arg0; + wxXmlNode * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","node", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlDocument_SetRoot",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlDocument_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlDocument_SetRoot. Expected _wxXmlDocument_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlDocument_SetRoot. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlDocument_SetRoot(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxXmlDocument_SetVersion(_swigobj,_swigarg0) (_swigobj->SetVersion(_swigarg0)) +static PyObject *_wrap_wxXmlDocument_SetVersion(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlDocument * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","version", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlDocument_SetVersion",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlDocument_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlDocument_SetVersion. Expected _wxXmlDocument_p."); + return NULL; + } + } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlDocument_SetVersion(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxXmlDocument_SetFileEncoding(_swigobj,_swigarg0) (_swigobj->SetFileEncoding(_swigarg0)) +static PyObject *_wrap_wxXmlDocument_SetFileEncoding(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlDocument * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","encoding", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlDocument_SetFileEncoding",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlDocument_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlDocument_SetFileEncoding. Expected _wxXmlDocument_p."); + return NULL; + } + } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlDocument_SetFileEncoding(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +static wxString wxXmlDocument_GetEncoding(wxXmlDocument *self) { + #if wxUSE_UNICODE + return wxPyEmptyString; + #else + return self->GetEncoding(); + #endif + } +static PyObject *_wrap_wxXmlDocument_GetEncoding(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxXmlDocument * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlDocument_GetEncoding",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlDocument_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlDocument_GetEncoding. Expected _wxXmlDocument_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxXmlDocument_GetEncoding(_arg0)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + delete _result; +} + return _resultobj; +} + +static void *SwigwxPyXmlResourceHandlerTowxObject(void *ptr) { + wxPyXmlResourceHandler *src; + wxObject *dest; + src = (wxPyXmlResourceHandler *) ptr; + dest = (wxObject *) src; + return (void *) dest; +} + +#define new_wxXmlResourceHandler() (new wxPyXmlResourceHandler()) +static PyObject *_wrap_new_wxXmlResourceHandler(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPyXmlResourceHandler * _result; + char *_kwnames[] = { NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxXmlResourceHandler",_kwnames)) + return NULL; +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxPyXmlResourceHandler *)new_wxXmlResourceHandler(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxPyXmlResourceHandler_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define wxXmlResourceHandler__setCallbackInfo(_swigobj,_swigarg0,_swigarg1) (_swigobj->_setCallbackInfo(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxXmlResourceHandler__setCallbackInfo(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPyXmlResourceHandler * _arg0; + PyObject * _arg1; + PyObject * _arg2; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + PyObject * _obj2 = 0; + char *_kwnames[] = { "self","self","_class", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxXmlResourceHandler__setCallbackInfo",_kwnames,&_argo0,&_obj1,&_obj2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler__setCallbackInfo. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } +{ + _arg1 = _obj1; +} +{ + _arg2 = _obj2; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlResourceHandler__setCallbackInfo(_arg0,_arg1,_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxXmlResourceHandler_CreateResource(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->CreateResource(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_wxXmlResourceHandler_CreateResource(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxObject * _result; + wxPyXmlResourceHandler * _arg0; + wxXmlNode * _arg1; + wxObject * _arg2; + wxObject * _arg3; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + PyObject * _argo2 = 0; + PyObject * _argo3 = 0; + char *_kwnames[] = { "self","node","parent","instance", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOOO:wxXmlResourceHandler_CreateResource",_kwnames,&_argo0,&_argo1,&_argo2,&_argo3)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_CreateResource. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlResourceHandler_CreateResource. Expected _wxXmlNode_p."); + return NULL; + } + } + if (_argo2) { + if (_argo2 == Py_None) { _arg2 = NULL; } + else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxObject_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxXmlResourceHandler_CreateResource. Expected _wxObject_p."); + return NULL; + } + } + if (_argo3) { + if (_argo3 == Py_None) { _arg3 = NULL; } + else if (SWIG_GetPtrObj(_argo3,(void **) &_arg3,"_wxObject_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 4 of wxXmlResourceHandler_CreateResource. Expected _wxObject_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxObject *)wxXmlResourceHandler_CreateResource(_arg0,_arg1,_arg2,_arg3); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ _resultobj = wxPyMake_wxObject(_result); } + return _resultobj; +} + +#define wxXmlResourceHandler_SetParentResource(_swigobj,_swigarg0) (_swigobj->SetParentResource(_swigarg0)) +static PyObject *_wrap_wxXmlResourceHandler_SetParentResource(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPyXmlResourceHandler * _arg0; + wxXmlResource * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","res", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlResourceHandler_SetParentResource",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_SetParentResource. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxXmlResource_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlResourceHandler_SetParentResource. Expected _wxXmlResource_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlResourceHandler_SetParentResource(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxXmlResourceHandler_GetResource(_swigobj) (_swigobj->GetResource()) +static PyObject *_wrap_wxXmlResourceHandler_GetResource(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlResource * _result; + wxPyXmlResourceHandler * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlResourceHandler_GetResource",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetResource. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxXmlResource *)wxXmlResourceHandler_GetResource(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxXmlResource_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define wxXmlResourceHandler_GetNode(_swigobj) (_swigobj->GetNode()) +static PyObject *_wrap_wxXmlResourceHandler_GetNode(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlNode * _result; + wxPyXmlResourceHandler * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlResourceHandler_GetNode",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetNode. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxXmlNode *)wxXmlResourceHandler_GetNode(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxXmlNode_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define wxXmlResourceHandler_GetClass(_swigobj) (_swigobj->GetClass()) +static PyObject *_wrap_wxXmlResourceHandler_GetClass(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxPyXmlResourceHandler * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlResourceHandler_GetClass",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetClass. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxXmlResourceHandler_GetClass(_arg0)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + delete _result; +} + return _resultobj; +} + +#define wxXmlResourceHandler_GetParent(_swigobj) (_swigobj->GetParent()) +static PyObject *_wrap_wxXmlResourceHandler_GetParent(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxObject * _result; + wxPyXmlResourceHandler * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlResourceHandler_GetParent",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetParent. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxObject *)wxXmlResourceHandler_GetParent(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ _resultobj = wxPyMake_wxObject(_result); } + return _resultobj; +} + +#define wxXmlResourceHandler_GetInstance(_swigobj) (_swigobj->GetInstance()) +static PyObject *_wrap_wxXmlResourceHandler_GetInstance(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxObject * _result; + wxPyXmlResourceHandler * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlResourceHandler_GetInstance",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetInstance. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxObject *)wxXmlResourceHandler_GetInstance(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ _resultobj = wxPyMake_wxObject(_result); } + return _resultobj; +} + +#define wxXmlResourceHandler_GetParentAsWindow(_swigobj) (_swigobj->GetParentAsWindow()) +static PyObject *_wrap_wxXmlResourceHandler_GetParentAsWindow(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _result; + wxPyXmlResourceHandler * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlResourceHandler_GetParentAsWindow",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetParentAsWindow. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxWindow *)wxXmlResourceHandler_GetParentAsWindow(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ _resultobj = wxPyMake_wxObject(_result); } + return _resultobj; +} + +#define wxXmlResourceHandler_GetInstanceAsWindow(_swigobj) (_swigobj->GetInstanceAsWindow()) +static PyObject *_wrap_wxXmlResourceHandler_GetInstanceAsWindow(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _result; + wxPyXmlResourceHandler * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlResourceHandler_GetInstanceAsWindow",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetInstanceAsWindow. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxWindow *)wxXmlResourceHandler_GetInstanceAsWindow(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ _resultobj = wxPyMake_wxObject(_result); } + return _resultobj; +} + +#define wxXmlResourceHandler_IsOfClass(_swigobj,_swigarg0,_swigarg1) (_swigobj->IsOfClass(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxXmlResourceHandler_IsOfClass(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxPyXmlResourceHandler * _arg0; + wxXmlNode * _arg1; + wxString * _arg2; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + PyObject * _obj2 = 0; + char *_kwnames[] = { "self","node","classname", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxXmlResourceHandler_IsOfClass",_kwnames,&_argo0,&_argo1,&_obj2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_IsOfClass. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlResourceHandler_IsOfClass. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxXmlResourceHandler_IsOfClass(_arg0,_arg1,*_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj2) + delete _arg2; +} + return _resultobj; +} + +#define wxXmlResourceHandler_GetNodeContent(_swigobj,_swigarg0) (_swigobj->GetNodeContent(_swigarg0)) +static PyObject *_wrap_wxXmlResourceHandler_GetNodeContent(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxPyXmlResourceHandler * _arg0; + wxXmlNode * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","node", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlResourceHandler_GetNodeContent",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetNodeContent. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlResourceHandler_GetNodeContent. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxXmlResourceHandler_GetNodeContent(_arg0,_arg1)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + delete _result; +} + return _resultobj; +} + +#define wxXmlResourceHandler_HasParam(_swigobj,_swigarg0) (_swigobj->HasParam(_swigarg0)) +static PyObject *_wrap_wxXmlResourceHandler_HasParam(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxPyXmlResourceHandler * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","param", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlResourceHandler_HasParam",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_HasParam. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxXmlResourceHandler_HasParam(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxXmlResourceHandler_GetParamNode(_swigobj,_swigarg0) (_swigobj->GetParamNode(_swigarg0)) +static PyObject *_wrap_wxXmlResourceHandler_GetParamNode(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxXmlNode * _result; + wxPyXmlResourceHandler * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","param", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlResourceHandler_GetParamNode",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetParamNode. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxXmlNode *)wxXmlResourceHandler_GetParamNode(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxXmlNode_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxXmlResourceHandler_GetParamValue(_swigobj,_swigarg0) (_swigobj->GetParamValue(_swigarg0)) +static PyObject *_wrap_wxXmlResourceHandler_GetParamValue(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxPyXmlResourceHandler * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","param", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlResourceHandler_GetParamValue",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetParamValue. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxXmlResourceHandler_GetParamValue(_arg0,*_arg1)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + if (_obj1) + delete _arg1; +} +{ + delete _result; +} + return _resultobj; +} + +#define wxXmlResourceHandler_AddStyle(_swigobj,_swigarg0,_swigarg1) (_swigobj->AddStyle(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxXmlResourceHandler_AddStyle(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPyXmlResourceHandler * _arg0; + wxString * _arg1; + int _arg2; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","name","value", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi:wxXmlResourceHandler_AddStyle",_kwnames,&_argo0,&_obj1,&_arg2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_AddStyle. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlResourceHandler_AddStyle(_arg0,*_arg1,_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxXmlResourceHandler_AddWindowStyles(_swigobj) (_swigobj->AddWindowStyles()) +static PyObject *_wrap_wxXmlResourceHandler_AddWindowStyles(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPyXmlResourceHandler * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlResourceHandler_AddWindowStyles",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_AddWindowStyles. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlResourceHandler_AddWindowStyles(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxXmlResourceHandler_GetStyle(_swigobj,_swigarg0,_swigarg1) (_swigobj->GetStyle(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxXmlResourceHandler_GetStyle(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxPyXmlResourceHandler * _arg0; + wxString * _arg1 = (wxString *) &wxPyStyleString; + int _arg2 = (int ) 0; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","param","defaults", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|Oi:wxXmlResourceHandler_GetStyle",_kwnames,&_argo0,&_obj1,&_arg2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetStyle. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } + if (_obj1) +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxXmlResourceHandler_GetStyle(_arg0,*_arg1,_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxXmlResourceHandler_GetText(_swigobj,_swigarg0,_swigarg1) (_swigobj->GetText(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxXmlResourceHandler_GetText(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxPyXmlResourceHandler * _arg0; + wxString * _arg1; + bool _arg2 = (bool ) TRUE; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + int tempbool2 = (int) TRUE; + char *_kwnames[] = { "self","param","translate", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxXmlResourceHandler_GetText",_kwnames,&_argo0,&_obj1,&tempbool2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetText. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} + _arg2 = (bool ) tempbool2; +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxXmlResourceHandler_GetText(_arg0,*_arg1,_arg2)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + if (_obj1) + delete _arg1; +} +{ + delete _result; +} + return _resultobj; +} + +#define wxXmlResourceHandler_GetID(_swigobj) (_swigobj->GetID()) +static PyObject *_wrap_wxXmlResourceHandler_GetID(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxPyXmlResourceHandler * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlResourceHandler_GetID",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetID. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxXmlResourceHandler_GetID(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxXmlResourceHandler_GetName(_swigobj) (_swigobj->GetName()) +static PyObject *_wrap_wxXmlResourceHandler_GetName(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxPyXmlResourceHandler * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlResourceHandler_GetName",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetName. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxXmlResourceHandler_GetName(_arg0)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + delete _result; +} + return _resultobj; +} + +#define wxXmlResourceHandler_GetBool(_swigobj,_swigarg0,_swigarg1) (_swigobj->GetBool(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxXmlResourceHandler_GetBool(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxPyXmlResourceHandler * _arg0; + wxString * _arg1; + bool _arg2 = (bool ) FALSE; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + int tempbool2 = (int) FALSE; + char *_kwnames[] = { "self","param","defaultv", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxXmlResourceHandler_GetBool",_kwnames,&_argo0,&_obj1,&tempbool2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetBool. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} + _arg2 = (bool ) tempbool2; +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxXmlResourceHandler_GetBool(_arg0,*_arg1,_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxXmlResourceHandler_GetLong(_swigobj,_swigarg0,_swigarg1) (_swigobj->GetLong(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxXmlResourceHandler_GetLong(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + long _result; + wxPyXmlResourceHandler * _arg0; + wxString * _arg1; + long _arg2 = (long ) 0; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","param","defaultv", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|l:wxXmlResourceHandler_GetLong",_kwnames,&_argo0,&_obj1,&_arg2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetLong. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (long )wxXmlResourceHandler_GetLong(_arg0,*_arg1,_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("l",_result); +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxXmlResourceHandler_GetColour(_swigobj,_swigarg0) (_swigobj->GetColour(_swigarg0)) +static PyObject *_wrap_wxXmlResourceHandler_GetColour(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxColour * _result; + wxPyXmlResourceHandler * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","param", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlResourceHandler_GetColour",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetColour. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxColour (wxXmlResourceHandler_GetColour(_arg0,*_arg1)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} SWIG_MakePtr(_ptemp, (void *) _result,"_wxColour_p"); + _resultobj = Py_BuildValue("s",_ptemp); +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxXmlResourceHandler_GetSize(_swigobj,_swigarg0) (_swigobj->GetSize(_swigarg0)) +static PyObject *_wrap_wxXmlResourceHandler_GetSize(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxSize * _result; + wxPyXmlResourceHandler * _arg0; + wxString * _arg1 = (wxString *) &wxPySizeString; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","param", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:wxXmlResourceHandler_GetSize",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetSize. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } + if (_obj1) +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxSize (wxXmlResourceHandler_GetSize(_arg0,*_arg1)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} SWIG_MakePtr(_ptemp, (void *) _result,"_wxSize_p"); + _resultobj = Py_BuildValue("s",_ptemp); +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxXmlResourceHandler_GetPosition(_swigobj,_swigarg0) (_swigobj->GetPosition(_swigarg0)) +static PyObject *_wrap_wxXmlResourceHandler_GetPosition(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPoint * _result; + wxPyXmlResourceHandler * _arg0; + wxString * _arg1 = (wxString *) &wxPyPosString; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","param", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:wxXmlResourceHandler_GetPosition",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetPosition. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } + if (_obj1) +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxPoint (wxXmlResourceHandler_GetPosition(_arg0,*_arg1)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} SWIG_MakePtr(_ptemp, (void *) _result,"_wxPoint_p"); + _resultobj = Py_BuildValue("s",_ptemp); +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxXmlResourceHandler_GetDimension(_swigobj,_swigarg0,_swigarg1) (_swigobj->GetDimension(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxXmlResourceHandler_GetDimension(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxCoord _result; + wxPyXmlResourceHandler * _arg0; + wxString * _arg1; + wxCoord _arg2 = (wxCoord ) 0; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","param","defaultv", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxXmlResourceHandler_GetDimension",_kwnames,&_argo0,&_obj1,&_arg2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetDimension. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxCoord )wxXmlResourceHandler_GetDimension(_arg0,*_arg1,_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxXmlResourceHandler_GetBitmap(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->GetBitmap(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_wxXmlResourceHandler_GetBitmap(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxBitmap * _result; + wxPyXmlResourceHandler * _arg0; + wxString * _arg1 = (wxString *) &wxPyBitmapString; + wxArtClient * _arg2 = (wxArtClient *) &wxART_OTHER; + wxSize * _arg3 = (wxSize *) &wxDefaultSize; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + PyObject * _argo2 = 0; + wxSize temp; + PyObject * _obj3 = 0; + char *_kwnames[] = { "self","param","defaultArtClient","size", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OOO:wxXmlResourceHandler_GetBitmap",_kwnames,&_argo0,&_obj1,&_argo2,&_obj3)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetBitmap. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } + if (_obj1) +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} + if (_argo2) { + if (_argo2 == Py_None) { _arg2 = NULL; } + else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxArtClient_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxXmlResourceHandler_GetBitmap. Expected _wxArtClient_p."); + return NULL; + } + } + if (_obj3) +{ + _arg3 = &temp; + if (! wxSize_helper(_obj3, &_arg3)) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxBitmap (wxXmlResourceHandler_GetBitmap(_arg0,*_arg1,*_arg2,*_arg3)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} SWIG_MakePtr(_ptemp, (void *) _result,"_wxBitmap_p"); + _resultobj = Py_BuildValue("s",_ptemp); +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxXmlResourceHandler_GetIcon(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->GetIcon(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_wxXmlResourceHandler_GetIcon(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxIcon * _result; + wxPyXmlResourceHandler * _arg0; + wxString * _arg1 = (wxString *) &wxPyIconString; + wxArtClient * _arg2 = (wxArtClient *) &wxART_OTHER; + wxSize * _arg3 = (wxSize *) &wxDefaultSize; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + PyObject * _argo2 = 0; + wxSize temp; + PyObject * _obj3 = 0; + char *_kwnames[] = { "self","param","defaultArtClient","size", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OOO:wxXmlResourceHandler_GetIcon",_kwnames,&_argo0,&_obj1,&_argo2,&_obj3)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetIcon. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } + if (_obj1) +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} + if (_argo2) { + if (_argo2 == Py_None) { _arg2 = NULL; } + else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxArtClient_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxXmlResourceHandler_GetIcon. Expected _wxArtClient_p."); + return NULL; + } + } + if (_obj3) +{ + _arg3 = &temp; + if (! wxSize_helper(_obj3, &_arg3)) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxIcon (wxXmlResourceHandler_GetIcon(_arg0,*_arg1,*_arg2,*_arg3)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} SWIG_MakePtr(_ptemp, (void *) _result,"_wxIcon_p"); + _resultobj = Py_BuildValue("s",_ptemp); +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxXmlResourceHandler_GetFont(_swigobj,_swigarg0) (_swigobj->GetFont(_swigarg0)) +static PyObject *_wrap_wxXmlResourceHandler_GetFont(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxFont * _result; + wxPyXmlResourceHandler * _arg0; + wxString * _arg1 = (wxString *) &wxPyFontString; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","param", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:wxXmlResourceHandler_GetFont",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetFont. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } + if (_obj1) +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxFont (wxXmlResourceHandler_GetFont(_arg0,*_arg1)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} SWIG_MakePtr(_ptemp, (void *) _result,"_wxFont_p"); + _resultobj = Py_BuildValue("s",_ptemp); +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxXmlResourceHandler_SetupWindow(_swigobj,_swigarg0) (_swigobj->SetupWindow(_swigarg0)) +static PyObject *_wrap_wxXmlResourceHandler_SetupWindow(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPyXmlResourceHandler * _arg0; + wxWindow * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","wnd", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlResourceHandler_SetupWindow",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_SetupWindow. Expected _wxPyXmlResourceHandler_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 wxXmlResourceHandler_SetupWindow. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlResourceHandler_SetupWindow(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxXmlResourceHandler_CreateChildren(_swigobj,_swigarg0,_swigarg1) (_swigobj->CreateChildren(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxXmlResourceHandler_CreateChildren(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPyXmlResourceHandler * _arg0; + wxObject * _arg1; + bool _arg2 = (bool ) FALSE; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + int tempbool2 = (int) FALSE; + char *_kwnames[] = { "self","parent","this_hnd_only", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxXmlResourceHandler_CreateChildren",_kwnames,&_argo0,&_argo1,&tempbool2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_CreateChildren. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxObject_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlResourceHandler_CreateChildren. Expected _wxObject_p."); + return NULL; + } + } + _arg2 = (bool ) tempbool2; +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlResourceHandler_CreateChildren(_arg0,_arg1,_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxXmlResourceHandler_CreateChildrenPrivately(_swigobj,_swigarg0,_swigarg1) (_swigobj->CreateChildrenPrivately(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxXmlResourceHandler_CreateChildrenPrivately(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPyXmlResourceHandler * _arg0; + wxObject * _arg1; + wxXmlNode * _arg2 = (wxXmlNode *) NULL; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + PyObject * _argo2 = 0; + char *_kwnames[] = { "self","parent","rootnode", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|O:wxXmlResourceHandler_CreateChildrenPrivately",_kwnames,&_argo0,&_argo1,&_argo2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_CreateChildrenPrivately. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxObject_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlResourceHandler_CreateChildrenPrivately. Expected _wxObject_p."); + return NULL; + } + } + if (_argo2) { + if (_argo2 == Py_None) { _arg2 = NULL; } + else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxXmlResourceHandler_CreateChildrenPrivately. Expected _wxXmlNode_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxXmlResourceHandler_CreateChildrenPrivately(_arg0,_arg1,_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxXmlResourceHandler_CreateResFromNode(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->CreateResFromNode(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_wxXmlResourceHandler_CreateResFromNode(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxObject * _result; + wxPyXmlResourceHandler * _arg0; + wxXmlNode * _arg1; + wxObject * _arg2; + wxObject * _arg3 = (wxObject *) NULL; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + PyObject * _argo2 = 0; + PyObject * _argo3 = 0; + char *_kwnames[] = { "self","node","parent","instance", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO|O:wxXmlResourceHandler_CreateResFromNode",_kwnames,&_argo0,&_argo1,&_argo2,&_argo3)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_CreateResFromNode. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxXmlNode_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlResourceHandler_CreateResFromNode. Expected _wxXmlNode_p."); + return NULL; + } + } + if (_argo2) { + if (_argo2 == Py_None) { _arg2 = NULL; } + else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxObject_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxXmlResourceHandler_CreateResFromNode. Expected _wxObject_p."); + return NULL; + } + } + if (_argo3) { + if (_argo3 == Py_None) { _arg3 = NULL; } + else if (SWIG_GetPtrObj(_argo3,(void **) &_arg3,"_wxObject_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 4 of wxXmlResourceHandler_CreateResFromNode. Expected _wxObject_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxObject *)wxXmlResourceHandler_CreateResFromNode(_arg0,_arg1,_arg2,_arg3); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ _resultobj = wxPyMake_wxObject(_result); } + return _resultobj; +} + +#define wxXmlResourceHandler_GetCurFileSystem(_swigobj) (_swigobj->GetCurFileSystem()) +static PyObject *_wrap_wxXmlResourceHandler_GetCurFileSystem(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxFileSystem * _result; + wxPyXmlResourceHandler * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlResourceHandler_GetCurFileSystem",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlResourceHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResourceHandler_GetCurFileSystem. Expected _wxPyXmlResourceHandler_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxFileSystem & _result_ref = wxXmlResourceHandler_GetCurFileSystem(_arg0); + _result = (wxFileSystem *) &_result_ref; + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ _resultobj = wxPyMake_wxObject(_result); } + return _resultobj; +} + static PyMethodDef xrccMethods[] = { + { "wxXmlResourceHandler_GetCurFileSystem", (PyCFunction) _wrap_wxXmlResourceHandler_GetCurFileSystem, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_CreateResFromNode", (PyCFunction) _wrap_wxXmlResourceHandler_CreateResFromNode, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_CreateChildrenPrivately", (PyCFunction) _wrap_wxXmlResourceHandler_CreateChildrenPrivately, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_CreateChildren", (PyCFunction) _wrap_wxXmlResourceHandler_CreateChildren, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_SetupWindow", (PyCFunction) _wrap_wxXmlResourceHandler_SetupWindow, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetFont", (PyCFunction) _wrap_wxXmlResourceHandler_GetFont, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetIcon", (PyCFunction) _wrap_wxXmlResourceHandler_GetIcon, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetBitmap", (PyCFunction) _wrap_wxXmlResourceHandler_GetBitmap, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetDimension", (PyCFunction) _wrap_wxXmlResourceHandler_GetDimension, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetPosition", (PyCFunction) _wrap_wxXmlResourceHandler_GetPosition, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetSize", (PyCFunction) _wrap_wxXmlResourceHandler_GetSize, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetColour", (PyCFunction) _wrap_wxXmlResourceHandler_GetColour, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetLong", (PyCFunction) _wrap_wxXmlResourceHandler_GetLong, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetBool", (PyCFunction) _wrap_wxXmlResourceHandler_GetBool, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetName", (PyCFunction) _wrap_wxXmlResourceHandler_GetName, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetID", (PyCFunction) _wrap_wxXmlResourceHandler_GetID, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetText", (PyCFunction) _wrap_wxXmlResourceHandler_GetText, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetStyle", (PyCFunction) _wrap_wxXmlResourceHandler_GetStyle, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_AddWindowStyles", (PyCFunction) _wrap_wxXmlResourceHandler_AddWindowStyles, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_AddStyle", (PyCFunction) _wrap_wxXmlResourceHandler_AddStyle, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetParamValue", (PyCFunction) _wrap_wxXmlResourceHandler_GetParamValue, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetParamNode", (PyCFunction) _wrap_wxXmlResourceHandler_GetParamNode, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_HasParam", (PyCFunction) _wrap_wxXmlResourceHandler_HasParam, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetNodeContent", (PyCFunction) _wrap_wxXmlResourceHandler_GetNodeContent, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_IsOfClass", (PyCFunction) _wrap_wxXmlResourceHandler_IsOfClass, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetInstanceAsWindow", (PyCFunction) _wrap_wxXmlResourceHandler_GetInstanceAsWindow, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetParentAsWindow", (PyCFunction) _wrap_wxXmlResourceHandler_GetParentAsWindow, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetInstance", (PyCFunction) _wrap_wxXmlResourceHandler_GetInstance, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetParent", (PyCFunction) _wrap_wxXmlResourceHandler_GetParent, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetClass", (PyCFunction) _wrap_wxXmlResourceHandler_GetClass, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetNode", (PyCFunction) _wrap_wxXmlResourceHandler_GetNode, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_GetResource", (PyCFunction) _wrap_wxXmlResourceHandler_GetResource, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_SetParentResource", (PyCFunction) _wrap_wxXmlResourceHandler_SetParentResource, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler_CreateResource", (PyCFunction) _wrap_wxXmlResourceHandler_CreateResource, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResourceHandler__setCallbackInfo", (PyCFunction) _wrap_wxXmlResourceHandler__setCallbackInfo, METH_VARARGS | METH_KEYWORDS }, + { "new_wxXmlResourceHandler", (PyCFunction) _wrap_new_wxXmlResourceHandler, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlDocument_GetEncoding", (PyCFunction) _wrap_wxXmlDocument_GetEncoding, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlDocument_SetFileEncoding", (PyCFunction) _wrap_wxXmlDocument_SetFileEncoding, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlDocument_SetVersion", (PyCFunction) _wrap_wxXmlDocument_SetVersion, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlDocument_SetRoot", (PyCFunction) _wrap_wxXmlDocument_SetRoot, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlDocument_GetFileEncoding", (PyCFunction) _wrap_wxXmlDocument_GetFileEncoding, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlDocument_GetVersion", (PyCFunction) _wrap_wxXmlDocument_GetVersion, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlDocument_GetRoot", (PyCFunction) _wrap_wxXmlDocument_GetRoot, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlDocument_IsOk", (PyCFunction) _wrap_wxXmlDocument_IsOk, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlDocument_SaveToStream", (PyCFunction) _wrap_wxXmlDocument_SaveToStream, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlDocument_Save", (PyCFunction) _wrap_wxXmlDocument_Save, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlDocument_LoadFromStream", (PyCFunction) _wrap_wxXmlDocument_LoadFromStream, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlDocument_Load", (PyCFunction) _wrap_wxXmlDocument_Load, METH_VARARGS | METH_KEYWORDS }, + { "delete_wxXmlDocument", (PyCFunction) _wrap_delete_wxXmlDocument, METH_VARARGS | METH_KEYWORDS }, + { "new_wxEmptyXmlDocument", (PyCFunction) _wrap_new_wxEmptyXmlDocument, METH_VARARGS | METH_KEYWORDS }, + { "new_wxXmlDocumentFromStream", (PyCFunction) _wrap_new_wxXmlDocumentFromStream, METH_VARARGS | METH_KEYWORDS }, + { "new_wxXmlDocument", (PyCFunction) _wrap_new_wxXmlDocument, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlNode_SetProperties", (PyCFunction) _wrap_wxXmlNode_SetProperties, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlNode_SetChildren", (PyCFunction) _wrap_wxXmlNode_SetChildren, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlNode_SetNext", (PyCFunction) _wrap_wxXmlNode_SetNext, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlNode_SetParent", (PyCFunction) _wrap_wxXmlNode_SetParent, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlNode_SetContent", (PyCFunction) _wrap_wxXmlNode_SetContent, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlNode_SetName", (PyCFunction) _wrap_wxXmlNode_SetName, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlNode_SetType", (PyCFunction) _wrap_wxXmlNode_SetType, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlNode_HasProp", (PyCFunction) _wrap_wxXmlNode_HasProp, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlNode_GetPropVal", (PyCFunction) _wrap_wxXmlNode_GetPropVal, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlNode_GetProperties", (PyCFunction) _wrap_wxXmlNode_GetProperties, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlNode_GetChildren", (PyCFunction) _wrap_wxXmlNode_GetChildren, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlNode_GetNext", (PyCFunction) _wrap_wxXmlNode_GetNext, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlNode_GetParent", (PyCFunction) _wrap_wxXmlNode_GetParent, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlNode_GetContent", (PyCFunction) _wrap_wxXmlNode_GetContent, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlNode_GetName", (PyCFunction) _wrap_wxXmlNode_GetName, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlNode_GetType", (PyCFunction) _wrap_wxXmlNode_GetType, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlNode_DeleteProperty", (PyCFunction) _wrap_wxXmlNode_DeleteProperty, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlNode_AddPropertyName", (PyCFunction) _wrap_wxXmlNode_AddPropertyName, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlNode_AddProperty", (PyCFunction) _wrap_wxXmlNode_AddProperty, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlNode_RemoveChild", (PyCFunction) _wrap_wxXmlNode_RemoveChild, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlNode_InsertChild", (PyCFunction) _wrap_wxXmlNode_InsertChild, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlNode_AddChild", (PyCFunction) _wrap_wxXmlNode_AddChild, METH_VARARGS | METH_KEYWORDS }, + { "new_wxXmlNodeEasy", (PyCFunction) _wrap_new_wxXmlNodeEasy, METH_VARARGS | METH_KEYWORDS }, + { "delete_wxXmlNode", (PyCFunction) _wrap_delete_wxXmlNode, METH_VARARGS | METH_KEYWORDS }, + { "new_wxXmlNode", (PyCFunction) _wrap_new_wxXmlNode, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlProperty_SetNext", (PyCFunction) _wrap_wxXmlProperty_SetNext, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlProperty_SetValue", (PyCFunction) _wrap_wxXmlProperty_SetValue, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlProperty_SetName", (PyCFunction) _wrap_wxXmlProperty_SetName, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlProperty_GetNext", (PyCFunction) _wrap_wxXmlProperty_GetNext, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlProperty_GetValue", (PyCFunction) _wrap_wxXmlProperty_GetValue, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlProperty_GetName", (PyCFunction) _wrap_wxXmlProperty_GetName, METH_VARARGS | METH_KEYWORDS }, + { "new_wxXmlProperty", (PyCFunction) _wrap_new_wxXmlProperty, METH_VARARGS | METH_KEYWORDS }, { "wxXmlResource_Set", (PyCFunction) _wrap_wxXmlResource_Set, METH_VARARGS | METH_KEYWORDS }, { "wxXmlResource_Get", (PyCFunction) _wrap_wxXmlResource_Get, METH_VARARGS | METH_KEYWORDS }, { "wxXmlResource_CompareVersion", (PyCFunction) _wrap_wxXmlResource_CompareVersion, METH_VARARGS | METH_KEYWORDS }, @@ -1136,6 +4970,9 @@ static PyMethodDef xrccMethods[] = { { "wxXmlResource_AttachUnknownControl", (PyCFunction) _wrap_wxXmlResource_AttachUnknownControl, METH_VARARGS | METH_KEYWORDS }, { "wxXmlResource_LoadIcon", (PyCFunction) _wrap_wxXmlResource_LoadIcon, METH_VARARGS | METH_KEYWORDS }, { "wxXmlResource_LoadBitmap", (PyCFunction) _wrap_wxXmlResource_LoadBitmap, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResource_LoadOnObject", (PyCFunction) _wrap_wxXmlResource_LoadOnObject, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResource_LoadObject", (PyCFunction) _wrap_wxXmlResource_LoadObject, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResource_LoadOnFrame", (PyCFunction) _wrap_wxXmlResource_LoadOnFrame, METH_VARARGS | METH_KEYWORDS }, { "wxXmlResource_LoadFrame", (PyCFunction) _wrap_wxXmlResource_LoadFrame, METH_VARARGS | METH_KEYWORDS }, { "wxXmlResource_LoadOnPanel", (PyCFunction) _wrap_wxXmlResource_LoadOnPanel, METH_VARARGS | METH_KEYWORDS }, { "wxXmlResource_LoadPanel", (PyCFunction) _wrap_wxXmlResource_LoadPanel, METH_VARARGS | METH_KEYWORDS }, @@ -1146,6 +4983,7 @@ static PyMethodDef xrccMethods[] = { { "wxXmlResource_LoadMenuBar", (PyCFunction) _wrap_wxXmlResource_LoadMenuBar, METH_VARARGS | METH_KEYWORDS }, { "wxXmlResource_LoadMenu", (PyCFunction) _wrap_wxXmlResource_LoadMenu, METH_VARARGS | METH_KEYWORDS }, { "wxXmlResource_ClearHandlers", (PyCFunction) _wrap_wxXmlResource_ClearHandlers, METH_VARARGS | METH_KEYWORDS }, + { "wxXmlResource_InsertHandler", (PyCFunction) _wrap_wxXmlResource_InsertHandler, METH_VARARGS | METH_KEYWORDS }, { "wxXmlResource_AddHandler", (PyCFunction) _wrap_wxXmlResource_AddHandler, METH_VARARGS | METH_KEYWORDS }, { "wxXmlResource_InitAllHandlers", (PyCFunction) _wrap_wxXmlResource_InitAllHandlers, METH_VARARGS | METH_KEYWORDS }, { "wxXmlResource_LoadFromString", (PyCFunction) _wrap_wxXmlResource_LoadFromString, METH_VARARGS | METH_KEYWORDS }, @@ -1211,6 +5049,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_unsigned_short","_wxDateTime_t",0}, { "_unsigned_short","_WXTYPE",0}, { "_unsigned_short","_short",0}, + { "_wxObject","_wxPyXmlResourceHandler",SwigwxPyXmlResourceHandlerTowxObject}, + { "_wxObject","_wxXmlDocument",SwigwxXmlDocumentTowxObject}, { "_wxObject","_wxXmlResource",SwigwxXmlResourceTowxObject}, { "_signed_short","_WXTYPE",0}, { "_signed_short","_short",0}, @@ -1276,6 +5116,19 @@ SWIGEXPORT(void) initxrcc() { d = PyModule_GetDict(m); PyDict_SetItemString(d,"wxXRC_USE_LOCALE", PyInt_FromLong((long) wxXRC_USE_LOCALE)); PyDict_SetItemString(d,"wxXRC_NO_SUBCLASSING", PyInt_FromLong((long) wxXRC_NO_SUBCLASSING)); + PyDict_SetItemString(d,"wxXML_ELEMENT_NODE", PyInt_FromLong((long) wxXML_ELEMENT_NODE)); + PyDict_SetItemString(d,"wxXML_ATTRIBUTE_NODE", PyInt_FromLong((long) wxXML_ATTRIBUTE_NODE)); + PyDict_SetItemString(d,"wxXML_TEXT_NODE", PyInt_FromLong((long) wxXML_TEXT_NODE)); + PyDict_SetItemString(d,"wxXML_CDATA_SECTION_NODE", PyInt_FromLong((long) wxXML_CDATA_SECTION_NODE)); + PyDict_SetItemString(d,"wxXML_ENTITY_REF_NODE", PyInt_FromLong((long) wxXML_ENTITY_REF_NODE)); + PyDict_SetItemString(d,"wxXML_ENTITY_NODE", PyInt_FromLong((long) wxXML_ENTITY_NODE)); + PyDict_SetItemString(d,"wxXML_PI_NODE", PyInt_FromLong((long) wxXML_PI_NODE)); + PyDict_SetItemString(d,"wxXML_COMMENT_NODE", PyInt_FromLong((long) wxXML_COMMENT_NODE)); + PyDict_SetItemString(d,"wxXML_DOCUMENT_NODE", PyInt_FromLong((long) wxXML_DOCUMENT_NODE)); + PyDict_SetItemString(d,"wxXML_DOCUMENT_TYPE_NODE", PyInt_FromLong((long) wxXML_DOCUMENT_TYPE_NODE)); + PyDict_SetItemString(d,"wxXML_DOCUMENT_FRAG_NODE", PyInt_FromLong((long) wxXML_DOCUMENT_FRAG_NODE)); + PyDict_SetItemString(d,"wxXML_NOTATION_NODE", PyInt_FromLong((long) wxXML_NOTATION_NODE)); + PyDict_SetItemString(d,"wxXML_HTML_DOCUMENT_NODE", PyInt_FromLong((long) wxXML_HTML_DOCUMENT_NODE)); wxClassInfo::CleanUpClasses(); diff --git a/wxPython/contrib/xrc/xrc.i b/wxPython/contrib/xrc/xrc.i index 6783f33e8d..04f3c39471 100644 --- a/wxPython/contrib/xrc/xrc.i +++ b/wxPython/contrib/xrc/xrc.i @@ -15,6 +15,8 @@ %{ #include "wxPython.h" +#include "pyistream.h" +#include "wx/xrc/xml.h" #include "wx/xrc/xmlres.h" #include #include @@ -31,7 +33,21 @@ %extern events.i %extern controls.i +%extern streams.i + +//--------------------------------------------------------------------------- +%{ + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyEmptyString(wxT("")); + static const wxString wxPyUTF8String(wxT("UTF-8")); + static const wxString wxPyStyleString(wxT("style")); + static const wxString wxPySizeString(wxT("size")); + static const wxString wxPyPosString(wxT("pos")); + static const wxString wxPyBitmapString(wxT("bitmap")); + static const wxString wxPyIconString(wxT("icon")); + static const wxString wxPyFontString(wxT("font")); +%} //--------------------------------------------------------------------------- enum wxXmlResourceFlags @@ -104,7 +120,10 @@ public: // wxTextCtrlXmlHandler, wxHtmlWindowXmlHandler. XML resource compiler // (xmlres) can create include file that contains initialization code for // all controls used within the resource. - void AddHandler(wxXmlResourceHandler *handler); + void AddHandler(wxPyXmlResourceHandler *handler); + + // Add a new handler at the begining of the handler list + void InsertHandler(wxPyXmlResourceHandler *handler); // Removes all handlers void ClearHandlers(); @@ -135,9 +154,22 @@ public: wxPanel *LoadPanel(wxWindow *parent, const wxString& name); %name(LoadOnPanel)bool LoadPanel(wxPanel *panel, wxWindow *parent, const wxString& name); - bool LoadFrame(wxFrame* frame, wxWindow *parent, const wxString& name); + // Load a frame's contents from a resource + wxFrame *LoadFrame(wxWindow* parent, const wxString& name); + %name(LoadOnFrame)bool LoadFrame(wxFrame* frame, wxWindow *parent, const wxString& name); - // Loads bitmap or icon resource from file: + // Load an object from the resource specifying both the resource name and + // the classname. This lets you load nonstandard container windows. + wxObject *LoadObject(wxWindow *parent, const wxString& name, + const wxString& classname); + + // Load an object from the resource specifying both the resource name and + // the classname. This form lets you finish the creation of an existing + // instance. + %name(LoadOnObject)bool LoadObject(wxObject *instance, wxWindow *parent, const wxString& name, + const wxString& classname); + + // Loads bitmap or icon resource from file: wxBitmap LoadBitmap(const wxString& name); wxIcon LoadIcon(const wxString& name); @@ -180,9 +212,448 @@ XMLCTRL = XRCCTRL " //---------------------------------------------------------------------- +//---------------------------------------------------------------------- +// In order to provide wrappers for wxXmlResourceHandler we need to also +// provide the classes for representing and parsing XML. + + +// Represents XML node type. +enum wxXmlNodeType +{ + // note: values are synchronized with xmlElementType from libxml + wxXML_ELEMENT_NODE, + wxXML_ATTRIBUTE_NODE, + wxXML_TEXT_NODE, + wxXML_CDATA_SECTION_NODE, + wxXML_ENTITY_REF_NODE, + wxXML_ENTITY_NODE, + wxXML_PI_NODE, + wxXML_COMMENT_NODE, + wxXML_DOCUMENT_NODE, + wxXML_DOCUMENT_TYPE_NODE, + wxXML_DOCUMENT_FRAG_NODE, + wxXML_NOTATION_NODE, + wxXML_HTML_DOCUMENT_NODE +}; + + + +// Represents node property(ies). +// Example: in "src" is property with value +// "hello.gif" and "id" is property with value "3". +class wxXmlProperty +{ +public: + wxXmlProperty(const wxString& name = wxPyEmptyString, + const wxString& value = wxPyEmptyString, + wxXmlProperty *next = NULL); + + wxString GetName() const; + wxString GetValue() const; + wxXmlProperty *GetNext() const; + + void SetName(const wxString& name); + void SetValue(const wxString& value); + void SetNext(wxXmlProperty *next); +}; + + + + +// Represents node in XML document. Node has name and may have content +// and properties. Most common node types are wxXML_TEXT_NODE (name and props +// are irrelevant) and wxXML_ELEMENT_NODE (e.g. in hi there is +// element with name="title", irrelevant content and one child (wxXML_TEXT_NODE +// with content="hi"). +// +// If wxUSE_UNICODE is 0, all strings are encoded in the encoding given to Load +// (default is UTF-8). +class wxXmlNode +{ +public: + wxXmlNode(wxXmlNode *parent = NULL, + wxXmlNodeType type = 0, + const wxString& name = wxPyEmptyString, + const wxString& content = wxPyEmptyString, + wxXmlProperty *props = NULL, + wxXmlNode *next = NULL); + ~wxXmlNode(); + + + // user-friendly creation: + %name(wxXmlNodeEasy)wxXmlNode(wxXmlNodeType type, const wxString& name, + const wxString& content = wxPyEmptyString); + + void AddChild(wxXmlNode *child); + void InsertChild(wxXmlNode *child, wxXmlNode *before_node); + bool RemoveChild(wxXmlNode *child); + void AddProperty(wxXmlProperty *prop); + %name(AddPropertyName)void AddProperty(const wxString& name, const wxString& value); + bool DeleteProperty(const wxString& name); + + // access methods: + wxXmlNodeType GetType() const; + wxString GetName() const; + wxString GetContent() const; + + wxXmlNode *GetParent() const; + wxXmlNode *GetNext() const; + wxXmlNode *GetChildren() const; + + wxXmlProperty *GetProperties() const; + wxString GetPropVal(const wxString& propName, + const wxString& defaultVal) const; + bool HasProp(const wxString& propName) const; + + void SetType(wxXmlNodeType type); + void SetName(const wxString& name); + void SetContent(const wxString& con); + + void SetParent(wxXmlNode *parent); + void SetNext(wxXmlNode *next); + void SetChildren(wxXmlNode *child); + + void SetProperties(wxXmlProperty *prop); +}; + + + +// This class holds XML data/document as parsed by XML parser. +class wxXmlDocument : public wxObject +{ +public: + wxXmlDocument(const wxString& filename, + const wxString& encoding = wxPyUTF8String); + %name(wxXmlDocumentFromStream)wxXmlDocument(wxInputStream& stream, + const wxString& encoding = wxPyUTF8String); + %name(wxEmptyXmlDocument)wxXmlDocument(); + + ~wxXmlDocument(); + + + // Parses .xml file and loads data. Returns TRUE on success, FALSE + // otherwise. + bool Load(const wxString& filename, + const wxString& encoding = wxPyUTF8String); + %name(LoadFromStream)bool Load(wxInputStream& stream, + const wxString& encoding = wxPyUTF8String); + + // Saves document as .xml file. + bool Save(const wxString& filename) const; + %name(SaveToStream)bool Save(wxOutputStream& stream) const; + + bool IsOk() const; + + // Returns root node of the document. + wxXmlNode *GetRoot() const; + + // Returns version of document (may be empty). + wxString GetVersion() const; + + // Returns encoding of document (may be empty). + // Note: this is the encoding original file was saved in, *not* the + // encoding of in-memory representation! + wxString GetFileEncoding() const; + + // Write-access methods: + void SetRoot(wxXmlNode *node); + void SetVersion(const wxString& version); + void SetFileEncoding(const wxString& encoding); + + %addmethods { + // Returns encoding of in-memory representation of the document (same + // as passed to Load or ctor, defaults to UTF-8). NB: this is + // meaningless in Unicode build where data are stored as wchar_t* + wxString GetEncoding() { + #if wxUSE_UNICODE + return wxPyEmptyString; + #else + return self->GetEncoding(); + #endif + } + } +}; + + +//---------------------------------------------------------------------- +// And now for wxXmlResourceHandler... + + + +%{ // C++ version of Python aware wxXmlResourceHandler, for the pure virtual + // callbacks, as well as to make some protected things public so they can + // be wrapped. +class wxPyXmlResourceHandler : public wxXmlResourceHandler { +public: + wxPyXmlResourceHandler() : wxXmlResourceHandler() {} + //~wxPyXmlResourceHandler(); + + // Base class virtuals + + DEC_PYCALLBACK_OBJECT__pure(DoCreateResource); + DEC_PYCALLBACK_BOOL_NODE_pure(CanHandle); + +// wxObject* DoCreateResource() { +// wxObject* rv = NULL; +// wxPyBeginBlockThreads(); +// if (wxPyCBH_findCallback(m_myInst, "DoCreateResource")) { +// PyObject* ro; +// ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()")); +// if (ro) { +// SWIG_GetPtrObj(ro, (void **)&rv, "_wxObject_p"); +// Py_DECREF(ro); +// } +// } +// wxPyEndBlockThreads(); +// return rv; +// } + +// bool CanHandle(wxXmlNode* a) { +// bool rv=FALSE; +// wxPyBeginBlockThreads(); +// if (wxPyCBH_findCallback(m_myInst, "CanHandle")) { +// PyObject* obj = wxPyConstructObject((void*)a, "wxXmlNode", 0); +// rv = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); +// Py_DECREF(obj); +// } +// wxPyEndBlockThreads(); +// return rv; +// } + + + + // accessors for protected members + + wxXmlResource* GetResource() { return m_resource; } + wxXmlNode* GetNode() { return m_node; } + wxString GetClass() { return m_class; } + wxObject* GetParent() { return m_parent; } + wxObject* GetInstance() { return m_instance; } + wxWindow* GetParentAsWindow() { return m_parentAsWindow; } + wxWindow* GetInstanceAsWindow() { return m_instanceAsWindow; } + + + // turn some protected methods into public via delegation + + bool IsOfClass(wxXmlNode *node, const wxString& classname) + { return wxXmlResourceHandler::IsOfClass(node, classname); } + + wxString GetNodeContent(wxXmlNode *node) + { return wxXmlResourceHandler::GetNodeContent(node); } + + bool HasParam(const wxString& param) + { return wxXmlResourceHandler::HasParam(param); } + + wxXmlNode *GetParamNode(const wxString& param) + { return wxXmlResourceHandler::GetParamNode(param); } + + wxString GetParamValue(const wxString& param) + { return wxXmlResourceHandler::GetParamValue(param); } + + void AddStyle(const wxString& name, int value) + { wxXmlResourceHandler::AddStyle(name, value); } + + void AddWindowStyles() + { wxXmlResourceHandler::AddWindowStyles(); } + + int GetStyle(const wxString& param = wxT("style"), int defaults = 0) + { return wxXmlResourceHandler::GetStyle(param, defaults); } + + wxString GetText(const wxString& param, bool translate = TRUE) + { return wxXmlResourceHandler::GetText(param, translate); } + + int GetID() + { return wxXmlResourceHandler::GetID(); } + + wxString GetName() + { return wxXmlResourceHandler::GetName(); } + + bool GetBool(const wxString& param, bool defaultv = FALSE) + { return wxXmlResourceHandler::GetBool(param, defaultv); } + + long GetLong( const wxString& param, long defaultv = 0 ) + { return wxXmlResourceHandler::GetLong(param, defaultv); } + + wxColour GetColour(const wxString& param) + { return wxXmlResourceHandler::GetColour(param); } + + wxSize GetSize(const wxString& param = wxT("size")) + { return wxXmlResourceHandler::GetSize(param); } + + wxPoint GetPosition(const wxString& param = wxT("pos")) + { return wxXmlResourceHandler::GetPosition(param); } + + wxCoord GetDimension(const wxString& param, wxCoord defaultv = 0) + { return wxXmlResourceHandler::GetDimension(param, defaultv); } + + wxBitmap GetBitmap(const wxString& param = wxT("bitmap"), + const wxArtClient& defaultArtClient = wxART_OTHER, + wxSize size = wxDefaultSize) + { return wxXmlResourceHandler::GetBitmap(param, defaultArtClient, size); } + + wxIcon GetIcon(const wxString& param = wxT("icon"), + const wxArtClient& defaultArtClient = wxART_OTHER, + wxSize size = wxDefaultSize) + { return wxXmlResourceHandler::GetIcon(param, defaultArtClient, size); } + + wxFont GetFont(const wxString& param = wxT("font")) + { return wxXmlResourceHandler::GetFont(param); } + + void SetupWindow(wxWindow *wnd) + { wxXmlResourceHandler::SetupWindow(wnd); } + + void CreateChildren(wxObject *parent, bool this_hnd_only = FALSE) + { wxXmlResourceHandler::CreateChildren(parent, this_hnd_only); } + + void CreateChildrenPrivately(wxObject *parent, wxXmlNode *rootnode = NULL) + { wxXmlResourceHandler::CreateChildrenPrivately(parent, rootnode); } + + wxObject *CreateResFromNode(wxXmlNode *node, + wxObject *parent, wxObject *instance = NULL) + { return wxXmlResourceHandler::CreateResFromNode(node, parent, instance); } + + wxFileSystem& GetCurFileSystem() + { return wxXmlResourceHandler::GetCurFileSystem(); } + + + PYPRIVATE; +}; + +IMP_PYCALLBACK_OBJECT__pure(wxPyXmlResourceHandler, wxXmlResourceHandler, DoCreateResource); +IMP_PYCALLBACK_BOOL_NODE_pure(wxPyXmlResourceHandler, wxXmlResourceHandler, CanHandle); + +%} + + +//---------------------------------------------------------------------- +// Now the version that will be SWIGged. + + +%name(wxXmlResourceHandler) class wxPyXmlResourceHandler : public wxObject { +public: + wxPyXmlResourceHandler() : wxXmlResourceHandler() {} + //~wxPyXmlResourceHandler(); + + void _setCallbackInfo(PyObject* self, PyObject* _class); + %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxXmlResourceHandler)" -// TODO: Add wxXmlResourceHandler and allow it to be derived from. + + // Creates an object (menu, dialog, control, ...) from an XML node. + // Should check for validity. + // parent is a higher-level object (usually window, dialog or panel) + // that is often neccessary to create the resource. + // If instance is non-NULL it should not create a new instance via 'new' but + // should rather use this one, and call its Create method. + wxObject *CreateResource(wxXmlNode *node, wxObject *parent, + wxObject *instance); + + // Sets the parent resource. + void SetParentResource(wxXmlResource *res); + + + wxXmlResource* GetResource() { return m_resource; } + wxXmlNode* GetNode() { return m_node; } + wxString GetClass() { return m_class; } + wxObject* GetParent() { return m_parent; } + wxObject* GetInstance() { return m_instance; } + wxWindow* GetParentAsWindow() { return m_parentAsWindow; } + wxWindow* GetInstanceAsWindow() { return m_instanceAsWindow; } + + + // Returns true if the node has a property class equal to classname, + // e.g. . + bool IsOfClass(wxXmlNode *node, const wxString& classname); + + // Gets node content from wxXML_ENTITY_NODE + // The problem is, content is represented as + // wxXML_ENTITY_NODE name="tag", content="" + // |-- wxXML_TEXT_NODE or + // wxXML_CDATA_SECTION_NODE name="" content="content" + wxString GetNodeContent(wxXmlNode *node); + + // Check to see if a parameter exists. + bool HasParam(const wxString& param); + + // Finds the node or returns NULL. + wxXmlNode *GetParamNode(const wxString& param); + + // Finds the parameter value or returns the empty string. + wxString GetParamValue(const wxString& param); + + // Add a style flag (e.g. wxMB_DOCKABLE) to the list of flags + // understood by this handler. + void AddStyle(const wxString& name, int value); + + // Add styles common to all wxWindow-derived classes. + void AddWindowStyles(); + + // Gets style flags from text in form "flag | flag2| flag3 |..." + // Only understads flags added with AddStyle + int GetStyle(const wxString& param = wxPyStyleString, int defaults = 0); + + // Gets text from param and does some conversions: + // - replaces \n, \r, \t by respective chars (according to C syntax) + // - replaces _ by & and __ by _ (needed for _File => &File because of XML) + // - calls wxGetTranslations (unless disabled in wxXmlResource) + wxString GetText(const wxString& param, bool translate = TRUE); + + // Returns the XRCID. + int GetID(); + + // Returns the resource name. + wxString GetName(); + + // Gets a bool flag (1, t, yes, on, true are TRUE, everything else is FALSE). + bool GetBool(const wxString& param, bool defaultv = FALSE); + + // Gets the integer value from the parameter. + long GetLong( const wxString& param, long defaultv = 0 ); + + // Gets colour in HTML syntax (#RRGGBB). + wxColour GetColour(const wxString& param); + + // Gets the size (may be in dialog units). + wxSize GetSize(const wxString& param = wxPySizeString); + + // Gets the position (may be in dialog units). + wxPoint GetPosition(const wxString& param = wxPyPosString); + + // Gets a dimension (may be in dialog units). + wxCoord GetDimension(const wxString& param, wxCoord defaultv = 0); + + // Gets a bitmap. + wxBitmap GetBitmap(const wxString& param = wxPyBitmapString, + const wxArtClient& defaultArtClient = wxART_OTHER, + wxSize size = wxDefaultSize); + + // Gets an icon. + wxIcon GetIcon(const wxString& param = wxPyIconString, + const wxArtClient& defaultArtClient = wxART_OTHER, + wxSize size = wxDefaultSize); + + // Gets a font. + wxFont GetFont(const wxString& param = wxPyFontString); + + // Sets common window options. + void SetupWindow(wxWindow *wnd); + + // Creates children. + void CreateChildren(wxObject *parent, bool this_hnd_only = FALSE); + + // Helper function. + void CreateChildrenPrivately(wxObject *parent, wxXmlNode *rootnode = NULL); + + // Creates a resource from a node. + wxObject *CreateResFromNode(wxXmlNode *node, + wxObject *parent, wxObject *instance = NULL); + + // helper + wxFileSystem& GetCurFileSystem(); +}; + + +//---------------------------------------------------------------------- //---------------------------------------------------------------------- %init %{ diff --git a/wxPython/contrib/xrc/xrc.py b/wxPython/contrib/xrc/xrc.py index 2837e83749..6290c6cb87 100644 --- a/wxPython/contrib/xrc/xrc.py +++ b/wxPython/contrib/xrc/xrc.py @@ -71,6 +71,9 @@ class wxXmlResourcePtr(wxObjectPtr): def AddHandler(self, *_args, **_kwargs): val = apply(xrcc.wxXmlResource_AddHandler,(self,) + _args, _kwargs) return val + def InsertHandler(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResource_InsertHandler,(self,) + _args, _kwargs) + return val def ClearHandlers(self, *_args, **_kwargs): val = apply(xrcc.wxXmlResource_ClearHandlers,(self,) + _args, _kwargs) return val @@ -103,6 +106,15 @@ class wxXmlResourcePtr(wxObjectPtr): def LoadFrame(self, *_args, **_kwargs): val = apply(xrcc.wxXmlResource_LoadFrame,(self,) + _args, _kwargs) return val + def LoadOnFrame(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResource_LoadOnFrame,(self,) + _args, _kwargs) + return val + def LoadObject(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResource_LoadObject,(self,) + _args, _kwargs) + return val + def LoadOnObject(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResource_LoadOnObject,(self,) + _args, _kwargs) + return val def LoadBitmap(self, *_args, **_kwargs): val = apply(xrcc.wxXmlResource_LoadBitmap,(self,) + _args, _kwargs) if val: val = wxBitmapPtr(val) ; val.thisown = 1 @@ -137,6 +149,324 @@ def wxEmptyXmlResource(*_args,**_kwargs): return val +class wxXmlPropertyPtr : + def __init__(self,this): + self.this = this + self.thisown = 0 + def GetName(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlProperty_GetName,(self,) + _args, _kwargs) + return val + def GetValue(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlProperty_GetValue,(self,) + _args, _kwargs) + return val + def GetNext(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlProperty_GetNext,(self,) + _args, _kwargs) + if val: val = wxXmlPropertyPtr(val) + return val + def SetName(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlProperty_SetName,(self,) + _args, _kwargs) + return val + def SetValue(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlProperty_SetValue,(self,) + _args, _kwargs) + return val + def SetNext(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlProperty_SetNext,(self,) + _args, _kwargs) + return val + def __repr__(self): + return "" % (self.this,) +class wxXmlProperty(wxXmlPropertyPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(xrcc.new_wxXmlProperty,_args,_kwargs) + self.thisown = 1 + + + + +class wxXmlNodePtr : + def __init__(self,this): + self.this = this + self.thisown = 0 + def __del__(self,xrcc=xrcc): + if self.thisown == 1 : + xrcc.delete_wxXmlNode(self) + def AddChild(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlNode_AddChild,(self,) + _args, _kwargs) + return val + def InsertChild(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlNode_InsertChild,(self,) + _args, _kwargs) + return val + def RemoveChild(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlNode_RemoveChild,(self,) + _args, _kwargs) + return val + def AddProperty(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlNode_AddProperty,(self,) + _args, _kwargs) + return val + def AddPropertyName(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlNode_AddPropertyName,(self,) + _args, _kwargs) + return val + def DeleteProperty(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlNode_DeleteProperty,(self,) + _args, _kwargs) + return val + def GetType(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlNode_GetType,(self,) + _args, _kwargs) + return val + def GetName(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlNode_GetName,(self,) + _args, _kwargs) + return val + def GetContent(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlNode_GetContent,(self,) + _args, _kwargs) + return val + def GetParent(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlNode_GetParent,(self,) + _args, _kwargs) + if val: val = wxXmlNodePtr(val) + return val + def GetNext(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlNode_GetNext,(self,) + _args, _kwargs) + if val: val = wxXmlNodePtr(val) + return val + def GetChildren(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlNode_GetChildren,(self,) + _args, _kwargs) + if val: val = wxXmlNodePtr(val) + return val + def GetProperties(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlNode_GetProperties,(self,) + _args, _kwargs) + if val: val = wxXmlPropertyPtr(val) + return val + def GetPropVal(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlNode_GetPropVal,(self,) + _args, _kwargs) + return val + def HasProp(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlNode_HasProp,(self,) + _args, _kwargs) + return val + def SetType(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlNode_SetType,(self,) + _args, _kwargs) + return val + def SetName(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlNode_SetName,(self,) + _args, _kwargs) + return val + def SetContent(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlNode_SetContent,(self,) + _args, _kwargs) + return val + def SetParent(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlNode_SetParent,(self,) + _args, _kwargs) + return val + def SetNext(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlNode_SetNext,(self,) + _args, _kwargs) + return val + def SetChildren(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlNode_SetChildren,(self,) + _args, _kwargs) + return val + def SetProperties(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlNode_SetProperties,(self,) + _args, _kwargs) + return val + def __repr__(self): + return "" % (self.this,) +class wxXmlNode(wxXmlNodePtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(xrcc.new_wxXmlNode,_args,_kwargs) + self.thisown = 1 + + + +def wxXmlNodeEasy(*_args,**_kwargs): + val = wxXmlNodePtr(apply(xrcc.new_wxXmlNodeEasy,_args,_kwargs)) + val.thisown = 1 + return val + + +class wxXmlDocumentPtr(wxObjectPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def __del__(self,xrcc=xrcc): + if self.thisown == 1 : + xrcc.delete_wxXmlDocument(self) + def Load(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlDocument_Load,(self,) + _args, _kwargs) + return val + def LoadFromStream(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlDocument_LoadFromStream,(self,) + _args, _kwargs) + return val + def Save(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlDocument_Save,(self,) + _args, _kwargs) + return val + def SaveToStream(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlDocument_SaveToStream,(self,) + _args, _kwargs) + return val + def IsOk(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlDocument_IsOk,(self,) + _args, _kwargs) + return val + def GetRoot(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlDocument_GetRoot,(self,) + _args, _kwargs) + if val: val = wxXmlNodePtr(val) + return val + def GetVersion(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlDocument_GetVersion,(self,) + _args, _kwargs) + return val + def GetFileEncoding(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlDocument_GetFileEncoding,(self,) + _args, _kwargs) + return val + def SetRoot(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlDocument_SetRoot,(self,) + _args, _kwargs) + return val + def SetVersion(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlDocument_SetVersion,(self,) + _args, _kwargs) + return val + def SetFileEncoding(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlDocument_SetFileEncoding,(self,) + _args, _kwargs) + return val + def GetEncoding(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlDocument_GetEncoding,(self,) + _args, _kwargs) + return val + def __repr__(self): + return "" % (self.this,) +class wxXmlDocument(wxXmlDocumentPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(xrcc.new_wxXmlDocument,_args,_kwargs) + self.thisown = 1 + + + +def wxXmlDocumentFromStream(*_args,**_kwargs): + val = wxXmlDocumentPtr(apply(xrcc.new_wxXmlDocumentFromStream,_args,_kwargs)) + val.thisown = 1 + return val + +def wxEmptyXmlDocument(*_args,**_kwargs): + val = wxXmlDocumentPtr(apply(xrcc.new_wxEmptyXmlDocument,_args,_kwargs)) + val.thisown = 1 + return val + + +class wxXmlResourceHandlerPtr(wxObjectPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def _setCallbackInfo(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler__setCallbackInfo,(self,) + _args, _kwargs) + return val + def CreateResource(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_CreateResource,(self,) + _args, _kwargs) + return val + def SetParentResource(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_SetParentResource,(self,) + _args, _kwargs) + return val + def GetResource(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetResource,(self,) + _args, _kwargs) + if val: val = wxXmlResourcePtr(val) + return val + def GetNode(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetNode,(self,) + _args, _kwargs) + if val: val = wxXmlNodePtr(val) + return val + def GetClass(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetClass,(self,) + _args, _kwargs) + return val + def GetParent(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetParent,(self,) + _args, _kwargs) + return val + def GetInstance(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetInstance,(self,) + _args, _kwargs) + return val + def GetParentAsWindow(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetParentAsWindow,(self,) + _args, _kwargs) + return val + def GetInstanceAsWindow(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetInstanceAsWindow,(self,) + _args, _kwargs) + return val + def IsOfClass(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_IsOfClass,(self,) + _args, _kwargs) + return val + def GetNodeContent(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetNodeContent,(self,) + _args, _kwargs) + return val + def HasParam(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_HasParam,(self,) + _args, _kwargs) + return val + def GetParamNode(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetParamNode,(self,) + _args, _kwargs) + if val: val = wxXmlNodePtr(val) + return val + def GetParamValue(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetParamValue,(self,) + _args, _kwargs) + return val + def AddStyle(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_AddStyle,(self,) + _args, _kwargs) + return val + def AddWindowStyles(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_AddWindowStyles,(self,) + _args, _kwargs) + return val + def GetStyle(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetStyle,(self,) + _args, _kwargs) + return val + def GetText(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetText,(self,) + _args, _kwargs) + return val + def GetID(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetID,(self,) + _args, _kwargs) + return val + def GetName(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetName,(self,) + _args, _kwargs) + return val + def GetBool(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetBool,(self,) + _args, _kwargs) + return val + def GetLong(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetLong,(self,) + _args, _kwargs) + return val + def GetColour(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetColour,(self,) + _args, _kwargs) + if val: val = wxColourPtr(val) ; val.thisown = 1 + return val + def GetSize(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetSize,(self,) + _args, _kwargs) + if val: val = wxSizePtr(val) ; val.thisown = 1 + return val + def GetPosition(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetPosition,(self,) + _args, _kwargs) + if val: val = wxPointPtr(val) ; val.thisown = 1 + return val + def GetDimension(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetDimension,(self,) + _args, _kwargs) + return val + def GetBitmap(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetBitmap,(self,) + _args, _kwargs) + if val: val = wxBitmapPtr(val) ; val.thisown = 1 + return val + def GetIcon(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetIcon,(self,) + _args, _kwargs) + if val: val = wxIconPtr(val) ; val.thisown = 1 + return val + def GetFont(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetFont,(self,) + _args, _kwargs) + if val: val = wxFontPtr(val) ; val.thisown = 1 + return val + def SetupWindow(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_SetupWindow,(self,) + _args, _kwargs) + return val + def CreateChildren(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_CreateChildren,(self,) + _args, _kwargs) + return val + def CreateChildrenPrivately(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_CreateChildrenPrivately,(self,) + _args, _kwargs) + return val + def CreateResFromNode(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_CreateResFromNode,(self,) + _args, _kwargs) + return val + def GetCurFileSystem(self, *_args, **_kwargs): + val = apply(xrcc.wxXmlResourceHandler_GetCurFileSystem,(self,) + _args, _kwargs) + return val + def __repr__(self): + return "" % (self.this,) +class wxXmlResourceHandler(wxXmlResourceHandlerPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(xrcc.new_wxXmlResourceHandler,_args,_kwargs) + self.thisown = 1 + self._setCallbackInfo(self, wxXmlResourceHandler) + + + + #-------------- FUNCTION WRAPPERS ------------------ @@ -159,6 +489,19 @@ def wxXmlResource_Set(*_args, **_kwargs): wxXRC_USE_LOCALE = xrcc.wxXRC_USE_LOCALE wxXRC_NO_SUBCLASSING = xrcc.wxXRC_NO_SUBCLASSING +wxXML_ELEMENT_NODE = xrcc.wxXML_ELEMENT_NODE +wxXML_ATTRIBUTE_NODE = xrcc.wxXML_ATTRIBUTE_NODE +wxXML_TEXT_NODE = xrcc.wxXML_TEXT_NODE +wxXML_CDATA_SECTION_NODE = xrcc.wxXML_CDATA_SECTION_NODE +wxXML_ENTITY_REF_NODE = xrcc.wxXML_ENTITY_REF_NODE +wxXML_ENTITY_NODE = xrcc.wxXML_ENTITY_NODE +wxXML_PI_NODE = xrcc.wxXML_PI_NODE +wxXML_COMMENT_NODE = xrcc.wxXML_COMMENT_NODE +wxXML_DOCUMENT_NODE = xrcc.wxXML_DOCUMENT_NODE +wxXML_DOCUMENT_TYPE_NODE = xrcc.wxXML_DOCUMENT_TYPE_NODE +wxXML_DOCUMENT_FRAG_NODE = xrcc.wxXML_DOCUMENT_FRAG_NODE +wxXML_NOTATION_NODE = xrcc.wxXML_NOTATION_NODE +wxXML_HTML_DOCUMENT_NODE = xrcc.wxXML_HTML_DOCUMENT_NODE #-------------- USER INCLUDE ----------------------- @@ -167,3 +510,5 @@ wxXRC_NO_SUBCLASSING = xrcc.wxXRC_NO_SUBCLASSING # The global was removed in favor of static accessor functions. This is for # backwards compatibility: wxTheXmlResource = wxXmlResource_Get() + +wx.wxXmlNodePtr = wxXmlNodePtr diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index 09eba0f8cb..82736b72fe 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -36,6 +36,7 @@ _treeList = [ 'wxIEHtmlWin', 'wxKeyEvents', 'wxWizard', + 'wxXmlResourceHandler', ]), # managed windows == things with a caption you can close @@ -138,7 +139,8 @@ _treeList = [ 'ScrolledPanel', 'Sizers', 'wxLayoutConstraints', - 'XML_Resource', + 'wxXmlResource', + 'wxXmlResourceHandler', ]), # ditto diff --git a/wxPython/demo/XML_Resource.py b/wxPython/demo/XML_Resource.py deleted file mode 100644 index 2d0aa94768..0000000000 --- a/wxPython/demo/XML_Resource.py +++ /dev/null @@ -1,76 +0,0 @@ - -from wxPython.wx import * -from wxPython.xrc import * -from Main import opj - -#---------------------------------------------------------------------- - -RESFILE = opj("data/resource_wdr.xrc") - -class TestPanel(wxPanel): - def __init__(self, parent, log): - wxPanel.__init__(self, parent, -1) - self.log = log - - # make the components - label = wxStaticText(self, -1, "The lower panel was built from this XML:") - label.SetFont(wxFont(12, wxSWISS, wxNORMAL, wxBOLD)) - - resourceText = open(RESFILE).read() - text = wxTextCtrl(self, -1, resourceText, - style=wxTE_READONLY|wxTE_MULTILINE) - text.SetInsertionPoint(0) - - line = wxStaticLine(self, -1) - - # This shows a few different ways to load XML Resources - if 0: - # XML Resources can be loaded from a file like this: - res = wxXmlResource(RESFILE) - - elif 1: - # or from a Virtual FileSystem: - wxFileSystem_AddHandler(wxMemoryFSHandler()) - wxMemoryFSHandler_AddFile("XRC_Resources/data_file", resourceText) - res = wxXmlResource("memory:XRC_Resources/data_file") - - else: - # or from a string, like this: - res = wxEmptyXmlResource() - res.LoadFromString(resourceText) - - - # Now create a panel from the resource data - panel = res.LoadPanel(self, "MyPanel") - - # and do the layout - sizer = wxBoxSizer(wxVERTICAL) - sizer.Add(label, 0, wxEXPAND|wxTOP|wxLEFT, 5) - sizer.Add(text, 1, wxEXPAND|wxALL, 5) - sizer.Add(line, 0, wxEXPAND) - sizer.Add(panel, 1, wxEXPAND|wxALL, 5) - - self.SetSizer(sizer) - self.SetAutoLayout(true) - - -#---------------------------------------------------------------------- - -def runTest(frame, nb, log): - win = TestPanel(nb, log) - return win - -#---------------------------------------------------------------------- - - - -overview = """ -""" - - - -if __name__ == '__main__': - import sys,os - import run - run.main(['', os.path.basename(sys.argv[0])]) - diff --git a/wxPython/demo/wxXmlResource.py b/wxPython/demo/wxXmlResource.py new file mode 100644 index 0000000000..2d0aa94768 --- /dev/null +++ b/wxPython/demo/wxXmlResource.py @@ -0,0 +1,76 @@ + +from wxPython.wx import * +from wxPython.xrc import * +from Main import opj + +#---------------------------------------------------------------------- + +RESFILE = opj("data/resource_wdr.xrc") + +class TestPanel(wxPanel): + def __init__(self, parent, log): + wxPanel.__init__(self, parent, -1) + self.log = log + + # make the components + label = wxStaticText(self, -1, "The lower panel was built from this XML:") + label.SetFont(wxFont(12, wxSWISS, wxNORMAL, wxBOLD)) + + resourceText = open(RESFILE).read() + text = wxTextCtrl(self, -1, resourceText, + style=wxTE_READONLY|wxTE_MULTILINE) + text.SetInsertionPoint(0) + + line = wxStaticLine(self, -1) + + # This shows a few different ways to load XML Resources + if 0: + # XML Resources can be loaded from a file like this: + res = wxXmlResource(RESFILE) + + elif 1: + # or from a Virtual FileSystem: + wxFileSystem_AddHandler(wxMemoryFSHandler()) + wxMemoryFSHandler_AddFile("XRC_Resources/data_file", resourceText) + res = wxXmlResource("memory:XRC_Resources/data_file") + + else: + # or from a string, like this: + res = wxEmptyXmlResource() + res.LoadFromString(resourceText) + + + # Now create a panel from the resource data + panel = res.LoadPanel(self, "MyPanel") + + # and do the layout + sizer = wxBoxSizer(wxVERTICAL) + sizer.Add(label, 0, wxEXPAND|wxTOP|wxLEFT, 5) + sizer.Add(text, 1, wxEXPAND|wxALL, 5) + sizer.Add(line, 0, wxEXPAND) + sizer.Add(panel, 1, wxEXPAND|wxALL, 5) + + self.SetSizer(sizer) + self.SetAutoLayout(true) + + +#---------------------------------------------------------------------- + +def runTest(frame, nb, log): + win = TestPanel(nb, log) + return win + +#---------------------------------------------------------------------- + + + +overview = """ +""" + + + +if __name__ == '__main__': + import sys,os + import run + run.main(['', os.path.basename(sys.argv[0])]) + diff --git a/wxPython/demo/wxXmlResourceHandler.py b/wxPython/demo/wxXmlResourceHandler.py new file mode 100644 index 0000000000..8091c8ba10 --- /dev/null +++ b/wxPython/demo/wxXmlResourceHandler.py @@ -0,0 +1,182 @@ + +from wxPython.wx import * +from wxPython.xrc import * + +#---------------------------------------------------------------------- + +resourceText = r''' + + + + + + 200,100 + + + 10,10 + + + +''' + +#---------------------------------------------------------------------- + +class MyBluePanel(wxPanel): + def __init__(self, parent, id, pos, size, style, name): + wxPanel.__init__(self, parent, id, pos, size, style, name) + + # This is the little bit of customization that we do for this + # silly example. It could just as easily have been done in + # the resource. + self.SetBackgroundColour("BLUE") + + +# To do it the more complex way, (see below) we need to write the +# class a little differently... This could obviously be done with a +# single class, but I wanted to make separate ones to make clear what +# the different requirements are. +class PreMyBluePanel(wxPanel): + def __init__(self): + p = wxPrePanel() + self.this = p.this + + def Create(self, parent, id, pos, size, style, name): + wxPanel.Create(self, parent, id, pos, size, style, name) + self.SetBackgroundColour("BLUE") + +#---------------------------------------------------------------------- + +class MyBluePanelXmlHandler(wxXmlResourceHandler): + def __init__(self): + wxXmlResourceHandler.__init__(self) + # Specify the styles recognized by objects of this type + self.AddStyle("wxNO_3D", wxNO_3D); + self.AddStyle("wxTAB_TRAVERSAL", wxTAB_TRAVERSAL); + self.AddStyle("wxWS_EX_VALIDATE_RECURSIVELY", wxWS_EX_VALIDATE_RECURSIVELY); + self.AddStyle("wxCLIP_CHILDREN", wxCLIP_CHILDREN); + self.AddWindowStyles(); + + # This method and the next one are required for XmlResourceHandlers + def CanHandle(self, node): + return self.IsOfClass(node, "MyBluePanel") + + def DoCreateResource(self): + # NOTE: wxWindows can be created in either a single-phase or + # in a two-phase way. Single phase is what you normally do, + # and two-phase creates the instnace first, and then later + # creates the actual window when the Create method is called. + # (In wxPython the first phase is done using the wxPre* + # function, for example, wxPreFrame, wxPrePanel, etc.) + # + # wxXmlResource supports either method, a premade instance can + # be created and populated by xrc using the appropriate + # LoadOn* method (such as LoadOnPanel) or xrc can create the + # instance too, using the Load* method. However this makes + # the handlers a bit more complex. If you can be sure that a + # particular class will never be loaded using a pre-existing + # instance, then you can make the handle much simpler. I'll + # show both methods below. + + if 0: + # The simple method assumes that there is no existing + # instance. Be sure of that with an assert. + assert self.GetInstance() is None + + # Now create the object + panel = MyBluePanel(self.GetParentAsWindow(), + self.GetID(), + self.GetPosition(), + self.GetSize(), + self.GetStyle("style", wxTAB_TRAVERSAL), + self.GetName() + ) + else: + # When using the more complex (but more flexible) method + # the instance may already have been created, check for it + panel = self.GetInstance() + if panel is None: + # if not, then create the instance (but not the window) + panel = PreMyBluePanel() + + # Now call the panel's Create method to actually create the window + panel.Create(self.GetParentAsWindow(), + self.GetID(), + self.GetPosition(), + self.GetSize(), + self.GetStyle("style", wxTAB_TRAVERSAL), + self.GetName() + ) + + # These two things should be done in either case: + # Set standard window attributes + self.SetupWindow(panel) + # Create any child windows of this node + self.CreateChildren(panel) + + return panel + + +#---------------------------------------------------------------------- + + +class TestPanel(wxPanel): + def __init__(self, parent, log): + self.log = log + wxPanel.__init__(self, parent, -1) + + # make the components + label = wxStaticText(self, -1, "The lower panel was built from this XML:") + label.SetFont(wxFont(12, wxSWISS, wxNORMAL, wxBOLD)) + + text = wxTextCtrl(self, -1, resourceText, + style=wxTE_READONLY|wxTE_MULTILINE) + text.SetInsertionPoint(0) + + line = wxStaticLine(self, -1) + + # Load the resource + res = wxEmptyXmlResource() + res.InsertHandler(MyBluePanelXmlHandler()) + res.LoadFromString(resourceText) + + # Now create a panel from the resource data + panel = res.LoadObject(self, "MyPanel", "MyBluePanel") + + # and do the layout + sizer = wxBoxSizer(wxVERTICAL) + sizer.Add(label, 0, wxEXPAND|wxTOP|wxLEFT, 5) + sizer.Add(text, 1, wxEXPAND|wxALL, 5) + sizer.Add(line, 0, wxEXPAND) + sizer.Add(panel, 1, wxEXPAND|wxALL, 5) + + self.SetSizer(sizer) + self.SetAutoLayout(true) + + +#---------------------------------------------------------------------- + +def runTest(frame, nb, log): + win = TestPanel(nb, log) + return win + +#---------------------------------------------------------------------- + + + +overview = """ +

wxXmlResourceHandler

+ +Deriving a class from wxXmlResourceHandler allows you to specify your +own classes in XRC resources, and your handler class will then be used +to create instances of that class when the resource is loaded. + + +""" + + + +if __name__ == '__main__': + import sys,os + import run + run.main(['', os.path.basename(sys.argv[0])]) + diff --git a/wxPython/src/helpers.h b/wxPython/src/helpers.h index 3fefcfe62e..9cf9014612 100644 --- a/wxPython/src/helpers.h +++ b/wxPython/src/helpers.h @@ -1620,6 +1620,25 @@ void wxPyCBH_delete(wxPyCallbackHelper* cbh); //--------------------------------------------------------------------------- +#define DEC_PYCALLBACK_bool_anypure(CBNAME, Type) \ + bool CBNAME(Type& a); + + +#define IMP_PYCALLBACK_bool_anypure(CLASS, PCLASS, CBNAME, Type) \ + bool CLASS::CBNAME(Type& a) { \ + bool rv=FALSE; \ + wxPyBeginBlockThreads(); \ + if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ + PyObject* obj = wxPyConstructObject((void*)&a, #Type, 0); \ + rv = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); \ + Py_DECREF(obj); \ + } \ + wxPyEndBlockThreads(); \ + return rv; \ + } \ + +//--------------------------------------------------------------------------- + #define DEC_PYCALLBACK_STRING_LONGLONG(CBNAME) \ wxString CBNAME(long a, long b) const; \ wxString base_##CBNAME(long a, long b)const ; @@ -1746,9 +1765,8 @@ void wxPyCBH_delete(wxPyCallbackHelper* cbh); #define IMP_PYCALLBACK_WIZPG__pure(CLASS, PCLASS, CBNAME) \ wxWizardPage* CLASS::CBNAME() const { \ wxWizardPage* rv = NULL; \ - bool found; \ wxPyBeginBlockThreads(); \ - if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \ + if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ PyObject* ro; \ ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()")); \ if (ro) { \ @@ -1768,9 +1786,8 @@ void wxPyCBH_delete(wxPyCallbackHelper* cbh); #define IMP_PYCALLBACK_BITMAP__pure(CLASS, PCLASS, CBNAME) \ wxBitmap CLASS::CBNAME() const { \ wxBitmap rv; \ - bool found; \ wxPyBeginBlockThreads(); \ - if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \ + if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ PyObject* ro; \ wxBitmap* ptr; \ ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()")); \ @@ -1786,4 +1803,43 @@ void wxPyCBH_delete(wxPyCallbackHelper* cbh); //--------------------------------------------------------------------------- +#define DEC_PYCALLBACK_OBJECT__pure(CBNAME) \ + wxObject* CBNAME(); + +#define IMP_PYCALLBACK_OBJECT__pure(CLASS, PCLASS, CBNAME) \ + wxObject* CLASS::CBNAME() { \ + wxObject* rv = NULL; \ + wxPyBeginBlockThreads(); \ + if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ + PyObject* ro; \ + ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()")); \ + if (ro) { \ + SWIG_GetPtrObj(ro, (void **)&rv, "_wxObject_p"); \ + Py_DECREF(ro); \ + } \ + } \ + wxPyEndBlockThreads(); \ + return rv; \ + } + +//--------------------------------------------------------------------------- + +#define DEC_PYCALLBACK_BOOL_NODE_pure(CBNAME) \ + bool CBNAME(wxXmlNode* a); + + +#define IMP_PYCALLBACK_BOOL_NODE_pure(CLASS, PCLASS, CBNAME) \ + bool CLASS::CBNAME(wxXmlNode* a) { \ + bool rv=FALSE; \ + wxPyBeginBlockThreads(); \ + if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ + PyObject* obj = wxPyConstructObject((void*)a, "wxXmlNode", 0); \ + rv = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); \ + Py_DECREF(obj); \ + } \ + wxPyEndBlockThreads(); \ + return rv; \ + } \ + +//--------------------------------------------------------------------------- #endif