From 99929082b8f21cf567c021e85cc22fb83f570f54 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Thu, 12 Feb 2009 09:15:23 +0000 Subject: Enable support for hubbub in the framebuffer frontend. svn path=/trunk/netsurf/; revision=6449 --- framebuffer/fb_gui.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'framebuffer') diff --git a/framebuffer/fb_gui.c b/framebuffer/fb_gui.c index 07a615251..23d31b274 100644 --- a/framebuffer/fb_gui.c +++ b/framebuffer/fb_gui.c @@ -23,12 +23,17 @@ #include #include +#ifdef WITH_HUBBUB +#include +#endif + #include "desktop/gui.h" #include "desktop/plotters.h" #include "desktop/netsurf.h" #include "desktop/options.h" #include "utils/log.h" #include "utils/messages.h" +#include "utils/utils.h" #include "framebuffer/fb_bitmap.h" #include "framebuffer/fb_gui.h" @@ -136,11 +141,23 @@ static void fb_redraw(struct gui_window *g) redraws_pending = false; } +#ifdef WITH_HUBBUB +static void *myrealloc(void *ptr, size_t len, void *pw) +{ + return realloc(ptr, len); +} +#endif void gui_init(int argc, char** argv) { LOG(("argc %d, argv %p", argc, argv)); +#ifdef WITH_HUBBUB + if (hubbub_initialise(fb_findfile("Aliases"), myrealloc, NULL) != + HUBBUB_OK) + die("Unable to initialise HTML parsing library.\n"); +#endif + /* load browser messages */ messages_load(fb_findfile("messages")); @@ -238,6 +255,10 @@ void gui_quit(void) { LOG(("gui_quit")); fb_os_quit(framebuffer); +#ifdef WITH_HUBBUB + /* We don't care if this fails as we're about to die, anyway */ + hubbub_finalise(myrealloc, NULL); +#endif } -- cgit v1.2.3