From 9454b8bca10f2ac8e224b9d60d71355b36194555 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Fri, 2 Apr 2004 00:41:10 +0000 Subject: [project @ 2004-04-02 00:41:10 by jmb] Try to use external apps for URI schemes we don't understand (eg mailto:) svn path=/import/netsurf/; revision=698 --- riscos/url_protocol.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'riscos/url_protocol.c') diff --git a/riscos/url_protocol.c b/riscos/url_protocol.c index 1553d17ac..e1b32e691 100644 --- a/riscos/url_protocol.c +++ b/riscos/url_protocol.c @@ -15,6 +15,7 @@ #include "netsurf/riscos/theme.h" #include "netsurf/desktop/gui.h" #include "netsurf/riscos/gui.h" +#include "netsurf/riscos/uri.h" #include "netsurf/riscos/url_protocol.h" #include "netsurf/utils/log.h" #include "netsurf/utils/utils.h" @@ -125,3 +126,57 @@ char *read_string_value(os_string_value string, char *msg) { if(string.offset > 256) return string.pointer; return &msg[string.offset]; } + +bool ro_url_broadcast(char *url) { + + inetsuite_full_message_open_url_direct message; + os_error *e; + int len = (strlen(url)>235) ? 235 : strlen(url); + + message.size = (((20+len-1)+3) & ~3); + message.your_ref = 0; + message.action = message_INET_SUITE_OPEN_URL; + + *message.url = 0; + strncat(message.url, url, 235); + e = xwimp_send_message(wimp_USER_MESSAGE_RECORDED, + (wimp_message*)&message, 0); + if (e) { + return false; + } + + return true; +} + +bool ro_url_load(char *url) { + + char url_buf[512]; + char *colon; + os_error *e; + + colon = strchr(url, ':'); + if (!colon) return false; + + strcpy(url_buf, "Alias$URLOpen_"); + strncat(url_buf, url, colon-url); + if (!getenv(url_buf)) return false; + + strcat(url_buf, " "); + strncat(url_buf, url, 512-strlen(url_buf)-1); + + e = xwimp_start_task(url_buf+5, 0); + + if (e) { + return false; + } + + return true; +} + +void ro_url_bounce(wimp_message *message) { + + inetsuite_message_open_url *url_message = (inetsuite_message_open_url*)&message->data; + + /* ant broadcast bounced -> try uri broadcast / load */ + ro_uri_launch(url_message->url); +} -- cgit v1.2.3