X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d7abf01706714b3eb7777555ce4d1db00d641e40..3d7a4fe81fa69e9c518a62174ef584bdbb6af7c3:/wxPython/contrib/iewin/iewin.cpp diff --git a/wxPython/contrib/iewin/iewin.cpp b/wxPython/contrib/iewin/iewin.cpp index ea84cf4f8e..9bd052c734 100644 --- a/wxPython/contrib/iewin/iewin.cpp +++ b/wxPython/contrib/iewin/iewin.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 *); @@ -57,6 +56,7 @@ extern PyObject *SWIG_newvarlink(void); #include "wxPython.h" #include "IEHtmlWin.h" +#include "pyistream.h" static PyObject* t_output_helper(PyObject* target, PyObject* o) { @@ -150,8 +150,8 @@ static PyObject *_wrap_new_wxMSHTMLEvent(PyObject *self, PyObject *args, PyObjec return _resultobj; } -#define wxMSHTMLEvent_GetText(_swigobj) (_swigobj->GetText()) -static PyObject *_wrap_wxMSHTMLEvent_GetText(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxMSHTMLEvent_GetText1(_swigobj) (_swigobj->GetText1()) +static PyObject *_wrap_wxMSHTMLEvent_GetText1(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxString * _result; wxMSHTMLEvent * _arg0; @@ -159,24 +159,24 @@ static PyObject *_wrap_wxMSHTMLEvent_GetText(PyObject *self, PyObject *args, PyO char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMSHTMLEvent_GetText",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMSHTMLEvent_GetText1",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMSHTMLEvent_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMSHTMLEvent_GetText. Expected _wxMSHTMLEvent_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMSHTMLEvent_GetText1. Expected _wxMSHTMLEvent_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = new wxString (wxMSHTMLEvent_GetText(_arg0)); + _result = new wxString (wxMSHTMLEvent_GetText1(_arg0)); wxPyEndAllowThreads(__tstate); 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 @@ -412,6 +412,55 @@ static PyObject *_wrap_wxIEHtmlWin_LoadString(PyObject *self, PyObject *args, Py return _resultobj; } +#define wxIEHtmlWin_LoadStream(_swigobj,_swigarg0) (_swigobj->LoadStream(_swigarg0)) +static PyObject *_wrap_wxIEHtmlWin_LoadStream(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxIEHtmlWin * _arg0; + wxInputStream * _arg1; + PyObject * _argo0 = 0; + wxPyInputStream * temp; + bool created; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","is", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxIEHtmlWin_LoadStream",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIEHtmlWin_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIEHtmlWin_LoadStream. Expected _wxIEHtmlWin_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; + } +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxIEHtmlWin_LoadStream(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (created) + delete _arg1; +} + return _resultobj; +} + #define wxIEHtmlWin_SetCharset(_swigobj,_swigarg0) (_swigobj->SetCharset(_swigarg0)) static PyObject *_wrap_wxIEHtmlWin_SetCharset(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -539,7 +588,7 @@ static PyObject *_wrap_wxIEHtmlWin_GetStringSelection(PyObject *self, PyObject * 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 @@ -579,7 +628,7 @@ static PyObject *_wrap_wxIEHtmlWin_GetText(PyObject *self, PyObject *args, PyObj 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 @@ -702,8 +751,8 @@ static PyObject *_wrap_wxIEHtmlWin_GoSearch(PyObject *self, PyObject *args, PyOb return _resultobj; } -#define wxIEHtmlWin_Refresh(_swigobj,_swigarg0) (_swigobj->Refresh(_swigarg0)) -static PyObject *_wrap_wxIEHtmlWin_Refresh(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxIEHtmlWin_RefreshPage(_swigobj,_swigarg0) (_swigobj->Refresh(_swigarg0)) +static PyObject *_wrap_wxIEHtmlWin_RefreshPage(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; bool _result; wxIEHtmlWin * _arg0; @@ -712,18 +761,18 @@ static PyObject *_wrap_wxIEHtmlWin_Refresh(PyObject *self, PyObject *args, PyObj char *_kwnames[] = { "self","level", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxIEHtmlWin_Refresh",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxIEHtmlWin_RefreshPage",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIEHtmlWin_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIEHtmlWin_Refresh. Expected _wxIEHtmlWin_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIEHtmlWin_RefreshPage. Expected _wxIEHtmlWin_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxIEHtmlWin_Refresh(_arg0,_arg1); + _result = (bool )wxIEHtmlWin_RefreshPage(_arg0,_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -761,7 +810,7 @@ static PyObject *_wrap_wxIEHtmlWin_Stop(PyObject *self, PyObject *args, PyObject static PyMethodDef iewincMethods[] = { { "wxIEHtmlWin_Stop", (PyCFunction) _wrap_wxIEHtmlWin_Stop, METH_VARARGS | METH_KEYWORDS }, - { "wxIEHtmlWin_Refresh", (PyCFunction) _wrap_wxIEHtmlWin_Refresh, METH_VARARGS | METH_KEYWORDS }, + { "wxIEHtmlWin_RefreshPage", (PyCFunction) _wrap_wxIEHtmlWin_RefreshPage, METH_VARARGS | METH_KEYWORDS }, { "wxIEHtmlWin_GoSearch", (PyCFunction) _wrap_wxIEHtmlWin_GoSearch, METH_VARARGS | METH_KEYWORDS }, { "wxIEHtmlWin_GoHome", (PyCFunction) _wrap_wxIEHtmlWin_GoHome, METH_VARARGS | METH_KEYWORDS }, { "wxIEHtmlWin_GoForward", (PyCFunction) _wrap_wxIEHtmlWin_GoForward, METH_VARARGS | METH_KEYWORDS }, @@ -771,12 +820,13 @@ static PyMethodDef iewincMethods[] = { { "wxIEHtmlWin_GetEditMode", (PyCFunction) _wrap_wxIEHtmlWin_GetEditMode, METH_VARARGS | METH_KEYWORDS }, { "wxIEHtmlWin_SetEditMode", (PyCFunction) _wrap_wxIEHtmlWin_SetEditMode, METH_VARARGS | METH_KEYWORDS }, { "wxIEHtmlWin_SetCharset", (PyCFunction) _wrap_wxIEHtmlWin_SetCharset, METH_VARARGS | METH_KEYWORDS }, + { "wxIEHtmlWin_LoadStream", (PyCFunction) _wrap_wxIEHtmlWin_LoadStream, METH_VARARGS | METH_KEYWORDS }, { "wxIEHtmlWin_LoadString", (PyCFunction) _wrap_wxIEHtmlWin_LoadString, METH_VARARGS | METH_KEYWORDS }, { "wxIEHtmlWin_LoadUrl", (PyCFunction) _wrap_wxIEHtmlWin_LoadUrl, METH_VARARGS | METH_KEYWORDS }, { "new_wxIEHtmlWin", (PyCFunction) _wrap_new_wxIEHtmlWin, METH_VARARGS | METH_KEYWORDS }, { "wxMSHTMLEvent_GetLong2", (PyCFunction) _wrap_wxMSHTMLEvent_GetLong2, METH_VARARGS | METH_KEYWORDS }, { "wxMSHTMLEvent_GetLong1", (PyCFunction) _wrap_wxMSHTMLEvent_GetLong1, METH_VARARGS | METH_KEYWORDS }, - { "wxMSHTMLEvent_GetText", (PyCFunction) _wrap_wxMSHTMLEvent_GetText, METH_VARARGS | METH_KEYWORDS }, + { "wxMSHTMLEvent_GetText1", (PyCFunction) _wrap_wxMSHTMLEvent_GetText1, METH_VARARGS | METH_KEYWORDS }, { "new_wxMSHTMLEvent", (PyCFunction) _wrap_new_wxMSHTMLEvent, METH_VARARGS | METH_KEYWORDS }, { NULL, NULL } };