1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Embedding Apple's WebKit in wxWidgets
5 // Author: Robin Dunn / Kevin Ollivier
7 // Created: 18-Oct-2004
9 // Copyright: (c) 2004 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
17 #include "wx/wxPython/wxPython.h"
18 #include "wx/wxPython/pyclasses.h"
19 #include "wx/wxPython/pyistream.h"
21 #ifdef __WXMAC__ // avoid a bug in Carbon headers
26 #include "wx/html/webkit.h"
30 //---------------------------------------------------------------------------
33 %pythoncode { wx = _core }
34 %pythoncode { __docfilter__ = wx.__DocFilter(globals()) }
37 %include _webkit_rename.i
39 //---------------------------------------------------------------------------
41 // Put some wx default wxChar* values into wxStrings.
42 MAKE_CONST_WXSTRING_NOSWIG(EmptyString);
43 MAKE_CONST_WXSTRING2(WebKitNameStr, wxT("webkitctrl"))
50 // a dummy class for ports that don't have wxWebKitCtrl
51 class wxWebKitCtrl : public wxControl
54 wxWebKitCtrl(wxWindow *parent,
56 const wxString& strURL,
57 const wxPoint& pos = wxDefaultPosition,
58 const wxSize& size = wxDefaultSize, long style = 0,
59 const wxValidator& validator = wxDefaultValidator,
60 const wxString& name = wxPyWebKitNameStr)
61 { wxPyRaiseNotImplemented(); }
63 wxWebKitCtrl() { wxPyRaiseNotImplemented(); }
65 bool Create(wxWindow *parent,
67 const wxString& strURL,
68 const wxPoint& pos = wxDefaultPosition,
69 const wxSize& size = wxDefaultSize, long style = 0,
70 const wxValidator& validator = wxDefaultValidator,
71 const wxString& name = wxPyWebKitNameStr)
74 void LoadURL(const wxString &url) {}
76 bool CanGoBack() { return false; }
77 bool CanGoForward() { return false; }
78 bool GoBack() { return false; }
79 bool GoForward() { return false; }
82 bool CanGetPageSource() { return false; }
83 wxString GetPageSource() { return wxEmptyString; }
84 void SetPageSource(wxString& source, const wxString& baseUrl = wxEmptyString) {}
89 // Now define it for SWIG.
90 class wxWebKitCtrl : public wxControl
93 wxWebKitCtrl(wxWindow *parent,
95 const wxString& strURL,
96 const wxPoint& pos = wxDefaultPosition,
97 const wxSize& size = wxDefaultSize, long style = 0,
98 const wxValidator& validator = wxDefaultValidator,
99 const wxString& name = wxPyWebKitNameStr);
101 %name(PreWebKitCtrl)wxWebKitCtrl();
104 bool Create(wxWindow *parent,
106 const wxString& strURL,
107 const wxPoint& pos = wxDefaultPosition,
108 const wxSize& size = wxDefaultSize, long style = 0,
109 const wxValidator& validator = wxDefaultValidator,
110 const wxString& name = wxPyWebKitNameStr);
112 void LoadURL(const wxString &url);
120 bool CanGetPageSource();
121 wxString GetPageSource();
122 void SetPageSource(wxString& source, const wxString& baseUrl = wxPyEmptyString);