| !Run file for Browse
| (C) Tematic 2006
|
| Last modified: 02/03/2006

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

| Support the ANT URL protocol

SetMacro Alias$URLOpen_HTTP   Run <Browse$Dir>.!Run -url %%*0
SetMacro Alias$URLOpen_Gopher Run <Browse$Dir>.!Run -url %%*0
SetMacro Alias$URLOpen_File   Run <Browse$Dir>.!Run -url %%*0
SetMacro Alias$URLOpen_FTP    Run <Browse$Dir>.!Run -url %%*0

| Can't do much if we haven't got various key system resources...

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 off
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

| Toolbox modules

<Browse$Dir>.RMTry -app Browse -name Toolbox      -version 1.43 -path System:Modules.Toolbox.Toolbox
<Browse$Dir>.RMTry -app Browse -name IconBar      -version 1.18 -path System:Modules.Toolbox.IconBar
<Browse$Dir>.RMTry -app Browse -name ProgInfo     -version 0.14 -path System:Modules.Toolbox.ProgInfo
<Browse$Dir>.RMTry -app Browse -name Window       -version 1.54 -path System:Modules.Toolbox.Window
<Browse$Dir>.RMTry -app Browse -name Menu         -version 0.33 -path System:Modules.Toolbox.Menu
<Browse$Dir>.RMTry -app Browse -name ToolAction   -version 0.15 -path System:Modules.Toolbox.ToolAction
<Browse$Dir>.RMTry -app Browse -name PrintDBox    -version 0.14 -path System:Modules.Toolbox.PrintDBox
<Browse$Dir>.RMTry -app Browse -name FontMenu     -version 0.21 -path System:Modules.Toolbox.FontMenu
<Browse$Dir>.RMTry -app Browse -name TextGadgets  -version 0.28 -path System:Modules.Toolbox.TextGadget
                                                    
| Fetchers
                                                    
<Browse$Dir>.RMTry -app Browse -name URL_Fetcher  -version 0.41 -path System:Modules.Network.URL.URL
<Browse$Dir>.RMTry -app Browse -name AcornHTTP    -version 0.84 -path System:Modules.Network.URL.AcornHTTP
<Browse$Dir>.RMTry -app Browse -name FileFetcher  -version 0.38 -path System:Modules.Network.URL.File
<Browse$Dir>.RMTry -app Browse -name FTPFetcher   -version 0.32 -path System:Modules.Network.URL.FTP

| Other networking modules

<Browse$Dir>.RMTry -app Browse -name MimeMap      -version 0.05 -path System:Modules.Network.MimeMap

| General support modules

<Browse$Dir>.RMTry -app Browse -name DragAnObject -version 0.09 -path System:Modules.DragAnObj

| Try to get a new enough version of the URI handler. The module
| is not required, but its services will be used if available.

<Browse$Dir>.RMTry -silent -app Browse -name AcornURI -version 0.12 -path System:Modules.Network.URI

| The URI handler has a Wimp task side, so we 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.

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...

Set Browse$Sprites "<Browse$Dir>.!Sprites"
IconSprites <Browse$Sprites>

Set File$Type_FAF HTML
Set File$Type_F91 URI
Set File$Type_F81 JSScript
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 Alias$@RunType_F81 /<Browse$Dir>.!Run -jss %%*0

| Set the slot size and run the application.

WimpSlot -Min 1280K -Max 1280K
Run <Browse$Dir>.!RunImage %*0
