summaryrefslogtreecommitdiff
path: root/windows/main.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2011-10-05 08:32:52 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2011-10-05 08:32:52 +0000
commitd5bb9d98e7f98f0c3d706197231d58c4369d6b56 (patch)
tree8bf4f0941f6b48ced521004d0cb929ed69521dcf /windows/main.c
parenta25f87a739943312b0a0ffa3943b584fd8265102 (diff)
downloadnetsurf-d5bb9d98e7f98f0c3d706197231d58c4369d6b56.tar.gz
netsurf-d5bb9d98e7f98f0c3d706197231d58c4369d6b56.tar.bz2
Build resource: map at start time
Remove stylesheet url globals -- the core will always use resource:{default,quirks,adblock}.css as appropriate svn path=/trunk/netsurf/; revision=12949
Diffstat (limited to 'windows/main.c')
-rw-r--r--windows/main.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/windows/main.c b/windows/main.c
index 1a38f815e..26b966d25 100644
--- a/windows/main.c
+++ b/windows/main.c
@@ -35,16 +35,21 @@
static char **respaths; /** resource search path vector. */
-char *default_stylesheet_url;
-char *adblock_stylesheet_url;
-char *quirks_stylesheet_url;
-
char *options_file_location;
-char* gui_get_resource_url(const char *filename)
+nsurl *gui_get_resource_url(const char *path)
{
char buf[PATH_MAX];
- return path_to_url(filepath_sfind(respaths, buf, filename));
+ char *raw;
+ nsurl *url = NULL;
+
+ raw = path_to_url(filepath_sfind(respaths, buf, path));
+ if (raw != NULL) {
+ nsurl_create(raw, &url);
+ free(raw);
+ }
+
+ return url;
}
void gui_launch_url(const char *url)
@@ -122,16 +127,6 @@ WinMain(HINSTANCE hInstance, HINSTANCE hLastInstance, LPSTR lpcli, int ncmd)
free(messages);
- /* set up stylesheet urls */
- default_stylesheet_url = strdup("resource:default.css");
- LOG(("Using '%s' as Default CSS URL", default_stylesheet_url));
-
- quirks_stylesheet_url = strdup("resource:quirks.css");
- LOG(("Using '%s' as quirks CSS URL", quirks_stylesheet_url));
-
- adblock_stylesheet_url = strdup("resource:adblock.css");
- LOG(("Using '%s' as AdBlock CSS URL", adblock_stylesheet_url));
-
ret = nsws_create_main_class(hInstance);
ret = nsws_create_drawable_class(hInstance);
ret = nsws_create_localhistory_class(hInstance);