diff options
author | Vincent Sanders <vince@kyllikki.org> | 2017-04-26 22:22:03 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2017-04-26 22:22:03 +0100 |
commit | cbc60a906ae74869f133bfdacbadccddd3239ba1 (patch) | |
tree | 8467443e6177bf59e199f2ebf8375d3a074b13f3 /frontends/amiga | |
parent | 87066f9f8dbad2416c53f70497aeb7c940ccb239 (diff) | |
download | netsurf-cbc60a906ae74869f133bfdacbadccddd3239ba1.tar.gz netsurf-cbc60a906ae74869f133bfdacbadccddd3239ba1.tar.bz2 |
update amiga frontend to new set_scroll API
Diffstat (limited to 'frontends/amiga')
-rw-r--r-- | frontends/amiga/gui.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c index bf3102ac7..18816c496 100644 --- a/frontends/amiga/gui.c +++ b/frontends/amiga/gui.c @@ -4970,13 +4970,28 @@ static bool gui_window_get_scroll(struct gui_window *g, int *restrict sx, int *r return true; } -static void gui_window_set_scroll(struct gui_window *g, int sx, int sy) +/** + * Set the scroll position of a amiga browser window. + * + * Scrolls the viewport to ensure the specified rectangle of the + * content is shown. The amiga 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 *g, const struct rect *rect) { struct IBox *bbox; int width, height; + nserror res; - if(!g) return; - if(!g->bw || browser_window_has_content(g->bw) == false) return; + if(!g) { + return NSERROR_BAD_PARAMETER; + } + if(!g->bw || + browser_window_has_content(g->bw) == false) return; if(ami_gui_get_space_box((Object *)g->shared->objects[GID_BROWSER], &bbox) != NSERROR_OK) { amiga_warn_user("NoMemory", ""); |