From c13d6ac1ea199d1e3908d40d129e2fd5a4d82df7 Mon Sep 17 00:00:00 2001 From: Steve Lamerton Date: Mon, 15 Aug 2011 12:31:31 +0000 Subject: [PATCH] Rename wxWebHistoryItem to wxWebViewHistoryItem. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68698 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/webview_webkit.h | 6 +++--- ...em_webkit.h => webviewhistoryitem_webkit.h} | 14 +++++++------- include/wx/msw/webview_ie.h | 8 ++++---- ...istoryitem_ie.h => webviewhistoryitem_ie.h} | 14 +++++++------- include/wx/osx/webview_webkit.h | 6 +++--- ...em_webkit.h => webviewhistoryitem_webkit.h} | 14 +++++++------- include/wx/webview.h | 12 ++++++------ interface/wx/webview.h | 12 ++++++------ samples/web/web.cpp | 8 ++++---- src/gtk/webview_webkit.cpp | 18 +++++++++--------- src/msw/webview_ie.cpp | 12 ++++++------ src/osx/webview_webkit.mm | 18 +++++++++--------- 12 files changed, 71 insertions(+), 71 deletions(-) rename include/wx/gtk/{webhistoryitem_webkit.h => webviewhistoryitem_webkit.h} (67%) rename include/wx/msw/{webhistoryitem_ie.h => webviewhistoryitem_ie.h} (63%) rename include/wx/osx/{webhistoryitem_webkit.h => webviewhistoryitem_webkit.h} (68%) diff --git a/include/wx/gtk/webview_webkit.h b/include/wx/gtk/webview_webkit.h index 72fc0259f2..c5a8ea616b 100644 --- a/include/wx/gtk/webview_webkit.h +++ b/include/wx/gtk/webview_webkit.h @@ -74,9 +74,9 @@ public: virtual bool CanGoForward(); virtual void ClearHistory(); virtual void EnableHistory(bool enable = true); - virtual wxVector > GetBackwardHistory(); - virtual wxVector > GetForwardHistory(); - virtual void LoadHistoryItem(wxSharedPtr item); + virtual wxVector > GetBackwardHistory(); + virtual wxVector > GetForwardHistory(); + virtual void LoadHistoryItem(wxSharedPtr item); virtual wxString GetCurrentURL(); virtual wxString GetCurrentTitle(); virtual wxString GetPageSource(); diff --git a/include/wx/gtk/webhistoryitem_webkit.h b/include/wx/gtk/webviewhistoryitem_webkit.h similarity index 67% rename from include/wx/gtk/webhistoryitem_webkit.h rename to include/wx/gtk/webviewhistoryitem_webkit.h index 444d0f4fe7..3f96d612b4 100644 --- a/include/wx/gtk/webhistoryitem_webkit.h +++ b/include/wx/gtk/webviewhistoryitem_webkit.h @@ -1,14 +1,14 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: include/wx/gtk/webhistoryitem.h -// Purpose: wxWebHistoryItem header for GTK +// Name: include/wx/gtk/webviewhistoryitem.h +// Purpose: wxWebViewHistoryItem header for GTK // Author: Steven Lamerton // Id: $Id$ // Copyright: (c) 2011 Steven Lamerton // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef _WX_GTK_WEBHISTORYITEM_H_ -#define _WX_GTK_WEBHISTORYITEM_H_ +#ifndef _WX_GTK_WEBVIEWHISTORYITEM_H_ +#define _WX_GTK_WEBVIEWHISTORYITEM_H_ #include "wx/setup.h" @@ -16,10 +16,10 @@ #include "webkit/webkit.h" -class WXDLLIMPEXP_WEB wxWebHistoryItem +class WXDLLIMPEXP_WEB wxWebViewHistoryItem { public: - wxWebHistoryItem(const wxString& url, const wxString& title) : + wxWebViewHistoryItem(const wxString& url, const wxString& title) : m_url(url), m_title(title) {} wxString GetUrl() { return m_url; } wxString GetTitle() { return m_title; } @@ -33,4 +33,4 @@ private: #endif // wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__) -#endif // _WX_GTK_WEBHISTORYITEM_H_ +#endif // _WX_GTK_WEBVIEWHISTORYITEM_H_ diff --git a/include/wx/msw/webview_ie.h b/include/wx/msw/webview_ie.h index 1ab66d5de3..0cec911b2f 100644 --- a/include/wx/msw/webview_ie.h +++ b/include/wx/msw/webview_ie.h @@ -50,9 +50,9 @@ public: const wxString& name = wxWebViewNameStr); virtual void LoadUrl(const wxString& url); - virtual void LoadHistoryItem(wxSharedPtr item); - virtual wxVector > GetBackwardHistory(); - virtual wxVector > GetForwardHistory(); + virtual void LoadHistoryItem(wxSharedPtr item); + virtual wxVector > GetBackwardHistory(); + virtual wxVector > GetForwardHistory(); virtual bool CanGoForward(); virtual bool CanGoBack(); @@ -147,7 +147,7 @@ private: //which are added as documentcomplete events arrive, unless we are loading //an item from the history. The position is stored as an int, and reflects //where we are in the history list. - wxVector > m_historyList; + wxVector > m_historyList; int m_historyPosition; bool m_historyLoadingFromList; bool m_historyEnabled; diff --git a/include/wx/msw/webhistoryitem_ie.h b/include/wx/msw/webviewhistoryitem_ie.h similarity index 63% rename from include/wx/msw/webhistoryitem_ie.h rename to include/wx/msw/webviewhistoryitem_ie.h index 004eb0989a..29f94ce647 100644 --- a/include/wx/msw/webhistoryitem_ie.h +++ b/include/wx/msw/webviewhistoryitem_ie.h @@ -1,23 +1,23 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: include/wx/msw/webhistoryitem.h -// Purpose: wxWebHistoryItem header for MSW +// Name: include/wx/msw/webviewhistoryitem.h +// Purpose: wxWebViewHistoryItem header for MSW // Author: Steven Lamerton // Id: $Id$ // Copyright: (c) 2011 Steven Lamerton // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef _WX_MSW_WEBHISTORYITEM_H_ -#define _WX_MSW_WEBHISTORYITEM_H_ +#ifndef _WX_MSW_WEBVIEWHISTORYITEM_H_ +#define _WX_MSW_WEBVIEWHISTORYITEM_H_ #include "wx/setup.h" #if wxUSE_WEBVIEW_IE && defined(__WXMSW__) -class WXDLLIMPEXP_WEB wxWebHistoryItem +class WXDLLIMPEXP_WEB wxWebViewHistoryItem { public: - wxWebHistoryItem(const wxString& url, const wxString& title) : + wxWebViewHistoryItem(const wxString& url, const wxString& title) : m_url(url), m_title(title) {} wxString GetUrl() { return m_url; } wxString GetTitle() { return m_title; } @@ -28,4 +28,4 @@ private: #endif // wxUSE_WEBVIEW_IE && defined(__WXMSW__) -#endif // _WX_MSW_WEBHISTORYITEM_H_ +#endif // _WX_MSW_WEBVIEWHISTORYITEM_H_ diff --git a/include/wx/osx/webview_webkit.h b/include/wx/osx/webview_webkit.h index da88edfb6b..ecdd7a808b 100644 --- a/include/wx/osx/webview_webkit.h +++ b/include/wx/osx/webview_webkit.h @@ -81,9 +81,9 @@ public: //History functions virtual void ClearHistory(); virtual void EnableHistory(bool enable = true); - virtual wxVector > GetBackwardHistory(); - virtual wxVector > GetForwardHistory(); - virtual void LoadHistoryItem(wxSharedPtr item); + virtual wxVector > GetBackwardHistory(); + virtual wxVector > GetForwardHistory(); + virtual void LoadHistoryItem(wxSharedPtr item); //Undo / redo functionality virtual bool CanUndo(); diff --git a/include/wx/osx/webhistoryitem_webkit.h b/include/wx/osx/webviewhistoryitem_webkit.h similarity index 68% rename from include/wx/osx/webhistoryitem_webkit.h rename to include/wx/osx/webviewhistoryitem_webkit.h index e3b7a50ace..97a23d265e 100644 --- a/include/wx/osx/webhistoryitem_webkit.h +++ b/include/wx/osx/webviewhistoryitem_webkit.h @@ -1,24 +1,24 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: include/wx/osx/webhistoryitem.h -// Purpose: wxWebHistoryItem header for OSX +// Name: include/wx/osx/webviewhistoryitem.h +// Purpose: wxWebViewHistoryItem header for OSX // Author: Steven Lamerton // Id: $Id$ // Copyright: (c) 2011 Steven Lamerton // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef _WX_OSX_WEBHISTORYITEM_H_ -#define _WX_OSX_WEBHISTORYITEM_H_ +#ifndef _WX_OSX_WEBVIEWHISTORYITEM_H_ +#define _WX_OSX_WEBVIEWHISTORYITEM_H_ #include "wx/setup.h" #if wxUSE_WEBVIEW_WEBKIT && (defined(__WXOSX_COCOA__) \ || defined(__WXOSX_CARBON__)) -class WXDLLIMPEXP_WEB wxWebHistoryItem +class WXDLLIMPEXP_WEB wxWebViewHistoryItem { public: - wxWebHistoryItem(const wxString& url, const wxString& title) : + wxWebViewHistoryItem(const wxString& url, const wxString& title) : m_url(url), m_title(title) {} wxString GetUrl() { return m_url; } wxString GetTitle() { return m_title; } @@ -32,4 +32,4 @@ private: #endif // wxUSE_WEBVIEW_WEBKIT && defined(__WXOSX_MAC__) -#endif // _WX_OSX_WEBHISTORYITEM_H_ +#endif // _WX_OSX_WEBVIEWHISTORYITEM_H_ diff --git a/include/wx/webview.h b/include/wx/webview.h index 8830059269..ec1a1f383f 100644 --- a/include/wx/webview.h +++ b/include/wx/webview.h @@ -20,9 +20,9 @@ #include "wx/sharedptr.h" #include "wx/vector.h" -#include "wx/osx/webhistoryitem_webkit.h" -#include "wx/gtk/webhistoryitem_webkit.h" -#include "wx/msw/webhistoryitem_ie.h" +#include "wx/osx/webviewhistoryitem_webkit.h" +#include "wx/gtk/webviewhistoryitem_webkit.h" +#include "wx/msw/webviewhistoryitem_ie.h" class wxFSFile; class wxFileSystem; @@ -193,9 +193,9 @@ public: virtual void ClearHistory() = 0; virtual void EnableHistory(bool enable = true) = 0; - virtual wxVector > GetBackwardHistory() = 0; - virtual wxVector > GetForwardHistory() = 0; - virtual void LoadHistoryItem(wxSharedPtr item) = 0; + virtual wxVector > GetBackwardHistory() = 0; + virtual wxVector > GetForwardHistory() = 0; + virtual void LoadHistoryItem(wxSharedPtr item) = 0; /** * Stop the current page loading process, if any. diff --git a/interface/wx/webview.h b/interface/wx/webview.h index 481317d3e2..47f7abadb0 100644 --- a/interface/wx/webview.h +++ b/interface/wx/webview.h @@ -87,7 +87,7 @@ enum wxWebViewBackend }; /** - @class wxWebHistoryItem + @class wxWebViewHistoryItem A simple class that contains the URL and title of an element of the history of a wxWebView. @@ -97,13 +97,13 @@ enum wxWebViewBackend @see wxWebView */ -class wxWebHistoryItem +class wxWebViewHistoryItem { public: /** Construtor. */ - wxWebHistoryItem(const wxString& url, const wxString& title); + wxWebViewHistoryItem(const wxString& url, const wxString& title); /** @return The url of the page. @@ -456,14 +456,14 @@ public: Returns a list of items in the back history. The first item in the vector is the first page that was loaded by the control. */ - virtual wxVector > GetBackwardHistory() = 0; + virtual wxVector > GetBackwardHistory() = 0; /** Returns a list of items in the forward history. The first item in the vector is the next item in the history with respect to the curently loaded page. */ - virtual wxVector > GetForwardHistory() = 0; + virtual wxVector > GetForwardHistory() = 0; /** Navigate back in the history of visited pages. @@ -480,7 +480,7 @@ public: /** Loads a history item. */ - virtual void LoadHistoryItem(wxSharedPtr item) = 0; + virtual void LoadHistoryItem(wxSharedPtr item) = 0; /** @name Selection diff --git a/samples/web/web.cpp b/samples/web/web.cpp index f7ae5e3138..6bf04ffb8a 100644 --- a/samples/web/web.cpp +++ b/samples/web/web.cpp @@ -50,7 +50,7 @@ //We map menu items to their history items -WX_DECLARE_HASH_MAP(int, wxSharedPtr, +WX_DECLARE_HASH_MAP(int, wxSharedPtr, wxIntegerHash, wxIntegerEqual, wxMenuHistoryMap); class WebApp : public wxApp @@ -629,8 +629,8 @@ void WebFrame::OnToolsClicked(wxCommandEvent& WXUNUSED(evt)) } m_histMenuItems.clear(); - wxVector > back = m_browser->GetBackwardHistory(); - wxVector > forward = m_browser->GetForwardHistory(); + wxVector > back = m_browser->GetBackwardHistory(); + wxVector > forward = m_browser->GetForwardHistory(); wxMenuItem* item; @@ -646,7 +646,7 @@ void WebFrame::OnToolsClicked(wxCommandEvent& WXUNUSED(evt)) item->Check(); //No need to connect the current item - m_histMenuItems[item->GetId()] = wxSharedPtr(new wxWebHistoryItem(m_browser->GetCurrentURL(), m_browser->GetCurrentTitle())); + m_histMenuItems[item->GetId()] = wxSharedPtr(new wxWebViewHistoryItem(m_browser->GetCurrentURL(), m_browser->GetCurrentTitle())); for(unsigned int i = 0; i < forward.size(); i++) { diff --git a/src/gtk/webview_webkit.cpp b/src/gtk/webview_webkit.cpp index 5a95f5f194..6a47d8ddcd 100644 --- a/src/gtk/webview_webkit.cpp +++ b/src/gtk/webview_webkit.cpp @@ -546,9 +546,9 @@ void wxWebViewWebKit::EnableHistory(bool enable) } } -wxVector > wxWebViewWebKit::GetBackwardHistory() +wxVector > wxWebViewWebKit::GetBackwardHistory() { - wxVector > backhist; + wxVector > backhist; WebKitWebBackForwardList* history; history = webkit_web_view_get_back_forward_list(WEBKIT_WEB_VIEW(web_view)); GList* list = webkit_web_back_forward_list_get_back_list_with_limit(history, @@ -557,19 +557,19 @@ wxVector > wxWebViewWebKit::GetBackwardHistory() for(int i = g_list_length(list) - 1; i >= 0 ; i--) { WebKitWebHistoryItem* gtkitem = (WebKitWebHistoryItem*)g_list_nth_data(list, i); - wxWebHistoryItem* wxitem = new wxWebHistoryItem( + wxWebViewHistoryItem* wxitem = new wxWebViewHistoryItem( webkit_web_history_item_get_uri(gtkitem), webkit_web_history_item_get_title(gtkitem)); wxitem->m_histItem = gtkitem; - wxSharedPtr item(wxitem); + wxSharedPtr item(wxitem); backhist.push_back(item); } return backhist; } -wxVector > wxWebViewWebKit::GetForwardHistory() +wxVector > wxWebViewWebKit::GetForwardHistory() { - wxVector > forwardhist; + wxVector > forwardhist; WebKitWebBackForwardList* history; history = webkit_web_view_get_back_forward_list(WEBKIT_WEB_VIEW(web_view)); GList* list = webkit_web_back_forward_list_get_forward_list_with_limit(history, @@ -577,17 +577,17 @@ wxVector > wxWebViewWebKit::GetForwardHistory() for(guint i = 0; i < g_list_length(list); i++) { WebKitWebHistoryItem* gtkitem = (WebKitWebHistoryItem*)g_list_nth_data(list, i); - wxWebHistoryItem* wxitem = new wxWebHistoryItem( + wxWebViewHistoryItem* wxitem = new wxWebViewHistoryItem( webkit_web_history_item_get_uri(gtkitem), webkit_web_history_item_get_title(gtkitem)); wxitem->m_histItem = gtkitem; - wxSharedPtr item(wxitem); + wxSharedPtr item(wxitem); forwardhist.push_back(item); } return forwardhist; } -void wxWebViewWebKit::LoadHistoryItem(wxSharedPtr item) +void wxWebViewWebKit::LoadHistoryItem(wxSharedPtr item) { WebKitWebHistoryItem* gtkitem = item->m_histItem; if(gtkitem) diff --git a/src/msw/webview_ie.cpp b/src/msw/webview_ie.cpp index a90cdc3b1e..5d46b47916 100644 --- a/src/msw/webview_ie.cpp +++ b/src/msw/webview_ie.cpp @@ -325,7 +325,7 @@ bool wxWebViewIE::CanGoForward() return false; } -void wxWebViewIE::LoadHistoryItem(wxSharedPtr item) +void wxWebViewIE::LoadHistoryItem(wxSharedPtr item) { int pos = -1; for(unsigned int i = 0; i < m_historyList.size(); i++) @@ -341,9 +341,9 @@ void wxWebViewIE::LoadHistoryItem(wxSharedPtr item) m_historyPosition = pos; } -wxVector > wxWebViewIE::GetBackwardHistory() +wxVector > wxWebViewIE::GetBackwardHistory() { - wxVector > backhist; + wxVector > backhist; //As we don't have std::copy or an iterator constructor in the wxwidgets //native vector we construct it by hand for(int i = 0; i < m_historyPosition; i++) @@ -353,9 +353,9 @@ wxVector > wxWebViewIE::GetBackwardHistory() return backhist; } -wxVector > wxWebViewIE::GetForwardHistory() +wxVector > wxWebViewIE::GetForwardHistory() { - wxVector > forwardhist; + wxVector > forwardhist; //As we don't have std::copy or an iterator constructor in the wxwidgets //native vector we construct it by hand for(int i = m_historyPosition + 1; i < static_cast(m_historyList.size()); i++) @@ -789,7 +789,7 @@ void wxWebViewIE::onActiveXEvent(wxActiveXEvent& evt) m_historyList.erase(m_historyList.begin() + m_historyPosition + 1, m_historyList.end()); } - wxSharedPtr item(new wxWebHistoryItem(url, GetCurrentTitle())); + wxSharedPtr item(new wxWebViewHistoryItem(url, GetCurrentTitle())); m_historyList.push_back(item); m_historyPosition++; } diff --git a/src/osx/webview_webkit.mm b/src/osx/webview_webkit.mm index 2cf09e4668..ad3f20eeab 100644 --- a/src/osx/webview_webkit.mm +++ b/src/osx/webview_webkit.mm @@ -921,9 +921,9 @@ void wxWebViewWebKit::ClearHistory() [m_webView setMaintainsBackForwardList:YES]; } -wxVector > wxWebViewWebKit::GetBackwardHistory() +wxVector > wxWebViewWebKit::GetBackwardHistory() { - wxVector > backhist; + wxVector > backhist; WebBackForwardList* history = [m_webView backForwardList]; int count = [history backListCount]; for(int i = -count; i < 0; i++) @@ -931,17 +931,17 @@ wxVector > wxWebViewWebKit::GetBackwardHistory() WebHistoryItem* item = [history itemAtIndex:i]; wxString url = wxStringWithNSString([item URLString]); wxString title = wxStringWithNSString([item title]); - wxWebHistoryItem* wxitem = new wxWebHistoryItem(url, title); + wxWebViewHistoryItem* wxitem = new wxWebViewHistoryItem(url, title); wxitem->m_histItem = item; - wxSharedPtr itemptr(wxitem); + wxSharedPtr itemptr(wxitem); backhist.push_back(itemptr); } return backhist; } -wxVector > wxWebViewWebKit::GetForwardHistory() +wxVector > wxWebViewWebKit::GetForwardHistory() { - wxVector > forwardhist; + wxVector > forwardhist; WebBackForwardList* history = [m_webView backForwardList]; int count = [history forwardListCount]; for(int i = 1; i <= count; i++) @@ -949,15 +949,15 @@ wxVector > wxWebViewWebKit::GetForwardHistory() WebHistoryItem* item = [history itemAtIndex:i]; wxString url = wxStringWithNSString([item URLString]); wxString title = wxStringWithNSString([item title]); - wxWebHistoryItem* wxitem = new wxWebHistoryItem(url, title); + wxWebViewHistoryItem* wxitem = new wxWebViewHistoryItem(url, title); wxitem->m_histItem = item; - wxSharedPtr itemptr(wxitem); + wxSharedPtr itemptr(wxitem); forwardhist.push_back(itemptr); } return forwardhist; } -void wxWebViewWebKit::LoadHistoryItem(wxSharedPtr item) +void wxWebViewWebKit::LoadHistoryItem(wxSharedPtr item) { [m_webView goToBackForwardItem:item->m_histItem]; } -- 2.45.2