summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2019-08-03 15:52:42 +0100
committerMichael Drake <michael.drake@codethink.co.uk>2019-08-03 15:57:23 +0100
commit3938d5340b4d44dfe9c7839d1dc2bd790607f8ff (patch)
tree9d534645860dea8134a24d5cebb9338bc24fafb6 /desktop
parent8cff4b79d602b4437a81f3e008f22caf276d102a (diff)
downloadnetsurf-3938d5340b4d44dfe9c7839d1dc2bd790607f8ff.tar.gz
netsurf-3938d5340b4d44dfe9c7839d1dc2bd790607f8ff.tar.bz2
Corewindow: Sanitise scrolling API.
Now the core has a helper so that all the front ends don't need to implement the scroll to show area API. Now they simply have get and set scroll APIs.
Diffstat (limited to 'desktop')
-rw-r--r--desktop/Makefile2
-rw-r--r--desktop/local_history.c7
-rw-r--r--desktop/treeview.c11
3 files changed, 9 insertions, 11 deletions
diff --git a/desktop/Makefile b/desktop/Makefile
index c3c876642..0d88b2bc9 100644
--- a/desktop/Makefile
+++ b/desktop/Makefile
@@ -13,7 +13,7 @@ desktop/version.c: testament $(OBJROOT)/testament.h
# S_BROWSER are sources related to full browsers but are common
# between RISC OS, GTK, BeOS and AmigaOS builds
S_BROWSER := browser.c browser_window.c browser_history.c \
- download.c frames.c netsurf.c \
+ download.c frames.c netsurf.c cw_helper.c \
save_complete.c save_text.c selection.c textinput.c gui_factory.c \
save_pdf.c font_haru.c
diff --git a/desktop/local_history.c b/desktop/local_history.c
index 2a8871afe..ddebbbe58 100644
--- a/desktop/local_history.c
+++ b/desktop/local_history.c
@@ -33,6 +33,7 @@
#include "netsurf/plotters.h"
#include "netsurf/keypress.h"
+#include "desktop/cw_helper.h"
#include "desktop/gui_internal.h"
#include "desktop/system_colour.h"
#include "desktop/browser_private.h"
@@ -294,9 +295,9 @@ local_history_scroll_to_cursor(struct local_history_session *session)
cursor.y1 = cursor.y0 + LOCAL_HISTORY_HEIGHT +
LOCAL_HISTORY_BOTTOM_MARGIN / 2;
- session->cw_t->scroll_visible(session->core_window_handle, &cursor);
-
- return NSERROR_OK;
+ return cw_helper_scroll_visible(session->cw_t,
+ session->core_window_handle,
+ &cursor);
}
/* exported interface documented in desktop/local_history.h */
diff --git a/desktop/treeview.c b/desktop/treeview.c
index a54f4cee8..807366422 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -39,11 +39,12 @@
#include "content/hlcache.h"
#include "css/utils.h"
-#include "desktop/system_colour.h"
#include "desktop/knockout.h"
#include "desktop/textarea.h"
#include "desktop/treeview.h"
+#include "desktop/cw_helper.h"
#include "desktop/gui_internal.h"
+#include "desktop/system_colour.h"
/**
* The maximum horizontal size a treeview can possibly be.
@@ -404,9 +405,7 @@ static inline void treeview__cw_scroll_top(
.y1 = tree_g.line_height,
};
- if (tree->cw_t != NULL) {
- tree->cw_t->scroll_visible(tree->cw_h, &r);
- }
+ cw_helper_scroll_visible(tree->cw_t, tree->cw_h, &r);
}
@@ -584,9 +583,7 @@ static inline void treeview__cw_scroll_to_node(
r.y1 += r.y0; /* Apply the Y offset to the second Y coordinate */
- if (tree->cw_t != NULL) {
- tree->cw_t->scroll_visible(tree->cw_h, &r);
- }
+ cw_helper_scroll_visible(tree->cw_t, tree->cw_h, &r);
}