]> git.saurik.com Git - wxWidgets.git/commitdiff
Adding wxWebKitCtrl wrappers.
authorKevin Ollivier <kevino@theolliviers.com>
Tue, 19 Oct 2004 06:04:26 +0000 (06:04 +0000)
committerKevin Ollivier <kevino@theolliviers.com>
Tue, 19 Oct 2004 06:04:26 +0000 (06:04 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29988 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/src/_webkit_rename.i [new file with mode: 0644]
wxPython/src/webkit.i [new file with mode: 0644]

diff --git a/wxPython/src/_webkit_rename.i b/wxPython/src/_webkit_rename.i
new file mode 100644 (file)
index 0000000..a2073c7
--- /dev/null
@@ -0,0 +1,8 @@
+// A bunch of %rename directives generated by BuildRenamers in config.py
+// in order to remove the wx prefix from all global scope names.
+
+#ifndef BUILDING_RENAMERS
+
+%rename(WebKitCtrl)                         wxWebKitCtrl;
+
+#endif
diff --git a/wxPython/src/webkit.i b/wxPython/src/webkit.i
new file mode 100644 (file)
index 0000000..4b92570
--- /dev/null
@@ -0,0 +1,116 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        webkit.i
+// Purpose:     Embedding Apple's WebKit in wxWidgets
+//
+// Author:      Robin Dunn / Kevin Ollivier
+//
+// Created:     28-Feb-2003
+// RCS-ID:      $Id$
+// Copyright:   (c) 2001 by Total Control Software
+// Licence:     wxWindows license
+/////////////////////////////////////////////////////////////////////////////
+
+%module webkit
+
+%{
+
+#include "wx/wxPython/wxPython.h"
+#include "wx/wxPython/pyclasses.h"
+#include "wx/wxPython/pyistream.h"
+
+#ifdef __WXMAC__  // avoid a bug in Carbon headers
+#define scalb scalbn
+#endif
+
+#include "wx/html/webkit.h"
+%}
+
+//---------------------------------------------------------------------------
+
+%include typemaps.i
+%include my_typemaps.i
+
+%import core.i
+%import windows.i
+%import misc.i
+
+%include _webkit_rename.i
+
+%pragma(python) code = "import wx"
+
+//---------------------------------------------------------------------------
+
+%{
+    // Put some wx default wxChar* values into wxStrings.
+    DECLARE_DEF_STRING(PanelNameStr);
+%}
+
+%{
+#if !wxUSE_WEBKIT
+class wxWebKitCtrl : public wxControl
+{
+public:
+    wxWebKitCtrl(wxWindow *parent,
+                    wxWindowID winID,
+                    const wxString& strURL,
+                    const wxPoint& pos = wxDefaultPosition,
+                    const wxSize& size = wxDefaultSize, long style = 0,
+                    const wxValidator& validator = wxDefaultValidator,
+                    const wxString& name = wxT("webkitctrl")) {}
+    bool Create(wxWindow *parent,
+                wxWindowID winID,
+                const wxString& strURL,
+                const wxPoint& pos = wxDefaultPosition,
+                const wxSize& size = wxDefaultSize, long style = 0,
+                const wxValidator& validator = wxDefaultValidator,
+                const wxString& name = wxT("webkitctrl")) {return false;}
+
+    void LoadURL(const wxString &url) {}
+
+    bool CanGoBack() {return false;}
+    bool CanGoForward() {return false;}
+    bool GoBack() {return false;}
+    bool GoForward() {return false;}
+    void Reload() {}
+    void Stop(){}
+    bool CanGetPageSource(){return false;}
+    wxString GetPageSource(){return wxEmptyString;}
+    void SetPageSource(wxString& source, const wxString& baseUrl = wxEmptyString){}
+};
+#endif
+%}
+
+class wxWebKitCtrl : public wxControl
+{
+public:
+    wxWebKitCtrl(wxWindow *parent,
+                    wxWindowID winID,
+                    const wxString& strURL,
+                    const wxPoint& pos = wxDefaultPosition,
+                    const wxSize& size = wxDefaultSize, long style = 0,
+                    const wxValidator& validator = wxDefaultValidator,
+                    const wxString& name = wxT("webkitctrl"));
+    bool Create(wxWindow *parent,
+                wxWindowID winID,
+                const wxString& strURL,
+                const wxPoint& pos = wxDefaultPosition,
+                const wxSize& size = wxDefaultSize, long style = 0,
+                const wxValidator& validator = wxDefaultValidator,
+                const wxString& name = wxT("webkitctrl"));
+
+    void LoadURL(const wxString &url);
+
+    bool CanGoBack();
+    bool CanGoForward();
+    bool GoBack();
+    bool GoForward();
+    void Reload();
+    void Stop();
+    bool CanGetPageSource();
+    wxString GetPageSource();
+    void SetPageSource(wxString& source, const wxString& baseUrl = wxEmptyString);
+};
+
+%init %{
+
+%}