aboutsummaryrefslogtreecommitdiffhomepage
path: root/uzbl.c
diff options
context:
space:
mode:
authorGravatar Premysl 'Anydot' Hruby <dfenze@gmail.com>2009-05-01 15:07:06 +0200
committerGravatar Premysl 'Anydot' Hruby <dfenze@gmail.com>2009-05-01 15:07:06 +0200
commit97348882c8eeac6919ada99bdc5b55b86f99ee1f (patch)
tree6bac478d792631b158ca7b011fec1d75c2fdb08a /uzbl.c
parentb73df48c2c4c48c97bdce954669f4f82897da7ec (diff)
Use only 2 scrolling function
Diffstat (limited to 'uzbl.c')
-rw-r--r--uzbl.c38
1 files changed, 13 insertions, 25 deletions
diff --git a/uzbl.c b/uzbl.c
index ca6c6ae..6a17480 100644
--- a/uzbl.c
+++ b/uzbl.c
@@ -84,8 +84,6 @@ static gboolean insert_mode = FALSE;
static gboolean status_top = FALSE;
static gchar* modkey = NULL;
static guint modmask = 0;
-static gdouble hscroll = 20;
-static gdouble vscroll = 20;
/* settings from config: group bindings, key -> action */
static GHashTable *bindings;
@@ -185,36 +183,28 @@ download_cb (WebKitWebView *web_view, GObject *download, gpointer user_data) {
/* scroll a bar in a given direction */
static void
-scroll (double i, GtkAdjustment* bar) {
- gtk_adjustment_set_value (bar, gtk_adjustment_get_value(bar)+i);
-}
+scroll (GtkAdjustment* bar, const char *param) {
+ gdouble amount;
+ gchar *end;
-static void scroll_up (WebKitWebView* page, const char *param) {
- (void) page;
- (void) param;
+ amount = g_ascii_strtod(param, &end);
- scroll (-vscroll, bar_v);
-}
-
-static void scroll_left (WebKitWebView* page, const char *param) {
- (void) page;
- (void) param;
+ if (*end)
+ fprintf(stderr, "found something after double: %s\n", end);
- scroll (-hscroll, bar_h);
+ gtk_adjustment_set_value (bar, gtk_adjustment_get_value(bar)+amount);
}
-static void scroll_down (WebKitWebView* page, const char *param) {
+static void scroll_vert(WebKitWebView* page, const char *param) {
(void) page;
- (void) param;
- scroll (vscroll, bar_v);
+ scroll(bar_v, param);
}
-static void scroll_right (WebKitWebView* page, const char *param) {
+static void scroll_horz(WebKitWebView* page, const char *param) {
(void) page;
- (void) param;
- scroll (hscroll, bar_h);
+ scroll(bar_h, param);
}
static void
@@ -313,10 +303,8 @@ static struct {char *name; Command command;} cmdlist[] =
{
{ "back", view_go_back },
{ "forward", view_go_forward },
- { "scroll_down", scroll_down },
- { "scroll_up", scroll_up },
- { "scroll_left", scroll_left },
- { "scroll_right", scroll_right },
+ { "scroll_vert", scroll_vert },
+ { "scroll_horz", scroll_horz },
{ "reload", view_reload, }, //Buggy
{ "refresh", view_reload, }, /* for convenience, will change */
{ "stop", view_stop_loading, },