summaryrefslogtreecommitdiff
path: root/beos/beos_gui.cpp
diff options
context:
space:
mode:
authorFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-05 20:35:28 +0000
committerFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-05 20:35:28 +0000
commitb36a6f7734192a8d75116048fe6bf2d2ac6b4999 (patch)
tree9c25741dcbbc6d40888d3e7db0afa974cc7a3a77 /beos/beos_gui.cpp
parent022616ce99f65a02c6d818b0890b61048f1d973a (diff)
downloadnetsurf-b36a6f7734192a8d75116048fe6bf2d2ac6b4999.tar.gz
netsurf-b36a6f7734192a8d75116048fe6bf2d2ac6b4999.tar.bz2
Add Hubbub support, should work much better when actually initializing it.
svn path=/trunk/netsurf/; revision=5487
Diffstat (limited to 'beos/beos_gui.cpp')
-rw-r--r--beos/beos_gui.cpp31
1 files changed, 31 insertions, 0 deletions
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 <String.h>
extern "C" {
+
+#ifdef WITH_HUBBUB
+#include <hubbub/hubbub.h>
+#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