From d6cd92e0ccb2f78ec197e02ba714344951075a41 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 14 Feb 2009 12:49:21 +0000 Subject: Fix resource handling buy copying the GTK approach Cleanup mouse movement handlig svn path=/trunk/netsurf/; revision=6486 --- framebuffer/fb_gui.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'framebuffer/fb_gui.c') diff --git a/framebuffer/fb_gui.c b/framebuffer/fb_gui.c index 786fcae16..bc86ba11b 100644 --- a/framebuffer/fb_gui.c +++ b/framebuffer/fb_gui.c @@ -50,6 +50,7 @@ char *default_stylesheet_url; char *adblock_stylesheet_url; +char *options_file_location; struct gui_window *input_window = NULL; struct gui_window *search_current_window; struct gui_window *window_list = NULL; @@ -166,21 +167,33 @@ static void *myrealloc(void *ptr, size_t len, void *pw) void gui_init(int argc, char** argv) { + char buf[PATH_MAX]; + LOG(("argc %d, argv %p", argc, argv)); #ifdef WITH_HUBBUB - if (hubbub_initialise(fb_findfile("Aliases"), myrealloc, NULL) != + fb_find_resource(buf, "Aliases", "./framebuffer/res/Aliases"); + LOG(("Using '%s' as Aliases file", buf)); + if (hubbub_initialise(buf, myrealloc, NULL) != HUBBUB_OK) die("Unable to initialise HTML parsing library.\n"); #endif /* load browser messages */ - messages_load(fb_findfile("messages")); - + fb_find_resource(buf, "messages", "./framebuffer/res/messages"); + LOG(("Using '%s' as Messages file", buf)); + messages_load(buf); + /* load browser options */ - options_read(fb_findfile("Options")); - - default_stylesheet_url = fb_findfile_asurl("default.css"); + fb_find_resource(buf, "Options", "~/.netsurf/Options"); + LOG(("Using '%s' as Preferences file", buf)); + options_file_location = strdup(buf); + options_read(buf); + + /* set up stylesheet urls */ + fb_find_resource(buf, "default.css", "./framebuffer/res/default.css"); + default_stylesheet_url = path_to_url(buf); + LOG(("Using '%s' as Default CSS URL", default_stylesheet_url)); framebuffer = fb_os_init(argc, argv); -- cgit v1.2.3