summaryrefslogtreecommitdiffstats
path: root/WebKit/wx/bindings
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-07-30 10:46:49 +0100
committerKristian Monsen <kristianm@google.com>2010-08-04 13:01:34 +0100
commit0617145a89917ae7735fe1c9538688ab9a577df5 (patch)
tree56206078694427c37ed7bdf27eb5221398b833c0 /WebKit/wx/bindings
parentef1adcdfc805d4d13103f6f15cc5b4d96828a60f (diff)
downloadexternal_webkit-0617145a89917ae7735fe1c9538688ab9a577df5.zip
external_webkit-0617145a89917ae7735fe1c9538688ab9a577df5.tar.gz
external_webkit-0617145a89917ae7735fe1c9538688ab9a577df5.tar.bz2
Merge WebKit at r64264 : Initial merge by git.
Change-Id: Ic42bef02efef8217a0f84c47176a9c617c28d1f1
Diffstat (limited to 'WebKit/wx/bindings')
-rw-r--r--WebKit/wx/bindings/python/webview.i71
-rw-r--r--WebKit/wx/bindings/python/wscript6
2 files changed, 73 insertions, 4 deletions
diff --git a/WebKit/wx/bindings/python/webview.i b/WebKit/wx/bindings/python/webview.i
index bdc5561..15b1d93 100644
--- a/WebKit/wx/bindings/python/webview.i
+++ b/WebKit/wx/bindings/python/webview.i
@@ -22,24 +22,78 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
+
%module webview
%{
#include "wx/wxPython/wxPython.h"
#include "wx/wxPython/pyclasses.h"
-
#include "WebBrowserShell.h"
+#include "WebDOMSelection.h"
+#include "WebEdit.h"
#include "WebFrame.h"
-#include "WebKitDefines.h"
#include "WebSettings.h"
#include "WebView.h"
+
+#include "WebDOMAttr.h"
+#include "WebDOMCSSStyleDeclaration.h"
+#include "WebDOMDocument.h"
+#include "WebDOMDocumentFragment.h"
+#include "WebDOMDOMSelection.h"
+#include "WebDOMElement.h"
+#include "WebDOMEventListener.h"
+#include "WebDOMNamedNodeMap.h"
+#include "WebDOMNode.h"
+#include "WebDOMNodeList.h"
+#include "WebDOMObject.h"
+#include "WebDOMRange.h"
+
+PyObject* createDOMNodeSubtype(WebDOMNode* ptr, bool setThisOwn)
+{
+ //static wxPyTypeInfoHashMap* typeInfoCache = NULL;
+
+ //if (typeInfoCache == NULL)
+ // typeInfoCache = new wxPyTypeInfoHashMap;
+
+ swig_type_info* swigType = 0; //(*typeInfoCache)[name];
+ char* name = 0;
+ if (ptr) {
+ // it wasn't in the cache, so look it up from SWIG
+ switch (ptr->nodeType()) {
+ case WebDOMNode::WEBDOM_ELEMENT_NODE:
+ name = "WebDOMElement*";
+ break;
+ case WebDOMNode::WEBDOM_ATTRIBUTE_NODE:
+ name = "WebDOMAttr*";
+ break;
+ default:
+ name = "WebDOMNode*";
+ }
+ swigType = SWIG_TypeQuery(name);
+ if (swigType)
+ return SWIG_Python_NewPointerObj(ptr, swigType, setThisOwn);
+
+ // if it still wasn't found, try looking for a mapped name
+ //if (swigType) {
+ // and add it to the map if found
+ // (*typeInfoCache)[className] = swigType;
+ //}
+ }
+
+ Py_INCREF(Py_None);
+
+ return Py_None;
+}
+
%}
//---------------------------------------------------------------------------
%import core.i
%import windows.i
+%typemap(out) WebDOMNode* { $result = createDOMNodeSubtype($1, (bool)$owner); }
+%typemap(out) WebDOMElement* { $result = createDOMNodeSubtype($1, (bool)$owner); }
+
MAKE_CONST_WXSTRING(WebViewNameStr);
MustHaveApp(wxWebBrowserShell);
@@ -48,7 +102,18 @@ MustHaveApp(wxWebView);
%include WebKitDefines.h
+%include WebDOMObject.h
+%include WebDOMNode.h
+
+%include WebDOMAttr.h
+%include WebDOMDOMSelection.h
+%include WebDOMElement.h
+%include WebDOMNodeList.h
+%include WebDOMRange.h
+
%include WebBrowserShell.h
+%include WebDOMSelection.h
+%include WebEdit.h
%include WebFrame.h
%include WebSettings.h
%include WebView.h
diff --git a/WebKit/wx/bindings/python/wscript b/WebKit/wx/bindings/python/wscript
index 41e5d41..617a839 100644
--- a/WebKit/wx/bindings/python/wscript
+++ b/WebKit/wx/bindings/python/wscript
@@ -30,6 +30,9 @@ import Logs
import Options
include_paths = [
+ os.path.join(wk_root, 'JavaScriptCore'),
+ os.path.join(wk_root, 'WebCore', 'bindings', 'cpp'),
+ os.path.join(wk_root, 'WebCore', 'DerivedSources'),
os.path.join(wk_root, 'WebKit', 'wx'),
os.path.join(wx_root, 'wxPython', 'include'),
os.path.join(wx_root, '..', 'wxPython', 'include'),
@@ -95,4 +98,5 @@ def build(bld):
libpath = [output_dir],
uselib_local = '',
- install_path = output_dir)
+ install_path = output_dir
+ )