When an application wishes for a URL to be opened but does not know how to, it should broadcast a WIMP message that has event data in the following form:
If the string representing the URL that needs to be opened is less than 236 bytes long and no body file or window target needs to be specified then it may be sent in the array of bytes event_data.data.url
.
Otherwise the indirect form must be used. The tag value event_data.data.indirect.tag
should be set to zero. Each of the 'string_value
' fields above can then be in one of three catagories:
The flags
word should have bit 0 set to use the body_mimetype
field (for specifying a MIME type when sending form data). All other bits are currently all reserved and should be set to zero.
The target
is the name of the frame or window in which the URL should be opened. See the Netscape documentation at http://www.netscape.com/assist/net_sites/frames.html for more details on frame names. By default the URL is opened in a new window.
The body_file
is the file name of form data to be posted to the given URL (or 0 for no form data). By default, the MIME Content-Type for this form data is application/x-www-form-urlencoded, but can be changed by using the body_mimetype
field. The file will be deleted by the message recipient after it has been sent.
The WIMP message wimp_MOPENURL, number 0x4AF80, should be broadcast with the above data, with an event code of wimp_ESENDWANTACK.
When an application receives the about WIMP message it should first determine where the URL is stored by testing the length of the string in event_data.data.url
. If this is non-zero it should use the immediate string otherwise it should use the indirected strings. The application should examine the string and determine whether it can service the request. If it can service the request it should acknowledge the WIMP message before it next polls the WIMP manager.
If it can not service the request it should simply ignore the message.
In the indirected case the application should also check the size of the message block to see which fields in the indirect block are valid. Older applications (such as those in the ANT Internet Suite release I) will broadcast the indirect request with only the tag and url fields. In this case the message will be 28 bytes long.
Note that for maximum compatibility with older receiving applications the indirected URL field should always point into the RMA or a dynamic area as otherwise an older application will attempt to interpret the 'offset' form as a direct pointer and read from zero page which may cause a data abort.
New applications should allow for the URL being in offset or direct pointer form however for maximum flexibility.
If the requesting application receives a 'bounced' version of the WIMP message it should try to start an application to open the URL. It does so by issuing a Wimp_StartTask SWI with the command:
If this raises an error the appliaction should notify the user that the URL could not be followed.
If no 'bounce' is received then the application should assume that the URL has been opened by some other application.
This message may be sent or handled by a number of applications. A WWW browser will send the message when the user tries to follow a link with a method that is not supported internally to the browser. The browser may also respond to the message when the method is 'http', 'https', 'ftp' or 'gopher'.
eg, ANT !Fresco ®. An email or news application should examine URLs and respond to those that have a method of 'mailto', 'news' or 'nntp'. eg, ANT !Marcel ®. This application may also allow the user to menu over the body of a mail or news item, try to pick out a fragment of text below the pointer that looks like a URL, and broadcast a request made from this. An FTP client should detect requests with a method of 'ftp' and service them accordingly. Note that URL methods (or 'schemes') are not case sensitive, and so both 'HTTP://www.ant.co.uk/' and 'http://www.ant.co.uk/' are valid.
Applications should, as well as accepting the WIMP message, provide a startup option that allows a URL to be specified on the command line.
They should then set appropriate aliases to start the application when a URL of a known scheme is found. Thus a WWW browser should have in its !Boot file a line such as:
URLs for files on RISCOS filing systems (for example, ADFS, SCSI, NFS, etc), the file:/
scheme should be used. The mapping between RISCOS path names and URLs is very simple:
So for example:
To launch a WIMP message like this from a BASIC application:
Note that this simple example only launches a direct URL of up to 235 characters, and doesn't cope with that message being bounced (and so falling back to the *URLOpen_http
command). A complete example URL-launcher program can be found at URL launcher.
Please contact me if you have corrections, or questions relating to this document.
Last edit: 10th Apr 2016 at 1:55pm |
| Viewed 9108 times since 12th May 2006, |
| ||||||||||||||||||||||||
![]() ![]() | ![]() ![]() |