X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6824d4f9e0f6e7d97124a47ab2d75a551ed209ac..71aba8333cc915afff9e740c944f7fa7247abacb:/wxPython/src/mac/htmlhelp.cpp?ds=sidebyside diff --git a/wxPython/src/mac/htmlhelp.cpp b/wxPython/src/mac/htmlhelp.cpp index a413f6765c..f2a32eb4a9 100644 --- a/wxPython/src/mac/htmlhelp.cpp +++ b/wxPython/src/mac/htmlhelp.cpp @@ -19,6 +19,8 @@ /* Implementation : PYTHON */ #define SWIGPYTHON +#include "Python.h" + #include #include /* Definitions for Windows/Unix exporting */ @@ -36,12 +38,9 @@ # define SWIGEXPORT(a) a #endif -#include "Python.h" - #ifdef __cplusplus extern "C" { #endif - extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -55,7 +54,7 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "htmlhelpc" -#include "export.h" +#include "wxPython.h" #include #include #include @@ -63,6 +62,9 @@ extern PyObject *SWIG_newvarlink(void); #include #include + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyEmptyString(wxT("")); + static PyObject* t_output_helper(PyObject* target, PyObject* o) { PyObject* o2; @@ -92,14 +94,6 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { #ifdef __cplusplus extern "C" { #endif -static void *SwigwxHtmlBookRecordTowxObject(void *ptr) { - wxHtmlBookRecord *src; - wxObject *dest; - src = (wxHtmlBookRecord *) ptr; - dest = (wxObject *) src; - return (void *) dest; -} - #define new_wxHtmlBookRecord(_swigarg0,_swigarg1,_swigarg2,_swigarg3) (new wxHtmlBookRecord(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) static PyObject *_wrap_new_wxHtmlBookRecord(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -196,7 +190,7 @@ static PyObject *_wrap_wxHtmlBookRecord_GetBookFile(PyObject *self, PyObject *ar if (PyErr_Occurred()) return NULL; }{ #if wxUSE_UNICODE - _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); #else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); #endif @@ -233,7 +227,7 @@ static PyObject *_wrap_wxHtmlBookRecord_GetTitle(PyObject *self, PyObject *args, if (PyErr_Occurred()) return NULL; }{ #if wxUSE_UNICODE - _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); #else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); #endif @@ -270,7 +264,7 @@ static PyObject *_wrap_wxHtmlBookRecord_GetStart(PyObject *self, PyObject *args, if (PyErr_Occurred()) return NULL; }{ #if wxUSE_UNICODE - _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); #else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); #endif @@ -307,7 +301,7 @@ static PyObject *_wrap_wxHtmlBookRecord_GetBasePath(PyObject *self, PyObject *ar if (PyErr_Occurred()) return NULL; }{ #if wxUSE_UNICODE - _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); #else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); #endif @@ -554,7 +548,7 @@ static PyObject *_wrap_wxHtmlBookRecord_GetFullPath(PyObject *self, PyObject *ar if (PyErr_Occurred()) return NULL; }{ #if wxUSE_UNICODE - _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); #else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); #endif @@ -569,36 +563,36 @@ static PyObject *_wrap_wxHtmlBookRecord_GetFullPath(PyObject *self, PyObject *ar return _resultobj; } -#define wxHtmlContentsItem_m_Level_get(_swigobj) ((short ) _swigobj->m_Level) -static PyObject *_wrap_wxHtmlContentsItem_m_Level_get(PyObject *self, PyObject *args, PyObject *kwargs) { +static int wxHtmlContentsItem_GetLevel(wxHtmlContentsItem *self) { return self->m_Level; } +static PyObject *_wrap_wxHtmlContentsItem_GetLevel(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - short _result; + int _result; wxHtmlContentsItem * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlContentsItem_m_Level_get",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlContentsItem_GetLevel",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxHtmlContentsItem_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlContentsItem_m_Level_get. Expected _wxHtmlContentsItem_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlContentsItem_GetLevel. Expected _wxHtmlContentsItem_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (short )wxHtmlContentsItem_m_Level_get(_arg0); + _result = (int )wxHtmlContentsItem_GetLevel(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("h",_result); +} _resultobj = Py_BuildValue("i",_result); return _resultobj; } -#define wxHtmlContentsItem_m_ID_get(_swigobj) ((int ) _swigobj->m_ID) -static PyObject *_wrap_wxHtmlContentsItem_m_ID_get(PyObject *self, PyObject *args, PyObject *kwargs) { +static int wxHtmlContentsItem_GetID(wxHtmlContentsItem *self) { return self->m_ID; } +static PyObject *_wrap_wxHtmlContentsItem_GetID(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; int _result; wxHtmlContentsItem * _arg0; @@ -606,18 +600,18 @@ static PyObject *_wrap_wxHtmlContentsItem_m_ID_get(PyObject *self, PyObject *arg char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlContentsItem_m_ID_get",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlContentsItem_GetID",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxHtmlContentsItem_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlContentsItem_m_ID_get. Expected _wxHtmlContentsItem_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlContentsItem_GetID. Expected _wxHtmlContentsItem_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (int )wxHtmlContentsItem_m_ID_get(_arg0); + _result = (int )wxHtmlContentsItem_GetID(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -625,64 +619,82 @@ static PyObject *_wrap_wxHtmlContentsItem_m_ID_get(PyObject *self, PyObject *arg return _resultobj; } -#define wxHtmlContentsItem_m_Name_get(_swigobj) ((wxChar *) _swigobj->m_Name) -static PyObject *_wrap_wxHtmlContentsItem_m_Name_get(PyObject *self, PyObject *args, PyObject *kwargs) { +static wxString wxHtmlContentsItem_GetName(wxHtmlContentsItem *self) { return self->m_Name; } +static PyObject *_wrap_wxHtmlContentsItem_GetName(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxChar * _result; + wxString * _result; wxHtmlContentsItem * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlContentsItem_m_Name_get",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlContentsItem_GetName",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxHtmlContentsItem_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlContentsItem_m_Name_get. Expected _wxHtmlContentsItem_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlContentsItem_GetName. Expected _wxHtmlContentsItem_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxChar *)wxHtmlContentsItem_m_Name_get(_arg0); + _result = new wxString (wxHtmlContentsItem_GetName(_arg0)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("s", _result); +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + delete _result; +} return _resultobj; } -#define wxHtmlContentsItem_m_Page_get(_swigobj) ((wxChar *) _swigobj->m_Page) -static PyObject *_wrap_wxHtmlContentsItem_m_Page_get(PyObject *self, PyObject *args, PyObject *kwargs) { +static wxString wxHtmlContentsItem_GetPage(wxHtmlContentsItem *self) { return self->m_Page; } +static PyObject *_wrap_wxHtmlContentsItem_GetPage(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxChar * _result; + wxString * _result; wxHtmlContentsItem * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlContentsItem_m_Page_get",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlContentsItem_GetPage",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxHtmlContentsItem_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlContentsItem_m_Page_get. Expected _wxHtmlContentsItem_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlContentsItem_GetPage. Expected _wxHtmlContentsItem_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxChar *)wxHtmlContentsItem_m_Page_get(_arg0); + _result = new wxString (wxHtmlContentsItem_GetPage(_arg0)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("s", _result); +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + delete _result; +} return _resultobj; } -#define wxHtmlContentsItem_m_Book_get(_swigobj) ((wxHtmlBookRecord *) _swigobj->m_Book) -static PyObject *_wrap_wxHtmlContentsItem_m_Book_get(PyObject *self, PyObject *args, PyObject *kwargs) { +static wxHtmlBookRecord * wxHtmlContentsItem_GetBook(wxHtmlContentsItem *self) { return self->m_Book; } +static PyObject *_wrap_wxHtmlContentsItem_GetBook(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxHtmlBookRecord * _result; wxHtmlContentsItem * _arg0; @@ -691,18 +703,18 @@ static PyObject *_wrap_wxHtmlContentsItem_m_Book_get(PyObject *self, PyObject *a char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlContentsItem_m_Book_get",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlContentsItem_GetBook",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxHtmlContentsItem_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlContentsItem_m_Book_get. Expected _wxHtmlContentsItem_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlContentsItem_GetBook. Expected _wxHtmlContentsItem_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxHtmlBookRecord *)wxHtmlContentsItem_m_Book_get(_arg0); + _result = (wxHtmlBookRecord *)wxHtmlContentsItem_GetBook(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -855,7 +867,7 @@ static PyObject *_wrap_wxHtmlSearchStatus_GetName(PyObject *self, PyObject *args if (PyErr_Occurred()) return NULL; }{ #if wxUSE_UNICODE - _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); #else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); #endif @@ -1063,7 +1075,7 @@ static PyObject *_wrap_wxHtmlHelpData_FindPageByName(PyObject *self, PyObject *a if (PyErr_Occurred()) return NULL; }{ #if wxUSE_UNICODE - _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); #else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); #endif @@ -1105,7 +1117,7 @@ static PyObject *_wrap_wxHtmlHelpData_FindPageById(PyObject *self, PyObject *arg if (PyErr_Occurred()) return NULL; }{ #if wxUSE_UNICODE - _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); + _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len()); #else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); #endif @@ -1324,7 +1336,7 @@ static PyObject *_wrap_new_wxHtmlHelpFrame(PyObject *self, PyObject *args, PyObj wxHtmlHelpFrame * _result; wxWindow * _arg0; int _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; int _arg3 = (int ) wxHF_DEFAULTSTYLE; wxHtmlHelpData * _arg4 = (wxHtmlHelpData *) NULL; PyObject * _argo0 = 0; @@ -1618,7 +1630,7 @@ static PyObject *_wrap_wxHtmlHelpFrame_UseConfig(PyObject *self, PyObject *args, PyObject * _resultobj; wxHtmlHelpFrame * _arg0; wxConfigBase * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj2 = 0; @@ -1667,7 +1679,7 @@ static PyObject *_wrap_wxHtmlHelpFrame_ReadCustomization(PyObject *self, PyObjec PyObject * _resultobj; wxHtmlHelpFrame * _arg0; wxConfigBase * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj2 = 0; @@ -1716,7 +1728,7 @@ static PyObject *_wrap_wxHtmlHelpFrame_WriteCustomization(PyObject *self, PyObje PyObject * _resultobj; wxHtmlHelpFrame * _arg0; wxConfigBase * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj2 = 0; @@ -2117,7 +2129,7 @@ static PyObject *_wrap_wxHtmlHelpController_UseConfig(PyObject *self, PyObject * PyObject * _resultobj; wxHtmlHelpController * _arg0; wxConfigBase * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj2 = 0; @@ -2166,7 +2178,7 @@ static PyObject *_wrap_wxHtmlHelpController_ReadCustomization(PyObject *self, Py PyObject * _resultobj; wxHtmlHelpController * _arg0; wxConfigBase * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj2 = 0; @@ -2215,7 +2227,7 @@ static PyObject *_wrap_wxHtmlHelpController_WriteCustomization(PyObject *self, P PyObject * _resultobj; wxHtmlHelpController * _arg0; wxConfigBase * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj2 = 0; @@ -2337,11 +2349,11 @@ static PyMethodDef htmlhelpcMethods[] = { { "wxHtmlSearchStatus_GetCurIndex", (PyCFunction) _wrap_wxHtmlSearchStatus_GetCurIndex, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlSearchStatus_IsActive", (PyCFunction) _wrap_wxHtmlSearchStatus_IsActive, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlSearchStatus_Search", (PyCFunction) _wrap_wxHtmlSearchStatus_Search, METH_VARARGS | METH_KEYWORDS }, - { "wxHtmlContentsItem_m_Book_get", (PyCFunction) _wrap_wxHtmlContentsItem_m_Book_get, METH_VARARGS | METH_KEYWORDS }, - { "wxHtmlContentsItem_m_Page_get", (PyCFunction) _wrap_wxHtmlContentsItem_m_Page_get, METH_VARARGS | METH_KEYWORDS }, - { "wxHtmlContentsItem_m_Name_get", (PyCFunction) _wrap_wxHtmlContentsItem_m_Name_get, METH_VARARGS | METH_KEYWORDS }, - { "wxHtmlContentsItem_m_ID_get", (PyCFunction) _wrap_wxHtmlContentsItem_m_ID_get, METH_VARARGS | METH_KEYWORDS }, - { "wxHtmlContentsItem_m_Level_get", (PyCFunction) _wrap_wxHtmlContentsItem_m_Level_get, METH_VARARGS | METH_KEYWORDS }, + { "wxHtmlContentsItem_GetBook", (PyCFunction) _wrap_wxHtmlContentsItem_GetBook, METH_VARARGS | METH_KEYWORDS }, + { "wxHtmlContentsItem_GetPage", (PyCFunction) _wrap_wxHtmlContentsItem_GetPage, METH_VARARGS | METH_KEYWORDS }, + { "wxHtmlContentsItem_GetName", (PyCFunction) _wrap_wxHtmlContentsItem_GetName, METH_VARARGS | METH_KEYWORDS }, + { "wxHtmlContentsItem_GetID", (PyCFunction) _wrap_wxHtmlContentsItem_GetID, METH_VARARGS | METH_KEYWORDS }, + { "wxHtmlContentsItem_GetLevel", (PyCFunction) _wrap_wxHtmlContentsItem_GetLevel, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlBookRecord_GetFullPath", (PyCFunction) _wrap_wxHtmlBookRecord_GetFullPath, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlBookRecord_SetStart", (PyCFunction) _wrap_wxHtmlBookRecord_SetStart, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlBookRecord_SetBasePath", (PyCFunction) _wrap_wxHtmlBookRecord_SetBasePath, METH_VARARGS | METH_KEYWORDS }, @@ -2417,7 +2429,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxHtmlContentsItem","_struct_wxHtmlContentsItem",0}, { "_wxObject","_wxHtmlHelpController",SwigwxHtmlHelpControllerTowxObject}, { "_wxObject","_wxHtmlHelpFrame",SwigwxHtmlHelpFrameTowxObject}, - { "_wxObject","_wxHtmlBookRecord",SwigwxHtmlBookRecordTowxObject}, { "_signed_short","_WXTYPE",0}, { "_signed_short","_short",0}, { "_unsigned_char","_byte",0},