From f132a4c29e2619e473f275ad1ccc26d6e5ccaa23 Mon Sep 17 00:00:00 2001 From: Peter Hofmann Date: Sat, 14 Jun 2014 16:12:28 +0200 Subject: Sort functions --- zea.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'zea.c') diff --git a/zea.c b/zea.c index 56fff6c..b4ed42b 100644 --- a/zea.c +++ b/zea.c @@ -21,9 +21,9 @@ static gboolean zea_new_client_request(WebKitWebView *, WebKitWebFrame *, WebKitNetworkRequest *, WebKitWebNavigationAction *, WebKitWebPolicyDecision *, gpointer); +static void zea_scroll(GtkAdjustment *, gint, gdouble); static void zea_title_changed(GObject *, GParamSpec *, gpointer); static void zea_uri_changed(GObject *, GParamSpec *, gpointer); -static void zea_scroll(GtkAdjustment *, gint, gdouble); static void zea_web_view_hover(WebKitWebView *, gchar *, gchar *, gpointer); static gboolean zea_web_view_key(GtkWidget *, GdkEvent *, gpointer); @@ -233,6 +233,22 @@ zea_new_client_request(WebKitWebView *web_view, WebKitWebFrame *frame, return TRUE; } +void +zea_scroll(GtkAdjustment *a, gint step_type, gdouble factor) +{ + gdouble new, lower, upper, step; + lower = gtk_adjustment_get_lower(a); + upper = gtk_adjustment_get_upper(a) - gtk_adjustment_get_page_size(a) + lower; + if (step_type == 0) + step = gtk_adjustment_get_step_increment(a); + else + step = gtk_adjustment_get_page_increment(a); + new = gtk_adjustment_get_value(a) + factor * step; + new = new < lower ? lower : new; + new = new > upper ? upper : new; + gtk_adjustment_set_value(a, new); +} + void zea_title_changed(GObject *obj, GParamSpec *pspec, gpointer data) { @@ -259,22 +275,6 @@ zea_uri_changed(GObject *obj, GParamSpec *pspec, gpointer data) gtk_entry_set_text(GTK_ENTRY(c->location), (t == NULL ? "zea" : t)); } -void -zea_scroll(GtkAdjustment *a, gint step_type, gdouble factor) -{ - gdouble new, lower, upper, step; - lower = gtk_adjustment_get_lower(a); - upper = gtk_adjustment_get_upper(a) - gtk_adjustment_get_page_size(a) + lower; - if (step_type == 0) - step = gtk_adjustment_get_step_increment(a); - else - step = gtk_adjustment_get_page_increment(a); - new = gtk_adjustment_get_value(a) + factor * step; - new = new < lower ? lower : new; - new = new > upper ? upper : new; - gtk_adjustment_set_value(a, new); -} - void zea_web_view_hover(WebKitWebView *web_view, gchar *title, gchar *uri, gpointer data) -- cgit v1.2.3