| !Run file for Browse
| (C) Acorn Computers Ltd. 1994
|
| Last modified: 19/02/1998

Set      Browse$Dir          <Obey$Dir>

SetMacro Browse$Path         Choices:WWW.Browse.,<Browse$Dir>.,<Wimp$ScrapDir>.WWW.Browse.,<Browse$Dir>.User.
SetMacro Browse$ChoicesFile  Browse:Choices
SetMacro Browse$ControlsFile Browse:Controls
SetMacro Browse$ChoicesSave  <Choices$Write>.WWW.Browse.Choices

| URI handler support

Set Alias$Open_URI_http   <Browse$Dir>.!Run
Set Alias$Open_URI_ftp    <Browse$Dir>.!Run
Set Alias$Open_URI_gopher <Browse$Dir>.!Run

| Can't do much if we haven't got a System or Internet resource...

If "<System$Path>"       = "" Then Set System$Path_Message System resources not found.
If "<InetDBase$Path>"    = "" Then Error Internet resources not found.
If "<Unicode$Path>"      = "" Then Error Unicode resources not found.
If "<Inet$MimeMappings>" = "" Then Set Inet$MimeMappings InetDBase:Mimemap

| For font choices, if someone else hasn't already set them up

If "<Font$Bold>"   = "" Then Set Font$Bold   "Bold Demi ExtraBold Ultra Heavy"
If "<Font$Italic>" = "" Then Set Font$Italic "Italic Oblique Slant"

| HTTP fetcher controls

Set Browse$AcceptAllCookies on
Set Browse$CookieFile       Browse:User.Cookies
Set Browse$CookieFileFormat 2

| Fundamental modules

RMEnsure WindowManager  3.98 Error Browse requires version 3.98 or later of the WindowManager ('nested WIMP') module

| Ensure specific versions of Toolbox modules (or later ones)
| are present

RMEnsure Toolbox        1.41 RMLoad System:Modules.Toolbox.Toolbox
RMEnsure Toolbox        1.41 Error Browse requires version 1.41 or later of the Toolbox module
RMEnsure IconBar        1.18 RMLoad System:Modules.Toolbox.IconBar
RMEnsure IconBar        1.18 Error Browse requires version 1.18 or later of the IconBar module
RMEnsure ProgInfo       0.14 RMLoad System:Modules.Toolbox.ProgInfo
RMEnsure ProgInfo       0.14 Error Browse requires version 0.14 or later of the ProgInfo module
RMEnsure Window         1.47 RMLoad System:Modules.Toolbox.Window
RMEnsure Window         1.47 Error Browse requires version 1.47 or later of the Window module
RMEnsure Menu           0.32 RMLoad System:Modules.Toolbox.Menu
RMEnsure Menu           0.32 Error Browse requires version 0.32 or later of the Menu module
RMEnsure ToolAction     0.15 RMLoad System:Modules.Toolbox.ToolAction
RMEnsure ToolAction     0.15 Error Browse requires version 0.15 or later of the ToolAction module
RMEnsure PrintDBox      0.14 RMLoad System:Modules.Toolbox.PrintDBox
RMEnsure PrintDBox      0.14 Error Browse requires version 0.14 or later of the PrintDBox module
RMEnsure FontMenu       0.21 RMLoad System:Modules.Toolbox.FontMenu
RMEnsure FontMenu       0.21 Error Browse requires version 0.21 or later of the FontMenu module

| Important networking modules

RMEnsure URL_Fetcher    0.32 RMLoad System:Modules.Network.URL.URL
RMEnsure URL_Fetcher    0.32 Error Browse requires version 0.32 or later of the URL module
RMEnsure AcornHTTP      0.75 RMLoad System:Modules.Network.URL.HTTP
RMEnsure AcornHTTP      0.75 Error Browse requires version 0.75 or later of the HTTP module
RMEnsure FileFetcher    0.38 RMLoad System:Modules.Network.URL.File
RMEnsure FileFetcher    0.38 Error Browse requires version 0.38 or later of the File module
RMEnsure FTPFetcher     0.27 RMLoad System:Modules.Network.URL.FTP
RMEnsure FTPFetcher     0.27 Error Browse requires version 0.27 or later of the FTP module
RMEnsure GopherFetcher  0.10 RMLoad SysteM:Modules.Network.URL.Gopher
RMEnsure GopherFetcher  0.10 Error Browse requires version 0.10 or later of the Gopher module

RMEnsure MimeMap        0.05 RMLoad System:Modules.Network.MimeMap
RMEnsure MimeMap        0.05 Error Browse requires version 0.05 or later of the MimeMap module

| The URI handler for mailto:

RMEnsure AcornURI       0.12 RMLoad System:Modules.Network.URI

| The URI handler has a Wimp task side, so want to do a
| '*Desktop' when inside the application after Wimp_Initialise
| to start it. Set a system variable if this is NOT needed.

Set Browse$IssueDesktopCommand "yes"
RMEnsure AcornURI 0.12 Set Browse$IssueDesktopCommand "no"

| JPEG support for OS versions without this in SpriteExtend;
| again, not technically essential so let this fail too.

RMEnsure SpriteExtend 0.99 RMEnsure JPEGMsgs   0.00 RMLoad System:Modules.JPEGMsgs
RMEnsure SpriteExtend 0.99 RMEnsure JPEGRender 0.00 RMLoad System:Modules.JPEGRender

| Routine actions...

IconSprites <Browse$Dir>.!Sprites

Set File$Type_FAF HTML
Set File$Type_F91 URI
Set File$Type_695 GIF
Set File$Type_C85 JPEG
Set File$Type_B60 PNG

Set Alias$@RunType_FAF /<Browse$Dir>.!Run -html %%*0
Set Alias$@RunType_F91 /<Browse$Dir>.!Run -uri %%*0

| Set the slot size and run the application. RISC OS 3 versions
| prior to RISC OS 3.5 need more memory allocated initially.

WimpSlot -Min 672K -Max 672K

If "<Boot$OSVersion>"="300" Then WimpSlot -Min 800K -Max 800K
If "<Boot$OSVersion>"="310" Then WimpSlot -Min 800K -Max 800K
If "<Boot$OSVersion>"="311" Then WimpSlot -Min 800K -Max 800K

Run <Browse$Dir>.!RunImage %*0
