From 1e197432f89d6cee8440b5b37a29d249c46bd502 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 26 Apr 2017 09:59:08 +0100 Subject: update amiga frontend to remove reformat API --- frontends/amiga/gui.c | 49 ++++++++++++++++++++----------------------------- 1 file changed, 20 insertions(+), 29 deletions(-) (limited to 'frontends/amiga/gui.c') diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c index a6164db79..bf3102ac7 100644 --- a/frontends/amiga/gui.c +++ b/frontends/amiga/gui.c @@ -1643,15 +1643,26 @@ static void ami_gui_menu_update_all(void) } while((node = nnode)); } -static void gui_window_get_dimensions(struct gui_window *g, +/** + * Find the current dimensions of a amiga browser window content area. + * + * \param gw 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 + * \return NSERROR_OK on sucess and width and height updated + * else error code. + */ +static nserror gui_window_get_dimensions(struct gui_window *gw, int *restrict width, int *restrict height, bool scaled) { struct IBox *bbox; - if(!g) return; + nserror res; - if(ami_gui_get_space_box((Object *)g->shared->objects[GID_BROWSER], &bbox) != NSERROR_OK) { + res = ami_gui_get_space_box((Object *)gw->shared->objects[GID_BROWSER], &bbox); + if(res != NSERROR_OK) { amiga_warn_user("NoMemory", ""); - return; + return res; } *width = bbox->Width; @@ -1659,11 +1670,12 @@ static void gui_window_get_dimensions(struct gui_window *g, ami_gui_free_space_box(bbox); - if(scaled) - { - *width /= g->scale; - *height /= g->scale; + if(scaled) { + *width /= gw->scale; + *height /= gw->scale; } + + return NSERROR_OK; } /* Add a horizontal scroller, if not already present @@ -4828,26 +4840,6 @@ bool ami_gui_window_update_box_deferred_check(struct MinList *deferred_rects, } -/** - * callback from core to reformat a window. - */ -static void amiga_window_reformat(struct gui_window *gw) -{ - struct IBox *bbox; - - LOG("reformat window %p", gw); - - if (gw != NULL) { - if(ami_gui_get_space_box((Object *)gw->shared->objects[GID_BROWSER], &bbox) != NSERROR_OK) { - amiga_warn_user("NoMemory", ""); - return; - } - browser_window_reformat(gw->bw, false, bbox->Width, bbox->Height); - gw->shared->redraw_scroll = false; - ami_gui_free_space_box(bbox); - } -} - static void ami_do_redraw(struct gui_window_2 *gwin) { ULONG hcurrent,vcurrent,xoffset,yoffset,width=800,height=600; @@ -5576,7 +5568,6 @@ static struct gui_window_table amiga_window_table = { .set_scroll = gui_window_set_scroll, .get_dimensions = gui_window_get_dimensions, .update_extent = gui_window_update_extent, - .reformat = amiga_window_reformat, .set_icon = gui_window_set_icon, .set_title = gui_window_set_title, -- cgit v1.2.3