summaryrefslogtreecommitdiff
path: root/desktop/netsurf.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-01-11 14:20:30 +0000
committerVincent Sanders <vince@kyllikki.org>2014-01-11 14:20:30 +0000
commitd3c392c3d3b516f05fbf71020b2f6774ce20ce8c (patch)
treebad0d50f6d2d7bfc52774745ce10e69ce0ff5bff /desktop/netsurf.c
parenta856439afb743c7fa16f51108862b99a1f56c82a (diff)
downloadnetsurf-d3c392c3d3b516f05fbf71020b2f6774ce20ce8c.tar.gz
netsurf-d3c392c3d3b516f05fbf71020b2f6774ce20ce8c.tar.bz2
Initial conversion of netsurf gui to callback vtable
Diffstat (limited to 'desktop/netsurf.c')
-rw-r--r--desktop/netsurf.c12
1 files changed, 9 insertions, 3 deletions
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();