diff options
| author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:41 -0800 |
|---|---|---|
| committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:41 -0800 |
| commit | 648161bb0edfc3d43db63caed5cc5213bc6cb78f (patch) | |
| tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /WebKit/wx/bindings | |
| parent | a65af38181ac7d34544586bdb5cd004de93897ad (diff) | |
| download | external_webkit-648161bb0edfc3d43db63caed5cc5213bc6cb78f.zip external_webkit-648161bb0edfc3d43db63caed5cc5213bc6cb78f.tar.gz external_webkit-648161bb0edfc3d43db63caed5cc5213bc6cb78f.tar.bz2 | |
auto import from //depot/cupcake/@135843
Diffstat (limited to 'WebKit/wx/bindings')
| -rw-r--r-- | WebKit/wx/bindings/python/samples/simple.py | 162 | ||||
| -rw-r--r-- | WebKit/wx/bindings/python/webview.i | 60 | ||||
| -rw-r--r-- | WebKit/wx/bindings/python/wxwebkit-py.bkl | 116 |
3 files changed, 0 insertions, 338 deletions
diff --git a/WebKit/wx/bindings/python/samples/simple.py b/WebKit/wx/bindings/python/samples/simple.py deleted file mode 100644 index 2ebdf9c..0000000 --- a/WebKit/wx/bindings/python/samples/simple.py +++ /dev/null @@ -1,162 +0,0 @@ -#!/usr/bin/python - -# Copyright (C) 2007 Kevin Ollivier All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -import wx -import wx.webview - -class TestPanel(wx.Panel): - def __init__(self, parent, log, frame=None): - wx.Panel.__init__( - self, parent, -1, - style=wx.TAB_TRAVERSAL|wx.CLIP_CHILDREN|wx.NO_FULL_REPAINT_ON_RESIZE - ) - - self.log = log - self.current = "http://wxPython.org/" - self.frame = frame - - if frame: - self.titleBase = frame.GetTitle() - - sizer = wx.BoxSizer(wx.VERTICAL) - btnSizer = wx.BoxSizer(wx.HORIZONTAL) - - self.webview = wx.webview.WebView(self, -1) - - - btn = wx.Button(self, -1, "Open", style=wx.BU_EXACTFIT) - self.Bind(wx.EVT_BUTTON, self.OnOpenButton, btn) - btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2) - - btn = wx.Button(self, -1, "<--", style=wx.BU_EXACTFIT) - self.Bind(wx.EVT_BUTTON, self.OnPrevPageButton, btn) - btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2) - - btn = wx.Button(self, -1, "-->", style=wx.BU_EXACTFIT) - self.Bind(wx.EVT_BUTTON, self.OnNextPageButton, btn) - btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2) - - btn = wx.Button(self, -1, "Stop", style=wx.BU_EXACTFIT) - self.Bind(wx.EVT_BUTTON, self.OnStopButton, btn) - btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2) - - btn = wx.Button(self, -1, "Refresh", style=wx.BU_EXACTFIT) - self.Bind(wx.EVT_BUTTON, self.OnRefreshPageButton, btn) - btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2) - - txt = wx.StaticText(self, -1, "Location:") - btnSizer.Add(txt, 0, wx.CENTER|wx.ALL, 2) - - self.location = wx.ComboBox( - self, -1, "", style=wx.CB_DROPDOWN|wx.PROCESS_ENTER - ) - - self.Bind(wx.EVT_COMBOBOX, self.OnLocationSelect, self.location) - self.location.Bind(wx.EVT_KEY_UP, self.OnLocationKey) - self.location.Bind(wx.EVT_CHAR, self.IgnoreReturn) - btnSizer.Add(self.location, 1, wx.EXPAND|wx.ALL, 2) - - sizer.Add(btnSizer, 0, wx.EXPAND) - sizer.Add(self.webview, 1, wx.EXPAND) - - self.webview.LoadURL(self.current) - self.location.Append(self.current) - - self.webview.Bind(wx.webview.EVT_WEBVIEW_STATE_CHANGED, self.OnStateChanged) - - self.SetSizer(sizer) - - def OnStateChanged(self, event): - statusbar = self.GetParent().GetStatusBar() - if statusbar: - if event.GetState() == wx.webview.WEBVIEW_STATE_NEGOTIATING: - statusbar.SetStatusText("Contacting " + event.GetURL()) - elif event.GetState() == wx.webview.WEBVIEW_STATE_TRANSFERRING: - statusbar.SetStatusText("Loading " + event.GetURL()) - elif event.GetState() == wx.webview.WEBVIEW_STATE_STOP: - statusbar.SetStatusText("") - self.location.SetValue(event.GetURL()) - self.GetParent().SetTitle("wxWebView - " + self.webview.GetPageTitle()) - - def OnLocationKey(self, evt): - if evt.GetKeyCode() == wx.WXK_RETURN: - URL = self.location.GetValue() - self.location.Append(URL) - self.webview.LoadURL(URL) - else: - evt.Skip() - - def IgnoreReturn(self, evt): - if evt.GetKeyCode() != wx.WXK_RETURN: - evt.Skip() - - def OnLocationSelect(self, evt): - url = self.location.GetStringSelection() - self.webview.LoadURL(url) - - def OnOpenButton(self, event): - dlg = wx.TextEntryDialog(self, "Open Location", - "Enter a full URL or local path", - self.current, wx.OK|wx.CANCEL) - dlg.CentreOnParent() - - if dlg.ShowModal() == wx.ID_OK: - self.current = dlg.GetValue() - self.webview.LoadURL(self.current) - - dlg.Destroy() - - def OnPrevPageButton(self, event): - self.webview.GoBack() - - def OnNextPageButton(self, event): - self.webview.GoForward() - - def OnStopButton(self, evt): - self.webview.Stop() - - def OnRefreshPageButton(self, evt): - self.webview.Reload() - - -class wkFrame(wx.Frame): - def __init__(self): - wx.Frame.__init__(self, None, -1, "WebKit in wxPython!") - - self.panel = TestPanel(self, -1) - self.panel.webview.LoadURL("http://www.wxwidgets.org/") - self.CreateStatusBar() - -class wkApp(wx.App): - def OnInit(self): - self.webFrame = wkFrame() - self.SetTopWindow(self.webFrame) - self.webFrame.Show() - - return True - -app = wkApp(redirect=False) -app.MainLoop() diff --git a/WebKit/wx/bindings/python/webview.i b/WebKit/wx/bindings/python/webview.i deleted file mode 100644 index e9926ad..0000000 --- a/WebKit/wx/bindings/python/webview.i +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2007 Kevin Ollivier All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (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 "WebView.h" -#include "WebBrowserShell.h" -%} - -//--------------------------------------------------------------------------- - -%import core.i -%import windows.i - -MustHaveApp(wxWebView); -MustHaveApp(wxWebBrowserShell); - -%include WebView.h -%include WebBrowserShell.h - -%constant wxEventType wxEVT_WEBVIEW_BEFORE_LOAD; -%constant wxEventType wxEVT_WEBVIEW_LOAD; -%constant wxEventType wxEVT_WEBVIEW_NEW_WINDOW; -%constant wxEventType wxEVT_WEBVIEW_RIGHT_CLICK; -%constant wxEventType wxEVT_WEBVIEW_CONSOLE_MESSAGE; -%constant wxEventType wxEVT_WEBVIEW_RECEIVED_TITLE; - -%pythoncode { -EVT_WEBVIEW_BEFORE_LOAD = wx.PyEventBinder( wxEVT_WEBVIEW_BEFORE_LOAD, 1 ) -EVT_WEBVIEW_LOAD = wx.PyEventBinder( wxEVT_WEBVIEW_LOAD, 1 ) -EVT_WEBVIEW_NEW_WINDOW = wx.PyEventBinder( wxEVT_WEBVIEW_NEW_WINDOW, 1 ) -EVT_WEBVIEW_RIGHT_CLICK = wx.PyEventBinder( wxEVT_WEBVIEW_RIGHT_CLICK, 1 ) -EVT_WEBVIEW_CONSOLE_MESSAGE = wx.PyEventBinder( wxEVT_WEBVIEW_CONSOLE_MESSAGE, 1 ) -EVT_WEBVIEW_RECEIVED_TITLE = wx.PyEventBinder( wxEVT_WEBVIEW_RECEIVED_TITLE, 1 ) -} diff --git a/WebKit/wx/bindings/python/wxwebkit-py.bkl b/WebKit/wx/bindings/python/wxwebkit-py.bkl deleted file mode 100644 index d6c2f7a..0000000 --- a/WebKit/wx/bindings/python/wxwebkit-py.bkl +++ /dev/null @@ -1,116 +0,0 @@ -<?xml version="1.0" ?> -<!-- -Copyright (C) 2007 Kevin Ollivier <kevino@theolliviers.com> - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Bakefile for wxWebKit Python bindings. ---> - -<makefile> - <set var="WX_UNICODE">1</set> - <set var="WX_SHARED">1</set> - <include file="../../wxwk-settings.bkl"/> - - <!-- the WX_PYTHON option was added to presets/wx.bkl in 2.8.5, so define - it in case the presets/wx.bkl doesn't define it for us. --> - <if cond="not isdefined('WX_PYTHON')"> - <set var="WX_PYTHON">1</set> - </if> - - <if cond="not isdefined('PYTHON_VERSION')"> - <option name="PYTHON_VERSION"> - <values>24,25</values> - <default-value>25</default-value> - <description> - Python version we're building against. - </description> - </option> - </if> - - <if cond="not isdefined('PYTHON_LIBDIR')"> - <option name="PYTHON_LIBDIR" category="path"> - <default-value>C:/Python25/Libs</default-value> - <description> - The directory containing the Python library to link against. - </description> - </option> - </if> - - <module id="wxwebkit-python" template="wxwk,webcore,xml2,iconv,xslt,icu,jscore,curl,sqlite3,gtk,pthreads"> - <!-- make sure we relink wxwebkit if either webcore or jscore change --> - <if cond="FORMAT=='gnu'"> - <depends-on-file>$(WKOUTPUTDIR)/libjscore.a</depends-on-file> - <depends-on-file>$(WKOUTPUTDIR)/libwebcore-wx.a</depends-on-file> - </if> - <if cond="FORMAT=='msvc'"> - <depends-on-file>$(WKOUTPUTDIR)/jscore.lib</depends-on-file> - <depends-on-file>$(WKOUTPUTDIR)/webcore-wx.lib</depends-on-file> - </if> - <runtime-libs>dynamic</runtime-libs> - <dllname>_webview</dllname> - - <include>$(WK_ROOT)/WebCore/platform/wx</include> - <include>$(WK_ROOT)/WebCore/bridge/wx</include> - <include>$(WK_ROOT)/WebCore/page/wx</include> - <include>$(WK_ROOT)/WebKit/wx</include> - <include>$(WK_ROOT)/WebKit/wx/WebKitSupport</include> - - <if cond="FORMAT=='gnu'"> - <sys-lib>png</sys-lib> - <set var="MAC_FLAGS"> - <if cond="WX_PORT=='mac'">-bundle -undefined dynamic_lookup</if> - </set> - - <ldflags>$(MAC_FLAGS)</ldflags> - </if> - <if cond="FORMAT in ['msvc','msvs2005prj']"> - <set var="PY_LIBNAME"> - <if cond="PYTHON_VERSION=='24'"> - python24 - </if> - <if cond="PYTHON_VERSION=='25'"> - python25 - </if> - </set> - <sys-lib>libpng</sys-lib> - <sys-lib>$(PY_LIBNAME)</sys-lib> - <lib-path>$(WK_ROOT)/libpng</lib-path> - <lib-path>$(PYTHON_LIBDIR)</lib-path> - </if> - - <sys-lib>wxwebkit</sys-lib> - <lib-path>$(WKOUTPUTDIR)</lib-path> - - <define>SWIG_TYPE_TABLE=_wxPython_table</define> - <define>WXP_USE_THREAD=1</define> - <define>SWIG_PYTHON_OUTPUT_TUPLE</define> - - <sources> - webview.cpp - </sources> - </module> - -</makefile> |
