From d3c392c3d3b516f05fbf71020b2f6774ce20ce8c Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 11 Jan 2014 14:20:30 +0000 Subject: Initial conversion of netsurf gui to callback vtable --- desktop/netsurf.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'desktop/netsurf.c') diff --git a/desktop/netsurf.c b/desktop/netsurf.c index 36b0b589a..10dc7ba68 100644 --- a/desktop/netsurf.c +++ b/desktop/netsurf.c @@ -41,6 +41,7 @@ #include "desktop/browser.h" #include "desktop/system_colour.h" #include "desktop/gui.h" +#include "desktop/gui_factory.h" #include "utils/nsoption.h" #include "desktop/searchweb.h" @@ -116,7 +117,7 @@ static nserror netsurf_llcache_query_handler(const llcache_query *query, * Initialise components used by gui NetSurf. */ -nserror netsurf_init(const char *messages) +nserror netsurf_init(const char *messages, struct gui_table *gt) { nserror error; struct utsname utsname; @@ -150,6 +151,11 @@ nserror netsurf_init(const char *messages) utsname.nodename, utsname.release, utsname.version, utsname.machine)); + /* register the gui handlers */ + error = gui_factory_register(gt); + if (error != NSERROR_OK) + return error; + messages_load(messages); /* corestrings init */ @@ -228,7 +234,7 @@ nserror netsurf_init(const char *messages) int netsurf_main_loop(void) { while (!netsurf_quit) { - gui_poll(fetch_active); + guit->poll(fetch_active); hlcache_poll(); } @@ -244,7 +250,7 @@ void netsurf_exit(void) hlcache_stop(); LOG(("Closing GUI")); - gui_quit(); + guit->quit(); LOG(("Finalising JavaScript")); js_finalise(); -- cgit v1.2.3