From bd065d4a434755e67642a071e255cba596de8d1e Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 15 Jan 2014 19:37:05 +0000 Subject: split browser gui operations up --- amiga/download.c | 4 ++-- amiga/download.h | 2 +- amiga/gui.c | 23 +++++++++++++---------- 3 files changed, 16 insertions(+), 13 deletions(-) (limited to 'amiga') diff --git a/amiga/download.c b/amiga/download.c index 60190ce17..4f4c39b20 100644 --- a/amiga/download.c +++ b/amiga/download.c @@ -433,11 +433,11 @@ BOOL ami_download_check_overwrite(const char *file, struct Window *win, ULONG si else return FALSE; } -static struct gui_download_table gui_download_table = { +static struct gui_download_table download_table = { .create = gui_download_window_create, .data = gui_download_window_data, .error = gui_download_window_error, .done = gui_download_window_done, }; -struct gui_download_table *amiga_gui_download_table = &gui_download_table; +struct gui_download_table *amiga_download_table = &download_table; diff --git a/amiga/download.h b/amiga/download.h index d9e637ede..95d71ecfe 100755 --- a/amiga/download.h +++ b/amiga/download.h @@ -23,7 +23,7 @@ #include "amiga/gui.h" -extern struct gui_download_table *amiga_gui_download_table; +extern struct gui_download_table *amiga_download_table; struct download_context; struct gui_download_window; diff --git a/amiga/gui.c b/amiga/gui.c index 9e433101e..27e747a05 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -5085,7 +5085,7 @@ static void gui_file_gadget_open(struct gui_window *g, hlcache_handle *hl, } } -static struct gui_window_table ami_window_table = { +static struct gui_window_table amiga_window_table = { .create = gui_window_create, .destroy = gui_window_destroy, .redraw = gui_window_redraw_window, @@ -5117,19 +5117,19 @@ static struct gui_window_table ami_window_table = { .save_link = gui_window_save_link, }; +static struct gui_clipboard_table amiga_clipboard_table = { + .get = gui_get_clipboard, + .set = gui_set_clipboard, +}; -static struct gui_table ami_gui_table = { +static struct gui_browser_table amiga_browser_table = { .poll = gui_poll, .quit = gui_quit, .set_search_ico = gui_set_search_ico, .get_resource_url = gui_get_resource_url, .launch_url = gui_launch_url, .create_form_select_menu = gui_create_form_select_menu, - .get_clipboard = gui_get_clipboard, - .set_clipboard = gui_set_clipboard, .cert_verify = gui_cert_verify, - - .window = &ami_window_table, }; /** Normal entry point from OS */ @@ -5143,6 +5143,12 @@ int main(int argc, char** argv) int32 user = 0; nserror ret; Object *splash_window = ami_gui_splash_open(); + struct gui_table amiga_gui_table = { + .browser = &amiga_browser_table, + .window = &amiga_window_table, + .clipboard = &amiga_clipboard_table, + .download = amiga_download_table, + }; /* Open popupmenu.library just to check the version. * Versions older than 53.11 are dangerous, so we @@ -5190,10 +5196,7 @@ int main(int argc, char** argv) if (ami_locate_resource(messages, "Messages") == false) die("Cannot open Messages file"); - - ami_gui_table.download = amiga_gui_download_table; - - ret = netsurf_init(messages, &ami_gui_table); + ret = netsurf_init(messages, &amiga_gui_table); if (ret != NSERROR_OK) { die("NetSurf failed to initialise"); } -- cgit v1.2.3