+
+%name(wxHtmlTagHandler) class wxPyHtmlTagHandler {
+public:
+ wxPyHtmlTagHandler();
+
+ void _setSelf(PyObject* self);
+ %pragma(python) addtomethod = "__init__:self._setSelf(self)"
+
+ void SetParser(wxHtmlParser *parser);
+ wxHtmlParser* GetParser();
+ void ParseInner(const wxHtmlTag& tag);
+};
+
+
+//---------------------------------------------------------------------------
+
+%{
+class wxPyHtmlWinTagHandler : public wxHtmlWinTagHandler {
+public:
+ wxPyHtmlWinTagHandler() : wxHtmlWinTagHandler() {};
+
+ wxHtmlWinParser* GetParser() { return m_WParser; }
+ void ParseInner(const wxHtmlTag& tag)
+ { wxHtmlWinTagHandler::ParseInner(tag); }
+
+ DEC_PYCALLBACK_STRING__pure(GetSupportedTags);
+ DEC_PYCALLBACK_BOOL_TAG_pure(HandleTag);
+
+ PYPRIVATE;
+};
+
+IMP_PYCALLBACK_STRING__pure(wxPyHtmlWinTagHandler, wxHtmlWinTagHandler, GetSupportedTags);
+IMP_PYCALLBACK_BOOL_TAG_pure(wxPyHtmlWinTagHandler, wxHtmlWinTagHandler, HandleTag);
+%}
+
+
+%name(wxHtmlWinTagHandler) class wxPyHtmlWinTagHandler : public wxPyHtmlTagHandler {
+public:
+ wxPyHtmlWinTagHandler();
+
+ void _setSelf(PyObject* self);
+ %pragma(python) addtomethod = "__init__:self._setSelf(self)"
+
+ void SetParser(wxHtmlParser *parser);
+ wxHtmlWinParser* GetParser();
+ void ParseInner(const wxHtmlTag& tag);
+};
+
+
+//---------------------------------------------------------------------------
+
+%{
+
+class wxPyHtmlTagsModule : public wxHtmlTagsModule {
+public:
+ wxPyHtmlTagsModule(PyObject* thc) : wxHtmlTagsModule() {
+ m_tagHandlerClass = thc;
+ Py_INCREF(m_tagHandlerClass);
+ RegisterModule(this);
+ wxHtmlWinParser::AddModule(this);
+ }
+
+ void OnExit() {
+ Py_DECREF(m_tagHandlerClass);
+ m_tagHandlerClass = NULL;
+ for (int x=0; x < m_objArray.GetCount(); x++) {
+ PyObject* obj = (PyObject*)m_objArray.Item(x);
+ Py_DECREF(obj);
+ }
+ };
+
+ void FillHandlersTable(wxHtmlWinParser *parser) {
+ // Wave our magic wand... (if it works it's a miracle! ;-)
+
+ // First, make a new instance of the tag handler
+ bool doSave = wxPyRestoreThread();
+ PyObject* arg = Py_BuildValue("()");
+ PyObject* obj = PyInstance_New(m_tagHandlerClass, arg, NULL);
+ Py_DECREF(arg);
+ wxPySaveThread(doSave);
+
+ // now figure out where it's C++ object is...
+ wxPyHtmlWinTagHandler* thPtr;
+ if (SWIG_GetPtrObj(obj, (void **)&thPtr, "_wxPyHtmlWinTagHandler_p"))
+ return;
+
+ // add it,
+ parser->AddTagHandler(thPtr);
+
+ // and track it.
+ m_objArray.Add(obj);
+ }
+
+private:
+ PyObject* m_tagHandlerClass;
+ wxArrayPtrVoid m_objArray;
+
+};
+%}
+
+
+
+%inline %{
+ void wxHtmlWinParser_AddTagHandler(PyObject* tagHandlerClass) {
+ // Dynamically create a new wxModule. Refcounts tagHandlerClass
+ // and adds itself to the wxModules list and to the wxHtmlWinParser.
+ new wxPyHtmlTagsModule(tagHandlerClass);
+ }
+%}
+
+//---------------------------------------------------------------------------
+//---------------------------------------------------------------------------
+
+class wxHtmlCell {
+public:
+ wxHtmlCell();
+
+ void SetParent(wxHtmlContainerCell *p);
+ wxHtmlContainerCell* GetParent();
+ int GetPosX();
+ int GetPosY();
+ int GetWidth();
+ int GetHeight();
+ int GetDescent();
+ wxString GetLink(int x = 0, int y = 0);
+ wxHtmlCell* GetNext();
+ void SetPos(int x, int y);
+ void SetLink(const wxString& link);
+ void SetNext(wxHtmlCell *cell);
+ void Layout(int w);
+ void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
+ void DrawInvisible(wxDC& dc, int x, int y);
+ const wxHtmlCell* Find(int condition, const void* param);
+};
+
+
+class wxHtmlContainerCell : public wxHtmlCell {
+public:
+ wxHtmlContainerCell(wxHtmlContainerCell *parent);
+
+ void InsertCell(wxHtmlCell *cell);
+ void SetAlignHor(int al);
+ int GetAlignHor();
+ void SetAlignVer(int al);
+ int GetAlignVer();
+ void SetIndent(int i, int what, int units = HTML_UNITS_PIXELS);
+ int GetIndent(int ind);
+ int GetIndentUnits(int ind);
+ void SetAlign(const wxHtmlTag& tag);
+ void SetWidthFloat(int w, int units);
+ %name(SetWidthFloatFromTag)void SetWidthFloat(const wxHtmlTag& tag);
+ void SetMinHeight(int h, int align = HTML_ALIGN_TOP);
+ int GetMaxLineWidth();
+ void SetBackgroundColour(const wxColour& clr);
+ void SetBorder(const wxColour& clr1, const wxColour& clr2);
+ wxHtmlCell* GetFirstCell();
+};
+
+
+
+
+class wxHtmlWidgetCell : public wxHtmlCell {
+public:
+ wxHtmlWidgetCell(wxWindow* wnd, int w = 0);
+
+};
+
+
+
+//---------------------------------------------------------------------------
+//---------------------------------------------------------------------------