X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/42781abb2fcbd6550228c467f32fd826ec87b2b4..577579933d98787229fd5a197cd9bdc8798c9bc4:/wxPython/src/html.i?ds=sidebyside diff --git a/wxPython/src/html.i b/wxPython/src/html.i index b19cada0c0..b2a8fd5f12 100644 --- a/wxPython/src/html.i +++ b/wxPython/src/html.i @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include @@ -50,7 +50,6 @@ MAKE_CONST_WXSTRING2(HtmlPrintingTitleStr, wxT("Printing")) // TODO: Split this file into multiple %included files that coresponds to the // wx/html include files (more or less.) -//--------------------------------------------------------------------------- //--------------------------------------------------------------------------- %newgroup @@ -245,7 +244,7 @@ public: %{ class wxPyHtmlTagHandler : public wxHtmlTagHandler { - DECLARE_DYNAMIC_CLASS(wxPyHtmlTagHandler); + DECLARE_DYNAMIC_CLASS(wxPyHtmlTagHandler) public: wxPyHtmlTagHandler() : wxHtmlTagHandler() {}; @@ -283,7 +282,7 @@ public: %{ class wxPyHtmlWinTagHandler : public wxHtmlWinTagHandler { - DECLARE_DYNAMIC_CLASS(wxPyHtmlWinTagHandler); + DECLARE_DYNAMIC_CLASS(wxPyHtmlWinTagHandler) public: wxPyHtmlWinTagHandler() : wxHtmlWinTagHandler() {}; @@ -385,6 +384,10 @@ private: //--------------------------------------------------------------------------- + +%typemap(out) wxHtmlCell* { $result = wxPyMake_wxObject($1, $owner); } +%typemap(out) const wxHtmlCell* { $result = wxPyMake_wxObject($1, $owner); } + //--------------------------------------------------------------------------- %newgroup @@ -500,7 +503,13 @@ enum class wxHtmlCell : public wxObject { public: + %typemap(out) wxHtmlCell*; // turn off this typemap + wxHtmlCell(); + ~wxHtmlCell(); + + // Turn it back on again + %typemap(out) wxHtmlCell* { $result = wxPyMake_wxObject($1, $owner); } int GetPosX(); int GetPosY(); @@ -528,7 +537,11 @@ public: void SetLink(const wxHtmlLinkInfo& link); + + %disownarg(wxHtmlCell*); void SetNext(wxHtmlCell *cell); + %cleardisown(wxHtmlCell*); + void SetParent(wxHtmlContainerCell *p); void SetPos(int x, int y); void Layout(int w); @@ -583,6 +596,9 @@ class wxHtmlWordCell : public wxHtmlCell { public: wxHtmlWordCell(const wxString& word, wxDC& dc); + wxString ConvertToText(wxHtmlSelection *sel) const; + bool IsLinebreakAllowed() const; + void SetPreviousWord(wxHtmlWordCell *cell); }; @@ -590,7 +606,10 @@ class wxHtmlContainerCell : public wxHtmlCell { public: wxHtmlContainerCell(wxHtmlContainerCell *parent); + %disownarg(wxHtmlCell*); void InsertCell(wxHtmlCell *cell); + %cleardisown(wxHtmlCell*); + void SetAlignHor(int al); int GetAlignHor(); void SetAlignVer(int al); @@ -642,7 +661,7 @@ public: %{ // here's the C++ version class wxPyHtmlFilter : public wxHtmlFilter { - DECLARE_ABSTRACT_CLASS(wxPyHtmlFilter); + DECLARE_ABSTRACT_CLASS(wxPyHtmlFilter) public: wxPyHtmlFilter() : wxHtmlFilter() {} @@ -710,7 +729,7 @@ public: %{ class wxPyHtmlWindow : public wxHtmlWindow { - DECLARE_ABSTRACT_CLASS(wxPyHtmlWindow); + DECLARE_ABSTRACT_CLASS(wxPyHtmlWindow) public: wxPyHtmlWindow(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, @@ -730,7 +749,6 @@ public: } void OnLinkClicked(const wxHtmlLinkInfo& link); - void base_OnLinkClicked(const wxHtmlLinkInfo& link); wxHtmlOpeningStatus OnOpeningURL(wxHtmlURLType type, const wxString& url, @@ -760,9 +778,6 @@ void wxPyHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link) { if (! found) wxHtmlWindow::OnLinkClicked(link); } -void wxPyHtmlWindow::base_OnLinkClicked(const wxHtmlLinkInfo& link) { - wxHtmlWindow::OnLinkClicked(link); -} wxHtmlOpeningStatus wxPyHtmlWindow::OnOpeningURL(wxHtmlURLType type, @@ -939,12 +954,16 @@ public: // Converts current page to text: wxString ToText(); - void base_OnLinkClicked(const wxHtmlLinkInfo& link); - void base_OnSetTitle(const wxString& title); - void base_OnCellMouseHover(wxHtmlCell *cell, wxCoord x, wxCoord y); - void base_OnCellClicked(wxHtmlCell *cell, - wxCoord x, wxCoord y, - const wxMouseEvent& event); + void OnLinkClicked(const wxHtmlLinkInfo& link); + void OnSetTitle(const wxString& title); + void OnCellMouseHover(wxHtmlCell *cell, wxCoord x, wxCoord y); + void OnCellClicked(wxHtmlCell *cell, + wxCoord x, wxCoord y, + const wxMouseEvent& event); + %MAKE_BASE_FUNC(HtmlWindow, OnLinkClicked); + %MAKE_BASE_FUNC(HtmlWindow, OnSetTitle); + %MAKE_BASE_FUNC(HtmlWindow, OnCellMouseHover); + %MAKE_BASE_FUNC(HtmlWindow, OnCellClicked); static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); @@ -1139,10 +1158,6 @@ public: int GetCurIndex(); int GetMaxIndex(); const wxString& GetName(); - // WXWIN_COMPATIBILITY_2_4 -#if 0 - wxHtmlContentsItem* GetContentsItem(); -#endif }; //--------------------------------------------------------------------------- @@ -1165,13 +1180,6 @@ public: // TODO: this one needs fixed... const wxHtmlBookRecArray& GetBookRecArray(); - // WXWIN_COMPATIBILITY_2_4 -#if 0 - wxHtmlContentsItem* GetContents(); - int GetContentsCnt(); - wxHtmlContentsItem* GetIndex(); - int GetIndexCnt(); -#endif }; //--------------------------------------------------------------------------- @@ -1255,7 +1263,10 @@ public: wxHtmlHelpData* GetData(); wxHtmlHelpController* GetController() const; + + %disownarg( wxHtmlHelpController* controller ); void SetController(wxHtmlHelpController* controller); + %cleardisown( wxHtmlHelpController* controller ); // Displays page x. If not found it will offect the user a choice of // searching books. @@ -1360,7 +1371,9 @@ public: wxHtmlHelpController* GetController() const; /// Sets the help controller associated with the window. + %disownarg( wxHtmlHelpController* controller ); void SetController(wxHtmlHelpController* controller); + %cleardisown( wxHtmlHelpController* controller ); /// Returns the help window. wxHtmlHelpWindow* GetHelpWindow() const; @@ -1417,7 +1430,9 @@ public: wxHtmlHelpController* GetController() const; /// Sets the controller associated with this dialog. + %disownarg( wxHtmlHelpController* controller ); void SetController(wxHtmlHelpController* controller); + %cleardisown( wxHtmlHelpController* controller ); /// Returns the help window. wxHtmlHelpWindow* GetHelpWindow() const; @@ -1497,6 +1512,7 @@ public: /// Get the window that can optionally be used for the help window's parent. virtual wxWindow* GetParentWindow() const; + }; @@ -1515,6 +1531,9 @@ public: wxHtmlHelpWindow* GetHelpWindow(); void SetHelpWindow(wxHtmlHelpWindow* helpWindow); + wxHtmlHelpFrame* GetFrame(); + wxHtmlHelpDialog* GetDialog(); + void SetTitleFormat(const wxString& format); void SetTempDir(const wxString& path); bool AddBook(const wxString& book, int show_wait_msg = false); @@ -1529,8 +1548,6 @@ public: void MakeModalIfNeeded(); wxWindow* FindTopLevelWindow(); - - %pythoncode { def Destroy(self): pass } };