- switch to using builtin css files from rsrc:

- add debug output to trace keyboard input as textinput doesn't work anymore.

svn path=/trunk/netsurf/; revision=5468
This commit is contained in:
François Revel 2008-10-02 13:34:20 +00:00
parent 9e640a2ab9
commit 08073fb3d6
3 changed files with 19 additions and 5 deletions

View File

@ -78,7 +78,10 @@ extern "C" {
/* Where to search for shared resources. Must have trailing / */ /* Where to search for shared resources. Must have trailing / */
#define RESPATH "/boot/apps/netsurf/res/" #define RESPATH "/boot/apps/netsurf/res/"
//TODO: use resources //TODO: use resources
// enable using resources instead of files
#define USE_RESOURCES 1
bool gui_in_multitask = false; bool gui_in_multitask = false;
@ -464,15 +467,22 @@ void gui_init(int argc, char** argv)
beos_fetch_filetype_init(buf); beos_fetch_filetype_init(buf);
/* set up stylesheet urls */ /* set up stylesheet urls */
#ifdef USE_RESOURCES
default_stylesheet_url = strdup("rsrc:/beosdefault.css,text/css");
#else
find_resource(buf, "beosdefault.css", "./beos/res/beosdefault.css"); find_resource(buf, "beosdefault.css", "./beos/res/beosdefault.css");
default_stylesheet_url = path_to_url(buf); default_stylesheet_url = path_to_url(buf);
//default_stylesheet_url = strdup("rsrc:/beosdefault.css,text/css"); #endif
//default_stylesheet_url = generate_default_css(); //default_stylesheet_url = generate_default_css();
LOG(("Using '%s' as Default CSS URL", default_stylesheet_url)); LOG(("Using '%s' as Default CSS URL", default_stylesheet_url));
#ifdef USE_RESOURCES
adblock_stylesheet_url = strdup("rsrc:/adblock.css,text/css");
#else
find_resource(buf, "adblock.css", "./beos/res/adblock.css"); find_resource(buf, "adblock.css", "./beos/res/adblock.css");
adblock_stylesheet_url = path_to_url(buf); adblock_stylesheet_url = path_to_url(buf);
//adblock_stylesheet_url = strdup("rsrc:/adblock.css,text/css"); #endif
LOG(("Using '%s' as AdBlock CSS URL", adblock_stylesheet_url)); LOG(("Using '%s' as AdBlock CSS URL", adblock_stylesheet_url));
urldb_load(option_url_file); urldb_load(option_url_file);

View File

@ -627,7 +627,6 @@ void nsbeos_dispatch_event(BMessage *message)
LOG(("discarding event for destroyed scaffolding")); LOG(("discarding event for destroyed scaffolding"));
return; return;
} }
//#warning XXX VALIDATE gui_window!!!
// messages for top-level // messages for top-level
if (scaffold) { if (scaffold) {
@ -637,6 +636,7 @@ void nsbeos_dispatch_event(BMessage *message)
return; return;
} }
LOG(("processing message"));
switch (message->what) { switch (message->what) {
case B_QUIT_REQUESTED: case B_QUIT_REQUESTED:
// from the BApplication // from the BApplication
@ -814,6 +814,7 @@ void nsbeos_window_keypress_event(BView *view, gui_window *g, BMessage *event)
if (!numbytes) if (!numbytes)
numbytes = strlen(bytes); numbytes = strlen(bytes);
LOG(("mods 0x%08lx key %ld raw %ld byte[0] %d", mods, key, raw_char, buff[0]));
char byte; char byte;
if (numbytes == 1) { if (numbytes == 1) {
@ -877,7 +878,9 @@ void nsbeos_window_keypress_event(BView *view, gui_window *g, BMessage *event)
// else use convert_from_utf8() // else use convert_from_utf8()
} }
if (browser_window_key_press(g->bw, nskey)) bool done = browser_window_key_press(g->bw, nskey);
LOG(("nskey %d %d", nskey, done));
//if (browser_window_key_press(g->bw, nskey))
return; return;
} }

View File

@ -4,7 +4,8 @@
/* Load base stylesheet. */ /* Load base stylesheet. */
@import "default.css"; /*@import "default.css";*/
@import "rsrc:/default.css,text/css";
/* Apply GTK specific rules. */ /* Apply GTK specific rules. */