From: Kevin Ollivier Date: Tue, 19 Oct 2004 06:04:26 +0000 (+0000) Subject: Adding wxWebKitCtrl wrappers. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/5ed68428a8d9101c1398f0a8a4dfff82d3e0e62b Adding wxWebKitCtrl wrappers. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29988 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/src/_webkit_rename.i b/wxPython/src/_webkit_rename.i new file mode 100644 index 0000000000..a2073c7474 --- /dev/null +++ b/wxPython/src/_webkit_rename.i @@ -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 index 0000000000..4b925709ad --- /dev/null +++ b/wxPython/src/webkit.i @@ -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 %{ + +%}