diff --git a/midori/compat.c b/midori/compat.c index 6eb1c96c..253d93ed 100644 --- a/midori/compat.c +++ b/midori/compat.c @@ -73,7 +73,7 @@ webkit_web_view_get_zoom_level (WebKitWebView* web_view) { g_return_val_if_fail (WEBKIT_IS_WEB_VIEW (web_view), 1.0); - return 1.0; + return 1.0f; } void diff --git a/midori/gjs.c b/midori/gjs.c index 372f3de3..91490022 100644 --- a/midori/gjs.c +++ b/midori/gjs.c @@ -15,6 +15,7 @@ #include /* Needed for versioning macros */ #include +#include "compat.h" struct _GjsValue { @@ -1022,12 +1023,7 @@ gjs_module_new (JSContextRef js_context, JSGlobalContextRef gjs_global_context_new (void) { - #ifdef WEBKIT_CHECK_VERSION #if WEBKIT_CHECK_VERSION (1, 0, 3) - #define HAVE_JSCONTEXTGROUP 1 - #endif - #endif - #if HAVE_JSCONTEXTGROUP JSGlobalContextRef js_context = JSGlobalContextCreateInGroup (NULL, NULL); #else JSGlobalContextRef js_context = JSGlobalContextCreate (NULL); diff --git a/midori/main.c b/midori/main.c index ad9aa3e2..2f3fb1a1 100644 --- a/midori/main.c +++ b/midori/main.c @@ -29,6 +29,7 @@ #include "midori-websettings.h" #include "sokoke.h" +#include "compat.h" #if HAVE_UNISTD_H #include @@ -1607,12 +1608,7 @@ midori_run_script (const gchar* filename) gchar* script; GError* error = NULL; - #ifdef WEBKIT_CHECK_VERSION #if WEBKIT_CHECK_VERSION (1, 0, 3) - #define HAVE_JSCONTEXTGROUP 1 - #endif - #endif - #if HAVE_JSCONTEXTGROUP js_context = JSGlobalContextCreateInGroup (NULL, NULL); #else js_context = JSGlobalContextCreate (NULL); diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 0807e497..8bfa767d 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -252,7 +252,7 @@ _midori_browser_update_interface (MidoriBrowser* browser) _action_set_sensitive (browser, "ZoomOut", midori_view_can_zoom_out (MIDORI_VIEW (view))); _action_set_sensitive (browser, "ZoomNormal", - midori_view_get_zoom_level (MIDORI_VIEW (view)) != 1.0); + midori_view_get_zoom_level (MIDORI_VIEW (view)) != 1.0f); _action_set_sensitive (browser, "Encoding", midori_browser_view_can_set_encoding (MIDORI_VIEW (view))); _action_set_sensitive (browser, "SourceView", @@ -511,7 +511,7 @@ midori_view_notify_zoom_level_cb (GtkWidget* view, { if (view == midori_browser_get_current_tab (browser)) _action_set_sensitive (browser, "ZoomNormal", - midori_view_get_zoom_level (MIDORI_VIEW (view)) != 1.0); + midori_view_get_zoom_level (MIDORI_VIEW (view)) != 1.0f); } static void diff --git a/midori/midori-view.c b/midori/midori-view.c index a610d599..c39d515c 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -2246,13 +2246,9 @@ midori_view_get_proxy_item (MidoriView* view) gfloat midori_view_get_zoom_level (MidoriView* view) { - g_return_val_if_fail (MIDORI_IS_VIEW (view), 1.0); + g_return_val_if_fail (MIDORI_IS_VIEW (view), 1.0f); - #ifdef WEBKIT_CHECK_VERSION - if (view->web_view != NULL) - return webkit_web_view_get_zoom_level (WEBKIT_WEB_VIEW (view->web_view)); - #endif - return 1.0; + return webkit_web_view_get_zoom_level (WEBKIT_WEB_VIEW (view->web_view)); } /** @@ -2268,10 +2264,9 @@ midori_view_set_zoom_level (MidoriView* view, { g_return_if_fail (MIDORI_IS_VIEW (view)); - #ifdef WEBKIT_CHECK_VERSION webkit_web_view_set_zoom_level ( WEBKIT_WEB_VIEW (view->web_view), zoom_level); - #endif + g_object_notify (G_OBJECT (view), "zoom-level"); } gboolean @@ -2279,7 +2274,7 @@ midori_view_can_zoom_in (MidoriView* view) { g_return_val_if_fail (MIDORI_IS_VIEW (view), FALSE); - #ifdef WEBKIT_CHECK_VERSION + #if WEBKIT_CHECK_VERSION (1, 0, 1) return view->web_view != NULL; #else return FALSE; @@ -2291,7 +2286,7 @@ midori_view_can_zoom_out (MidoriView* view) { g_return_val_if_fail (MIDORI_IS_VIEW (view), FALSE); - #ifdef WEBKIT_CHECK_VERSION + #if WEBKIT_CHECK_VERSION (1, 0, 1) return view->web_view != NULL; #else return FALSE; @@ -2440,7 +2435,7 @@ midori_view_print (MidoriView* view) { g_return_if_fail (MIDORI_IS_VIEW (view)); - #ifdef WEBKIT_CHECK_VERSION + #if WEBKIT_CHECK_VERSION (1, 0, 1) webkit_web_frame_print (webkit_web_view_get_main_frame ( WEBKIT_WEB_VIEW (view->web_view))); #else