+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<wxWebHistoryItem> > wxWebViewWebKit::GetBackwardHistory()
+{
+ wxVector<wxSharedPtr<wxWebHistoryItem> > 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);
+ wxWebHistoryItem* wxitem = new wxWebHistoryItem(
+ webkit_web_history_item_get_uri(gtkitem),
+ webkit_web_history_item_get_title(gtkitem));
+ wxitem->m_histItem = gtkitem;
+ wxSharedPtr<wxWebHistoryItem> item(wxitem);
+ backhist.push_back(item);
+ }
+ return backhist;
+}
+
+wxVector<wxSharedPtr<wxWebHistoryItem> > wxWebViewWebKit::GetForwardHistory()
+{
+ wxVector<wxSharedPtr<wxWebHistoryItem> > 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);
+ wxWebHistoryItem* wxitem = new wxWebHistoryItem(
+ webkit_web_history_item_get_uri(gtkitem),
+ webkit_web_history_item_get_title(gtkitem));
+ wxitem->m_histItem = gtkitem;
+ wxSharedPtr<wxWebHistoryItem> item(wxitem);
+ forwardhist.push_back(item);
+ }
+ return forwardhist;
+}
+
+void wxWebViewWebKit::LoadHistoryItem(wxSharedPtr<wxWebHistoryItem> 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_back_forward_list_go_to_item(WEBKIT_WEB_BACK_FORWARD_LIST(history),
+ WEBKIT_WEB_HISTORY_ITEM(gtkitem));
+ }
+}
+
+bool wxWebViewWebKit::CanCut()
+{
+ return webkit_web_view_can_cut_clipboard(WEBKIT_WEB_VIEW(web_view));
+}
+
+bool wxWebViewWebKit::CanCopy()
+{
+ return webkit_web_view_can_copy_clipboard(WEBKIT_WEB_VIEW(web_view));
+}
+
+bool wxWebViewWebKit::CanPaste()
+{
+ 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()
+{
+ return webkit_web_view_can_undo(WEBKIT_WEB_VIEW(web_view));
+}
+
+bool wxWebViewWebKit::CanRedo()
+{
+ return webkit_web_view_can_redo(WEBKIT_WEB_VIEW(web_view));
+}
+
+void wxWebViewWebKit::Undo()
+{
+ webkit_web_view_undo(WEBKIT_WEB_VIEW(web_view));
+}
+
+void wxWebViewWebKit::Redo()
+{
+ webkit_web_view_redo(WEBKIT_WEB_VIEW(web_view));
+}