summaryrefslogtreecommitdiff
path: root/frontends/windows
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 /frontends/windows
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 'frontends/windows')
-rw-r--r--frontends/windows/corewindow.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/frontends/windows/corewindow.c b/frontends/windows/corewindow.c
index 7d88ce7c4..be2891fcd 100644
--- a/frontends/windows/corewindow.c
+++ b/frontends/windows/corewindow.c
@@ -443,7 +443,7 @@ nsw32_cw_invalidate_area(struct core_window *cw, const struct rect *rect)
/**
* Callback from the core to update the content area size
*/
-static void
+static nserror
nsw32_cw_update_size(struct core_window *cw, int width, int height)
{
struct nsw32_corewindow *nsw32_cw = (struct nsw32_corewindow *)cw;
@@ -453,13 +453,23 @@ nsw32_cw_update_size(struct core_window *cw, int width, int height)
NSLOG(netsurf, INFO, "new content size w:%d h:%d", width, height);
update_scrollbars(nsw32_cw);
+ return NSERROR_OK;
}
-static void
-nsw32_cw_scroll_visible(struct core_window *cw, const struct rect *r)
+static nserror
+nsw32_cw_set_scroll(struct core_window *cw, int x, int y)
{
/** /todo call setscroll apropriately */
+ return NSERROR_OK;
+}
+
+
+static nserror
+nsw32_cw_get_scroll(struct core_window *cw, int *x, int *y)
+{
+ /** /todo call getscroll apropriately */
+ return NSERROR_NOT_IMPLEMENTED;
}
@@ -470,7 +480,7 @@ nsw32_cw_scroll_visible(struct core_window *cw, const struct rect *r)
* \param[out] width to be set to viewport width in px
* \param[out] height to be set to viewport height in px
*/
-static void
+static nserror
nsw32_cw_get_window_dimensions(struct core_window *cw, int *width, int *height)
{
struct nsw32_corewindow *nsw32_cw = (struct nsw32_corewindow *)cw;
@@ -479,21 +489,24 @@ nsw32_cw_get_window_dimensions(struct core_window *cw, int *width, int *height)
GetClientRect(nsw32_cw->hWnd, &rc);
*width = rc.right;
*height = rc.bottom;
+ return NSERROR_OK;
}
-static void
+static nserror
nsw32_cw_drag_status(struct core_window *cw, core_window_drag_status ds)
{
struct nsw32_corewindow *nsw32_cw = (struct nsw32_corewindow *)cw;
nsw32_cw->drag_status = ds;
+ return NSERROR_OK;
}
struct core_window_callback_table nsw32_cw_cb_table = {
.invalidate = nsw32_cw_invalidate_area,
.update_size = nsw32_cw_update_size,
- .scroll_visible = nsw32_cw_scroll_visible,
+ .set_scroll = nsw32_cw_set_scroll,
+ .get_scroll = nsw32_cw_get_scroll,
.get_window_dimensions = nsw32_cw_get_window_dimensions,
.drag_status = nsw32_cw_drag_status
};