Use DOM API to get selected text in WebKitGTK+ 1.4.3

Related to https://bugs.launchpad.net/midori/+bug/799603
This commit is contained in:
Lucas Baudin 2011-10-05 20:50:31 +02:00 committed by Christian Dywan
parent bd5a85fb9f
commit b46db9b170

View file

@ -39,7 +39,7 @@
#include <sys/utsname.h> #include <sys/utsname.h>
#endif #endif
#if !WEBKIT_CHECK_VERSION (1, 5, 1) #if !WEBKIT_CHECK_VERSION (1, 4, 3)
/* This is unstable API, so we need to declare it */ /* This is unstable API, so we need to declare it */
gchar* gchar*
webkit_web_view_get_selected_text (WebKitWebView* web_view); webkit_web_view_get_selected_text (WebKitWebView* web_view);
@ -4184,7 +4184,7 @@ midori_view_get_link_uri (MidoriView* view)
gboolean gboolean
midori_view_has_selection (MidoriView* view) midori_view_has_selection (MidoriView* view)
{ {
#if WEBKIT_CHECK_VERSION (1, 5, 1) #if WEBKIT_CHECK_VERSION (1, 4, 3)
WebKitDOMDocument* doc; WebKitDOMDocument* doc;
WebKitDOMDOMWindow* window; WebKitDOMDOMWindow* window;
WebKitDOMDOMSelection* selection; WebKitDOMDOMSelection* selection;
@ -4194,7 +4194,7 @@ midori_view_has_selection (MidoriView* view)
g_return_val_if_fail (MIDORI_IS_VIEW (view), FALSE); g_return_val_if_fail (MIDORI_IS_VIEW (view), FALSE);
#if WEBKIT_CHECK_VERSION (1, 5, 1) #if WEBKIT_CHECK_VERSION (1, 4, 3)
doc = webkit_web_view_get_dom_document (WEBKIT_WEB_VIEW (view->web_view)); doc = webkit_web_view_get_dom_document (WEBKIT_WEB_VIEW (view->web_view));
window = webkit_dom_document_get_default_view (doc); window = webkit_dom_document_get_default_view (doc);
selection = webkit_dom_dom_window_get_selection (window); selection = webkit_dom_dom_window_get_selection (window);