summaryrefslogtreecommitdiff
path: root/framebuffer/fb_gui.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-02-12 09:15:23 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-02-12 09:15:23 +0000
commit99929082b8f21cf567c021e85cc22fb83f570f54 (patch)
tree443b4a0112fd1a44c1b252936fa8a93f477006a2 /framebuffer/fb_gui.c
parent53f5a9ab4d9c54b8b73a973a4c4931685e936517 (diff)
downloadnetsurf-99929082b8f21cf567c021e85cc22fb83f570f54.tar.gz
netsurf-99929082b8f21cf567c021e85cc22fb83f570f54.tar.bz2
Enable support for hubbub in the framebuffer frontend.
svn path=/trunk/netsurf/; revision=6449
Diffstat (limited to 'framebuffer/fb_gui.c')
-rw-r--r--framebuffer/fb_gui.c21
1 files changed, 21 insertions, 0 deletions
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 <limits.h>
#include <unistd.h>
+#ifdef WITH_HUBBUB
+#include <hubbub/hubbub.h>
+#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
}