summaryrefslogtreecommitdiff
path: root/frontends/amiga/gui.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2016-12-30 13:06:42 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2016-12-30 13:06:42 +0000
commit47379c04442c805af95ba16b9932fbdb549a7594 (patch)
tree1a6d7032a9265ae8c3f186ef5ae718c67894877e /frontends/amiga/gui.c
parent9379a64c6dfab6046ba56b8cdb299c4da3d6c3f2 (diff)
downloadnetsurf-47379c04442c805af95ba16b9932fbdb549a7594.tar.gz
netsurf-47379c04442c805af95ba16b9932fbdb549a7594.tar.bz2
Update treeviews to use event callback
Diffstat (limited to 'frontends/amiga/gui.c')
-rw-r--r--frontends/amiga/gui.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index ad00557b2..e55e1da2a 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -1925,7 +1925,7 @@ static void ami_handle_msg(void)
w = node->objstruct;
if(node->Type == AMINS_TVWINDOW) {
- if(ami_tree_event((struct treeview_window *)w)) {
+ if(w->tbl->event(w)) {
ami_try_quit();
break;
} else {
@@ -2957,7 +2957,7 @@ void ami_quit_netsurf(void)
{
struct nsObject *node;
struct nsObject *nnode;
- struct gui_window_2 *gwin;
+ struct ami_generic_window *w;
/* Disable the multiple tabs open warning */
nsoption_set_bool(tab_close_warn, false);
@@ -2967,18 +2967,18 @@ void ami_quit_netsurf(void)
do {
nnode=(struct nsObject *)GetSucc((struct Node *)node);
- gwin = node->objstruct;
+ w = node->objstruct;
switch(node->Type) {
case AMINS_TVWINDOW:
- ami_tree_close((struct treeview_window *)gwin);
+ w->tbl->close(w);
break;
case AMINS_WINDOW:
/* This also closes windows that are attached to the
* gui_window, such as local history and find. */
- ShowWindow(gwin->win, WINDOW_BACKMOST); // do we need this??
- gwin->w.tbl->close(gwin);
+ //ShowWindow(gwin->win, WINDOW_BACKMOST); // do we need this??
+ w->tbl->close(w);
break;
case AMINS_GUIOPTSWINDOW:
@@ -2986,7 +2986,7 @@ void ami_quit_netsurf(void)
break;
case AMINS_DLWINDOW:
- ami_download_window_abort((struct gui_download_window *)gwin);
+ ami_download_window_abort((struct gui_download_window *)w);
break;
}
} while((node = nnode));
@@ -3828,7 +3828,7 @@ HOOKF(void, ami_scroller_hook, Object *, object, struct IntuiMessage *)
}
/* exported function documented in gui.h */
-nserror ami_gui_win_list_add(void *win, int type, struct ami_win_event_table *table)
+nserror ami_gui_win_list_add(void *win, int type, const struct ami_win_event_table *table)
{
struct nsObject *node = AddObject(window_list, type);
if(node == NULL) return NSERROR_NOMEM;
@@ -3846,10 +3846,14 @@ void ami_gui_win_list_remove(void *win)
{
struct ami_generic_window *w = (struct ami_generic_window *)win;
- DelObject(w->node);
+ if(w->node->Type == AMINS_TVWINDOW) {
+ DelObjectNoFree(w->node);
+ } else {
+ DelObject(w->node);
+ }
}
-static struct ami_win_event_table ami_gui_table = {
+static const struct ami_win_event_table ami_gui_table = {
ami_gui_event,
ami_gui_close_window,
};