Upgrade WX to r74856, mainly to support @2x.

This commit is contained in:
comex
2013-09-22 18:44:55 -04:00
parent 0bdef3932f
commit 66ed9a1804
1935 changed files with 45373 additions and 22739 deletions

View File

@ -2,7 +2,6 @@
// Name: include/gtk/wx/webview.h
// Purpose: GTK webkit backend for web view component
// Author: Robert Roebling, Marianne Gagnon
// Id: $Id: webview_webkit.h 70768 2012-03-01 16:44:31Z PC $
// Copyright: (c) 2010 Marianne Gagnon, 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -10,7 +9,7 @@
#ifndef _WX_GTK_WEBKITCTRL_H_
#define _WX_GTK_WEBKITCTRL_H_
#include "wx/setup.h"
#include "wx/defs.h"
#if wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__)
@ -26,7 +25,7 @@ typedef struct _WebKitWebView WebKitWebView;
class WXDLLIMPEXP_WEBVIEW wxWebViewWebKit : public wxWebView
{
public:
wxWebViewWebKit() { Init(); }
wxWebViewWebKit();
wxWebViewWebKit(wxWindow *parent,
wxWindowID id = wxID_ANY,
@ -35,8 +34,6 @@ public:
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = wxWebViewNameStr)
{
Init();
Create(parent, id, url, pos, size, style, name);
}
@ -47,6 +44,8 @@ public:
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = wxWebViewNameStr);
virtual ~wxWebViewWebKit();
virtual bool Enable( bool enable = true );
// implementation
@ -59,10 +58,11 @@ public:
virtual void LoadURL(const wxString& url);
virtual void GoBack();
virtual void GoForward();
virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT);
virtual void Reload(wxWebViewReloadFlags flags = wxWEBVIEW_RELOAD_DEFAULT);
virtual bool CanGoBack() const;
virtual bool CanGoForward() const;
virtual void ClearHistory();
virtual void EnableContextMenu(bool enable = true);
virtual void EnableHistory(bool enable = true);
virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetBackwardHistory();
virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetForwardHistory();
@ -71,9 +71,6 @@ public:
virtual wxString GetCurrentTitle() const;
virtual wxString GetPageSource() const;
virtual wxString GetPageText() const;
//We do not want to hide the other overloads
using wxWebView::SetPage;
virtual void SetPage(const wxString& html, const wxString& baseUrl);
virtual void Print();
virtual bool IsBusy() const;
@ -97,6 +94,9 @@ public:
virtual void Undo();
virtual void Redo();
//Find function
virtual long Find(const wxString& text, int flags = wxWEBVIEW_FIND_DEFAULT);
//Editing functions
virtual void SetEditable(bool enable = true);
virtual bool IsEditable() const;
@ -110,11 +110,13 @@ public:
virtual void ClearSelection();
virtual void RunScript(const wxString& javascript);
//Virtual Filesystem Support
virtual void RegisterHandler(wxSharedPtr<wxWebViewHandler> handler);
virtual wxVector<wxSharedPtr<wxWebViewHandler> > GetHandlers() { return m_handlerList; }
virtual void* GetNativeBackend() const { return m_web_view; }
/** TODO: check if this can be made private
* The native control has a getter to check for busy state, but except in
* very recent versions of webkit this getter doesn't say everything we need
@ -128,8 +130,12 @@ public:
//We use this flag to stop recursion when we load a page from the navigation
//callback, mainly when loading a VFS page
bool m_guard;
//This flag is use to indicate when a navigation event is the result of a
//create-web-view signal and so we need to send a new window event
bool m_creating;
protected:
virtual void DoSetPage(const wxString& html, const wxString& baseUrl);
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
@ -140,6 +146,9 @@ private:
void SetWebkitZoom(float level);
float GetWebkitZoom() const;
//Find helper function
void FindClear();
// focus event handler: calls GTKUpdateBitmap()
void GTKOnFocus(wxFocusEvent& event);
@ -148,9 +157,30 @@ private:
wxVector<wxSharedPtr<wxWebViewHandler> > m_handlerList;
//variables used for Find()
int m_findFlags;
wxString m_findText;
int m_findPosition;
int m_findCount;
wxDECLARE_DYNAMIC_CLASS(wxWebViewWebKit);
};
class WXDLLIMPEXP_WEBVIEW wxWebViewFactoryWebKit : public wxWebViewFactory
{
public:
virtual wxWebView* Create() { return new wxWebViewWebKit; }
virtual wxWebView* Create(wxWindow* parent,
wxWindowID id,
const wxString& url = wxWebViewDefaultURLStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxWebViewNameStr)
{ return new wxWebViewWebKit(parent, id, url, pos, size, style, name); }
};
#endif // wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__)
#endif