summaryrefslogtreecommitdiff
path: root/frontends
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2017-04-26 22:24:03 +0100
committerVincent Sanders <vince@kyllikki.org>2017-04-26 22:24:03 +0100
commitdb9b829df2a7c1676da131f5fe66f106af2ba14a (patch)
tree840a8b9fd6d31a6b00de708f966d2893ea066cca /frontends
parentdb549331f7523fbbfe0460b8adb540838f582cec (diff)
downloadnetsurf-db9b829df2a7c1676da131f5fe66f106af2ba14a.tar.gz
netsurf-db9b829df2a7c1676da131f5fe66f106af2ba14a.tar.bz2
Update beos frontend for set_scroll API change
Diffstat (limited to 'frontends')
-rw-r--r--frontends/beos/window.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/frontends/beos/window.cpp b/frontends/beos/window.cpp
index f3d63da98..2121d9456 100644
--- a/frontends/beos/window.cpp
+++ b/frontends/beos/window.cpp
@@ -981,7 +981,7 @@ void nsbeos_redraw_caret(struct gui_window *g)
/**
* Invalidate an area of a beos browser window
*
- * \param gw The netsurf window being invalidated.
+ * \param g The netsurf window being invalidated.
* \param rect area to redraw or NULL for entrire window area.
* \return NSERROR_OK or appropriate error code.
*/
@@ -1034,7 +1034,19 @@ static bool gui_window_get_scroll(struct gui_window *g, int *sx, int *sy)
return true;
}
-static void gui_window_set_scroll(struct gui_window *g, int sx, int sy)
+/**
+ * Set the scroll position of a beos browser window.
+ *
+ * Scrolls the viewport to ensure the specified rectangle of the
+ * content is shown. The beos implementation scrolls the contents so
+ * the specified point in the content is at the top of the viewport.
+ *
+ * \param g 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 *g, const struct rect *rect)
{
//CALLED();
if (g->view == NULL)
@@ -1044,11 +1056,13 @@ static void gui_window_set_scroll(struct gui_window *g, int sx, int sy)
#warning XXX: report to view frame ?
if (g->view->ScrollBar(B_HORIZONTAL))
- g->view->ScrollBar(B_HORIZONTAL)->SetValue(sx);
+ g->view->ScrollBar(B_HORIZONTAL)->SetValue(rect->x0);
if (g->view->ScrollBar(B_VERTICAL))
- g->view->ScrollBar(B_VERTICAL)->SetValue(sy);
+ g->view->ScrollBar(B_VERTICAL)->SetValue(rect->y0);
g->view->UnlockLooper();
+
+ return NSERROR_OK;
}
@@ -1315,7 +1329,7 @@ struct gui_clipboard_table *beos_clipboard_table = &clipboard_table;
/**
* Find the current dimensions of a beos browser window content area.
*
- * \param gw The gui window to measure content area of.
+ * \param g The gui window to measure content area of.
* \param width receives width of window
* \param height receives height of window
* \param scaled whether to return scaled values
@@ -1361,7 +1375,6 @@ static struct gui_window_table window_table = {
gui_window_stop_throbber,
NULL, //drag_start
NULL, //save_link
- NULL, //scroll_visible
NULL, //scroll_start
gui_window_new_content,
NULL, //create_form_select_menu