Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/76673bbf655592a62d21acfec860d5bf181bc848
...commit
http://git.netsurf-browser.org/netsurf.git/commit/76673bbf655592a62d21acfec860d5bf181bc848
...tree
http://git.netsurf-browser.org/netsurf.git/tree/76673bbf655592a62d21acfec860d5bf181bc848
The branch, master has been updated
via 76673bbf655592a62d21acfec860d5bf181bc848 (commit)
via 5e523b608a330c2c10f20a8913b7bad85388d475 (commit)
via 9df30eb78fc024448c39182a5d9fb0053c6ef137 (commit)
via d8eec1b048fe7c7cac4a0bd3bb4f31203524ee79 (commit)
via d9c8d1c70cac756d47586e2abf2dfbb9a1d96b59 (commit)
from d90e82d3f1c0ed0cdd665899c754b655f661976d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=76673bbf655592a62d21acfec860d5bf181bc848
commit 76673bbf655592a62d21acfec860d5bf181bc848
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>
add a todo
diff --git a/frontends/amiga/gui.h b/frontends/amiga/gui.h
index b76efdc..eb39e9e 100644
--- a/frontends/amiga/gui.h
+++ b/frontends/amiga/gui.h
@@ -190,7 +190,7 @@ struct gui_window
float scale;
};
-extern struct MinList *window_list;
+extern struct MinList *window_list; /**\todo stop arexx.c poking about in here
*/
extern struct Screen *scrn;
extern struct MsgPort *sport;
extern struct gui_window *cur_gw;
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=5e523b608a330c2c10f20a8913b7bad85388d475
commit 5e523b608a330c2c10f20a8913b7bad85388d475
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>
Simply the event loop for the shared message port
This now simply calls the event callback for each window, which returns
TRUE is the window was closed during event processing.
The window loop now restarts if any windows were closed, which fixes a
potential rare issue with delayed event processing.
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index a453e08..e835e2b 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -1903,18 +1903,17 @@ static void ami_set_border_gadget_size(struct
gui_window_2 *gwin)
#endif
}
-static void ami_handle_msg(void)
+static BOOL ami_handle_msg(void)
{
struct ami_generic_window *w = NULL;
struct nsObject *node;
struct nsObject *nnode;
- struct gui_window_2 *gwin = NULL;
+ BOOL win_closed = FALSE;
- if(IsMinListEmpty(window_list))
- {
+ if(IsMinListEmpty(window_list)) {
/* no windows in list, so NetSurf should not be running */
ami_try_quit();
- return;
+ return FALSE;
}
node = (struct nsObject *)GetHead((struct List *)window_list);
@@ -1923,75 +1922,20 @@ static void ami_handle_msg(void)
nnode=(struct nsObject *)GetSucc((struct Node *)node);
w = node->objstruct;
+ if(w == NULL) continue;
- if(node->Type == AMINS_TVWINDOW) {
- if(w->tbl->event(w)) {
- ami_try_quit();
- break;
- } else {
- node = nnode;
- continue;
- }
- } else if(node->Type == AMINS_FINDWINDOW) {
- if(w->tbl->event(w)) {
- ami_try_quit();
- break;
- } else {
- node = nnode;
- continue;
- }
- } else if(node->Type == AMINS_HISTORYWINDOW) {
- if(w->tbl->event(w)) {
- ami_try_quit();
- break;
- } else {
- node = nnode;
- continue;
- }
- } else if(node->Type == AMINS_PRINTWINDOW) {
- if(w->tbl->event(w)) {
- ami_try_quit();
- break;
- } else {
- node = nnode;
- continue;
- }
- } else if(node->Type == AMINS_GUIOPTSWINDOW) {
- if(w->tbl->event(w)) {
- /* last window possibly closed, so exit with
conditions ;) */
- if(scrn) ami_try_quit();
- break;
- } else {
- node = nnode;
- continue;
- }
- } else if(node->Type == AMINS_DLWINDOW) {
- if(w->tbl->event(w)) {
- ami_try_quit();
- break;
- } else {
- node = nnode;
- continue;
- }
- } else if(node->Type == AMINS_LOGINWINDOW) {
- if(w->tbl->event(w)) {
- ami_try_quit();
- break;
+ if(w->tbl->event != NULL) {
+ if((win_closed = w->tbl->event(w))) {
+ if((node->Type != AMINS_GUIOPTSWINDOW) ||
+ ((node->Type == AMINS_GUIOPTSWINDOW) &&
(scrn != NULL))) {
+ ami_try_quit();
+ break;
+ }
} else {
node = nnode;
continue;
}
}
-
- /* assume this is a normal gui window for now */
- gwin = (struct gui_window_2 *)w;
- if((gwin == NULL) || (gwin->objects[OID_MAIN] == NULL))
continue;
- if(w->tbl->event(w)) {
- break;
- } else {
- node = nnode;
- continue;
- }
} while((node = nnode));
if(ami_menu_quit_selected() == true) {
@@ -2001,6 +1945,8 @@ static void ami_handle_msg(void)
if(ami_menu_get_check_toggled() == true) {
ami_gui_menu_update_all();
}
+
+ return win_closed;
}
static BOOL ami_gui_event(void *w)
@@ -2846,7 +2792,7 @@ void ami_get_msg(void)
}
if(signal & winsignal)
- ami_handle_msg();
+ while(ami_handle_msg());
if(signal & appsig)
ami_handle_appmsg();
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=9df30eb78fc024448c39182a5d9fb0053c6ef137
commit 9df30eb78fc024448c39182a5d9fb0053c6ef137
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>
Update local history window to use event callback
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index 82db164..a453e08 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -1941,7 +1941,7 @@ static void ami_handle_msg(void)
continue;
}
} else if(node->Type == AMINS_HISTORYWINDOW) {
- if(ami_history_event((struct history_window *)w)) {
+ if(w->tbl->event(w)) {
ami_try_quit();
break;
} else {
diff --git a/frontends/amiga/history_local.c b/frontends/amiga/history_local.c
index 5009ce8..3d1c6f3 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;
diff --git a/frontends/amiga/history_local.h b/frontends/amiga/history_local.h
index 284da34..97aea05 100755
--- a/frontends/amiga/history_local.h
+++ b/frontends/amiga/history_local.h
@@ -24,15 +24,7 @@
struct gui_window;
struct gui_globals;
-
-struct history_window {
- struct nsObject *node;
- struct Window *win;
- Object *objects[GID_LAST];
- struct gui_window *gw;
- struct Hook scrollerhook;
- struct gui_globals *gg;
-};
+struct history_window;
/**
* Open history window.
@@ -42,7 +34,5 @@ struct history_window {
void ami_history_open(struct gui_window *gw);
void ami_history_close(struct history_window *hw);
-BOOL ami_history_event(struct history_window *hw);
-
#endif
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=d8eec1b048fe7c7cac4a0bd3bb4f31203524ee79
commit d8eec1b048fe7c7cac4a0bd3bb4f31203524ee79
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>
Update print window to use event callback
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index aea1f74..82db164 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -1949,7 +1949,7 @@ static void ami_handle_msg(void)
continue;
}
} else if(node->Type == AMINS_PRINTWINDOW) {
- if(ami_print_event((struct ami_print_window *)w)) {
+ if(w->tbl->event(w)) {
ami_try_quit();
break;
} else {
diff --git a/frontends/amiga/print.c b/frontends/amiga/print.c
index 25a4c32..5fab0f9 100644
--- a/frontends/amiga/print.c
+++ b/frontends/amiga/print.c
@@ -96,6 +96,14 @@ struct ami_printer_info
struct Window *win;
};
+struct ami_print_window {
+ struct ami_generic_window w;
+ struct Window *win;
+ Object *objects[OID_LAST];
+ Object *gadgets[GID_LAST];
+ struct hlcache_handle *c;
+};
+
enum
{
PGID_MAIN=0,
@@ -119,6 +127,13 @@ static struct ami_printer_info ami_print_info;
static CONST_STRPTR gadlab[PGID_LAST];
static STRPTR printers[11];
+static BOOL ami_print_event(void *w);
+
+static const struct ami_win_event_table ami_print_table = {
+ ami_print_event,
+ NULL, /* we don't explicitly close the print window on quit (or at
all???) */
+};
+
static void ami_print_ui_setup(void)
{
gadlab[PGID_PRINTER] = (char *)ami_utf8_easy((char
*)messages_get("Printer"));
@@ -325,22 +340,21 @@ void ami_print_ui(struct hlcache_handle *c)
EndWindow;
pw->win = (struct Window *)RA_OpenWindow(pw->objects[OID_MAIN]);
-
- pw->node = AddObject(window_list, AMINS_PRINTWINDOW);
- pw->node->objstruct = pw;
+ ami_gui_win_list_add(pw, AMINS_PRINTWINDOW, &ami_print_table);
}
static void ami_print_close(struct ami_print_window *pw)
{
DisposeObject(pw->objects[OID_MAIN]);
- DelObject(pw->node);
+ ami_gui_win_list_remove(pw);
ami_print_ui_free();
}
-BOOL ami_print_event(struct ami_print_window *pw)
+static BOOL ami_print_event(void *w)
{
/* return TRUE if window destroyed */
+ struct ami_print_window *pw = (struct ami_print_window *)w;
ULONG result;
uint16 code;
struct hlcache_handle *c;
diff --git a/frontends/amiga/print.h b/frontends/amiga/print.h
index bdd409b..0d6b4f5 100755
--- a/frontends/amiga/print.h
+++ b/frontends/amiga/print.h
@@ -21,18 +21,10 @@
#include <proto/exec.h>
struct content;
-
-struct ami_print_window {
- struct nsObject *node;
- struct Window *win;
- Object *objects[OID_LAST];
- Object *gadgets[GID_LAST];
- struct hlcache_handle *c;
-};
+struct ami_print_window;
void ami_print(struct hlcache_handle *c, int copies);
void ami_print_ui(struct hlcache_handle *c);
-BOOL ami_print_event(struct ami_print_window *pw);
bool ami_print_cont(void);
struct MsgPort *ami_print_init(void);
void ami_print_free(void);
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=d9c8d1c70cac756d47586e2abf2dfbb9a1d96b59
commit d9c8d1c70cac756d47586e2abf2dfbb9a1d96b59
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>
Update 401 login window to use event callbacks
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index b7e5faa..aea1f74 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -1974,7 +1974,7 @@ static void ami_handle_msg(void)
continue;
}
} else if(node->Type == AMINS_LOGINWINDOW) {
- if(ami_401login_event((struct gui_login_window *)w)) {
+ if(w->tbl->event(w)) {
ami_try_quit();
break;
} else {
diff --git a/frontends/amiga/login.c b/frontends/amiga/login.c
index 805e25c..85324b0 100755
--- a/frontends/amiga/login.c
+++ b/frontends/amiga/login.c
@@ -50,7 +50,7 @@
#include "amiga/login.h"
struct gui_login_window {
- struct nsObject *node;
+ struct ami_generic_window w;
struct Window *win;
Object *objects[GID_LAST];
nserror (*cb)(bool proceed, void *pw);
@@ -62,6 +62,14 @@ struct gui_login_window {
char pwd[256];
};
+static BOOL ami_401login_event(void *w);
+
+static const struct ami_win_event_table ami_login_table = {
+ ami_401login_event,
+ NULL, /* we don't explicitly close the login window at all.
+ @todo check if this prevents us from quitting NetSurf */
+};
+
void gui_401login_open(nsurl *url, const char *realm,
nserror (*cb)(bool proceed, void *pw), void *cbpw)
{
@@ -168,9 +176,7 @@ void gui_401login_open(nsurl *url, const char *realm,
EndWindow;
lw->win = (struct Window *)RA_OpenWindow(lw->objects[OID_MAIN]);
-
- lw->node = AddObject(window_list,AMINS_LOGINWINDOW);
- lw->node->objstruct = lw;
+ ami_gui_win_list_add(lw, AMINS_LOGINWINDOW, &ami_login_table);
}
static void ami_401login_close(struct gui_login_window *lw)
@@ -182,7 +188,7 @@ static void ami_401login_close(struct gui_login_window *lw)
DisposeObject(lw->objects[OID_MAIN]);
lwc_string_unref(lw->host);
nsurl_unref(lw->url);
- DelObject(lw->node);
+ ami_gui_win_list_remove(lw);
}
static void ami_401login_login(struct gui_login_window *lw)
@@ -206,9 +212,10 @@ static void ami_401login_login(struct gui_login_window *lw)
ami_401login_close(lw);
}
-BOOL ami_401login_event(struct gui_login_window *lw)
+static BOOL ami_401login_event(void *w)
{
/* return TRUE if window destroyed */
+ struct gui_login_window *lw = (struct gui_login_window *)w;
ULONG result;
uint16 code;
diff --git a/frontends/amiga/login.h b/frontends/amiga/login.h
index e3f7790..058fa59 100755
--- a/frontends/amiga/login.h
+++ b/frontends/amiga/login.h
@@ -23,9 +23,7 @@
struct gui_login_window;
-BOOL ami_401login_event(struct gui_login_window *lw);
-
void gui_401login_open(nsurl *url, const char *realm,
nserror (*cb)(bool proceed, void *pw), void *cbpw);
-
#endif
+
-----------------------------------------------------------------------
Summary of changes:
frontends/amiga/gui.c | 84 +++++++--------------------------------
frontends/amiga/gui.h | 2 +-
frontends/amiga/history_local.c | 24 +++++++++--
frontends/amiga/history_local.h | 12 +-----
frontends/amiga/login.c | 19 ++++++---
frontends/amiga/login.h | 4 +-
frontends/amiga/print.c | 24 ++++++++---
frontends/amiga/print.h | 10 +----
8 files changed, 71 insertions(+), 108 deletions(-)
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index b7e5faa..e835e2b 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -1903,18 +1903,17 @@ static void ami_set_border_gadget_size(struct
gui_window_2 *gwin)
#endif
}
-static void ami_handle_msg(void)
+static BOOL ami_handle_msg(void)
{
struct ami_generic_window *w = NULL;
struct nsObject *node;
struct nsObject *nnode;
- struct gui_window_2 *gwin = NULL;
+ BOOL win_closed = FALSE;
- if(IsMinListEmpty(window_list))
- {
+ if(IsMinListEmpty(window_list)) {
/* no windows in list, so NetSurf should not be running */
ami_try_quit();
- return;
+ return FALSE;
}
node = (struct nsObject *)GetHead((struct List *)window_list);
@@ -1923,75 +1922,20 @@ static void ami_handle_msg(void)
nnode=(struct nsObject *)GetSucc((struct Node *)node);
w = node->objstruct;
+ if(w == NULL) continue;
- if(node->Type == AMINS_TVWINDOW) {
- if(w->tbl->event(w)) {
- ami_try_quit();
- break;
- } else {
- node = nnode;
- continue;
- }
- } else if(node->Type == AMINS_FINDWINDOW) {
- if(w->tbl->event(w)) {
- ami_try_quit();
- break;
- } else {
- node = nnode;
- continue;
- }
- } else if(node->Type == AMINS_HISTORYWINDOW) {
- if(ami_history_event((struct history_window *)w)) {
- ami_try_quit();
- break;
- } else {
- node = nnode;
- continue;
- }
- } else if(node->Type == AMINS_PRINTWINDOW) {
- if(ami_print_event((struct ami_print_window *)w)) {
- ami_try_quit();
- break;
- } else {
- node = nnode;
- continue;
- }
- } else if(node->Type == AMINS_GUIOPTSWINDOW) {
- if(w->tbl->event(w)) {
- /* last window possibly closed, so exit with
conditions ;) */
- if(scrn) ami_try_quit();
- break;
- } else {
- node = nnode;
- continue;
- }
- } else if(node->Type == AMINS_DLWINDOW) {
- if(w->tbl->event(w)) {
- ami_try_quit();
- break;
- } else {
- node = nnode;
- continue;
- }
- } else if(node->Type == AMINS_LOGINWINDOW) {
- if(ami_401login_event((struct gui_login_window *)w)) {
- ami_try_quit();
- break;
+ if(w->tbl->event != NULL) {
+ if((win_closed = w->tbl->event(w))) {
+ if((node->Type != AMINS_GUIOPTSWINDOW) ||
+ ((node->Type == AMINS_GUIOPTSWINDOW) &&
(scrn != NULL))) {
+ ami_try_quit();
+ break;
+ }
} else {
node = nnode;
continue;
}
}
-
- /* assume this is a normal gui window for now */
- gwin = (struct gui_window_2 *)w;
- if((gwin == NULL) || (gwin->objects[OID_MAIN] == NULL))
continue;
- if(w->tbl->event(w)) {
- break;
- } else {
- node = nnode;
- continue;
- }
} while((node = nnode));
if(ami_menu_quit_selected() == true) {
@@ -2001,6 +1945,8 @@ static void ami_handle_msg(void)
if(ami_menu_get_check_toggled() == true) {
ami_gui_menu_update_all();
}
+
+ return win_closed;
}
static BOOL ami_gui_event(void *w)
@@ -2846,7 +2792,7 @@ void ami_get_msg(void)
}
if(signal & winsignal)
- ami_handle_msg();
+ while(ami_handle_msg());
if(signal & appsig)
ami_handle_appmsg();
diff --git a/frontends/amiga/gui.h b/frontends/amiga/gui.h
index b76efdc..eb39e9e 100644
--- a/frontends/amiga/gui.h
+++ b/frontends/amiga/gui.h
@@ -190,7 +190,7 @@ struct gui_window
float scale;
};
-extern struct MinList *window_list;
+extern struct MinList *window_list; /**\todo stop arexx.c poking about in here
*/
extern struct Screen *scrn;
extern struct MsgPort *sport;
extern struct gui_window *cur_gw;
diff --git a/frontends/amiga/history_local.c b/frontends/amiga/history_local.c
index 5009ce8..3d1c6f3 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;
diff --git a/frontends/amiga/history_local.h b/frontends/amiga/history_local.h
index 284da34..97aea05 100755
--- a/frontends/amiga/history_local.h
+++ b/frontends/amiga/history_local.h
@@ -24,15 +24,7 @@
struct gui_window;
struct gui_globals;
-
-struct history_window {
- struct nsObject *node;
- struct Window *win;
- Object *objects[GID_LAST];
- struct gui_window *gw;
- struct Hook scrollerhook;
- struct gui_globals *gg;
-};
+struct history_window;
/**
* Open history window.
@@ -42,7 +34,5 @@ struct history_window {
void ami_history_open(struct gui_window *gw);
void ami_history_close(struct history_window *hw);
-BOOL ami_history_event(struct history_window *hw);
-
#endif
diff --git a/frontends/amiga/login.c b/frontends/amiga/login.c
index 805e25c..85324b0 100755
--- a/frontends/amiga/login.c
+++ b/frontends/amiga/login.c
@@ -50,7 +50,7 @@
#include "amiga/login.h"
struct gui_login_window {
- struct nsObject *node;
+ struct ami_generic_window w;
struct Window *win;
Object *objects[GID_LAST];
nserror (*cb)(bool proceed, void *pw);
@@ -62,6 +62,14 @@ struct gui_login_window {
char pwd[256];
};
+static BOOL ami_401login_event(void *w);
+
+static const struct ami_win_event_table ami_login_table = {
+ ami_401login_event,
+ NULL, /* we don't explicitly close the login window at all.
+ @todo check if this prevents us from quitting NetSurf */
+};
+
void gui_401login_open(nsurl *url, const char *realm,
nserror (*cb)(bool proceed, void *pw), void *cbpw)
{
@@ -168,9 +176,7 @@ void gui_401login_open(nsurl *url, const char *realm,
EndWindow;
lw->win = (struct Window *)RA_OpenWindow(lw->objects[OID_MAIN]);
-
- lw->node = AddObject(window_list,AMINS_LOGINWINDOW);
- lw->node->objstruct = lw;
+ ami_gui_win_list_add(lw, AMINS_LOGINWINDOW, &ami_login_table);
}
static void ami_401login_close(struct gui_login_window *lw)
@@ -182,7 +188,7 @@ static void ami_401login_close(struct gui_login_window *lw)
DisposeObject(lw->objects[OID_MAIN]);
lwc_string_unref(lw->host);
nsurl_unref(lw->url);
- DelObject(lw->node);
+ ami_gui_win_list_remove(lw);
}
static void ami_401login_login(struct gui_login_window *lw)
@@ -206,9 +212,10 @@ static void ami_401login_login(struct gui_login_window *lw)
ami_401login_close(lw);
}
-BOOL ami_401login_event(struct gui_login_window *lw)
+static BOOL ami_401login_event(void *w)
{
/* return TRUE if window destroyed */
+ struct gui_login_window *lw = (struct gui_login_window *)w;
ULONG result;
uint16 code;
diff --git a/frontends/amiga/login.h b/frontends/amiga/login.h
index e3f7790..058fa59 100755
--- a/frontends/amiga/login.h
+++ b/frontends/amiga/login.h
@@ -23,9 +23,7 @@
struct gui_login_window;
-BOOL ami_401login_event(struct gui_login_window *lw);
-
void gui_401login_open(nsurl *url, const char *realm,
nserror (*cb)(bool proceed, void *pw), void *cbpw);
-
#endif
+
diff --git a/frontends/amiga/print.c b/frontends/amiga/print.c
index 25a4c32..5fab0f9 100644
--- a/frontends/amiga/print.c
+++ b/frontends/amiga/print.c
@@ -96,6 +96,14 @@ struct ami_printer_info
struct Window *win;
};
+struct ami_print_window {
+ struct ami_generic_window w;
+ struct Window *win;
+ Object *objects[OID_LAST];
+ Object *gadgets[GID_LAST];
+ struct hlcache_handle *c;
+};
+
enum
{
PGID_MAIN=0,
@@ -119,6 +127,13 @@ static struct ami_printer_info ami_print_info;
static CONST_STRPTR gadlab[PGID_LAST];
static STRPTR printers[11];
+static BOOL ami_print_event(void *w);
+
+static const struct ami_win_event_table ami_print_table = {
+ ami_print_event,
+ NULL, /* we don't explicitly close the print window on quit (or at
all???) */
+};
+
static void ami_print_ui_setup(void)
{
gadlab[PGID_PRINTER] = (char *)ami_utf8_easy((char
*)messages_get("Printer"));
@@ -325,22 +340,21 @@ void ami_print_ui(struct hlcache_handle *c)
EndWindow;
pw->win = (struct Window *)RA_OpenWindow(pw->objects[OID_MAIN]);
-
- pw->node = AddObject(window_list, AMINS_PRINTWINDOW);
- pw->node->objstruct = pw;
+ ami_gui_win_list_add(pw, AMINS_PRINTWINDOW, &ami_print_table);
}
static void ami_print_close(struct ami_print_window *pw)
{
DisposeObject(pw->objects[OID_MAIN]);
- DelObject(pw->node);
+ ami_gui_win_list_remove(pw);
ami_print_ui_free();
}
-BOOL ami_print_event(struct ami_print_window *pw)
+static BOOL ami_print_event(void *w)
{
/* return TRUE if window destroyed */
+ struct ami_print_window *pw = (struct ami_print_window *)w;
ULONG result;
uint16 code;
struct hlcache_handle *c;
diff --git a/frontends/amiga/print.h b/frontends/amiga/print.h
index bdd409b..0d6b4f5 100755
--- a/frontends/amiga/print.h
+++ b/frontends/amiga/print.h
@@ -21,18 +21,10 @@
#include <proto/exec.h>
struct content;
-
-struct ami_print_window {
- struct nsObject *node;
- struct Window *win;
- Object *objects[OID_LAST];
- Object *gadgets[GID_LAST];
- struct hlcache_handle *c;
-};
+struct ami_print_window;
void ami_print(struct hlcache_handle *c, int copies);
void ami_print_ui(struct hlcache_handle *c);
-BOOL ami_print_event(struct ami_print_window *pw);
bool ami_print_cont(void);
struct MsgPort *ami_print_init(void);
void ami_print_free(void);
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org