summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-02 13:34:20 +0000
committerFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-02 13:34:20 +0000
commit08073fb3d696c474c92a6ac8cfabf8bf04774258 (patch)
tree9b4f658aa8362df25665e1a95c91f116316734d0
parent9e640a2ab97e0d7484268c2fc3456687a1b7360a (diff)
downloadnetsurf-08073fb3d696c474c92a6ac8cfabf8bf04774258.tar.gz
netsurf-08073fb3d696c474c92a6ac8cfabf8bf04774258.tar.bz2
- 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
-rw-r--r--beos/beos_gui.cpp14
-rw-r--r--beos/beos_window.cpp7
-rw-r--r--beos/res/beosdefault.css3
3 files changed, 19 insertions, 5 deletions
diff --git a/beos/beos_gui.cpp b/beos/beos_gui.cpp
index 983ea7ae3..00feeb8ff 100644
--- a/beos/beos_gui.cpp
+++ b/beos/beos_gui.cpp
@@ -78,7 +78,10 @@ extern "C" {
/* Where to search for shared resources. Must have trailing / */
#define RESPATH "/boot/apps/netsurf/res/"
+
//TODO: use resources
+// enable using resources instead of files
+#define USE_RESOURCES 1
bool gui_in_multitask = false;
@@ -464,15 +467,22 @@ void gui_init(int argc, char** argv)
beos_fetch_filetype_init(buf);
/* 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");
default_stylesheet_url = path_to_url(buf);
- //default_stylesheet_url = strdup("rsrc:/beosdefault.css,text/css");
+#endif
//default_stylesheet_url = generate_default_css();
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");
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));
urldb_load(option_url_file);
diff --git a/beos/beos_window.cpp b/beos/beos_window.cpp
index 46d7ca2c3..e8d602275 100644
--- a/beos/beos_window.cpp
+++ b/beos/beos_window.cpp
@@ -627,7 +627,6 @@ void nsbeos_dispatch_event(BMessage *message)
LOG(("discarding event for destroyed scaffolding"));
return;
}
- //#warning XXX VALIDATE gui_window!!!
// messages for top-level
if (scaffold) {
@@ -637,6 +636,7 @@ void nsbeos_dispatch_event(BMessage *message)
return;
}
+ LOG(("processing message"));
switch (message->what) {
case B_QUIT_REQUESTED:
// from the BApplication
@@ -814,6 +814,7 @@ void nsbeos_window_keypress_event(BView *view, gui_window *g, BMessage *event)
if (!numbytes)
numbytes = strlen(bytes);
+ LOG(("mods 0x%08lx key %ld raw %ld byte[0] %d", mods, key, raw_char, buff[0]));
char byte;
if (numbytes == 1) {
@@ -877,7 +878,9 @@ void nsbeos_window_keypress_event(BView *view, gui_window *g, BMessage *event)
// 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;
}
diff --git a/beos/res/beosdefault.css b/beos/res/beosdefault.css
index 9021eedd9..b32449172 100644
--- a/beos/res/beosdefault.css
+++ b/beos/res/beosdefault.css
@@ -4,7 +4,8 @@
/* Load base stylesheet. */
-@import "default.css";
+/*@import "default.css";*/
+@import "rsrc:/default.css,text/css";
/* Apply GTK specific rules. */