From 6239b32d92069595da0ba788311a3f9e4e71e690 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 9 Jul 2016 23:55:16 +0100 Subject: Make browserglob private to gui.c --- frontends/amiga/gui.c | 12 +++++++++--- frontends/amiga/gui.h | 4 ++++ frontends/amiga/history_local.c | 2 +- frontends/amiga/plotters.c | 1 - frontends/amiga/plotters.h | 1 - frontends/amiga/print.c | 4 ++-- frontends/amiga/tree.c | 4 ++-- 7 files changed, 18 insertions(+), 10 deletions(-) (limited to 'frontends/amiga') diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c index 508fde914..b32e58d1a 100644 --- a/frontends/amiga/gui.c +++ b/frontends/amiga/gui.c @@ -199,6 +199,7 @@ static BOOL locked_screen = FALSE; static int screen_signal = -1; static bool win_destroyed; static STRPTR nsscreentitle; +static struct gui_globals browserglob; static struct MsgPort *applibport = NULL; static uint32 ami_appid = 0; @@ -951,6 +952,11 @@ static void ami_gui_read_all_tooltypes(int argc, char **argv) } } +void ami_gui_set_default_gg(void) +{ + glob = &browserglob; +} + static void gui_init2(int argc, char** argv) { struct Screen *screen; @@ -962,7 +968,7 @@ static void gui_init2(int argc, char** argv) notalreadyrunning = ami_arexx_init(&rxsig); /* Treeview init code ends up calling a font function which needs this */ - glob = &browserglob; + ami_gui_set_default_gg(); /* ...and this ensures the treeview at least gets the WB colour palette to work with */ if(scrn == NULL) { @@ -4412,7 +4418,7 @@ gui_window_create(struct browser_window *bw, g->shared->node = AddObject(window_list,AMINS_WINDOW); g->shared->node->objstruct = g->shared; - glob = &browserglob; + ami_gui_set_default_gg(); if(locked_screen) { UnlockPubScreen(NULL,scrn); @@ -4864,7 +4870,7 @@ static void ami_do_redraw(struct gui_window_2 *gwin) .plot = &amiplot }; - glob = &browserglob; + ami_gui_set_default_gg(); if(nsoption_bool(direct_render) == false) { diff --git a/frontends/amiga/gui.h b/frontends/amiga/gui.h index 3addea56d..c1513a075 100644 --- a/frontends/amiga/gui.h +++ b/frontends/amiga/gui.h @@ -241,5 +241,9 @@ uint32 ami_gui_get_app_id(void); */ STRPTR ami_gui_get_screen_title(void); +/** + * Set gui_globals back to the default for the browser context + */ +void ami_gui_set_default_gg(void); #endif diff --git a/frontends/amiga/history_local.c b/frontends/amiga/history_local.c index e08349616..c87b56385 100755 --- a/frontends/amiga/history_local.c +++ b/frontends/amiga/history_local.c @@ -89,7 +89,7 @@ static void ami_history_redraw(struct history_window *hw) browser_window_history_redraw_rectangle(hw->gw->bw, xs, ys, bbox->Width + xs, bbox->Height + ys, 0, 0, &ctx); - glob = &browserglob; + ami_gui_set_default_gg(); ami_clearclipreg(hw->gg); ami_history_update_extent(hw); diff --git a/frontends/amiga/plotters.c b/frontends/amiga/plotters.c index 9076eeadc..efb0b0985 100644 --- a/frontends/amiga/plotters.c +++ b/frontends/amiga/plotters.c @@ -72,7 +72,6 @@ struct bez_point { float y; }; -struct gui_globals browserglob; struct gui_globals *glob; static int init_layers_count = 0; diff --git a/frontends/amiga/plotters.h b/frontends/amiga/plotters.h index e027189af..7cb994f9d 100644 --- a/frontends/amiga/plotters.h +++ b/frontends/amiga/plotters.h @@ -46,7 +46,6 @@ struct gui_globals extern const struct plotter_table amiplot; extern struct gui_globals *glob; -extern struct gui_globals browserglob; void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height, bool force32bit); void ami_free_layers(struct gui_globals *gg); diff --git a/frontends/amiga/print.c b/frontends/amiga/print.c index 56d25703e..6926647c3 100644 --- a/frontends/amiga/print.c +++ b/frontends/amiga/print.c @@ -448,7 +448,7 @@ bool ami_print_cont(void) glob = ami_print_info.gg; print_draw_next_page(&amiprinter, ami_print_info.ps); ami_print_dump(); - glob = &browserglob; + ami_gui_set_default_gg(); ret = true; } else @@ -511,7 +511,7 @@ void ami_print_end(void) ami_free_layers(ami_print_info.gg); FreeVec(ami_print_info.gg); DisposeObject(ami_print_info.objects[OID_MAIN]); - glob = &browserglob; + ami_gui_set_default_gg(); ami_print_close_device(); ami_print_free(); diff --git a/frontends/amiga/tree.c b/frontends/amiga/tree.c index f02fdcdbb..8328194ac 100644 --- a/frontends/amiga/tree.c +++ b/frontends/amiga/tree.c @@ -262,7 +262,7 @@ static void ami_tree_redraw_req_dr(void *p) ami_update_pointer(twin->win, GUI_POINTER_DEFAULT); ami_clearclipreg(glob); glob->rp = temprp; - glob = &browserglob; + ami_gui_set_default_gg(); } static void ami_tree_redraw_req(void *p) @@ -345,7 +345,7 @@ static void ami_tree_redraw_req(void *p) ami_gui_free_space_box(bbox); ami_update_pointer(twin->win, GUI_POINTER_DEFAULT); ami_clearclipreg(glob); - glob = &browserglob; + ami_gui_set_default_gg(); } static void ami_tree_redraw_request(int x, int y, int width, int height, void *data) -- cgit v1.2.3