From b36a6f7734192a8d75116048fe6bf2d2ac6b4999 Mon Sep 17 00:00:00 2001 From: François Revel Date: Sun, 5 Oct 2008 20:35:28 +0000 Subject: Add Hubbub support, should work much better when actually initializing it. svn path=/trunk/netsurf/; revision=5487 --- beos/beos_gui.cpp | 31 +++++++++++++++++++++++++++++++ beos/res/Aliases | 1 + 2 files changed, 32 insertions(+) create mode 120000 beos/res/Aliases diff --git a/beos/beos_gui.cpp b/beos/beos_gui.cpp index fe0cba020..3f7f803f3 100644 --- a/beos/beos_gui.cpp +++ b/beos/beos_gui.cpp @@ -42,6 +42,11 @@ #include extern "C" { + +#ifdef WITH_HUBBUB +#include +#endif + #include "content/content.h" #include "content/fetch.h" #include "content/fetchers/fetch_curl.h" @@ -78,6 +83,11 @@ extern "C" { #include "beos/beos_fetch_rsrc.h" +#ifdef WITH_HUBBUB +static void *myrealloc(void *ptr, size_t len, void *pw); +#endif + + /* Where to search for shared resources. Must have trailing / */ #define RESPATH "/boot/apps/netsurf/res/" @@ -520,6 +530,15 @@ void gui_init(int argc, char** argv) #endif LOG(("Using '%s' as AdBlock CSS URL", adblock_stylesheet_url)); +#ifdef WITH_HUBBUB + find_resource(buf, "Aliases", "./beos/res/Aliases"); + LOG(("Using '%s' as aliases file", buf)); + if(hubbub_initialise(buf,myrealloc,NULL) != HUBBUB_OK) + { + die(messages_get("NoMemory")); + } +#endif + urldb_load(option_url_file); urldb_load_cookies(option_cookie_file); @@ -734,6 +753,11 @@ void gui_quit(void) CALLED(); urldb_save_cookies(option_cookie_jar); urldb_save(option_url_file); +#ifdef WITH_HUBBUB + hubbub_finalise(myrealloc,NULL); +#endif + //options_save_tree(hotlist,option_hotlist_file,messages_get("TreeHotlist")); + free(default_stylesheet_url); free(adblock_stylesheet_url); free(option_cookie_file); @@ -1112,3 +1136,10 @@ bool cookies_update(const char *domain, const struct cookie_data *data) { return true; } + +#ifdef WITH_HUBBUB +static void *myrealloc(void *ptr, size_t len, void *pw) +{ + return realloc(ptr, len); +} +#endif diff --git a/beos/res/Aliases b/beos/res/Aliases new file mode 120000 index 000000000..a95a734da --- /dev/null +++ b/beos/res/Aliases @@ -0,0 +1 @@ +../../!NetSurf/Resources/Aliases \ No newline at end of file -- cgit v1.2.3