]>
Commit | Line | Data |
---|---|---|
5ed68428 KO |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: webkit.i | |
3 | // Purpose: Embedding Apple's WebKit in wxWidgets | |
4 | // | |
5 | // Author: Robin Dunn / Kevin Ollivier | |
6 | // | |
f6f1e19f | 7 | // Created: 18-Oct-2004 |
5ed68428 | 8 | // RCS-ID: $Id$ |
f6f1e19f | 9 | // Copyright: (c) 2004 by Total Control Software |
5ed68428 KO |
10 | // Licence: wxWindows license |
11 | ///////////////////////////////////////////////////////////////////////////// | |
12 | ||
13 | %module webkit | |
14 | ||
15 | %{ | |
16 | ||
17 | #include "wx/wxPython/wxPython.h" | |
18 | #include "wx/wxPython/pyclasses.h" | |
19 | #include "wx/wxPython/pyistream.h" | |
20 | ||
21 | #ifdef __WXMAC__ // avoid a bug in Carbon headers | |
22 | #define scalb scalbn | |
23 | #endif | |
24 | ||
f6f1e19f | 25 | #if wxUSE_WEBKIT |
5ed68428 | 26 | #include "wx/html/webkit.h" |
f6f1e19f | 27 | #endif |
5ed68428 KO |
28 | %} |
29 | ||
30 | //--------------------------------------------------------------------------- | |
31 | ||
5ed68428 | 32 | %import core.i |
f6f1e19f RD |
33 | %pythoncode { wx = _core } |
34 | %pythoncode { __docfilter__ = wx.__DocFilter(globals()) } | |
5ed68428 | 35 | |
5ed68428 | 36 | |
f6f1e19f | 37 | %include _webkit_rename.i |
5ed68428 KO |
38 | |
39 | //--------------------------------------------------------------------------- | |
40 | ||
f6f1e19f RD |
41 | // Put some wx default wxChar* values into wxStrings. |
42 | MAKE_CONST_WXSTRING_NOSWIG(EmptyString); | |
43 | MAKE_CONST_WXSTRING2(WebKitNameStr, wxT("webkitctrl")) | |
44 | ||
45 | ||
5ed68428 | 46 | |
f6f1e19f | 47 | |
5ed68428 KO |
48 | %{ |
49 | #if !wxUSE_WEBKIT | |
f6f1e19f | 50 | // a dummy class for ports that don't have wxWebKitCtrl |
5ed68428 KO |
51 | class wxWebKitCtrl : public wxControl |
52 | { | |
53 | public: | |
54 | wxWebKitCtrl(wxWindow *parent, | |
f6f1e19f RD |
55 | wxWindowID winID, |
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(); } | |
62 | ||
63 | wxWebKitCtrl() { wxPyRaiseNotImplemented(); } | |
64 | ||
5ed68428 KO |
65 | bool Create(wxWindow *parent, |
66 | wxWindowID winID, | |
67 | const wxString& strURL, | |
68 | const wxPoint& pos = wxDefaultPosition, | |
69 | const wxSize& size = wxDefaultSize, long style = 0, | |
70 | const wxValidator& validator = wxDefaultValidator, | |
f6f1e19f RD |
71 | const wxString& name = wxPyWebKitNameStr) |
72 | { return false; } | |
5ed68428 KO |
73 | |
74 | void LoadURL(const wxString &url) {} | |
75 | ||
f6f1e19f RD |
76 | bool CanGoBack() { return false; } |
77 | bool CanGoForward() { return false; } | |
78 | bool GoBack() { return false; } | |
79 | bool GoForward() { return false; } | |
5ed68428 | 80 | void Reload() {} |
f6f1e19f RD |
81 | void Stop() {} |
82 | bool CanGetPageSource() { return false; } | |
83 | wxString GetPageSource() { return wxEmptyString; } | |
84 | void SetPageSource(wxString& source, const wxString& baseUrl = wxEmptyString) {} | |
5ed68428 KO |
85 | }; |
86 | #endif | |
87 | %} | |
88 | ||
f6f1e19f | 89 | // Now define it for SWIG. |
5ed68428 KO |
90 | class wxWebKitCtrl : public wxControl |
91 | { | |
92 | public: | |
93 | wxWebKitCtrl(wxWindow *parent, | |
94 | wxWindowID winID, | |
95 | const wxString& strURL, | |
96 | const wxPoint& pos = wxDefaultPosition, | |
97 | const wxSize& size = wxDefaultSize, long style = 0, | |
98 | const wxValidator& validator = wxDefaultValidator, | |
f6f1e19f RD |
99 | const wxString& name = wxPyWebKitNameStr); |
100 | ||
101 | %name(PreWebKitCtrl)wxWebKitCtrl(); | |
102 | ||
103 | ||
5ed68428 KO |
104 | bool Create(wxWindow *parent, |
105 | wxWindowID winID, | |
106 | const wxString& strURL, | |
107 | const wxPoint& pos = wxDefaultPosition, | |
108 | const wxSize& size = wxDefaultSize, long style = 0, | |
109 | const wxValidator& validator = wxDefaultValidator, | |
f6f1e19f | 110 | const wxString& name = wxPyWebKitNameStr); |
5ed68428 KO |
111 | |
112 | void LoadURL(const wxString &url); | |
113 | ||
114 | bool CanGoBack(); | |
115 | bool CanGoForward(); | |
116 | bool GoBack(); | |
117 | bool GoForward(); | |
118 | void Reload(); | |
119 | void Stop(); | |
120 | bool CanGetPageSource(); | |
121 | wxString GetPageSource(); | |
f6f1e19f | 122 | void SetPageSource(wxString& source, const wxString& baseUrl = wxPyEmptyString); |
5ed68428 KO |
123 | }; |
124 | ||
f6f1e19f | 125 | |
5ed68428 KO |
126 | %init %{ |
127 | ||
128 | %} |