From 7f1eced1ea5cd6eb706d6aff1cb7a132806de29d Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Fri, 5 Mar 2004 16:34:31 +0000 Subject: [PATCH] [project @ 2004-03-05 16:34:31 by jmb] Add support for dragging in URI files svn path=/import/netsurf/; revision=584 --- riscos/gui.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/riscos/gui.c b/riscos/gui.c index 28e617eb2..b96937a18 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -818,11 +818,38 @@ void ro_msg_dataload(wimp_message *message) message->data.data_xfer.file_type != 0xaff && message->data.data_xfer.file_type != 0xb60 && message->data.data_xfer.file_type != 0xc85 && + message->data.data_xfer.file_type != 0xf91 && message->data.data_xfer.file_type != 0xff9 && message->data.data_xfer.file_type != 0xfff && message->data.data_xfer.file_type != 0xb28) return; + /* uri file */ + if (message->data.data_xfer.file_type == 0xf91) { + char *temp; + int i=0; + FILE *fp = fopen(message->data.data_xfer.file_name, "r"); + + if (!fp) return; + + url = xcalloc(256, sizeof(char)); /* fixed size != good */ + + while (i != 2) { + temp = fgets(url, 256, fp); + if (!temp) { + xfree(url); + return; + } + + temp = xstrdup(strip(url)); + xfree(url); + url = temp; + if (url[0] != '#') { /* not a comment */ + i++; + } + } + } + /* url file */ if (message->data.data_xfer.file_type == 0xb28) { char *temp; @@ -852,7 +879,8 @@ void ro_msg_dataload(wimp_message *message) wimp_send_message(wimp_USER_MESSAGE, message, message->sender); /* create a new window with the file */ - if (message->data.data_xfer.file_type != 0xb28) { + if (message->data.data_xfer.file_type != 0xb28 && + message->data.data_xfer.file_type != 0xf91) { url = ro_path_to_url(message->data.data_xfer.file_name); } if (url) {