diff options
author | Vincent Sanders <vince@kyllikki.org> | 2014-01-13 01:08:15 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2014-01-13 01:08:15 +0000 |
commit | 7227c29bbacbc796e9f549cf21e8bd978fde5114 (patch) | |
tree | ecd935b801f61ea1d69eea576fcaaf57e4bd909c /gtk/window.c | |
parent | 5a962586fb161651fc612ed8a8f6da99d8d22f65 (diff) | |
download | netsurf-7227c29bbacbc796e9f549cf21e8bd978fde5114.tar.gz |
move window scroll getter and setter into operations table
Diffstat (limited to 'gtk/window.c')
-rw-r--r-- | gtk/window.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/gtk/window.c b/gtk/window.c index 0ea67edb9..e6da490e6 100644 --- a/gtk/window.c +++ b/gtk/window.c @@ -888,6 +888,20 @@ static void gui_window_set_icon(struct gui_window *gw, hlcache_handle *icon) nsgtk_scaffolding_set_icon(gw); } +static bool gui_window_get_scroll(struct gui_window *g, int *sx, int *sy) +{ + GtkAdjustment *vadj = nsgtk_layout_get_vadjustment(g->layout); + GtkAdjustment *hadj = nsgtk_layout_get_hadjustment(g->layout); + + assert(vadj); + assert(hadj); + + *sy = (int)(gtk_adjustment_get_value(vadj)); + *sx = (int)(gtk_adjustment_get_value(hadj)); + + return true; +} + static void nsgtk_redraw_caret(struct gui_window *g) { int sx, sy; @@ -948,21 +962,8 @@ void gui_window_set_status(struct gui_window *g, const char *text) gtk_label_set_text(g->status_bar, text); } -bool gui_window_get_scroll(struct gui_window *g, int *sx, int *sy) -{ - GtkAdjustment *vadj = nsgtk_layout_get_vadjustment(g->layout); - GtkAdjustment *hadj = nsgtk_layout_get_hadjustment(g->layout); - - assert(vadj); - assert(hadj); - - *sy = (int)(gtk_adjustment_get_value(vadj)); - *sx = (int)(gtk_adjustment_get_value(hadj)); - - return true; -} -void gui_window_set_scroll(struct gui_window *g, int sx, int sy) +static void gui_window_set_scroll(struct gui_window *g, int sx, int sy) { GtkAdjustment *vadj = nsgtk_layout_get_vadjustment(g->layout); GtkAdjustment *hadj = nsgtk_layout_get_hadjustment(g->layout); @@ -1176,6 +1177,8 @@ static struct gui_window_table gui_window_table = { .destroy = gui_window_destroy, .redraw = gui_window_redraw_window, .update = gui_window_update_box, + .get_scroll = gui_window_get_scroll, + .set_scroll = gui_window_set_scroll, .set_icon = gui_window_set_icon, |