From 236cff7334bfd8020adc3fba134641fc7b189622 Mon Sep 17 00:00:00 2001 From: Steve Lamerton Date: Fri, 1 Feb 2013 09:38:53 +0000 Subject: [PATCH] Rename all WEB_VIEW* style identifiers to WEBVIEW*. This makes wxWebView consistent with the rest of the toolkit. Closes #15013 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73453 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 2 + include/wx/gtk/webview_webkit.h | 4 +- include/wx/msw/webview_ie.h | 4 +- include/wx/osx/webview_webkit.h | 4 +- include/wx/webview.h | 92 +++++++------- include/wx/webviewarchivehandler.h | 6 +- include/wx/webviewfshandler.h | 6 +- interface/wx/webview.h | 132 ++++++++++---------- samples/webview/webview.cpp | 66 +++++----- src/common/webview.cpp | 12 +- src/gtk/webview_webkit.cpp | 86 ++++++------- src/msw/webview_ie.cpp | 188 ++++++++++++++--------------- src/osx/webview_webkit.mm | 62 +++++----- tests/controls/webtest.cpp | 24 ++-- 14 files changed, 345 insertions(+), 343 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 82de338a9f..d6f1880a1e 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -540,6 +540,8 @@ INCOMPATIBLE CHANGES SINCE 2.9.4: old behaviour. - wxWebView::New now takes a string identifier for the backend to be used rather than a wxWebViewBackend enum value. +- wxWebView identifiers of the form WEB_VIEW_* have been renamed to WEBVIEW_* + for consistency with the rest of wxWidgets. All: diff --git a/include/wx/gtk/webview_webkit.h b/include/wx/gtk/webview_webkit.h index b89fa9f106..24d30c89d9 100644 --- a/include/wx/gtk/webview_webkit.h +++ b/include/wx/gtk/webview_webkit.h @@ -59,7 +59,7 @@ 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(); @@ -96,7 +96,7 @@ public: virtual void Redo(); //Find function - virtual long Find(const wxString& text, int flags = wxWEB_VIEW_FIND_DEFAULT); + virtual long Find(const wxString& text, int flags = wxWEBVIEW_FIND_DEFAULT); //Editing functions virtual void SetEditable(bool enable = true); diff --git a/include/wx/msw/webview_ie.h b/include/wx/msw/webview_ie.h index 0f613d1200..020bd7fb87 100644 --- a/include/wx/msw/webview_ie.h +++ b/include/wx/msw/webview_ie.h @@ -75,7 +75,7 @@ public: virtual void ClearHistory(); virtual void EnableHistory(bool enable = true); virtual void Stop(); - virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT); + virtual void Reload(wxWebViewReloadFlags flags = wxWEBVIEW_RELOAD_DEFAULT); virtual wxString GetPageSource() const; virtual wxString GetPageText() const; @@ -108,7 +108,7 @@ public: virtual void Redo(); //Find function - virtual long Find(const wxString& text, int flags = wxWEB_VIEW_FIND_DEFAULT); + virtual long Find(const wxString& text, int flags = wxWEBVIEW_FIND_DEFAULT); //Editing functions virtual void SetEditable(bool enable = true); diff --git a/include/wx/osx/webview_webkit.h b/include/wx/osx/webview_webkit.h index a21bf6551e..8733618c08 100644 --- a/include/wx/osx/webview_webkit.h +++ b/include/wx/osx/webview_webkit.h @@ -54,7 +54,7 @@ public: virtual bool CanGoForward() const; virtual void GoBack(); virtual void GoForward(); - virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT); + virtual void Reload(wxWebViewReloadFlags flags = wxWEBVIEW_RELOAD_DEFAULT); virtual void Stop(); virtual wxString GetPageSource() const; virtual wxString GetPageText() const; @@ -87,7 +87,7 @@ public: virtual void Redo(); //Find function - virtual long Find(const wxString& text, int flags = wxWEB_VIEW_FIND_DEFAULT) + virtual long Find(const wxString& text, int flags = wxWEBVIEW_FIND_DEFAULT) { wxUnusedVar(text); wxUnusedVar(flags); diff --git a/include/wx/webview.h b/include/wx/webview.h index 2ff23c6a76..c6e8b200cf 100644 --- a/include/wx/webview.h +++ b/include/wx/webview.h @@ -7,8 +7,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef _WX_WEB_VIEW_H_ -#define _WX_WEB_VIEW_H_ +#ifndef _WX_WEBVIEW_H_ +#define _WX_WEBVIEW_H_ #include "wx/defs.h" @@ -36,47 +36,47 @@ class wxWebView; enum wxWebViewZoom { - wxWEB_VIEW_ZOOM_TINY, - wxWEB_VIEW_ZOOM_SMALL, - wxWEB_VIEW_ZOOM_MEDIUM, - wxWEB_VIEW_ZOOM_LARGE, - wxWEB_VIEW_ZOOM_LARGEST + wxWEBVIEW_ZOOM_TINY, + wxWEBVIEW_ZOOM_SMALL, + wxWEBVIEW_ZOOM_MEDIUM, + wxWEBVIEW_ZOOM_LARGE, + wxWEBVIEW_ZOOM_LARGEST }; enum wxWebViewZoomType { //Scales entire page, including images - wxWEB_VIEW_ZOOM_TYPE_LAYOUT, - wxWEB_VIEW_ZOOM_TYPE_TEXT + wxWEBVIEW_ZOOM_TYPE_LAYOUT, + wxWEBVIEW_ZOOM_TYPE_TEXT }; enum wxWebViewNavigationError { - wxWEB_NAV_ERR_CONNECTION, - wxWEB_NAV_ERR_CERTIFICATE, - wxWEB_NAV_ERR_AUTH, - wxWEB_NAV_ERR_SECURITY, - wxWEB_NAV_ERR_NOT_FOUND, - wxWEB_NAV_ERR_REQUEST, - wxWEB_NAV_ERR_USER_CANCELLED, - wxWEB_NAV_ERR_OTHER + wxWEBVIEW_NAV_ERR_CONNECTION, + wxWEBVIEW_NAV_ERR_CERTIFICATE, + wxWEBVIEW_NAV_ERR_AUTH, + wxWEBVIEW_NAV_ERR_SECURITY, + wxWEBVIEW_NAV_ERR_NOT_FOUND, + wxWEBVIEW_NAV_ERR_REQUEST, + wxWEBVIEW_NAV_ERR_USER_CANCELLED, + wxWEBVIEW_NAV_ERR_OTHER }; enum wxWebViewReloadFlags { //Default, may access cache - wxWEB_VIEW_RELOAD_DEFAULT, - wxWEB_VIEW_RELOAD_NO_CACHE + wxWEBVIEW_RELOAD_DEFAULT, + wxWEBVIEW_RELOAD_NO_CACHE }; enum wxWebViewFindFlags { - wxWEB_VIEW_FIND_WRAP = 0x0001, - wxWEB_VIEW_FIND_ENTIRE_WORD = 0x0002, - wxWEB_VIEW_FIND_MATCH_CASE = 0x0004, - wxWEB_VIEW_FIND_HIGHLIGHT_RESULT = 0x0008, - wxWEB_VIEW_FIND_BACKWARDS = 0x0010, - wxWEB_VIEW_FIND_DEFAULT = 0 + wxWEBVIEW_FIND_WRAP = 0x0001, + wxWEBVIEW_FIND_ENTIRE_WORD = 0x0002, + wxWEBVIEW_FIND_MATCH_CASE = 0x0004, + wxWEBVIEW_FIND_HIGHLIGHT_RESULT = 0x0008, + wxWEBVIEW_FIND_BACKWARDS = 0x0010, + wxWEBVIEW_FIND_DEFAULT = 0 }; //Base class for custom scheme handlers @@ -161,7 +161,7 @@ public: virtual void LoadURL(const wxString& url) = 0; virtual void Print() = 0; virtual void RegisterHandler(wxSharedPtr handler) = 0; - virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT) = 0; + virtual void Reload(wxWebViewReloadFlags flags = wxWEBVIEW_RELOAD_DEFAULT) = 0; virtual void RunScript(const wxString& javascript) = 0; virtual void SetEditable(bool enable = true) = 0; void SetPage(const wxString& html, const wxString& baseUrl) @@ -219,7 +219,7 @@ public: //Get the pointer to the underlying native engine. virtual void* GetNativeBackend() const = 0; //Find function - virtual long Find(const wxString& text, int flags = wxWEB_VIEW_FIND_DEFAULT) = 0; + virtual long Find(const wxString& text, int flags = wxWEBVIEW_FIND_DEFAULT) = 0; protected: virtual void DoSetPage(const wxString& html, const wxString& baseUrl) = 0; @@ -255,12 +255,12 @@ private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxWebViewEvent); }; -wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEB_VIEW_NAVIGATING, wxWebViewEvent ); -wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEB_VIEW_NAVIGATED, wxWebViewEvent ); -wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEB_VIEW_LOADED, wxWebViewEvent ); -wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEB_VIEW_ERROR, wxWebViewEvent ); -wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEB_VIEW_NEWWINDOW, wxWebViewEvent ); -wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED, wxWebViewEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEBVIEW_NAVIGATING, wxWebViewEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEBVIEW_NAVIGATED, wxWebViewEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEBVIEW_LOADED, wxWebViewEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEBVIEW_ERROR, wxWebViewEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEBVIEW_NEWWINDOW, wxWebViewEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED, wxWebViewEvent ); typedef void (wxEvtHandler::*wxWebViewEventFunction) (wxWebViewEvent&); @@ -268,30 +268,30 @@ typedef void (wxEvtHandler::*wxWebViewEventFunction) #define wxWebViewEventHandler(func) \ wxEVENT_HANDLER_CAST(wxWebViewEventFunction, func) -#define EVT_WEB_VIEW_NAVIGATING(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_WEB_VIEW_NAVIGATING, id, \ +#define EVT_WEBVIEW_NAVIGATING(id, fn) \ + wx__DECLARE_EVT1(wxEVT_COMMAND_WEBVIEW_NAVIGATING, id, \ wxWebViewEventHandler(fn)) -#define EVT_WEB_VIEW_NAVIGATED(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_WEB_VIEW_NAVIGATED, id, \ +#define EVT_WEBVIEW_NAVIGATED(id, fn) \ + wx__DECLARE_EVT1(wxEVT_COMMAND_WEBVIEW_NAVIGATED, id, \ wxWebViewEventHandler(fn)) -#define EVT_WEB_VIEW_LOADED(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_WEB_VIEW_LOADED, id, \ +#define EVT_WEBVIEW_LOADED(id, fn) \ + wx__DECLARE_EVT1(wxEVT_COMMAND_WEBVIEW_LOADED, id, \ wxWebViewEventHandler(fn)) -#define EVT_WEB_VIEW_ERROR(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_WEB_VIEW_ERROR, id, \ +#define EVT_WEBVIEW_ERROR(id, fn) \ + wx__DECLARE_EVT1(wxEVT_COMMAND_WEBVIEW_ERROR, id, \ wxWebViewEventHandler(fn)) -#define EVT_WEB_VIEW_NEWWINDOW(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_WEB_VIEW_NEWWINDOW, id, \ +#define EVT_WEBVIEW_NEWWINDOW(id, fn) \ + wx__DECLARE_EVT1(wxEVT_COMMAND_WEBVIEW_NEWWINDOW, id, \ wxWebViewEventHandler(fn)) -#define EVT_WEB_VIEW_TITLE_CHANGED(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED, id, \ +#define EVT_WEBVIEW_TITLE_CHANGED(id, fn) \ + wx__DECLARE_EVT1(wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED, id, \ wxWebViewEventHandler(fn)) #endif // wxUSE_WEBVIEW -#endif // _WX_WEB_VIEW_H_ +#endif // _WX_WEBVIEW_H_ diff --git a/include/wx/webviewarchivehandler.h b/include/wx/webviewarchivehandler.h index 40f4ce5195..454641c640 100644 --- a/include/wx/webviewarchivehandler.h +++ b/include/wx/webviewarchivehandler.h @@ -7,8 +7,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef _WX_WEB_VIEW_FILE_HANDLER_H_ -#define _WX_WEB_VIEW_FILE_HANDLER_H_ +#ifndef _WX_WEBVIEW_FILE_HANDLER_H_ +#define _WX_WEBVIEW_FILE_HANDLER_H_ #include "wx/setup.h" @@ -34,4 +34,4 @@ private: #endif // wxUSE_WEBVIEW -#endif // _WX_WEB_VIEW_FILE_HANDLER_H_ +#endif // _WX_WEBVIEW_FILE_HANDLER_H_ diff --git a/include/wx/webviewfshandler.h b/include/wx/webviewfshandler.h index 4dde577976..9a58031953 100644 --- a/include/wx/webviewfshandler.h +++ b/include/wx/webviewfshandler.h @@ -9,8 +9,8 @@ // Based on webviewarchivehandler.h file by Steven Lamerton -#ifndef _WX_WEB_VIEW_FS_HANDLER_H_ -#define _WX_WEB_VIEW_FS_HANDLER_H_ +#ifndef _WX_WEBVIEW_FS_HANDLER_H_ +#define _WX_WEBVIEW_FS_HANDLER_H_ #include "wx/setup.h" @@ -35,4 +35,4 @@ private: #endif // wxUSE_WEBVIEW -#endif // _WX_WEB_VIEW_FS_HANDLER_H_ +#endif // _WX_WEBVIEW_FS_HANDLER_H_ diff --git a/interface/wx/webview.h b/interface/wx/webview.h index 933b45b98c..27c80e0564 100644 --- a/interface/wx/webview.h +++ b/interface/wx/webview.h @@ -11,11 +11,11 @@ */ enum wxWebViewZoom { - wxWEB_VIEW_ZOOM_TINY, - wxWEB_VIEW_ZOOM_SMALL, - wxWEB_VIEW_ZOOM_MEDIUM, //!< default size - wxWEB_VIEW_ZOOM_LARGE, - wxWEB_VIEW_ZOOM_LARGEST + wxWEBVIEW_ZOOM_TINY, + wxWEBVIEW_ZOOM_SMALL, + wxWEBVIEW_ZOOM_MEDIUM, //!< default size + wxWEBVIEW_ZOOM_LARGE, + wxWEBVIEW_ZOOM_LARGEST }; /** @@ -26,12 +26,12 @@ enum wxWebViewZoomType /** The entire layout scales when zooming, including images */ - wxWEB_VIEW_ZOOM_TYPE_LAYOUT, + wxWEBVIEW_ZOOM_TYPE_LAYOUT, /** Only the text changes in size when zooming, images and other layout elements retain their initial size */ - wxWEB_VIEW_ZOOM_TYPE_TEXT + wxWEBVIEW_ZOOM_TYPE_TEXT }; /** @@ -40,22 +40,22 @@ enum wxWebViewZoomType enum wxWebViewNavigationError { /** Connection error (timeout, etc.) */ - wxWEB_NAV_ERR_CONNECTION, + wxWEBVIEW_NAV_ERR_CONNECTION, /** Invalid certificate */ - wxWEB_NAV_ERR_CERTIFICATE, + wxWEBVIEW_NAV_ERR_CERTIFICATE, /** Authentication required */ - wxWEB_NAV_ERR_AUTH, + wxWEBVIEW_NAV_ERR_AUTH, /** Other security error */ - wxWEB_NAV_ERR_SECURITY, + wxWEBVIEW_NAV_ERR_SECURITY, /** Requested resource not found */ - wxWEB_NAV_ERR_NOT_FOUND, + wxWEBVIEW_NAV_ERR_NOT_FOUND, /** Invalid request/parameters (e.g. bad URL, bad protocol, unsupported resource type) */ - wxWEB_NAV_ERR_REQUEST, + wxWEBVIEW_NAV_ERR_REQUEST, /** The user cancelled (e.g. in a dialog) */ - wxWEB_NAV_ERR_USER_CANCELLED, + wxWEBVIEW_NAV_ERR_USER_CANCELLED, /** Another (exotic) type of error that didn't fit in other categories*/ - wxWEB_NAV_ERR_OTHER + wxWEBVIEW_NAV_ERR_OTHER }; /** @@ -64,9 +64,9 @@ enum wxWebViewNavigationError enum wxWebViewReloadFlags { /** Default reload, will access cache */ - wxWEB_VIEW_RELOAD_DEFAULT, + wxWEBVIEW_RELOAD_DEFAULT, /** Reload the current view without accessing the cache */ - wxWEB_VIEW_RELOAD_NO_CACHE + wxWEBVIEW_RELOAD_NO_CACHE }; /** @@ -75,22 +75,22 @@ enum wxWebViewReloadFlags enum wxWebViewFindFlags { /** Causes the search to restart when end or beginning reached */ - wxWEB_VIEW_FIND_WRAP = 0x0001, + wxWEBVIEW_FIND_WRAP = 0x0001, /** Matches an entire word when searching */ - wxWEB_VIEW_FIND_ENTIRE_WORD = 0x0002, + wxWEBVIEW_FIND_ENTIRE_WORD = 0x0002, /** Match case, i.e. case sensitive searching */ - wxWEB_VIEW_FIND_MATCH_CASE = 0x0004, + wxWEBVIEW_FIND_MATCH_CASE = 0x0004, /** Highlights the search results */ - wxWEB_VIEW_FIND_HIGHLIGHT_RESULT = 0x0008, + wxWEBVIEW_FIND_HIGHLIGHT_RESULT = 0x0008, /** Searches for phrase in backward direction */ - wxWEB_VIEW_FIND_BACKWARDS = 0x0010, + wxWEBVIEW_FIND_BACKWARDS = 0x0010, /** The default flag, which is simple searching */ - wxWEB_VIEW_FIND_DEFAULT = 0 + wxWEBVIEW_FIND_DEFAULT = 0 }; @@ -209,7 +209,7 @@ public: @section descriptions Backend Descriptions - @par wxWEB_VIEW_BACKEND_IE (MSW) + @par wxWEBVIEW_BACKEND_IE (MSW) The IE backend uses Microsoft's Trident rendering engine, specifically the version used by the locally installed copy of Internet Explorer. As such it @@ -221,7 +221,7 @@ public: this article for more information. This backend has full support for custom schemes and virtual file systems. - @par wxWEB_VIEW_WEBKIT (GTK) + @par wxWEBVIEW_WEBKIT (GTK) Under GTK the WebKit backend uses WebKitGTK+. The current minimum version @@ -231,7 +231,7 @@ public: resources such as images and stylesheets are currently loaded using the data:// scheme. - @par wxWEB_VIEW_WEBKIT (OSX) + @par wxWEBVIEW_WEBKIT (OSX) The OSX WebKit backend uses Apple's WebView @@ -244,9 +244,9 @@ public: immediately and perform their work in the background. This includes functions such as LoadUrl() and Reload(). To receive notification of the progress and completion of these functions you need to handle the events - that are provided. Specifically @c wxEVT_COMMAND_WEB_VIEW_LOADED notifies + that are provided. Specifically @c wxEVT_COMMAND_WEBVIEW_LOADED notifies when the page or a sub-frame has finished loading and - @c wxEVT_COMMAND_WEB_VIEW_ERROR notifies that an error has occurred. + @c wxEVT_COMMAND_WEBVIEW_ERROR notifies that an error has occurred. @section vfs Virtual File Systems and Custom Schemes @@ -265,32 +265,32 @@ public: @c scheme:///C:/example/docs.zip;protocol=zip/main.htm @beginEventEmissionTable{wxWebViewEvent} - @event{EVT_WEB_VIEW_NAVIGATING(id, func)} - Process a @c wxEVT_COMMAND_WEB_VIEW_NAVIGATING event, generated before trying + @event{EVT_WEBVIEW_NAVIGATING(id, func)} + Process a @c wxEVT_COMMAND_WEBVIEW_NAVIGATING event, generated before trying to get a resource. This event may be vetoed to prevent navigating to this resource. Note that if the displayed HTML document has several frames, one such event will be generated per frame. - @event{EVT_WEB_VIEW_NAVIGATED(id, func)} - Process a @c wxEVT_COMMAND_WEB_VIEW_NAVIGATED event generated after it was + @event{EVT_WEBVIEW_NAVIGATED(id, func)} + Process a @c wxEVT_COMMAND_WEBVIEW_NAVIGATED event generated after it was confirmed that a resource would be requested. This event may not be vetoed. Note that if the displayed HTML document has several frames, one such event will be generated per frame. - @event{EVT_WEB_VIEW_LOADED(id, func)} - Process a @c wxEVT_COMMAND_WEB_VIEW_LOADED event generated when the document + @event{EVT_WEBVIEW_LOADED(id, func)} + Process a @c wxEVT_COMMAND_WEBVIEW_LOADED event generated when the document is fully loaded and displayed. Note that if the displayed HTML document has several frames, one such event will be generated per frame. - @event{EVT_WEB_VIEW_ERROR(id, func)} - Process a @c wxEVT_COMMAND_WEB_VIEW_ERROR event generated when a navigation + @event{EVT_WEBVIEW_ERROR(id, func)} + Process a @c wxEVT_COMMAND_WEBVIEW_ERROR event generated when a navigation error occurs. The integer associated with this event will be a wxWebNavigationError item. The string associated with this event may contain a backend-specific more precise error message/code. - @event{EVT_WEB_VIEW_NEWWINDOW(id, func)} - Process a @c wxEVT_COMMAND_WEB_VIEW_NEWWINDOW event, generated when a new + @event{EVT_WEBVIEW_NEWWINDOW(id, func)} + Process a @c wxEVT_COMMAND_WEBVIEW_NEWWINDOW event, generated when a new window is created. You must handle this event if you want anything to happen, for example to load the page in a new window or tab. - @event{EVT_WEB_VIEW_TITLE_CHANGED(id, func)} - Process a @c wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED event, generated when + @event{EVT_WEBVIEW_TITLE_CHANGED(id, func)} + Process a @c wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED event, generated when the page title changes. Use GetString to get the title. @endEventTable @@ -445,11 +445,11 @@ public: Reload the currently displayed URL. @param flags A bit array that may optionally contain reload options. */ - virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT) = 0; + virtual void Reload(wxWebViewReloadFlags flags = wxWEBVIEW_RELOAD_DEFAULT) = 0; /** Runs the given javascript code. - @note When using wxWEB_VIEW_BACKEND_IE you must wait for the current + @note When using wxWEBVIEW_BACKEND_IE you must wait for the current page to finish loading before calling RunScript(). */ virtual void RunScript(const wxString& javascript) = 0; @@ -466,7 +466,7 @@ public: @param html The string that contains the HTML data to display. @param baseUrl URL assigned to the HTML data, to be used to resolve relative paths, for instance. - @note When using wxWEB_VIEW_BACKEND_IE you must wait for the current + @note When using wxWEBVIEW_BACKEND_IE you must wait for the current page to finish loading before calling SetPage(). */ virtual void SetPage(const wxString& html, const wxString& baseUrl) = 0; @@ -481,8 +481,8 @@ public: /** Stop the current page loading process, if any. - May trigger an error event of type @c wxWEB_NAV_ERR_USER_CANCELLED. - TODO: make @c wxWEB_NAV_ERR_USER_CANCELLED errors uniform across ports. + May trigger an error event of type @c wxWEBVIEW_NAV_ERR_USER_CANCELLED. + TODO: make @c wxWEBVIEW_NAV_ERR_USER_CANCELLED errors uniform across ports. */ virtual void Stop() = 0; @@ -613,7 +613,7 @@ public: virtual void ClearSelection() = 0; /** - Deletes the current selection. Note that for @c wxWEB_VIEW_BACKEND_WEBKIT + Deletes the current selection. Note that for @c wxWEBVIEW_BACKEND_WEBKIT the selection must be editable, either through SetEditable or the correct HTML attribute. */ @@ -678,14 +678,14 @@ public: returned. Then for every time its called with the same search phrase it will return the number of the current match. @note This function will restart the search if the flags - @c wxWEB_VIEW_FIND_ENTIRE_WORD or @c wxWEB_VIEW_FIND_MATCH_CASE + @c wxWEBVIEW_FIND_ENTIRE_WORD or @c wxWEBVIEW_FIND_MATCH_CASE are changed, since this will require a new search. To reset the search, for example reseting the highlights call the function with an empty search phrase. This always returns @c wxNOT_FOUND on the OSX WebKit backend. @since 2.9.5 */ - virtual long Find(const wxString& text, wxWebViewFindFlags flags = wxWEB_VIEW_FIND_DEFAULT) = 0; + virtual long Find(const wxString& text, wxWebViewFindFlags flags = wxWEBVIEW_FIND_DEFAULT) = 0; /** @name Zoom @@ -737,32 +737,32 @@ public: wxWebView objects. @beginEventEmissionTable{wxWebViewEvent} - @event{EVT_WEB_VIEW_NAVIGATING(id, func)} - Process a @c wxEVT_COMMAND_WEB_VIEW_NAVIGATING event, generated before trying + @event{EVT_WEBVIEW_NAVIGATING(id, func)} + Process a @c wxEVT_COMMAND_WEBVIEW_NAVIGATING event, generated before trying to get a resource. This event may be vetoed to prevent navigating to this resource. Note that if the displayed HTML document has several frames, one such event will be generated per frame. - @event{EVT_WEB_VIEW_NAVIGATED(id, func)} - Process a @c wxEVT_COMMAND_WEB_VIEW_NAVIGATED event generated after it was + @event{EVT_WEBVIEW_NAVIGATED(id, func)} + Process a @c wxEVT_COMMAND_WEBVIEW_NAVIGATED event generated after it was confirmed that a resource would be requested. This event may not be vetoed. Note that if the displayed HTML document has several frames, one such event will be generated per frame. - @event{EVT_WEB_VIEW_LOADED(id, func)} - Process a @c wxEVT_COMMAND_WEB_VIEW_LOADED event generated when the document + @event{EVT_WEBVIEW_LOADED(id, func)} + Process a @c wxEVT_COMMAND_WEBVIEW_LOADED event generated when the document is fully loaded and displayed. Note that if the displayed HTML document has several frames, one such event will be generated per frame. - @event{EVT_WEB_VIEW_ERROR(id, func)} - Process a @c wxEVT_COMMAND_WEB_VIEW_ERROR event generated when a navigation + @event{EVT_WEBVIEW_ERROR(id, func)} + Process a @c wxEVT_COMMAND_WEBVIEW_ERROR event generated when a navigation error occurs. The integer associated with this event will be a wxWebNavigationError item. The string associated with this event may contain a backend-specific more precise error message/code. - @event{EVT_WEB_VIEW_NEWWINDOW(id, func)} - Process a @c wxEVT_COMMAND_WEB_VIEW_NEWWINDOW event, generated when a new + @event{EVT_WEBVIEW_NEWWINDOW(id, func)} + Process a @c wxEVT_COMMAND_WEBVIEW_NEWWINDOW event, generated when a new window is created. You must handle this event if you want anything to happen, for example to load the page in a new window or tab. - @event{EVT_WEB_VIEW_TITLE_CHANGED(id, func)} - Process a @c wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED event, generated when + @event{EVT_WEBVIEW_TITLE_CHANGED(id, func)} + Process a @c wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED event, generated when the page title changes. Use GetString to get the title. @endEventTable @@ -793,9 +793,9 @@ public: }; -wxEventType wxEVT_COMMAND_WEB_VIEW_NAVIGATING; -wxEventType wxEVT_COMMAND_WEB_VIEW_NAVIGATED; -wxEventType wxEVT_COMMAND_WEB_VIEW_LOADED; -wxEventType wxEVT_COMMAND_WEB_VIEW_ERROR; -wxEventType wxEVT_COMMAND_WEB_VIEW_NEWWINDOW; -wxEventType wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED; +wxEventType wxEVT_COMMAND_WEBVIEW_NAVIGATING; +wxEventType wxEVT_COMMAND_WEBVIEW_NAVIGATED; +wxEventType wxEVT_COMMAND_WEBVIEW_LOADED; +wxEventType wxEVT_COMMAND_WEBVIEW_ERROR; +wxEventType wxEVT_COMMAND_WEBVIEW_NEWWINDOW; +wxEventType wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED; diff --git a/samples/webview/webview.cpp b/samples/webview/webview.cpp index a5e56df68c..fc134a9498 100644 --- a/samples/webview/webview.cpp +++ b/samples/webview/webview.cpp @@ -282,7 +282,7 @@ WebFrame::WebFrame(const wxString& url) : m_toolbar->Realize(); // Set find values. - m_findFlags = wxWEB_VIEW_FIND_DEFAULT; + m_findFlags = wxWEBVIEW_FIND_DEFAULT; m_findText = wxEmptyString; m_findCount = 0; @@ -411,7 +411,7 @@ WebFrame::WebFrame(const wxString& url) : m_tools_handle_navigation->Check(); m_tools_handle_new_window->Check(); m_tools_enable_history->Check(); - if(!m_browser->CanSetZoomType(wxWEB_VIEW_ZOOM_TYPE_LAYOUT)) + if(!m_browser->CanSetZoomType(wxWEBVIEW_ZOOM_TYPE_LAYOUT)) m_tools_layout->Enable(false); @@ -445,17 +445,17 @@ WebFrame::WebFrame(const wxString& url) : wxCommandEventHandler(WebFrame::OnFindText), NULL, this ); // Connect the webview events - Connect(m_browser->GetId(), wxEVT_COMMAND_WEB_VIEW_NAVIGATING, + Connect(m_browser->GetId(), wxEVT_COMMAND_WEBVIEW_NAVIGATING, wxWebViewEventHandler(WebFrame::OnNavigationRequest), NULL, this); - Connect(m_browser->GetId(), wxEVT_COMMAND_WEB_VIEW_NAVIGATED, + Connect(m_browser->GetId(), wxEVT_COMMAND_WEBVIEW_NAVIGATED, wxWebViewEventHandler(WebFrame::OnNavigationComplete), NULL, this); - Connect(m_browser->GetId(), wxEVT_COMMAND_WEB_VIEW_LOADED, + Connect(m_browser->GetId(), wxEVT_COMMAND_WEBVIEW_LOADED, wxWebViewEventHandler(WebFrame::OnDocumentLoaded), NULL, this); - Connect(m_browser->GetId(), wxEVT_COMMAND_WEB_VIEW_ERROR, + Connect(m_browser->GetId(), wxEVT_COMMAND_WEBVIEW_ERROR, wxWebViewEventHandler(WebFrame::OnError), NULL, this); - Connect(m_browser->GetId(), wxEVT_COMMAND_WEB_VIEW_NEWWINDOW, + Connect(m_browser->GetId(), wxEVT_COMMAND_WEBVIEW_NEWWINDOW, wxWebViewEventHandler(WebFrame::OnNewWindow), NULL, this); - Connect(m_browser->GetId(), wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED, + Connect(m_browser->GetId(), wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED, wxWebViewEventHandler(WebFrame::OnTitleChanged), NULL, this); // Connect the menu events @@ -697,16 +697,16 @@ void WebFrame::OnFindText(wxCommandEvent& evt) int flags = 0; if(m_find_toolbar_wrap->IsChecked()) - flags |= wxWEB_VIEW_FIND_WRAP; + flags |= wxWEBVIEW_FIND_WRAP; if(m_find_toolbar_wholeword->IsChecked()) - flags |= wxWEB_VIEW_FIND_ENTIRE_WORD; + flags |= wxWEBVIEW_FIND_ENTIRE_WORD; if(m_find_toolbar_matchcase->IsChecked()) - flags |= wxWEB_VIEW_FIND_MATCH_CASE; + flags |= wxWEBVIEW_FIND_MATCH_CASE; if(m_find_toolbar_highlight->IsChecked()) - flags |= wxWEB_VIEW_FIND_HIGHLIGHT_RESULT; + flags |= wxWEBVIEW_FIND_HIGHLIGHT_RESULT; if(m_find_toolbar_previous->GetId() == evt.GetId()) - flags |= wxWEB_VIEW_FIND_BACKWARDS; + flags |= wxWEBVIEW_FIND_BACKWARDS; wxString find_text = m_find_ctrl->GetValue(); long count = m_browser->Find(find_text, flags); @@ -834,19 +834,19 @@ void WebFrame::OnToolsClicked(wxCommandEvent& WXUNUSED(evt)) wxWebViewZoom zoom = m_browser->GetZoom(); switch (zoom) { - case wxWEB_VIEW_ZOOM_TINY: + case wxWEBVIEW_ZOOM_TINY: m_tools_tiny->Check(); break; - case wxWEB_VIEW_ZOOM_SMALL: + case wxWEBVIEW_ZOOM_SMALL: m_tools_small->Check(); break; - case wxWEB_VIEW_ZOOM_MEDIUM: + case wxWEBVIEW_ZOOM_MEDIUM: m_tools_medium->Check(); break; - case wxWEB_VIEW_ZOOM_LARGE: + case wxWEBVIEW_ZOOM_LARGE: m_tools_large->Check(); break; - case wxWEB_VIEW_ZOOM_LARGEST: + case wxWEBVIEW_ZOOM_LARGEST: m_tools_largest->Check(); break; } @@ -913,23 +913,23 @@ void WebFrame::OnSetZoom(wxCommandEvent& evt) { if (evt.GetId() == m_tools_tiny->GetId()) { - m_browser->SetZoom(wxWEB_VIEW_ZOOM_TINY); + m_browser->SetZoom(wxWEBVIEW_ZOOM_TINY); } else if (evt.GetId() == m_tools_small->GetId()) { - m_browser->SetZoom(wxWEB_VIEW_ZOOM_SMALL); + m_browser->SetZoom(wxWEBVIEW_ZOOM_SMALL); } else if (evt.GetId() == m_tools_medium->GetId()) { - m_browser->SetZoom(wxWEB_VIEW_ZOOM_MEDIUM); + m_browser->SetZoom(wxWEBVIEW_ZOOM_MEDIUM); } else if (evt.GetId() == m_tools_large->GetId()) { - m_browser->SetZoom(wxWEB_VIEW_ZOOM_LARGE); + m_browser->SetZoom(wxWEBVIEW_ZOOM_LARGE); } else if (evt.GetId() == m_tools_largest->GetId()) { - m_browser->SetZoom(wxWEB_VIEW_ZOOM_LARGEST); + m_browser->SetZoom(wxWEBVIEW_ZOOM_LARGEST); } else { @@ -940,9 +940,9 @@ void WebFrame::OnSetZoom(wxCommandEvent& evt) void WebFrame::OnZoomLayout(wxCommandEvent& WXUNUSED(evt)) { if(m_tools_layout->IsChecked()) - m_browser->SetZoomType(wxWEB_VIEW_ZOOM_TYPE_LAYOUT); + m_browser->SetZoomType(wxWEBVIEW_ZOOM_TYPE_LAYOUT); else - m_browser->SetZoomType(wxWEB_VIEW_ZOOM_TYPE_TEXT); + m_browser->SetZoomType(wxWEBVIEW_ZOOM_TYPE_TEXT); } void WebFrame::OnHistory(wxCommandEvent& evt) @@ -987,14 +987,14 @@ void WebFrame::OnError(wxWebViewEvent& evt) wxString category; switch (evt.GetInt()) { - WX_ERROR_CASE(wxWEB_NAV_ERR_CONNECTION); - WX_ERROR_CASE(wxWEB_NAV_ERR_CERTIFICATE); - WX_ERROR_CASE(wxWEB_NAV_ERR_AUTH); - WX_ERROR_CASE(wxWEB_NAV_ERR_SECURITY); - WX_ERROR_CASE(wxWEB_NAV_ERR_NOT_FOUND); - WX_ERROR_CASE(wxWEB_NAV_ERR_REQUEST); - WX_ERROR_CASE(wxWEB_NAV_ERR_USER_CANCELLED); - WX_ERROR_CASE(wxWEB_NAV_ERR_OTHER); + WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_CONNECTION); + WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_CERTIFICATE); + WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_AUTH); + WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_SECURITY); + WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_NOT_FOUND); + WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_REQUEST); + WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_USER_CANCELLED); + WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_OTHER); } wxLogMessage("%s", "Error; url='" + evt.GetURL() + "', error='" + category + " (" + evt.GetString() + ")'"); diff --git a/src/common/webview.cpp b/src/common/webview.cpp index 81d042e94f..e664d60192 100644 --- a/src/common/webview.cpp +++ b/src/common/webview.cpp @@ -44,12 +44,12 @@ extern WXDLLIMPEXP_DATA_WEBVIEW(const char) wxWebViewBackendDefault[] = "wxWebVi wxIMPLEMENT_ABSTRACT_CLASS(wxWebView, wxControl); wxIMPLEMENT_DYNAMIC_CLASS(wxWebViewEvent, wxCommandEvent); -wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_NAVIGATING, wxWebViewEvent ); -wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_NAVIGATED, wxWebViewEvent ); -wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_LOADED, wxWebViewEvent ); -wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_ERROR, wxWebViewEvent ); -wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_NEWWINDOW, wxWebViewEvent ); -wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED, wxWebViewEvent ); +wxDEFINE_EVENT( wxEVT_COMMAND_WEBVIEW_NAVIGATING, wxWebViewEvent ); +wxDEFINE_EVENT( wxEVT_COMMAND_WEBVIEW_NAVIGATED, wxWebViewEvent ); +wxDEFINE_EVENT( wxEVT_COMMAND_WEBVIEW_LOADED, wxWebViewEvent ); +wxDEFINE_EVENT( wxEVT_COMMAND_WEBVIEW_ERROR, wxWebViewEvent ); +wxDEFINE_EVENT( wxEVT_COMMAND_WEBVIEW_NEWWINDOW, wxWebViewEvent ); +wxDEFINE_EVENT( wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED, wxWebViewEvent ); wxStringWebViewFactoryMap wxWebView::m_factoryMap; diff --git a/src/gtk/webview_webkit.cpp b/src/gtk/webview_webkit.cpp index 5a3ad0cb04..c6579f8fcb 100644 --- a/src/gtk/webview_webkit.cpp +++ b/src/gtk/webview_webkit.cpp @@ -59,7 +59,7 @@ wxgtk_webview_webkit_load_status(GtkWidget* widget, } webKitCtrl->m_busy = false; - wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_LOADED, + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_LOADED, webKitCtrl->GetId(), url, target); @@ -69,7 +69,7 @@ wxgtk_webview_webkit_load_status(GtkWidget* widget, else if (status == WEBKIT_LOAD_COMMITTED) { webKitCtrl->m_busy = true; - wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_NAVIGATED, + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_NAVIGATED, webKitCtrl->GetId(), url, target); @@ -101,7 +101,7 @@ wxgtk_webview_webkit_navigation(WebKitWebView *, const gchar* uri = webkit_network_request_get_uri(request); wxString target = webkit_web_frame_get_name (frame); - wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_NAVIGATING, + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_NAVIGATING, webKitCtrl->GetId(), wxString( uri, wxConvUTF8 ), target); @@ -155,7 +155,7 @@ wxgtk_webview_webkit_error(WebKitWebView*, wxWebViewWebKit* webKitWindow) { webKitWindow->m_busy = false; - wxWebViewNavigationError type = wxWEB_NAV_ERR_OTHER; + wxWebViewNavigationError type = wxWEBVIEW_NAV_ERR_OTHER; GError* error = (GError*)web_error; wxString description(error->message, wxConvUTF8); @@ -165,12 +165,12 @@ wxgtk_webview_webkit_error(WebKitWebView*, switch (error->code) { case SOUP_STATUS_CANCELLED: - type = wxWEB_NAV_ERR_USER_CANCELLED; + type = wxWEBVIEW_NAV_ERR_USER_CANCELLED; break; case SOUP_STATUS_CANT_RESOLVE: case SOUP_STATUS_NOT_FOUND: - type = wxWEB_NAV_ERR_NOT_FOUND; + type = wxWEBVIEW_NAV_ERR_NOT_FOUND; break; case SOUP_STATUS_CANT_RESOLVE_PROXY: @@ -178,54 +178,54 @@ wxgtk_webview_webkit_error(WebKitWebView*, case SOUP_STATUS_CANT_CONNECT_PROXY: case SOUP_STATUS_SSL_FAILED: case SOUP_STATUS_IO_ERROR: - type = wxWEB_NAV_ERR_CONNECTION; + type = wxWEBVIEW_NAV_ERR_CONNECTION; break; case SOUP_STATUS_MALFORMED: //case SOUP_STATUS_TOO_MANY_REDIRECTS: - type = wxWEB_NAV_ERR_REQUEST; + type = wxWEBVIEW_NAV_ERR_REQUEST; break; //case SOUP_STATUS_NO_CONTENT: //case SOUP_STATUS_RESET_CONTENT: case SOUP_STATUS_BAD_REQUEST: - type = wxWEB_NAV_ERR_REQUEST; + type = wxWEBVIEW_NAV_ERR_REQUEST; break; case SOUP_STATUS_UNAUTHORIZED: case SOUP_STATUS_FORBIDDEN: - type = wxWEB_NAV_ERR_AUTH; + type = wxWEBVIEW_NAV_ERR_AUTH; break; case SOUP_STATUS_METHOD_NOT_ALLOWED: case SOUP_STATUS_NOT_ACCEPTABLE: - type = wxWEB_NAV_ERR_SECURITY; + type = wxWEBVIEW_NAV_ERR_SECURITY; break; case SOUP_STATUS_PROXY_AUTHENTICATION_REQUIRED: - type = wxWEB_NAV_ERR_AUTH; + type = wxWEBVIEW_NAV_ERR_AUTH; break; case SOUP_STATUS_REQUEST_TIMEOUT: - type = wxWEB_NAV_ERR_CONNECTION; + type = wxWEBVIEW_NAV_ERR_CONNECTION; break; //case SOUP_STATUS_PAYMENT_REQUIRED: case SOUP_STATUS_REQUEST_ENTITY_TOO_LARGE: case SOUP_STATUS_REQUEST_URI_TOO_LONG: case SOUP_STATUS_UNSUPPORTED_MEDIA_TYPE: - type = wxWEB_NAV_ERR_REQUEST; + type = wxWEBVIEW_NAV_ERR_REQUEST; break; case SOUP_STATUS_BAD_GATEWAY: case SOUP_STATUS_SERVICE_UNAVAILABLE: case SOUP_STATUS_GATEWAY_TIMEOUT: - type = wxWEB_NAV_ERR_CONNECTION; + type = wxWEBVIEW_NAV_ERR_CONNECTION; break; case SOUP_STATUS_HTTP_VERSION_NOT_SUPPORTED: - type = wxWEB_NAV_ERR_REQUEST; + type = wxWEBVIEW_NAV_ERR_REQUEST; break; //case SOUP_STATUS_INSUFFICIENT_STORAGE: //case SOUP_STATUS_NOT_EXTENDED: @@ -240,15 +240,15 @@ wxgtk_webview_webkit_error(WebKitWebView*, //WEBKIT_NETWORK_ERROR_TRANSPORT: case WEBKIT_NETWORK_ERROR_UNKNOWN_PROTOCOL: - type = wxWEB_NAV_ERR_REQUEST; + type = wxWEBVIEW_NAV_ERR_REQUEST; break; case WEBKIT_NETWORK_ERROR_CANCELLED: - type = wxWEB_NAV_ERR_USER_CANCELLED; + type = wxWEBVIEW_NAV_ERR_USER_CANCELLED; break; case WEBKIT_NETWORK_ERROR_FILE_DOES_NOT_EXIST: - type = wxWEB_NAV_ERR_NOT_FOUND; + type = wxWEBVIEW_NAV_ERR_NOT_FOUND; break; } } @@ -262,7 +262,7 @@ wxgtk_webview_webkit_error(WebKitWebView*, //case WEBKIT_POLICY_ERROR_CANNOT_SHOW_URL: //case WEBKIT_POLICY_ERROR_FRAME_LOAD_INTERRUPTED_BY_POLICY_CHANGE: case WEBKIT_POLICY_ERROR_CANNOT_USE_RESTRICTED_PORT: - type = wxWEB_NAV_ERR_SECURITY; + type = wxWEBVIEW_NAV_ERR_SECURITY; break; } } @@ -274,7 +274,7 @@ wxgtk_webview_webkit_error(WebKitWebView*, } */ - wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_ERROR, + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_ERROR, webKitWindow->GetId(), uri, ""); event.SetString(description); @@ -299,7 +299,7 @@ wxgtk_webview_webkit_new_window(WebKitWebView*, const gchar* uri = webkit_network_request_get_uri(request); wxString target = webkit_web_frame_get_name (frame); - wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_NEWWINDOW, + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_NEWWINDOW, webKitCtrl->GetId(), wxString( uri, wxConvUTF8 ), target); @@ -318,7 +318,7 @@ wxgtk_webview_webkit_title_changed(WebKitWebView*, gchar *title, wxWebViewWebKit *webKitCtrl) { - wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED, + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED, webKitCtrl->GetId(), webKitCtrl->GetCurrentURL(), ""); @@ -529,7 +529,7 @@ void wxWebViewWebKit::Stop() void wxWebViewWebKit::Reload(wxWebViewReloadFlags flags) { - if (flags & wxWEB_VIEW_RELOAD_NO_CACHE) + if (flags & wxWEBVIEW_RELOAD_NO_CACHE) { webkit_web_view_reload_bypass_cache(m_web_view); } @@ -722,28 +722,28 @@ wxWebViewZoom wxWebViewWebKit::GetZoom() const // arbitrary way to map float zoom to our common zoom enum if (zoom <= 0.65) { - return wxWEB_VIEW_ZOOM_TINY; + return wxWEBVIEW_ZOOM_TINY; } else if (zoom > 0.65 && zoom <= 0.90) { - return wxWEB_VIEW_ZOOM_SMALL; + return wxWEBVIEW_ZOOM_SMALL; } else if (zoom > 0.90 && zoom <= 1.15) { - return wxWEB_VIEW_ZOOM_MEDIUM; + return wxWEBVIEW_ZOOM_MEDIUM; } else if (zoom > 1.15 && zoom <= 1.45) { - return wxWEB_VIEW_ZOOM_LARGE; + return wxWEBVIEW_ZOOM_LARGE; } else if (zoom > 1.45) { - return wxWEB_VIEW_ZOOM_LARGEST; + return wxWEBVIEW_ZOOM_LARGEST; } // to shut up compilers, this can never be reached logically wxASSERT(false); - return wxWEB_VIEW_ZOOM_MEDIUM; + return wxWEBVIEW_ZOOM_MEDIUM; } @@ -752,23 +752,23 @@ void wxWebViewWebKit::SetZoom(wxWebViewZoom zoom) // arbitrary way to map our common zoom enum to float zoom switch (zoom) { - case wxWEB_VIEW_ZOOM_TINY: + case wxWEBVIEW_ZOOM_TINY: SetWebkitZoom(0.6f); break; - case wxWEB_VIEW_ZOOM_SMALL: + case wxWEBVIEW_ZOOM_SMALL: SetWebkitZoom(0.8f); break; - case wxWEB_VIEW_ZOOM_MEDIUM: + case wxWEBVIEW_ZOOM_MEDIUM: SetWebkitZoom(1.0f); break; - case wxWEB_VIEW_ZOOM_LARGE: + case wxWEBVIEW_ZOOM_LARGE: SetWebkitZoom(1.3); break; - case wxWEB_VIEW_ZOOM_LARGEST: + case wxWEBVIEW_ZOOM_LARGEST: SetWebkitZoom(1.6); break; @@ -780,7 +780,7 @@ void wxWebViewWebKit::SetZoom(wxWebViewZoom zoom) void wxWebViewWebKit::SetZoomType(wxWebViewZoomType type) { webkit_web_view_set_full_content_zoom(m_web_view, - (type == wxWEB_VIEW_ZOOM_TYPE_LAYOUT ? + (type == wxWEBVIEW_ZOOM_TYPE_LAYOUT ? TRUE : FALSE)); } @@ -788,8 +788,8 @@ wxWebViewZoomType wxWebViewWebKit::GetZoomType() const { gboolean fczoom = webkit_web_view_get_full_content_zoom(m_web_view); - if (fczoom) return wxWEB_VIEW_ZOOM_TYPE_LAYOUT; - else return wxWEB_VIEW_ZOOM_TYPE_TEXT; + if (fczoom) return wxWEBVIEW_ZOOM_TYPE_LAYOUT; + else return wxWEBVIEW_ZOOM_TYPE_TEXT; } bool wxWebViewWebKit::CanSetZoomType(wxWebViewZoomType) const @@ -961,7 +961,7 @@ long wxWebViewWebKit::Find(const wxString& text, int flags) { bool newSearch = false; if(text != m_findText || - (flags & wxWEB_VIEW_FIND_MATCH_CASE) != (m_findFlags & wxWEB_VIEW_FIND_MATCH_CASE)) + (flags & wxWEBVIEW_FIND_MATCH_CASE) != (m_findFlags & wxWEBVIEW_FIND_MATCH_CASE)) { newSearch = true; //If it is a new search we need to clear existing highlights @@ -982,11 +982,11 @@ long wxWebViewWebKit::Find(const wxString& text, int flags) } bool wrap = false, matchCase = false, forward = true; - if(flags & wxWEB_VIEW_FIND_WRAP) + if(flags & wxWEBVIEW_FIND_WRAP) wrap = true; - if(flags & wxWEB_VIEW_FIND_MATCH_CASE) + if(flags & wxWEBVIEW_FIND_MATCH_CASE) matchCase = true; - if(flags & wxWEB_VIEW_FIND_BACKWARDS) + if(flags & wxWEBVIEW_FIND_BACKWARDS) forward = false; if(newSearch) @@ -1010,7 +1010,7 @@ long wxWebViewWebKit::Find(const wxString& text, int flags) } //Highlight them if needed - bool highlight = flags & wxWEB_VIEW_FIND_HIGHLIGHT_RESULT ? true : false; + bool highlight = flags & wxWEBVIEW_FIND_HIGHLIGHT_RESULT ? true : false; webkit_web_view_set_highlight_text_matches(m_web_view, highlight); if(!webkit_web_view_search_text(m_web_view, wxGTK_CONV(text), matchCase, forward, wrap)) diff --git a/src/msw/webview_ie.cpp b/src/msw/webview_ie.cpp index b1c12209b6..76c1c0a5fe 100644 --- a/src/msw/webview_ie.cpp +++ b/src/msw/webview_ie.cpp @@ -45,8 +45,8 @@ DEFINE_GUID(wxIID_IMarkupContainer,0x3050f5f9,0x98b5,0x11cf,0xbb,0x82,0,0xaa,0,0 enum //Internal find flags { - wxWEB_VIEW_FIND_ADD_POINTERS = 0x0001, - wxWEB_VIEW_FIND_REMOVE_HIGHLIGHT = 0x0002 + wxWEBVIEW_FIND_ADD_POINTERS = 0x0001, + wxWEBVIEW_FIND_REMOVE_HIGHLIGHT = 0x0002 }; } @@ -84,7 +84,7 @@ bool wxWebViewIE::Create(wxWindow* parent, m_historyLoadingFromList = false; m_historyEnabled = true; m_historyPosition = -1; - m_zoomType = wxWEB_VIEW_ZOOM_TYPE_TEXT; + m_zoomType = wxWEBVIEW_ZOOM_TYPE_TEXT; FindClear(); if (::CoCreateInstance(CLSID_WebBrowser, NULL, @@ -188,13 +188,13 @@ void wxWebViewIE::DoSetPage(const wxString& html, const wxString& baseUrl) //We send the events when we are done to mimic webkit //Navigated event - wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_NAVIGATED, + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_NAVIGATED, GetId(), baseUrl, ""); event.SetEventObject(this); HandleWindowEvent(event); //Document complete event - event.SetEventType(wxEVT_COMMAND_WEB_VIEW_LOADED); + event.SetEventType(wxEVT_COMMAND_WEBVIEW_LOADED); event.SetEventObject(this); HandleWindowEvent(event); } @@ -241,16 +241,16 @@ wxWebViewZoom wxWebViewIE::GetZoom() const { switch( m_zoomType ) { - case wxWEB_VIEW_ZOOM_TYPE_LAYOUT: + case wxWEBVIEW_ZOOM_TYPE_LAYOUT: return GetIEOpticalZoom(); - case wxWEB_VIEW_ZOOM_TYPE_TEXT: + case wxWEBVIEW_ZOOM_TYPE_TEXT: return GetIETextZoom(); default: wxFAIL; } //Dummy return to stop compiler warnings - return wxWEB_VIEW_ZOOM_MEDIUM; + return wxWEBVIEW_ZOOM_MEDIUM; } @@ -258,10 +258,10 @@ void wxWebViewIE::SetZoom(wxWebViewZoom zoom) { switch( m_zoomType ) { - case wxWEB_VIEW_ZOOM_TYPE_LAYOUT: + case wxWEBVIEW_ZOOM_TYPE_LAYOUT: SetIEOpticalZoom(zoom); break; - case wxWEB_VIEW_ZOOM_TYPE_TEXT: + case wxWEBVIEW_ZOOM_TYPE_TEXT: SetIETextZoom(zoom); break; default: @@ -317,19 +317,19 @@ void wxWebViewIE::SetIEOpticalZoom(wxWebViewZoom level) //We make a somewhat arbitray map here, taken from values used by webkit switch(level) { - case wxWEB_VIEW_ZOOM_TINY: + case wxWEBVIEW_ZOOM_TINY: V_I4(&zoomVariant) = 60; break; - case wxWEB_VIEW_ZOOM_SMALL: + case wxWEBVIEW_ZOOM_SMALL: V_I4(&zoomVariant) = 80; break; - case wxWEB_VIEW_ZOOM_MEDIUM: + case wxWEBVIEW_ZOOM_MEDIUM: V_I4(&zoomVariant) = 100; break; - case wxWEB_VIEW_ZOOM_LARGE: + case wxWEBVIEW_ZOOM_LARGE: V_I4(&zoomVariant) = 130; break; - case wxWEB_VIEW_ZOOM_LARGEST: + case wxWEBVIEW_ZOOM_LARGEST: V_I4(&zoomVariant) = 160; break; default: @@ -365,23 +365,23 @@ wxWebViewZoom wxWebViewIE::GetIEOpticalZoom() const //We make a somewhat arbitray map here, taken from values used by webkit if (zoom <= 65) { - return wxWEB_VIEW_ZOOM_TINY; + return wxWEBVIEW_ZOOM_TINY; } else if (zoom > 65 && zoom <= 90) { - return wxWEB_VIEW_ZOOM_SMALL; + return wxWEBVIEW_ZOOM_SMALL; } else if (zoom > 90 && zoom <= 115) { - return wxWEB_VIEW_ZOOM_MEDIUM; + return wxWEBVIEW_ZOOM_MEDIUM; } else if (zoom > 115 && zoom <= 145) { - return wxWEB_VIEW_ZOOM_LARGE; + return wxWEBVIEW_ZOOM_LARGE; } else /*if (zoom > 145) */ //Using else removes a compiler warning { - return wxWEB_VIEW_ZOOM_LARGEST; + return wxWEBVIEW_ZOOM_LARGEST; } } @@ -404,7 +404,7 @@ bool wxWebViewIE::CanSetZoomType(wxWebViewZoomType type) const key.QueryValue("Version", value); long version = wxAtoi(value.Left(1)); - if(version <= 6 && type == wxWEB_VIEW_ZOOM_TYPE_LAYOUT) + if(version <= 6 && type == wxWEBVIEW_ZOOM_TYPE_LAYOUT) return false; else return true; @@ -508,10 +508,10 @@ void wxWebViewIE::Reload(wxWebViewReloadFlags flags) switch(flags) { - case wxWEB_VIEW_RELOAD_DEFAULT: + case wxWEBVIEW_RELOAD_DEFAULT: V_I2(&level) = REFRESH_NORMAL; break; - case wxWEB_VIEW_RELOAD_NO_CACHE: + case wxWEBVIEW_RELOAD_NO_CACHE: V_I2(&level) = REFRESH_COMPLETELY; break; default: @@ -634,9 +634,9 @@ long wxWebViewIE::Find(const wxString& text, int flags) if(text.IsEmpty()) { ClearSelection(); - if(m_findFlags & wxWEB_VIEW_FIND_HIGHLIGHT_RESULT) + if(m_findFlags & wxWEBVIEW_FIND_HIGHLIGHT_RESULT) { - FindInternal(m_findText, (m_findFlags &~ wxWEB_VIEW_FIND_HIGHLIGHT_RESULT), wxWEB_VIEW_FIND_REMOVE_HIGHLIGHT); + FindInternal(m_findText, (m_findFlags &~ wxWEBVIEW_FIND_HIGHLIGHT_RESULT), wxWEBVIEW_FIND_REMOVE_HIGHLIGHT); } FindClear(); return wxNOT_FOUND; @@ -645,25 +645,25 @@ long wxWebViewIE::Find(const wxString& text, int flags) if(m_findText == text) { //Just do a highlight? - if((flags & wxWEB_VIEW_FIND_HIGHLIGHT_RESULT) != (m_findFlags & wxWEB_VIEW_FIND_HIGHLIGHT_RESULT)) + if((flags & wxWEBVIEW_FIND_HIGHLIGHT_RESULT) != (m_findFlags & wxWEBVIEW_FIND_HIGHLIGHT_RESULT)) { m_findFlags = flags; if(!m_findPointers.empty()) { - FindInternal(m_findText, m_findFlags, ((flags & wxWEB_VIEW_FIND_HIGHLIGHT_RESULT) == 0 ? wxWEB_VIEW_FIND_REMOVE_HIGHLIGHT : 0)); + FindInternal(m_findText, m_findFlags, ((flags & wxWEBVIEW_FIND_HIGHLIGHT_RESULT) == 0 ? wxWEBVIEW_FIND_REMOVE_HIGHLIGHT : 0)); } return m_findPosition; } - else if(((m_findFlags & wxWEB_VIEW_FIND_ENTIRE_WORD) == (flags & wxWEB_VIEW_FIND_ENTIRE_WORD)) && ((m_findFlags & wxWEB_VIEW_FIND_MATCH_CASE) == (flags&wxWEB_VIEW_FIND_MATCH_CASE))) + else if(((m_findFlags & wxWEBVIEW_FIND_ENTIRE_WORD) == (flags & wxWEBVIEW_FIND_ENTIRE_WORD)) && ((m_findFlags & wxWEBVIEW_FIND_MATCH_CASE) == (flags&wxWEBVIEW_FIND_MATCH_CASE))) { m_findFlags = flags; - return FindNext(((flags & wxWEB_VIEW_FIND_BACKWARDS) ? -1 : 1)); + return FindNext(((flags & wxWEBVIEW_FIND_BACKWARDS) ? -1 : 1)); } } //Remove old highlight if any. - if(m_findFlags & wxWEB_VIEW_FIND_HIGHLIGHT_RESULT) + if(m_findFlags & wxWEBVIEW_FIND_HIGHLIGHT_RESULT) { - FindInternal(m_findText, (m_findFlags &~ wxWEB_VIEW_FIND_HIGHLIGHT_RESULT), wxWEB_VIEW_FIND_REMOVE_HIGHLIGHT); + FindInternal(m_findText, (m_findFlags &~ wxWEBVIEW_FIND_HIGHLIGHT_RESULT), wxWEBVIEW_FIND_REMOVE_HIGHLIGHT); } //Reset find variables. FindClear(); @@ -671,7 +671,7 @@ long wxWebViewIE::Find(const wxString& text, int flags) m_findText = text; m_findFlags = flags; //find the text and return count. - FindInternal(text, flags, wxWEB_VIEW_FIND_ADD_POINTERS); + FindInternal(text, flags, wxWEBVIEW_FIND_ADD_POINTERS); return m_findPointers.empty() ? wxNOT_FOUND : m_findPointers.size(); } @@ -1009,11 +1009,11 @@ void wxWebViewIE::FindInternal(const wxString& text, int flags, int internal_fla ptrBegin->SetGravity(wxPOINTER_GRAVITY_Right); ptrBegin->MoveToContainer(pIMC, TRUE); //Create the find flag from the wx one. - if(flags & wxWEB_VIEW_FIND_ENTIRE_WORD) + if(flags & wxWEBVIEW_FIND_ENTIRE_WORD) { find_flag |= wxFINDTEXT_WHOLEWORD; } - if(flags & wxWEB_VIEW_FIND_MATCH_CASE) + if(flags & wxWEBVIEW_FIND_MATCH_CASE) { find_flag |= wxFINDTEXT_MATCHCASE; } @@ -1031,20 +1031,20 @@ void wxWebViewIE::FindInternal(const wxString& text, int flags, int internal_fla if(IsElementVisible(elm)) { //Highlight the word if the flag was set. - if(flags & wxWEB_VIEW_FIND_HIGHLIGHT_RESULT) + if(flags & wxWEBVIEW_FIND_HIGHLIGHT_RESULT) { IHTMLElement* pFontEl; pIMS->CreateElement(wxTAGID_FONT, attr_bstr, &pFontEl); pIMS->InsertElement(pFontEl, ptrBegin, ptrEnd); } - if(internal_flag & wxWEB_VIEW_FIND_REMOVE_HIGHLIGHT) + if(internal_flag & wxWEBVIEW_FIND_REMOVE_HIGHLIGHT) { IHTMLElement* pFontEl; ptrBegin->CurrentScope(&pFontEl); pIMS->RemoveElement(pFontEl); pFontEl->Release(); } - if(internal_flag & wxWEB_VIEW_FIND_ADD_POINTERS) + if(internal_flag & wxWEBVIEW_FIND_ADD_POINTERS) { wxIMarkupPointer *cptrBegin, *cptrEnd; pIMS->CreateMarkupPointer(&cptrBegin); @@ -1089,7 +1089,7 @@ long wxWebViewIE::FindNext(int direction) if(m_findPosition >= (signed)m_findPointers.size()) { - if(m_findFlags & wxWEB_VIEW_FIND_WRAP) + if(m_findFlags & wxWEBVIEW_FIND_WRAP) { m_findPosition = 0; } @@ -1101,7 +1101,7 @@ long wxWebViewIE::FindNext(int direction) } else if(m_findPosition < 0) { - if(m_findFlags & wxWEB_VIEW_FIND_WRAP) + if(m_findFlags & wxWEBVIEW_FIND_WRAP) { m_findPosition = m_findPointers.size()-1; } @@ -1149,7 +1149,7 @@ void wxWebViewIE::FindClear() { //Reset find variables. m_findText.Empty(); - m_findFlags = wxWEB_VIEW_FIND_DEFAULT; + m_findFlags = wxWEBVIEW_FIND_DEFAULT; m_findPosition = -1; //The m_findPointers contains pointers for the found text. @@ -1217,7 +1217,7 @@ void wxWebViewIE::onActiveXEvent(wxActiveXEvent& evt) wxString url = evt[1].GetString(); wxString target = evt[3].GetString(); - wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_NAVIGATING, + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_NAVIGATING, GetId(), url, target); //skip empty javascript events. @@ -1252,7 +1252,7 @@ void wxWebViewIE::onActiveXEvent(wxActiveXEvent& evt) wxString url = evt[1].GetString(); // TODO: set target parameter if possible wxString target = wxEmptyString; - wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_NAVIGATED, + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_NAVIGATED, GetId(), url, target); event.SetEventObject(this); HandleWindowEvent(event); @@ -1303,7 +1303,7 @@ void wxWebViewIE::onActiveXEvent(wxActiveXEvent& evt) FindClear(); // TODO: set target parameter if possible wxString target = wxEmptyString; - wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_LOADED, GetId(), + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_LOADED, GetId(), url, target); event.SetEventObject(this); HandleWindowEvent(event); @@ -1319,7 +1319,7 @@ void wxWebViewIE::onActiveXEvent(wxActiveXEvent& evt) { wxString title = evt[0].GetString(); - wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED, + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED, GetId(), GetCurrentURL(), ""); event.SetString(title); event.SetEventObject(this); @@ -1329,65 +1329,65 @@ void wxWebViewIE::onActiveXEvent(wxActiveXEvent& evt) case DISPID_NAVIGATEERROR: { - wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_ERROR, GetId(), + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_ERROR, GetId(), evt[1].GetString(), evt[2].GetString()); event.SetEventObject(this); switch (evt[3].GetLong()) { // 400 Error codes - WX_ERROR_CASE(HTTP_STATUS_BAD_REQUEST, wxWEB_NAV_ERR_REQUEST) - WX_ERROR_CASE(HTTP_STATUS_DENIED, wxWEB_NAV_ERR_AUTH) - WX_ERROR_CASE(HTTP_STATUS_PAYMENT_REQ, wxWEB_NAV_ERR_OTHER) - WX_ERROR_CASE(HTTP_STATUS_FORBIDDEN, wxWEB_NAV_ERR_AUTH) - WX_ERROR_CASE(HTTP_STATUS_NOT_FOUND, wxWEB_NAV_ERR_NOT_FOUND) - WX_ERROR_CASE(HTTP_STATUS_BAD_METHOD, wxWEB_NAV_ERR_REQUEST) - WX_ERROR_CASE(HTTP_STATUS_NONE_ACCEPTABLE, wxWEB_NAV_ERR_OTHER) - WX_ERROR_CASE(HTTP_STATUS_PROXY_AUTH_REQ, wxWEB_NAV_ERR_AUTH) - WX_ERROR_CASE(HTTP_STATUS_REQUEST_TIMEOUT, wxWEB_NAV_ERR_CONNECTION) - WX_ERROR_CASE(HTTP_STATUS_CONFLICT, wxWEB_NAV_ERR_REQUEST) - WX_ERROR_CASE(HTTP_STATUS_GONE, wxWEB_NAV_ERR_NOT_FOUND) - WX_ERROR_CASE(HTTP_STATUS_LENGTH_REQUIRED, wxWEB_NAV_ERR_REQUEST) - WX_ERROR_CASE(HTTP_STATUS_PRECOND_FAILED, wxWEB_NAV_ERR_REQUEST) - WX_ERROR_CASE(HTTP_STATUS_REQUEST_TOO_LARGE, wxWEB_NAV_ERR_REQUEST) - WX_ERROR_CASE(HTTP_STATUS_URI_TOO_LONG, wxWEB_NAV_ERR_REQUEST) - WX_ERROR_CASE(HTTP_STATUS_UNSUPPORTED_MEDIA, wxWEB_NAV_ERR_REQUEST) - WX_ERROR_CASE(HTTP_STATUS_RETRY_WITH, wxWEB_NAV_ERR_OTHER) + WX_ERROR_CASE(HTTP_STATUS_BAD_REQUEST, wxWEBVIEW_NAV_ERR_REQUEST) + WX_ERROR_CASE(HTTP_STATUS_DENIED, wxWEBVIEW_NAV_ERR_AUTH) + WX_ERROR_CASE(HTTP_STATUS_PAYMENT_REQ, wxWEBVIEW_NAV_ERR_OTHER) + WX_ERROR_CASE(HTTP_STATUS_FORBIDDEN, wxWEBVIEW_NAV_ERR_AUTH) + WX_ERROR_CASE(HTTP_STATUS_NOT_FOUND, wxWEBVIEW_NAV_ERR_NOT_FOUND) + WX_ERROR_CASE(HTTP_STATUS_BAD_METHOD, wxWEBVIEW_NAV_ERR_REQUEST) + WX_ERROR_CASE(HTTP_STATUS_NONE_ACCEPTABLE, wxWEBVIEW_NAV_ERR_OTHER) + WX_ERROR_CASE(HTTP_STATUS_PROXY_AUTH_REQ, wxWEBVIEW_NAV_ERR_AUTH) + WX_ERROR_CASE(HTTP_STATUS_REQUEST_TIMEOUT, wxWEBVIEW_NAV_ERR_CONNECTION) + WX_ERROR_CASE(HTTP_STATUS_CONFLICT, wxWEBVIEW_NAV_ERR_REQUEST) + WX_ERROR_CASE(HTTP_STATUS_GONE, wxWEBVIEW_NAV_ERR_NOT_FOUND) + WX_ERROR_CASE(HTTP_STATUS_LENGTH_REQUIRED, wxWEBVIEW_NAV_ERR_REQUEST) + WX_ERROR_CASE(HTTP_STATUS_PRECOND_FAILED, wxWEBVIEW_NAV_ERR_REQUEST) + WX_ERROR_CASE(HTTP_STATUS_REQUEST_TOO_LARGE, wxWEBVIEW_NAV_ERR_REQUEST) + WX_ERROR_CASE(HTTP_STATUS_URI_TOO_LONG, wxWEBVIEW_NAV_ERR_REQUEST) + WX_ERROR_CASE(HTTP_STATUS_UNSUPPORTED_MEDIA, wxWEBVIEW_NAV_ERR_REQUEST) + WX_ERROR_CASE(HTTP_STATUS_RETRY_WITH, wxWEBVIEW_NAV_ERR_OTHER) // 500 - Error codes - WX_ERROR_CASE(HTTP_STATUS_SERVER_ERROR, wxWEB_NAV_ERR_CONNECTION) - WX_ERROR_CASE(HTTP_STATUS_NOT_SUPPORTED, wxWEB_NAV_ERR_CONNECTION) - WX_ERROR_CASE(HTTP_STATUS_BAD_GATEWAY, wxWEB_NAV_ERR_CONNECTION) - WX_ERROR_CASE(HTTP_STATUS_SERVICE_UNAVAIL, wxWEB_NAV_ERR_CONNECTION) - WX_ERROR_CASE(HTTP_STATUS_GATEWAY_TIMEOUT, wxWEB_NAV_ERR_CONNECTION) - WX_ERROR_CASE(HTTP_STATUS_VERSION_NOT_SUP, wxWEB_NAV_ERR_REQUEST) + WX_ERROR_CASE(HTTP_STATUS_SERVER_ERROR, wxWEBVIEW_NAV_ERR_CONNECTION) + WX_ERROR_CASE(HTTP_STATUS_NOT_SUPPORTED, wxWEBVIEW_NAV_ERR_CONNECTION) + WX_ERROR_CASE(HTTP_STATUS_BAD_GATEWAY, wxWEBVIEW_NAV_ERR_CONNECTION) + WX_ERROR_CASE(HTTP_STATUS_SERVICE_UNAVAIL, wxWEBVIEW_NAV_ERR_CONNECTION) + WX_ERROR_CASE(HTTP_STATUS_GATEWAY_TIMEOUT, wxWEBVIEW_NAV_ERR_CONNECTION) + WX_ERROR_CASE(HTTP_STATUS_VERSION_NOT_SUP, wxWEBVIEW_NAV_ERR_REQUEST) // URL Moniker error codes - WX_ERROR_CASE(INET_E_INVALID_URL, wxWEB_NAV_ERR_REQUEST) - WX_ERROR_CASE(INET_E_NO_SESSION, wxWEB_NAV_ERR_CONNECTION) - WX_ERROR_CASE(INET_E_CANNOT_CONNECT, wxWEB_NAV_ERR_CONNECTION) - WX_ERROR_CASE(INET_E_RESOURCE_NOT_FOUND, wxWEB_NAV_ERR_NOT_FOUND) - WX_ERROR_CASE(INET_E_OBJECT_NOT_FOUND, wxWEB_NAV_ERR_NOT_FOUND) - WX_ERROR_CASE(INET_E_DATA_NOT_AVAILABLE, wxWEB_NAV_ERR_NOT_FOUND) - WX_ERROR_CASE(INET_E_DOWNLOAD_FAILURE, wxWEB_NAV_ERR_CONNECTION) - WX_ERROR_CASE(INET_E_AUTHENTICATION_REQUIRED, wxWEB_NAV_ERR_AUTH) - WX_ERROR_CASE(INET_E_NO_VALID_MEDIA, wxWEB_NAV_ERR_REQUEST) - WX_ERROR_CASE(INET_E_CONNECTION_TIMEOUT, wxWEB_NAV_ERR_CONNECTION) - WX_ERROR_CASE(INET_E_INVALID_REQUEST, wxWEB_NAV_ERR_REQUEST) - WX_ERROR_CASE(INET_E_UNKNOWN_PROTOCOL, wxWEB_NAV_ERR_REQUEST) - WX_ERROR_CASE(INET_E_SECURITY_PROBLEM, wxWEB_NAV_ERR_SECURITY) - WX_ERROR_CASE(INET_E_CANNOT_LOAD_DATA, wxWEB_NAV_ERR_OTHER) - WX_ERROR_CASE(INET_E_REDIRECT_FAILED, wxWEB_NAV_ERR_OTHER) - WX_ERROR_CASE(INET_E_REDIRECT_TO_DIR, wxWEB_NAV_ERR_REQUEST) - WX_ERROR_CASE(INET_E_CANNOT_LOCK_REQUEST, wxWEB_NAV_ERR_OTHER) - WX_ERROR_CASE(INET_E_USE_EXTEND_BINDING, wxWEB_NAV_ERR_OTHER) - WX_ERROR_CASE(INET_E_TERMINATED_BIND, wxWEB_NAV_ERR_OTHER) - WX_ERROR_CASE(INET_E_INVALID_CERTIFICATE, wxWEB_NAV_ERR_CERTIFICATE) - WX_ERROR_CASE(INET_E_CODE_DOWNLOAD_DECLINED, wxWEB_NAV_ERR_USER_CANCELLED) - WX_ERROR_CASE(INET_E_RESULT_DISPATCHED, wxWEB_NAV_ERR_OTHER) - WX_ERROR_CASE(INET_E_CANNOT_REPLACE_SFP_FILE, wxWEB_NAV_ERR_SECURITY) - WX_ERROR_CASE(INET_E_CODE_INSTALL_BLOCKED_BY_HASH_POLICY, wxWEB_NAV_ERR_SECURITY) - WX_ERROR_CASE(INET_E_CODE_INSTALL_SUPPRESSED, wxWEB_NAV_ERR_SECURITY) + WX_ERROR_CASE(INET_E_INVALID_URL, wxWEBVIEW_NAV_ERR_REQUEST) + WX_ERROR_CASE(INET_E_NO_SESSION, wxWEBVIEW_NAV_ERR_CONNECTION) + WX_ERROR_CASE(INET_E_CANNOT_CONNECT, wxWEBVIEW_NAV_ERR_CONNECTION) + WX_ERROR_CASE(INET_E_RESOURCE_NOT_FOUND, wxWEBVIEW_NAV_ERR_NOT_FOUND) + WX_ERROR_CASE(INET_E_OBJECT_NOT_FOUND, wxWEBVIEW_NAV_ERR_NOT_FOUND) + WX_ERROR_CASE(INET_E_DATA_NOT_AVAILABLE, wxWEBVIEW_NAV_ERR_NOT_FOUND) + WX_ERROR_CASE(INET_E_DOWNLOAD_FAILURE, wxWEBVIEW_NAV_ERR_CONNECTION) + WX_ERROR_CASE(INET_E_AUTHENTICATION_REQUIRED, wxWEBVIEW_NAV_ERR_AUTH) + WX_ERROR_CASE(INET_E_NO_VALID_MEDIA, wxWEBVIEW_NAV_ERR_REQUEST) + WX_ERROR_CASE(INET_E_CONNECTION_TIMEOUT, wxWEBVIEW_NAV_ERR_CONNECTION) + WX_ERROR_CASE(INET_E_INVALID_REQUEST, wxWEBVIEW_NAV_ERR_REQUEST) + WX_ERROR_CASE(INET_E_UNKNOWN_PROTOCOL, wxWEBVIEW_NAV_ERR_REQUEST) + WX_ERROR_CASE(INET_E_SECURITY_PROBLEM, wxWEBVIEW_NAV_ERR_SECURITY) + WX_ERROR_CASE(INET_E_CANNOT_LOAD_DATA, wxWEBVIEW_NAV_ERR_OTHER) + WX_ERROR_CASE(INET_E_REDIRECT_FAILED, wxWEBVIEW_NAV_ERR_OTHER) + WX_ERROR_CASE(INET_E_REDIRECT_TO_DIR, wxWEBVIEW_NAV_ERR_REQUEST) + WX_ERROR_CASE(INET_E_CANNOT_LOCK_REQUEST, wxWEBVIEW_NAV_ERR_OTHER) + WX_ERROR_CASE(INET_E_USE_EXTEND_BINDING, wxWEBVIEW_NAV_ERR_OTHER) + WX_ERROR_CASE(INET_E_TERMINATED_BIND, wxWEBVIEW_NAV_ERR_OTHER) + WX_ERROR_CASE(INET_E_INVALID_CERTIFICATE, wxWEBVIEW_NAV_ERR_CERTIFICATE) + WX_ERROR_CASE(INET_E_CODE_DOWNLOAD_DECLINED, wxWEBVIEW_NAV_ERR_USER_CANCELLED) + WX_ERROR_CASE(INET_E_RESULT_DISPATCHED, wxWEBVIEW_NAV_ERR_OTHER) + WX_ERROR_CASE(INET_E_CANNOT_REPLACE_SFP_FILE, wxWEBVIEW_NAV_ERR_SECURITY) + WX_ERROR_CASE(INET_E_CODE_INSTALL_BLOCKED_BY_HASH_POLICY, wxWEBVIEW_NAV_ERR_SECURITY) + WX_ERROR_CASE(INET_E_CODE_INSTALL_SUPPRESSED, wxWEBVIEW_NAV_ERR_SECURITY) } HandleWindowEvent(event); break; @@ -1396,7 +1396,7 @@ void wxWebViewIE::onActiveXEvent(wxActiveXEvent& evt) { wxString url = evt[4].GetString(); - wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_NEWWINDOW, + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_NEWWINDOW, GetId(), url, wxEmptyString); event.SetEventObject(this); HandleWindowEvent(event); diff --git a/src/osx/webview_webkit.mm b/src/osx/webview_webkit.mm index 241a5f97d2..0340ca7a02 100644 --- a/src/osx/webview_webkit.mm +++ b/src/osx/webview_webkit.mm @@ -462,7 +462,7 @@ void wxWebViewWebKit::Reload(wxWebViewReloadFlags flags) if ( !m_webView ) return; - if (flags & wxWEB_VIEW_RELOAD_NO_CACHE) + if (flags & wxWEBVIEW_RELOAD_NO_CACHE) { // TODO: test this indeed bypasses the cache [[m_webView preferences] setUsesPageCache:NO]; @@ -599,7 +599,7 @@ void wxWebViewWebKit::SetZoomType(wxWebViewZoomType zoomType) { // there is only one supported zoom type at the moment so this setter // does nothing beyond checking sanity - wxASSERT(zoomType == wxWEB_VIEW_ZOOM_TYPE_TEXT); + wxASSERT(zoomType == wxWEBVIEW_ZOOM_TYPE_TEXT); } wxWebViewZoomType wxWebViewWebKit::GetZoomType() const @@ -607,7 +607,7 @@ wxWebViewZoomType wxWebViewWebKit::GetZoomType() const // for now that's the only one that is supported // FIXME: does the default zoom type change depending on webkit versions? :S // Then this will be wrong - return wxWEB_VIEW_ZOOM_TYPE_TEXT; + return wxWEBVIEW_ZOOM_TYPE_TEXT; } bool wxWebViewWebKit::CanSetZoomType(wxWebViewZoomType type) const @@ -617,7 +617,7 @@ bool wxWebViewWebKit::CanSetZoomType(wxWebViewZoomType type) const // for now that's the only one that is supported // TODO: I know recent versions of webkit support layout zoom too, // check if we can support it - case wxWEB_VIEW_ZOOM_TYPE_TEXT: + case wxWEBVIEW_ZOOM_TYPE_TEXT: return true; default: @@ -782,28 +782,28 @@ wxWebViewZoom wxWebViewWebKit::GetZoom() const // arbitrary way to map float zoom to our common zoom enum if (zoom <= 0.55) { - return wxWEB_VIEW_ZOOM_TINY; + return wxWEBVIEW_ZOOM_TINY; } else if (zoom > 0.55 && zoom <= 0.85) { - return wxWEB_VIEW_ZOOM_SMALL; + return wxWEBVIEW_ZOOM_SMALL; } else if (zoom > 0.85 && zoom <= 1.15) { - return wxWEB_VIEW_ZOOM_MEDIUM; + return wxWEBVIEW_ZOOM_MEDIUM; } else if (zoom > 1.15 && zoom <= 1.45) { - return wxWEB_VIEW_ZOOM_LARGE; + return wxWEBVIEW_ZOOM_LARGE; } else if (zoom > 1.45) { - return wxWEB_VIEW_ZOOM_LARGEST; + return wxWEBVIEW_ZOOM_LARGEST; } // to shut up compilers, this can never be reached logically wxASSERT(false); - return wxWEB_VIEW_ZOOM_MEDIUM; + return wxWEBVIEW_ZOOM_MEDIUM; } void wxWebViewWebKit::SetZoom(wxWebViewZoom zoom) @@ -811,23 +811,23 @@ void wxWebViewWebKit::SetZoom(wxWebViewZoom zoom) // arbitrary way to map our common zoom enum to float zoom switch (zoom) { - case wxWEB_VIEW_ZOOM_TINY: + case wxWEBVIEW_ZOOM_TINY: SetWebkitZoom(0.4f); break; - case wxWEB_VIEW_ZOOM_SMALL: + case wxWEBVIEW_ZOOM_SMALL: SetWebkitZoom(0.7f); break; - case wxWEB_VIEW_ZOOM_MEDIUM: + case wxWEBVIEW_ZOOM_MEDIUM: SetWebkitZoom(1.0f); break; - case wxWEB_VIEW_ZOOM_LARGE: + case wxWEBVIEW_ZOOM_LARGE: SetWebkitZoom(1.3); break; - case wxWEB_VIEW_ZOOM_LARGEST: + case wxWEBVIEW_ZOOM_LARGEST: SetWebkitZoom(1.6); break; @@ -1032,7 +1032,7 @@ void wxWebViewWebKit::RegisterHandler(wxSharedPtr handler) if (webKitWindow && frame == [sender mainFrame]){ NSString *url = [[[[frame dataSource] request] URL] absoluteString]; wxString target = wxStringWithNSString([frame name]); - wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_NAVIGATED, + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_NAVIGATED, webKitWindow->GetId(), wxStringWithNSString( url ), target); @@ -1050,7 +1050,7 @@ void wxWebViewWebKit::RegisterHandler(wxSharedPtr handler) NSString *url = [[[[frame dataSource] request] URL] absoluteString]; wxString target = wxStringWithNSString([frame name]); - wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_LOADED, + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_LOADED, webKitWindow->GetId(), wxStringWithNSString( url ), target); @@ -1062,7 +1062,7 @@ void wxWebViewWebKit::RegisterHandler(wxSharedPtr handler) wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) { - *out = wxWEB_NAV_ERR_OTHER; + *out = wxWEBVIEW_NAV_ERR_OTHER; if ([[error domain] isEqualToString:NSURLErrorDomain]) { @@ -1071,7 +1071,7 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) case NSURLErrorCannotFindHost: case NSURLErrorFileDoesNotExist: case NSURLErrorRedirectToNonExistentLocation: - *out = wxWEB_NAV_ERR_NOT_FOUND; + *out = wxWEBVIEW_NAV_ERR_NOT_FOUND; break; case NSURLErrorResourceUnavailable: @@ -1081,7 +1081,7 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) #endif case NSURLErrorBadURL: case NSURLErrorFileIsDirectory: - *out = wxWEB_NAV_ERR_REQUEST; + *out = wxWEBVIEW_NAV_ERR_REQUEST; break; case NSURLErrorTimedOut: @@ -1092,12 +1092,12 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) //case NSURLErrorInternationalRoamingOff: //case NSURLErrorCallIsActive: //case NSURLErrorDataNotAllowed: - *out = wxWEB_NAV_ERR_CONNECTION; + *out = wxWEBVIEW_NAV_ERR_CONNECTION; break; case NSURLErrorCancelled: case NSURLErrorUserCancelledAuthentication: - *out = wxWEB_NAV_ERR_USER_CANCELLED; + *out = wxWEBVIEW_NAV_ERR_USER_CANCELLED; break; #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 @@ -1106,7 +1106,7 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) case NSURLErrorCannotParseResponse: #endif case NSURLErrorBadServerResponse: - *out = wxWEB_NAV_ERR_REQUEST; + *out = wxWEBVIEW_NAV_ERR_REQUEST; break; case NSURLErrorUserAuthenticationRequired: @@ -1114,11 +1114,11 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 case NSURLErrorClientCertificateRequired: #endif - *out = wxWEB_NAV_ERR_AUTH; + *out = wxWEBVIEW_NAV_ERR_AUTH; break; case NSURLErrorNoPermissionsToReadFile: - *out = wxWEB_NAV_ERR_SECURITY; + *out = wxWEBVIEW_NAV_ERR_SECURITY; break; case NSURLErrorServerCertificateHasBadDate: @@ -1126,7 +1126,7 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) case NSURLErrorServerCertificateHasUnknownRoot: case NSURLErrorServerCertificateNotYetValid: case NSURLErrorClientCertificateRejected: - *out = wxWEB_NAV_ERR_CERTIFICATE; + *out = wxWEBVIEW_NAV_ERR_CERTIFICATE; break; } } @@ -1150,7 +1150,7 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) wxWebViewNavigationError type; wxString description = nsErrorToWxHtmlError(error, &type); - wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_ERROR, + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_ERROR, webKitWindow->GetId(), wxStringWithNSString( url ), wxEmptyString); @@ -1176,7 +1176,7 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) wxWebViewNavigationError type; wxString description = nsErrorToWxHtmlError(error, &type); - wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_ERROR, + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_ERROR, webKitWindow->GetId(), wxStringWithNSString( url ), wxEmptyString); @@ -1192,7 +1192,7 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) forFrame:(WebFrame *)frame { wxString target = wxStringWithNSString([frame name]); - wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED, + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED, webKitWindow->GetId(), webKitWindow->GetCurrentURL(), target); @@ -1224,7 +1224,7 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) webKitWindow->m_busy = true; NSString *url = [[request URL] absoluteString]; wxString target = wxStringWithNSString([frame name]); - wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_NAVIGATING, + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_NAVIGATING, webKitWindow->GetId(), wxStringWithNSString( url ), target); @@ -1251,7 +1251,7 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) wxUnusedVar(actionInformation); NSString *url = [[request URL] absoluteString]; - wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_NEWWINDOW, + wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_NEWWINDOW, webKitWindow->GetId(), wxStringWithNSString( url ), ""); diff --git a/tests/controls/webtest.cpp b/tests/controls/webtest.cpp index fab56fab35..6b9e093e00 100644 --- a/tests/controls/webtest.cpp +++ b/tests/controls/webtest.cpp @@ -79,7 +79,7 @@ void WebTestCase::setUp() { m_browser = wxWebView::New(wxTheApp->GetTopWindow(), wxID_ANY); - m_loaded = new EventCounter(m_browser, wxEVT_COMMAND_WEB_VIEW_LOADED); + m_loaded = new EventCounter(m_browser, wxEVT_COMMAND_WEBVIEW_LOADED); ENSURE_LOADED; } @@ -229,25 +229,25 @@ void WebTestCase::Selection() void WebTestCase::Zoom() { - if(m_browser->CanSetZoomType(wxWEB_VIEW_ZOOM_TYPE_LAYOUT)) + if(m_browser->CanSetZoomType(wxWEBVIEW_ZOOM_TYPE_LAYOUT)) { - m_browser->SetZoomType(wxWEB_VIEW_ZOOM_TYPE_LAYOUT); - CPPUNIT_ASSERT_EQUAL(wxWEB_VIEW_ZOOM_TYPE_LAYOUT, m_browser->GetZoomType()); + m_browser->SetZoomType(wxWEBVIEW_ZOOM_TYPE_LAYOUT); + CPPUNIT_ASSERT_EQUAL(wxWEBVIEW_ZOOM_TYPE_LAYOUT, m_browser->GetZoomType()); - m_browser->SetZoom(wxWEB_VIEW_ZOOM_TINY); - CPPUNIT_ASSERT_EQUAL(wxWEB_VIEW_ZOOM_TINY, m_browser->GetZoom()); + m_browser->SetZoom(wxWEBVIEW_ZOOM_TINY); + CPPUNIT_ASSERT_EQUAL(wxWEBVIEW_ZOOM_TINY, m_browser->GetZoom()); } //Reset the zoom level - m_browser->SetZoom(wxWEB_VIEW_ZOOM_MEDIUM); + m_browser->SetZoom(wxWEBVIEW_ZOOM_MEDIUM); - if(m_browser->CanSetZoomType(wxWEB_VIEW_ZOOM_TYPE_TEXT)) + if(m_browser->CanSetZoomType(wxWEBVIEW_ZOOM_TYPE_TEXT)) { - m_browser->SetZoomType(wxWEB_VIEW_ZOOM_TYPE_TEXT); - CPPUNIT_ASSERT_EQUAL(wxWEB_VIEW_ZOOM_TYPE_TEXT, m_browser->GetZoomType()); + m_browser->SetZoomType(wxWEBVIEW_ZOOM_TYPE_TEXT); + CPPUNIT_ASSERT_EQUAL(wxWEBVIEW_ZOOM_TYPE_TEXT, m_browser->GetZoomType()); - m_browser->SetZoom(wxWEB_VIEW_ZOOM_TINY); - CPPUNIT_ASSERT_EQUAL(wxWEB_VIEW_ZOOM_TINY, m_browser->GetZoom()); + m_browser->SetZoom(wxWEBVIEW_ZOOM_TINY); + CPPUNIT_ASSERT_EQUAL(wxWEBVIEW_ZOOM_TINY, m_browser->GetZoom()); } } -- 2.45.2