X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/423f194a1411e8aac372de29ef4a7ab5f90acb04..7eae615bad8c72486efd0ec84a2bad5c2d5af3af:/wxPython/src/msw/html_wrap.cpp diff --git a/wxPython/src/msw/html_wrap.cpp b/wxPython/src/msw/html_wrap.cpp index cb1c29b653..a5073aefee 100644 --- a/wxPython/src/msw/html_wrap.cpp +++ b/wxPython/src/msw/html_wrap.cpp @@ -45,6 +45,8 @@ private: #define SWIG_TypeName SWIG_Python_TypeName #define SWIG_TypeQuery SWIG_Python_TypeQuery #define SWIG_TypeClientData SWIG_Python_TypeClientData +#define SWIG_PackData SWIG_Python_PackData +#define SWIG_UnpackData SWIG_Python_UnpackData /*********************************************************************** @@ -59,36 +61,35 @@ private: #include -#if defined(_WIN32) || defined(__WIN32__) -# if defined(_MSC_VER) -# if defined(STATIC_LINKED) -# define SWIGEXPORT(a) a -# define SWIGIMPORT(a) extern a -# else -# define SWIGEXPORT(a) __declspec(dllexport) a -# define SWIGIMPORT(a) extern a -# endif -# else -# if defined(__BORLANDC__) -# define SWIGEXPORT(a) a _export -# define SWIGIMPORT(a) a _export -# else -# define SWIGEXPORT(a) a -# define SWIGIMPORT(a) a -# endif -# endif +#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(_MSC_VER) || defined(__GNUC__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT(a) a +# define SWIGIMPORT(a) extern a +# else +# define SWIGEXPORT(a) __declspec(dllexport) a +# define SWIGIMPORT(a) extern a +# endif +# else +# if defined(__BORLANDC__) +# define SWIGEXPORT(a) a _export +# define SWIGIMPORT(a) a _export +# else +# define SWIGEXPORT(a) a +# define SWIGIMPORT(a) a +# endif +# endif #else -# define SWIGEXPORT(a) a -# define SWIGIMPORT(a) a +# define SWIGEXPORT(a) a +# define SWIGIMPORT(a) a #endif #ifdef SWIG_GLOBAL -#define SWIGRUNTIME(a) SWIGEXPORT(a) +# define SWIGRUNTIME(a) SWIGEXPORT(a) #else -#define SWIGRUNTIME(a) static a +# define SWIGRUNTIME(a) static a #endif - #ifdef __cplusplus extern "C" { #endif @@ -97,10 +98,10 @@ typedef void *(*swig_converter_func)(void *); typedef struct swig_type_info *(*swig_dycast_func)(void **); typedef struct swig_type_info { - const char *name; + const char *name; swig_converter_func converter; const char *str; - void *clientdata; + void *clientdata; swig_dycast_func dcast; struct swig_type_info *next; struct swig_type_info *prev; @@ -114,6 +115,8 @@ SWIGIMPORT(swig_type_info *) SWIG_TypeDynamicCast(swig_type_info *, void **); SWIGIMPORT(const char *) SWIG_TypeName(const swig_type_info *); SWIGIMPORT(swig_type_info *) SWIG_TypeQuery(const char *); SWIGIMPORT(void) SWIG_TypeClientData(swig_type_info *, void *); +SWIGIMPORT(char *) SWIG_PackData(char *, void *, int); +SWIGIMPORT(char *) SWIG_UnpackData(char *, void *, int); #ifdef __cplusplus @@ -121,6 +124,7 @@ SWIGIMPORT(void) SWIG_TypeClientData(swig_type_info *, void *); #endif + /*********************************************************************** * pyrun.swg for wxPython * @@ -131,7 +135,6 @@ SWIGIMPORT(void) SWIG_TypeClientData(swig_type_info *, void *); * ************************************************************************/ - #include "Python.h" #ifdef __cplusplus @@ -162,8 +165,6 @@ typedef struct swig_const_info { swig_type_info **ptype; } swig_const_info; - - /* Common SWIG API */ #define SWIG_ConvertPtr(obj, pp, type, flags) \ SWIG_Python_ConvertPtr(obj, pp, type, flags) @@ -179,34 +180,27 @@ typedef struct swig_const_info { SWIG_Python_addvarlink(p, name, get_attr, set_attr) #define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) \ SWIG_Python_ConvertPacked(obj, ptr, sz, ty, flags) -#define SWIG_PackData(c, ptr, sz) \ - SWIG_Python_PackData(c, ptr, sz) -#define SWIG_UnpackData(c, ptr, sz) \ - SWIG_Python_UnpackData(c, ptr, sz) #define SWIG_NewPackedObj(ptr, sz, type) \ SWIG_Python_NewPackedObj(ptr, sz, type) #define SWIG_InstallConstants(d, constants) \ SWIG_Python_InstallConstants(d, constants) -SWIGEXPORT(int) SWIG_Python_ConvertPtr(PyObject *, void **, swig_type_info *, int); -SWIGEXPORT(PyObject *) SWIG_Python_NewPointerObj(void *, swig_type_info *,int own); -SWIGEXPORT(void *) SWIG_Python_MustGetPtr(PyObject *, swig_type_info *, int, int); +SWIGIMPORT(int) SWIG_Python_ConvertPtr(PyObject *, void **, swig_type_info *, int); +SWIGIMPORT(PyObject *) SWIG_Python_NewPointerObj(void *, swig_type_info *,int own); +SWIGIMPORT(void *) SWIG_Python_MustGetPtr(PyObject *, swig_type_info *, int, int); +SWIGIMPORT(PyObject *) SWIG_Python_newvarlink(void); +SWIGIMPORT(void) SWIG_Python_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *)); +SWIGIMPORT(int) SWIG_Python_ConvertPacked(PyObject *, void *, int sz, swig_type_info *, int); +SWIGIMPORT(PyObject *) SWIG_Python_NewPackedObj(void *, int sz, swig_type_info *); +SWIGIMPORT(void) SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]); -SWIGEXPORT(PyObject *) SWIG_Python_newvarlink(void); -SWIGEXPORT(void) SWIG_Python_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *)); -SWIGEXPORT(int) SWIG_Python_ConvertPacked(PyObject *, void *, int sz, swig_type_info *, int); -SWIGEXPORT(char *) SWIG_Python_PackData(char *c, void *, int); -SWIGEXPORT(char *) SWIG_Python_UnpackData(char *c, void *, int); -SWIGEXPORT(PyObject *) SWIG_Python_NewPackedObj(void *, int sz, swig_type_info *); -SWIGEXPORT(void) SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]); /* Contract support */ #define SWIG_contract_assert(expr, msg) if (!(expr)) { PyErr_SetString(PyExc_RuntimeError, (char *) msg ); goto fail; } else - #ifdef __cplusplus } #endif @@ -288,15 +282,10 @@ static swig_type_info *swig_types[52]; #include - DECLARE_DEF_STRING(EmptyString); - static const wxChar* wxHtmlWindowNameStr = wxT("htmlWindow"); - DECLARE_DEF_STRING(HtmlWindowNameStr); - static const wxChar* wxHtmlPrintoutTitleStr = wxT("Printout"); - DECLARE_DEF_STRING(HtmlPrintoutTitleStr); - static const wxChar* wxHtmlPrintingTitleStr = wxT("Printing"); - DECLARE_DEF_STRING(HtmlPrintingTitleStr); - - + static const wxString wxPyEmptyString(wxEmptyString); + static const wxString wxPyHtmlWindowNameStr(wxT("htmlWindow")); + static const wxString wxPyHtmlPrintoutTitleStr(wxT("Printout")); + static const wxString wxPyHtmlPrintingTitleStr(wxT("Printing")); void wxHtmlWinParser_SetFonts(wxHtmlWinParser *self,wxString normal_face,wxString fixed_face,PyObject *sizes){ int* temp = NULL; if (sizes) temp = int_LIST_helper(sizes); @@ -372,15 +361,17 @@ public: // First, make a new instance of the tag handler wxPyBeginBlockThreads(); - PyObject* arg = Py_BuildValue("()"); - PyObject* obj = PyInstance_New(m_tagHandlerClass, arg, NULL); + PyObject* arg = PyTuple_New(0); + PyObject* obj = PyObject_CallObject(m_tagHandlerClass, arg); Py_DECREF(arg); - wxPyEndBlockThreads(); - + // now figure out where it's C++ object is... wxPyHtmlWinTagHandler* thPtr; - if (! wxPyConvertSwigPtr(obj, (void **)&thPtr, wxT("wxPyHtmlWinTagHandler"))) + if (! wxPyConvertSwigPtr(obj, (void **)&thPtr, wxT("wxPyHtmlWinTagHandler"))) { + wxPyEndBlockThreads(); return; + } + wxPyEndBlockThreads(); // add it, parser->AddTagHandler(thPtr); @@ -602,6 +593,66 @@ wxHtmlBookRecord *wxHtmlContentsItem_GetBook(wxHtmlContentsItem *self){ return s #ifdef __cplusplus extern "C" { #endif +static int _wrap_HtmlWindowNameStr_set(PyObject *_val) { + PyErr_SetString(PyExc_TypeError,"Variable HtmlWindowNameStr is read-only."); + return 1; +} + + +static PyObject *_wrap_HtmlWindowNameStr_get() { + PyObject *pyobj; + + { +#if wxUSE_UNICODE + pyobj = PyUnicode_FromWideChar((&wxPyHtmlWindowNameStr)->c_str(), (&wxPyHtmlWindowNameStr)->Len()); +#else + pyobj = PyString_FromStringAndSize((&wxPyHtmlWindowNameStr)->c_str(), (&wxPyHtmlWindowNameStr)->Len()); +#endif + } + return pyobj; +} + + +static int _wrap_HtmlPrintoutTitleStr_set(PyObject *_val) { + PyErr_SetString(PyExc_TypeError,"Variable HtmlPrintoutTitleStr is read-only."); + return 1; +} + + +static PyObject *_wrap_HtmlPrintoutTitleStr_get() { + PyObject *pyobj; + + { +#if wxUSE_UNICODE + pyobj = PyUnicode_FromWideChar((&wxPyHtmlPrintoutTitleStr)->c_str(), (&wxPyHtmlPrintoutTitleStr)->Len()); +#else + pyobj = PyString_FromStringAndSize((&wxPyHtmlPrintoutTitleStr)->c_str(), (&wxPyHtmlPrintoutTitleStr)->Len()); +#endif + } + return pyobj; +} + + +static int _wrap_HtmlPrintingTitleStr_set(PyObject *_val) { + PyErr_SetString(PyExc_TypeError,"Variable HtmlPrintingTitleStr is read-only."); + return 1; +} + + +static PyObject *_wrap_HtmlPrintingTitleStr_get() { + PyObject *pyobj; + + { +#if wxUSE_UNICODE + pyobj = PyUnicode_FromWideChar((&wxPyHtmlPrintingTitleStr)->c_str(), (&wxPyHtmlPrintingTitleStr)->Len()); +#else + pyobj = PyString_FromStringAndSize((&wxPyHtmlPrintingTitleStr)->c_str(), (&wxPyHtmlPrintingTitleStr)->Len()); +#endif + } + return pyobj; +} + + static PyObject *_wrap_new_HtmlLinkInfo(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxString *arg1 = 0 ; @@ -3674,6 +3725,80 @@ static PyObject *_wrap_HtmlCell_GetDescent(PyObject *self, PyObject *args, PyObj } +static PyObject *_wrap_HtmlCell_GetId(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxHtmlCell *arg1 = (wxHtmlCell *) 0 ; + wxString *result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:HtmlCell_GetId",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxHtmlCell,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + { + wxString const &_result_ref = ((wxHtmlCell const *)arg1)->GetId(); + result = (wxString *) &_result_ref; + } + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { +#if wxUSE_UNICODE + resultobj = PyUnicode_FromWideChar(result->c_str(), result->Len()); +#else + resultobj = PyString_FromStringAndSize(result->c_str(), result->Len()); +#endif + } + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_HtmlCell_SetId(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxHtmlCell *arg1 = (wxHtmlCell *) 0 ; + wxString *arg2 = 0 ; + bool temp2 = False ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "id", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:HtmlCell_SetId",kwnames,&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxHtmlCell,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + { + arg2 = wxString_in_helper(obj1); + if (arg2 == NULL) SWIG_fail; + temp2 = True; + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->SetId((wxString const &)*arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + { + if (temp2) + delete arg2; + } + return resultobj; + fail: + { + if (temp2) + delete arg2; + } + return NULL; +} + + static PyObject *_wrap_HtmlCell_GetLink(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxHtmlCell *arg1 = (wxHtmlCell *) 0 ; @@ -8081,7 +8206,13 @@ static PyObject *_wrap_HtmlSearchStatus_GetName(PyObject *self, PyObject *args, wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxString, 0); + { +#if wxUSE_UNICODE + resultobj = PyUnicode_FromWideChar(result->c_str(), result->Len()); +#else + resultobj = PyString_FromStringAndSize(result->c_str(), result->Len()); +#endif + } return resultobj; fail: return NULL; @@ -9451,6 +9582,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"HtmlCell_GetWidth", (PyCFunction) _wrap_HtmlCell_GetWidth, METH_VARARGS | METH_KEYWORDS }, { (char *)"HtmlCell_GetHeight", (PyCFunction) _wrap_HtmlCell_GetHeight, METH_VARARGS | METH_KEYWORDS }, { (char *)"HtmlCell_GetDescent", (PyCFunction) _wrap_HtmlCell_GetDescent, METH_VARARGS | METH_KEYWORDS }, + { (char *)"HtmlCell_GetId", (PyCFunction) _wrap_HtmlCell_GetId, METH_VARARGS | METH_KEYWORDS }, + { (char *)"HtmlCell_SetId", (PyCFunction) _wrap_HtmlCell_SetId, METH_VARARGS | METH_KEYWORDS }, { (char *)"HtmlCell_GetLink", (PyCFunction) _wrap_HtmlCell_GetLink, METH_VARARGS | METH_KEYWORDS }, { (char *)"HtmlCell_GetNext", (PyCFunction) _wrap_HtmlCell_GetNext, METH_VARARGS | METH_KEYWORDS }, { (char *)"HtmlCell_GetParent", (PyCFunction) _wrap_HtmlCell_GetParent, METH_VARARGS | METH_KEYWORDS }, @@ -10184,9 +10317,6 @@ static void *_p_wxNavigationKeyEventTo_p_wxObject(void *x) { static void *_p_wxKeyEventTo_p_wxObject(void *x) { return (void *)((wxObject *) (wxEvent *) ((wxKeyEvent *) x)); } -static void *_p_wxScrolledWindowTo_p_wxObject(void *x) { - return (void *)((wxObject *) (wxEvtHandler *)(wxWindow *)(wxPanel *) ((wxScrolledWindow *) x)); -} static void *_p_wxWindowTo_p_wxObject(void *x) { return (void *)((wxObject *) (wxEvtHandler *) ((wxWindow *) x)); } @@ -10196,6 +10326,9 @@ static void *_p_wxMenuTo_p_wxObject(void *x) { static void *_p_wxMenuBarTo_p_wxObject(void *x) { return (void *)((wxObject *) (wxEvtHandler *)(wxWindow *) ((wxMenuBar *) x)); } +static void *_p_wxScrolledWindowTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvtHandler *)(wxWindow *)(wxPanel *) ((wxScrolledWindow *) x)); +} static void *_p_wxTopLevelWindowTo_p_wxObject(void *x) { return (void *)((wxObject *) (wxEvtHandler *)(wxWindow *) ((wxTopLevelWindow *) x)); } @@ -10662,6 +10795,13 @@ static swig_const_info swig_const_table[] = { { SWIG_PY_INT, (char *)"HTML_COND_ISANCHOR", (long) wxHTML_COND_ISANCHOR, 0, 0, 0}, { SWIG_PY_INT, (char *)"HTML_COND_ISIMAGEMAP", (long) wxHTML_COND_ISIMAGEMAP, 0, 0, 0}, { SWIG_PY_INT, (char *)"HTML_COND_USER", (long) wxHTML_COND_USER, 0, 0, 0}, +{ SWIG_PY_INT, (char *)"HTML_FONT_SIZE_1", (long) wxHTML_FONT_SIZE_1, 0, 0, 0}, +{ SWIG_PY_INT, (char *)"HTML_FONT_SIZE_2", (long) wxHTML_FONT_SIZE_2, 0, 0, 0}, +{ SWIG_PY_INT, (char *)"HTML_FONT_SIZE_3", (long) wxHTML_FONT_SIZE_3, 0, 0, 0}, +{ SWIG_PY_INT, (char *)"HTML_FONT_SIZE_4", (long) wxHTML_FONT_SIZE_4, 0, 0, 0}, +{ SWIG_PY_INT, (char *)"HTML_FONT_SIZE_5", (long) wxHTML_FONT_SIZE_5, 0, 0, 0}, +{ SWIG_PY_INT, (char *)"HTML_FONT_SIZE_6", (long) wxHTML_FONT_SIZE_6, 0, 0, 0}, +{ SWIG_PY_INT, (char *)"HTML_FONT_SIZE_7", (long) wxHTML_FONT_SIZE_7, 0, 0, 0}, { SWIG_PY_INT, (char *)"HW_SCROLLBAR_NEVER", (long) wxHW_SCROLLBAR_NEVER, 0, 0, 0}, { SWIG_PY_INT, (char *)"HW_SCROLLBAR_AUTO", (long) wxHW_SCROLLBAR_AUTO, 0, 0, 0}, { SWIG_PY_INT, (char *)"HW_NO_SELECTION", (long) wxHW_NO_SELECTION, 0, 0, 0}, @@ -10716,6 +10856,10 @@ SWIGEXPORT(void) SWIG_init(void) { } SWIG_InstallConstants(d,swig_const_table); + PyDict_SetItemString(d,(char*)"cvar", SWIG_globals); + SWIG_addvarlink(SWIG_globals,(char*)"HtmlWindowNameStr",_wrap_HtmlWindowNameStr_get, _wrap_HtmlWindowNameStr_set); + SWIG_addvarlink(SWIG_globals,(char*)"HtmlPrintoutTitleStr",_wrap_HtmlPrintoutTitleStr_get, _wrap_HtmlPrintoutTitleStr_set); + SWIG_addvarlink(SWIG_globals,(char*)"HtmlPrintingTitleStr",_wrap_HtmlPrintingTitleStr_get, _wrap_HtmlPrintingTitleStr_set); wxPyPtrTypeMap_Add("wxHtmlTagHandler", "wxPyHtmlTagHandler"); wxPyPtrTypeMap_Add("wxHtmlWinTagHandler", "wxPyHtmlWinTagHandler");