X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ad48a30eec981b8f5a3d4fa0321f746b2f66a2d4..0e980f91092ded629a7b014ff0d2238b1c8940c5:/wxPython/src/html.i?ds=inline diff --git a/wxPython/src/html.i b/wxPython/src/html.i index 4b5ef2274c..6bc207ffbf 100644 --- a/wxPython/src/html.i +++ b/wxPython/src/html.i @@ -75,18 +75,21 @@ enum { //--------------------------------------------------------------------------- -class wxHtmlLinkInfo { +class wxHtmlLinkInfo : public wxObject { public: wxHtmlLinkInfo(const wxString& href, const wxString& target = wxEmptyString); wxString GetHref(); wxString GetTarget(); wxMouseEvent* GetEvent(); wxHtmlCell* GetHtmlCell(); + + void SetEvent(const wxMouseEvent *e); + void SetHtmlCell(const wxHtmlCell * e); }; //--------------------------------------------------------------------------- -class wxHtmlTag { +class wxHtmlTag : public wxObject { public: // Never need to create a new tag from Python... //wxHtmlTag(const wxString& source, int pos, int end_pos, wxHtmlTagsCache* cache); @@ -109,7 +112,7 @@ public: //--------------------------------------------------------------------------- -class wxHtmlParser { +class wxHtmlParser : public wxObject { public: // wxHtmlParser(); This is an abstract base class... @@ -186,6 +189,7 @@ public: %{ class wxPyHtmlTagHandler : public wxHtmlTagHandler { + DECLARE_DYNAMIC_CLASS(wxPyHtmlTagHandler); public: wxPyHtmlTagHandler() : wxHtmlTagHandler() {}; @@ -198,12 +202,14 @@ public: PYPRIVATE; }; +IMPLEMENT_DYNAMIC_CLASS(wxPyHtmlTagHandler, wxHtmlTagHandler); + IMP_PYCALLBACK_STRING__pure(wxPyHtmlTagHandler, wxHtmlTagHandler, GetSupportedTags); IMP_PYCALLBACK_BOOL_TAG_pure(wxPyHtmlTagHandler, wxHtmlTagHandler, HandleTag); %} -%name(wxHtmlTagHandler) class wxPyHtmlTagHandler { +%name(wxHtmlTagHandler) class wxPyHtmlTagHandler : public wxObject { public: wxPyHtmlTagHandler(); @@ -220,6 +226,7 @@ public: %{ class wxPyHtmlWinTagHandler : public wxHtmlWinTagHandler { + DECLARE_DYNAMIC_CLASS(wxPyHtmlWinTagHandler); public: wxPyHtmlWinTagHandler() : wxHtmlWinTagHandler() {}; @@ -233,6 +240,8 @@ public: PYPRIVATE; }; +IMPLEMENT_DYNAMIC_CLASS( wxPyHtmlWinTagHandler, wxHtmlWinTagHandler); + IMP_PYCALLBACK_STRING__pure(wxPyHtmlWinTagHandler, wxHtmlWinTagHandler, GetSupportedTags); IMP_PYCALLBACK_BOOL_TAG_pure(wxPyHtmlWinTagHandler, wxHtmlWinTagHandler, HandleTag); %} @@ -318,7 +327,7 @@ private: //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- -class wxHtmlCell { +class wxHtmlCell : public wxObject { public: wxHtmlCell(); @@ -345,6 +354,13 @@ public: }; +class wxHtmlWordCell : public wxHtmlCell +{ +public: + wxHtmlWordCell(const wxString& word, wxDC& dc); +}; + + class wxHtmlContainerCell : public wxHtmlCell { public: wxHtmlContainerCell(wxHtmlContainerCell *parent); @@ -375,6 +391,12 @@ public: }; +class wxHtmlFontCell : public wxHtmlCell +{ +public: + wxHtmlFontCell(wxFont *font); +}; + class wxHtmlWidgetCell : public wxHtmlCell { public: @@ -388,19 +410,6 @@ public: //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- -// item of history list -class HtmlHistoryItem { -public: - HtmlHistoryItem(const char* p, const char* a); - - int GetPos(); - void SetPos(int p); - const wxString& GetPage(); - const wxString& GetAnchor(); -}; - - -//--------------------------------------------------------------------------- %{ class wxPyHtmlWindow : public wxHtmlWindow { public: @@ -421,7 +430,7 @@ public: IMP_PYCALLBACK__STRING(wxPyHtmlWindow, wxHtmlWindow, OnSetTitle); - void wxPyHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link) { +void wxPyHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link) { bool doSave = wxPyRestoreThread(); if (wxPyCBH_findCallback(m_myInst, "OnLinkClicked")) { PyObject* obj = wxPyConstructObject((void*)&link, "wxHtmlLinkInfo", 0); @@ -453,9 +462,12 @@ public: %pragma(python) addtomethod = "__init__:#wx._StdOnScrollCallbacks(self)" - bool SetPage(const char* source); - bool LoadPage(const char* location); + bool SetPage(const wxString& source); + bool LoadPage(const wxString& location); wxString GetOpenedPage(); + wxString GetOpenedAnchor(); + wxString GetOpenedPageTitle(); + void SetRelatedFrame(wxFrame* frame, const char* format); wxFrame* GetRelatedFrame(); void SetRelatedStatusBar(int bar); @@ -471,12 +483,14 @@ public: } } - void SetTitle(const char* title); + void SetTitle(const wxString& title); void SetBorders(int b); - void ReadCustomization(wxConfigBase *cfg, char* path = ""); - void WriteCustomization(wxConfigBase *cfg, char* path = ""); + void ReadCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); + void WriteCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); bool HistoryBack(); bool HistoryForward(); + bool HistoryCanBack(); + bool HistoryCanForward(); void HistoryClear(); wxHtmlContainerCell* GetInternalRepresentation(); wxHtmlWinParser* GetParser(); @@ -497,7 +511,7 @@ public: //--------------------------------------------------------------------------- -class wxHtmlDCRenderer { +class wxHtmlDCRenderer : public wxObject { public: wxHtmlDCRenderer(); ~wxHtmlDCRenderer(); @@ -523,7 +537,7 @@ enum { class wxHtmlPrintout : public wxPyPrintout { public: wxHtmlPrintout(const char* title = "Printout"); - //~wxHtmlPrintout(); + //~wxHtmlPrintout(); wxPrintPreview object takes ownership... void SetHtmlText(const wxString& html, const wxString &basepath = wxEmptyString, @@ -538,7 +552,7 @@ public: -class wxHtmlEasyPrinting { +class wxHtmlEasyPrinting : public wxObject { public: wxHtmlEasyPrinting(const char* name = "Printing", wxFrame *parent_frame = NULL); @@ -574,6 +588,10 @@ public: wxClassInfo::CleanUpClasses(); wxClassInfo::InitializeClasses(); + + wxPyPtrTypeMap_Add("wxHtmlTagHandler", "wxPyHtmlTagHandler"); + wxPyPtrTypeMap_Add("wxHtmlWinTagHandler", "wxPyHtmlWinTagHandler"); + wxPyPtrTypeMap_Add("wxHtmlWindow", "wxPyHtmlWindow"); %} //---------------------------------------------------------------------- @@ -583,4 +601,3 @@ public: %pragma(python) include="_htmlextras.py"; //--------------------------------------------------------------------------- -