summaryrefslogtreecommitdiff
path: root/beos/beos_gui.cpp
diff options
context:
space:
mode:
authorFrançois Revel <mmu_man@netsurf-browser.org>2008-08-13 19:35:41 +0000
committerFrançois Revel <mmu_man@netsurf-browser.org>2008-08-13 19:35:41 +0000
commit44856d86d4efb12e08c8ef7560f39233107dfa8a (patch)
tree63b13b49ea54c5b2d505f1c77c1cd61c48c57766 /beos/beos_gui.cpp
parent80c98b869433eb28e31da014b84c6839bc5908e6 (diff)
downloadnetsurf-44856d86d4efb12e08c8ef7560f39233107dfa8a.tar.gz
netsurf-44856d86d4efb12e08c8ef7560f39233107dfa8a.tar.bz2
Fix the BeOS build:
- hack to work around stdbool.h issue with R5 devkit - fix prototypes - fix bitmap code - fix copy-paste on forward button - remove unused gif throbber loading code - R5 rgb_color doesn't have != operator, use memcmp() - switch back to file based [beos]default.css for the time being - realpath() hack for R5 Regressions: - asserts on haiku-os.org - no libns* yet, so less image support - text field input doesn't work anymore. svn path=/trunk/netsurf/; revision=5109
Diffstat (limited to 'beos/beos_gui.cpp')
-rw-r--r--beos/beos_gui.cpp29
1 files changed, 24 insertions, 5 deletions
diff --git a/beos/beos_gui.cpp b/beos/beos_gui.cpp
index f1a99e245..dba6ba75a 100644
--- a/beos/beos_gui.cpp
+++ b/beos/beos_gui.cpp
@@ -18,6 +18,7 @@
*/
#define _GNU_SOURCE /* for strndup */
+#define __STDBOOL_H__ 1
#include <assert.h>
#include <ctype.h>
#include <stdbool.h>
@@ -33,7 +34,9 @@
#include <Alert.h>
#include <Application.h>
+#include <BeBuild.h>
#include <Mime.h>
+#include <Path.h>
#include <Roster.h>
#include <String.h>
@@ -226,6 +229,20 @@ static char *generate_default_css()
return strdup(url);
}
+/* realpath fallback on R5 */
+#if !defined(__HAIKU__) && !defined(B_BEOS_VERSION_DANO)
+char *realpath(const char *f, char *buf)
+{
+ BPath path(f, NULL, true);
+ if (path.InitCheck() < 0) {
+ strncpy(buf, f, MAXPATHLEN);
+ return NULL;
+ }
+ strncpy(buf, path.Path(), MAXPATHLEN);
+ return buf;
+}
+#endif
+
/**
* Locate a shared resource file by searching known places in order.
*
@@ -447,13 +464,15 @@ void gui_init(int argc, char** argv)
beos_fetch_filetype_init(buf);
/* set up stylesheet urls */
- /*find_resource(buf, "beosdefault.css", "./beos/res/beosdefault.css");*/
- default_stylesheet_url = strdup("rsrc:/beosdefault.css,text/css");
+ 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");
//default_stylesheet_url = generate_default_css();
LOG(("Using '%s' as Default CSS URL", default_stylesheet_url));
- /*find_resource(buf, "adblock.css", "./beos/res/adblock.css");*/
- adblock_stylesheet_url = strdup("rsrc:/adblock.css,text/css");
+ 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");
LOG(("Using '%s' as AdBlock CSS URL", adblock_stylesheet_url));
urldb_load(option_url_file);
@@ -768,7 +787,7 @@ void gui_quit(void)
struct gui_download_window *gui_download_window_create(const char *url,
const char *mime_type, struct fetch *fetch,
- unsigned int total_size)
+ unsigned int total_size, struct gui_window *gui)
{
return 0;
}