+void wxWebViewWebKit::ClearHistory()
+{
+ WebKitWebBackForwardList* history;
+ history = webkit_web_view_get_back_forward_list(WEBKIT_WEB_VIEW(web_view));
+ webkit_web_back_forward_list_clear(history);
+}
+
+void wxWebViewWebKit::EnableHistory(bool enable)
+{
+ WebKitWebBackForwardList* history;
+ history = webkit_web_view_get_back_forward_list(WEBKIT_WEB_VIEW(web_view));
+ if(enable)
+ {
+ webkit_web_back_forward_list_set_limit(history, m_historyLimit);
+ }
+ else
+ {
+ webkit_web_back_forward_list_set_limit(history, 0);
+ }
+}
+
+wxVector<wxSharedPtr<wxWebViewHistoryItem> > wxWebViewWebKit::GetBackwardHistory()
+{
+ wxVector<wxSharedPtr<wxWebViewHistoryItem> > 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,
+ m_historyLimit);
+ //We need to iterate in reverse to get the order we desire
+ for(int i = g_list_length(list) - 1; i >= 0 ; i--)
+ {
+ WebKitWebHistoryItem* gtkitem = (WebKitWebHistoryItem*)g_list_nth_data(list, i);
+ wxWebViewHistoryItem* wxitem = new wxWebViewHistoryItem(
+ webkit_web_history_item_get_uri(gtkitem),
+ webkit_web_history_item_get_title(gtkitem));
+ wxitem->m_histItem = gtkitem;
+ wxSharedPtr<wxWebViewHistoryItem> item(wxitem);
+ backhist.push_back(item);
+ }
+ return backhist;
+}
+
+wxVector<wxSharedPtr<wxWebViewHistoryItem> > wxWebViewWebKit::GetForwardHistory()
+{
+ wxVector<wxSharedPtr<wxWebViewHistoryItem> > 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,
+ m_historyLimit);
+ for(guint i = 0; i < g_list_length(list); i++)
+ {
+ WebKitWebHistoryItem* gtkitem = (WebKitWebHistoryItem*)g_list_nth_data(list, i);
+ wxWebViewHistoryItem* wxitem = new wxWebViewHistoryItem(
+ webkit_web_history_item_get_uri(gtkitem),
+ webkit_web_history_item_get_title(gtkitem));
+ wxitem->m_histItem = gtkitem;
+ wxSharedPtr<wxWebViewHistoryItem> item(wxitem);
+ forwardhist.push_back(item);
+ }
+ return forwardhist;
+}
+
+void wxWebViewWebKit::LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item)
+{
+ WebKitWebHistoryItem* gtkitem = item->m_histItem;
+ if(gtkitem)
+ {
+ WebKitWebBackForwardList* history;
+ history = webkit_web_view_get_back_forward_list(WEBKIT_WEB_VIEW(web_view));
+ webkit_web_view_go_to_back_forward_item(WEBKIT_WEB_VIEW(web_view),
+ WEBKIT_WEB_HISTORY_ITEM(gtkitem));
+ }
+}
+
+bool wxWebViewWebKit::CanCut() const
+{
+ return webkit_web_view_can_cut_clipboard(WEBKIT_WEB_VIEW(web_view));
+}
+
+bool wxWebViewWebKit::CanCopy() const
+{
+ return webkit_web_view_can_copy_clipboard(WEBKIT_WEB_VIEW(web_view));
+}
+
+bool wxWebViewWebKit::CanPaste() const
+{
+ return webkit_web_view_can_paste_clipboard(WEBKIT_WEB_VIEW(web_view));
+}
+
+void wxWebViewWebKit::Cut()
+{
+ webkit_web_view_cut_clipboard(WEBKIT_WEB_VIEW(web_view));
+}
+
+void wxWebViewWebKit::Copy()
+{
+ webkit_web_view_copy_clipboard(WEBKIT_WEB_VIEW(web_view));
+}
+
+void wxWebViewWebKit::Paste()
+{
+ webkit_web_view_paste_clipboard(WEBKIT_WEB_VIEW(web_view));
+}
+
+bool wxWebViewWebKit::CanUndo() const
+{
+ return webkit_web_view_can_undo(WEBKIT_WEB_VIEW(web_view));
+}