From 9df30eb78fc024448c39182a5d9fb0053c6ef137 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 31 Dec 2016 00:43:06 +0000 Subject: Update local history window to use event callback --- frontends/amiga/history_local.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'frontends/amiga/history_local.c') diff --git a/frontends/amiga/history_local.c b/frontends/amiga/history_local.c index 5009ce888..3d1c6f39b 100755 --- a/frontends/amiga/history_local.c +++ b/frontends/amiga/history_local.c @@ -57,9 +57,25 @@ #include "amiga/gui.h" #include "amiga/history_local.h" +struct history_window { + struct ami_generic_window w; + struct Window *win; + Object *objects[GID_LAST]; + struct gui_window *gw; + struct Hook scrollerhook; + struct gui_globals *gg; +}; + static void ami_history_update_extent(struct history_window *hw); HOOKF(void, ami_history_scroller_hook, Object *, object, struct IntuiMessage *); +static BOOL ami_history_event(void *w); + +static const struct ami_win_event_table ami_localhistory_table = { + ami_history_event, + NULL, /* we don't explicitly close the local history window on quit */ +}; + /** * Redraw history window. */ @@ -159,8 +175,7 @@ void ami_history_open(struct gui_window *gw) EndWindow; gw->hw->win = (struct Window *)RA_OpenWindow(gw->hw->objects[OID_MAIN]); - gw->hw->node = AddObject(window_list,AMINS_HISTORYWINDOW); - gw->hw->node->objstruct = gw->hw; + ami_gui_win_list_add(gw->hw, AMINS_HISTORYWINDOW, &ami_localhistory_table); GetAttr(WINDOW_HorizObject,gw->hw->objects[OID_MAIN],(ULONG *)&gw->hw->objects[OID_HSCROLL]); GetAttr(WINDOW_VertObject,gw->hw->objects[OID_MAIN],(ULONG *)&gw->hw->objects[OID_VSCROLL]); @@ -229,12 +244,13 @@ void ami_history_close(struct history_window *hw) free(hw->gg); hw->gw->hw = NULL; DisposeObject(hw->objects[OID_MAIN]); - DelObject(hw->node); + ami_gui_win_list_remove(hw); } -BOOL ami_history_event(struct history_window *hw) +static BOOL ami_history_event(void *w) { /* return TRUE if window destroyed */ + struct history_window *hw = (struct history_window *)w; ULONG result = 0; uint16 code; const char *url; -- cgit v1.2.3