summaryrefslogtreecommitdiff
path: root/beos
diff options
context:
space:
mode:
authorFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-16 16:01:44 +0000
committerFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-16 16:01:44 +0000
commitce07ebcea8d4c0460b58de7b59bb94734b650cbe (patch)
tree6c897f60eb9d561bdc1881e6f137fbf297911e03 /beos
parentb3a5250f994bd772b14dad3472384b8534e0ad4f (diff)
downloadnetsurf-ce07ebcea8d4c0460b58de7b59bb94734b650cbe.tar.gz
netsurf-ce07ebcea8d4c0460b58de7b59bb94734b650cbe.tar.bz2
- handle NetPositive what codes; this makes it easy to use NetSurf instead by just changing the archived message used to instantiate it.
- fix background view color, some host apps hide the BDragger, making it visible. - handle mailto: urls as a special case, we historically use the prefered app for text/x-email. svn path=/trunk/netsurf/; revision=5584
Diffstat (limited to 'beos')
-rw-r--r--beos/beos_gui.cpp14
-rw-r--r--beos/beos_scaffolding.cpp29
-rw-r--r--beos/beos_scaffolding.h2
-rw-r--r--beos/beos_window.cpp9
4 files changed, 54 insertions, 0 deletions
diff --git a/beos/beos_gui.cpp b/beos/beos_gui.cpp
index a0ff9ce81..2e8d2ca0f 100644
--- a/beos/beos_gui.cpp
+++ b/beos/beos_gui.cpp
@@ -162,6 +162,15 @@ NSBrowserApplication::MessageReceived(BMessage *message)
case 'urlc':
case 'urle':
case 'menu':
+ // NetPositive messages
+ case B_NETPOSITIVE_OPEN_URL:
+ case B_NETPOSITIVE_BACK:
+ case B_NETPOSITIVE_FORWARD:
+ case B_NETPOSITIVE_HOME:
+ case B_NETPOSITIVE_RELOAD:
+ case B_NETPOSITIVE_STOP:
+ case B_NETPOSITIVE_DOWN:
+ case B_NETPOSITIVE_UP:
//DetachCurrentMessage();
//nsbeos_pipe_message(message, this, fGuiWindow);
break;
@@ -943,6 +952,11 @@ void gui_launch_url(const char *url)
BString arg(url);
mimeType.Append(arg, arg.FindFirst(":"));
+ // special case, text/x-email is used traditionally
+ // use it instead
+ if (arg.IFindFirst("mailto:") == 0)
+ mimeType = "text/x-email";
+
// the protocol should be alphanum
// we just check if it's registered
// if not there is likely no supporting app anyway
diff --git a/beos/beos_scaffolding.cpp b/beos/beos_scaffolding.cpp
index bbc4afbed..652628855 100644
--- a/beos/beos_scaffolding.cpp
+++ b/beos/beos_scaffolding.cpp
@@ -354,6 +354,15 @@ NSBaseView::MessageReceived(BMessage *message)
case B_PASTE:
case B_SELECT_ALL:
//case B_MOUSE_WHEEL_CHANGED:
+ // NetPositive messages
+ case B_NETPOSITIVE_OPEN_URL:
+ case B_NETPOSITIVE_BACK:
+ case B_NETPOSITIVE_FORWARD:
+ case B_NETPOSITIVE_HOME:
+ case B_NETPOSITIVE_RELOAD:
+ case B_NETPOSITIVE_STOP:
+ case B_NETPOSITIVE_DOWN:
+ case B_NETPOSITIVE_UP:
// messages for top-level
case 'back':
case 'forw':
@@ -523,6 +532,8 @@ NSBaseView::AllAttached()
g->url_bar->SetTarget(this);
+ SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
+
g->dragger->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
g->status_bar->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
@@ -623,6 +634,9 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
case B_QUIT_REQUESTED:
nsbeos_scaffolding_destroy(scaffold);
break;
+ case B_NETPOSITIVE_DOWN:
+ //XXX WRITEME
+ break;
case B_SIMPLE_DATA:
{
if (!message->HasRef("refs")) {
@@ -683,6 +697,15 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
}
break;
}
+ case B_NETPOSITIVE_OPEN_URL:
+ {
+ int32 i;
+ BString url;
+ if (message->FindString("be:url", &url) < B_OK)
+ break;
+ browser_window_go(bw, url.String(), 0, true);
+ break;
+ }
case B_COPY:
gui_copy_to_clipboard(bw->sel);
break;
@@ -696,6 +719,7 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
LOG(("Selecting all text"));
selection_select_all(bw->sel);
break;
+ case B_NETPOSITIVE_BACK:
case BROWSER_NAVIGATE_BACK:
case 'back':
if (!history_back_available(bw->history))
@@ -703,6 +727,7 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
history_back(bw, bw->history);
nsbeos_window_update_back_forward(scaffold);
break;
+ case B_NETPOSITIVE_FORWARD:
case BROWSER_NAVIGATE_FORWARD:
case 'forw':
if (!history_forward_available(bw->history))
@@ -710,10 +735,12 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
history_forward(bw, bw->history);
nsbeos_window_update_back_forward(scaffold);
break;
+ case B_NETPOSITIVE_STOP:
case BROWSER_NAVIGATE_STOP:
case 'stop':
browser_window_stop(bw);
break;
+ case B_NETPOSITIVE_RELOAD:
case BROWSER_NAVIGATE_RELOAD_ALL:
case 'relo':
reloadAll = true;
@@ -721,6 +748,7 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
case BROWSER_NAVIGATE_RELOAD:
browser_window_reload(bw, reloadAll);
break;
+ case B_NETPOSITIVE_HOME:
case BROWSER_NAVIGATE_HOME:
case 'home':
{
@@ -855,6 +883,7 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
break;
case HISTORY_EXPORT:
break;
+ case B_NETPOSITIVE_UP:
case BROWSER_NAVIGATE_UP:
break;
case BROWSER_NAVIGATE_URL:
diff --git a/beos/beos_scaffolding.h b/beos/beos_scaffolding.h
index 6fcc84ebc..00c6b5add 100644
--- a/beos/beos_scaffolding.h
+++ b/beos/beos_scaffolding.h
@@ -22,6 +22,8 @@
#include <View.h>
#include <Window.h>
+#include <NetPositive.h>
+
extern "C" {
#include "desktop/gui.h"
#include "desktop/plotters.h"
diff --git a/beos/beos_window.cpp b/beos/beos_window.cpp
index 6eadb7ffb..3d66a2c82 100644
--- a/beos/beos_window.cpp
+++ b/beos/beos_window.cpp
@@ -150,6 +150,15 @@ NSBrowserFrameView::MessageReceived(BMessage *message)
case B_PASTE:
case B_SELECT_ALL:
//case B_MOUSE_WHEEL_CHANGED:
+ // NetPositive messages
+ case B_NETPOSITIVE_OPEN_URL:
+ case B_NETPOSITIVE_BACK:
+ case B_NETPOSITIVE_FORWARD:
+ case B_NETPOSITIVE_HOME:
+ case B_NETPOSITIVE_RELOAD:
+ case B_NETPOSITIVE_STOP:
+ case B_NETPOSITIVE_DOWN:
+ case B_NETPOSITIVE_UP:
// messages for top-level
case 'back':
case 'forw':