diff options
Diffstat (limited to 'beos')
-rw-r--r-- | beos/Makefile.target | 2 | ||||
-rw-r--r-- | beos/gui.cpp | 20 | ||||
-rw-r--r-- | beos/plotters.cpp | 1 | ||||
-rw-r--r-- | beos/scaffolding.cpp | 9 |
4 files changed, 19 insertions, 13 deletions
diff --git a/beos/Makefile.target b/beos/Makefile.target index a1259d644..bbeb0be22 100644 --- a/beos/Makefile.target +++ b/beos/Makefile.target @@ -38,7 +38,7 @@ ifeq ($(HOST),beos) ifneq ($(wildcard /boot/develop/lib/*/libzeta.so),) LDFLAGS += -lzeta endif - ifneq ($(wildcard /boot/develop/lib/*/libnetwork.so),) + ifneq ($(wildcard /boot/system/develop/lib/*/libnetwork.so),) # Haiku CFLAGS += -I/boot/common/include \ -I/boot/common/include/hubbub \ diff --git a/beos/gui.cpp b/beos/gui.cpp index 8518ba1ac..f9e02d0de 100644 --- a/beos/gui.cpp +++ b/beos/gui.cpp @@ -37,6 +37,7 @@ #include <FindDirectory.h> #include <Mime.h> #include <Path.h> +#include <PathFinder.h> #include <Roster.h> #include <Screen.h> #include <String.h> @@ -79,9 +80,6 @@ extern "C" { static void *myrealloc(void *ptr, size_t len, void *pw); -/* 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 @@ -297,7 +295,13 @@ static char *find_resource(char *buf, const char *filename, const char *def) return buf; } - strcpy(t, RESPATH); + + BPathFinder f((void*)find_resource); + + BPath p; + f.FindPath(B_FIND_PATH_APPS_DIRECTORY, "netsurf/res/", p); + strcpy(t, p.Path()); + strcat(t, filename); realpath(t, buf); if (access(buf, R_OK) == 0) @@ -488,7 +492,10 @@ static bool nslog_stream_configure(FILE *fptr) static BPath get_messages_path() { - BPath p("/boot/apps/netsurf/res"); + BPathFinder f((void*)get_messages_path); + + BPath p; + f.FindPath(B_FIND_PATH_APPS_DIRECTORY, "netsurf/res", p); // TODO: use Haiku's BLocale stuff BString lang(getenv("LC_MESSAGES")); lang.Truncate(2); @@ -978,9 +985,8 @@ static struct gui_fetch_table beos_fetch_table = { static struct gui_browser_table beos_browser_table = { gui_poll, - beos_schedule, + beos_schedule, gui_quit, - NULL, //set_search_ico gui_launch_url, NULL, //create_form_select_menu NULL, //cert_verify diff --git a/beos/plotters.cpp b/beos/plotters.cpp index c2a99fea0..52ab4ec21 100644 --- a/beos/plotters.cpp +++ b/beos/plotters.cpp @@ -36,6 +36,7 @@ extern "C" { #include "utils/log.h" #include "utils/utils.h" #include "utils/nsoption.h" +#include "utils/nsurl.h" } #include "beos/font.h" #include "beos/gui.h" diff --git a/beos/scaffolding.cpp b/beos/scaffolding.cpp index 35153b33d..0f87420a5 100644 --- a/beos/scaffolding.cpp +++ b/beos/scaffolding.cpp @@ -196,12 +196,11 @@ NSIconTextControl::NSIconTextControl(BRect frame, const char* name, fIconBitmap(NULL) { BRect r(Bounds()); - BRect frame = r; - frame.right = frame.left + ICON_WIDTH - 1; - frame.bottom = frame.top + ICON_WIDTH - 1; - frame.OffsetBy((int32)((r.IntegerHeight() - ICON_WIDTH + 3) / 2), + fIconFrame = r; + fIconFrame.right = fIconFrame.left + ICON_WIDTH - 1; + fIconFrame.bottom = fIconFrame.top + ICON_WIDTH - 1; + fIconFrame.OffsetBy((int32)((r.IntegerHeight() - ICON_WIDTH + 3) / 2), (int32)((r.IntegerHeight() - ICON_WIDTH + 1) / 2)); - fIconFrame = frame; FixupTextRect(); } |