summaryrefslogtreecommitdiff
path: root/frontends/atari
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2017-04-26 22:23:27 +0100
committerVincent Sanders <vince@kyllikki.org>2017-04-26 22:23:27 +0100
commitdb549331f7523fbbfe0460b8adb540838f582cec (patch)
tree04bc4df7d0a5ba35a414a7b3e10f0135fcd97726 /frontends/atari
parentcbc60a906ae74869f133bfdacbadccddd3239ba1 (diff)
downloadnetsurf-db549331f7523fbbfe0460b8adb540838f582cec.tar.gz
netsurf-db549331f7523fbbfe0460b8adb540838f582cec.tar.bz2
Update atari frontend for set_scroll API change
Diffstat (limited to 'frontends/atari')
-rw-r--r--frontends/atari/gui.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/frontends/atari/gui.c b/frontends/atari/gui.c
index cdea953b2..4876d3106 100644
--- a/frontends/atari/gui.c
+++ b/frontends/atari/gui.c
@@ -424,17 +424,30 @@ bool gui_window_get_scroll(struct gui_window *w, int *sx, int *sy)
return( true );
}
-static void gui_window_set_scroll(struct gui_window *w, int sx, int sy)
+/**
+ * Set the scroll position of a atari browser window.
+ *
+ * Scrolls the viewport to ensure the specified rectangle of the
+ * content is shown. The atari implementation scrolls the contents so
+ * the specified point in the content is at the top of the viewport.
+ *
+ * \param gw gui window to scroll
+ * \param rect The rectangle to ensure is shown.
+ * \return NSERROR_OK on success or apropriate error code.
+ */
+static nserror
+gui_window_set_scroll(struct gui_window *gw, const struct rect *rect)
{
- if ( (w == NULL)
- || (w->browser->bw == NULL)
- || (!browser_window_has_content(w->browser->bw)))
- return;
+ if ((gw == NULL) ||
+ (gw->browser->bw == NULL) ||
+ (!browser_window_has_content(gw->browser->bw))) {
+ return NSERROR_BAD_PARAMETER;
+ }
- LOG("scroll (gui_window: %p) %d, %d\n", w, sx, sy);
- window_scroll_by(w->root, sx, sy);
- return;
+ LOG("scroll (gui_window: %p) %d, %d\n", gw, rect->x0, rect->y0);
+ window_scroll_by(gw->root, rect->x0, rect->y0);
+ return NSERROR_OK;
}
/**