Purpose
-------

To reside in !Boot.Resources and contain sets of sprites for differing desktop styles.
Is invoked on booting to try to locate and load the resources for that style, or quit 
leaving the ROM defaults if something goes wrong.

Structure
---------

!ThemeDefs.!Run                   Obey
          .!RunImage              BASIC
          .!Sprites               Sprite
          .Messages               Text
          .Themes.ThemeName1.Banner      [optional]
                            .Sprites     [optional]
                            .Sprites11   [may exist if Sprites does]
                            .Sprites22   [may exist if Sprites does]
                            .Tools       [optional]
                            .SDFSFiler   [optional]
                            .SCSIFiler   [optional]
                            .Paint       [optional]
                            .Paint22     [may exist if Paint does]
                            .Draw        [optional]
                            .Draw22      [may exist if Draw does]
                 .ThemeName2             } 
                  :        :             } Repeated for all installed themes
                 .ThemeNameN             }

Icon theme
----------

Wimp$IconTheme will be set on loading the Wimp based on the UserIF active at the time
the module was assembled, hence matching the ROM sprites.

In versions of the Wimp prior to this being preset it may also be set in the boot sequence in
  Choices:Boot.PreDesktop
in the absence of any user choice at this stage it is assumed that the default will simply be 
to match the contemporary ROM sprites. ie.

  RISC OS 3.50-3.71 => Morris4
  RISC OS 4.01-4.04 => Ursula (very similar to RISC OS Ltd icons, but avoiding copyright)
  RISC OS 5.00-5.18 => Iyonix (or Sovereign, which is similar bar blue jellybean branding)
  RISC OS 5.19+     => set by Wimp

and that it is at least defined.

The user's choice (set by a not-yet-written theme setup plugin for !Configure) is stored in
  Choices:Boot.PreDesk.ThemeSetup
alongside all the other plugin settings obey files. 

If the plugin settings defined ThemeDefs$Disabled no action will be taken, this is to allow
a theme to have been defined but to skip loading the extra theme resources (for example, if 
memory is tight).

The !ThemeDefs application does not set Wimp$IconTheme itself, because it resides in
  Boot:Resources
which is read only on a network boot system. The system administrator would set which themes are
available to network users, and the user's (writeable) choices would go into Choices$Write.

Action
------

Note the !ThemeDefs application is run in PreDesktop so that the resources can be
registered before the desktop starts (for example, the desktop banner) and so that the
various module tasks get the correct sprite heights when calculating how big things are.

Any application sprites encountered prior to this may be for the wrong theme. This should
be limited to (in order of appearance)
  !System
  !Territory
though !System is retouched by the Filer_Boot of everything in BootResources: and !Territory
by opening the directory viewer.

The Wimp sprite precedence CMOS bit is inspected. If RAM precedence then the theme sprites
will be *ICONSPRITES'd or *TOOLSPRITES'd as appropriate, if ROM precedence then the theme
sprites will be put in ResourceFS for the Wimp to use directly.
The actual *ICONSPRITES or *TOOLSPRITES command is deferred until the desktop is entered
by passing the chosen theme's path via two system variables ThemeDefs$ToBeIcons for the
sprites and ThemeDefs$ToBeTools for the tools. This must be done because the Wimp 
selects the resolution based on the current mode, the *WIMPMODE command is set in
  Choices:Boot.Configure
and doesn't take effect until *DESKTOP is executed, so the wrong resolution would be
selected.

The version of the Desktop module is inspected, post 2.70 supports squashed sprites and
unfortunately no longer loads unsquashed sprites. Therefore if there are desktop banner
sprites provided these will be compressed where necessary.

The version of the TaskManager module is inspected, prior to 1.19 uses the 'switcher'
sprite in both its info box, the Wimp's error boxes, and for the icon in the bottom 
right hand corner of the screen. If theme sprites are being loaded this module will
also be patched to use the alternate 'taskmanager' sprite name.

A check for dynamic areas is made, where not available a module is inserted into RMA 
containing the resources instead. 

Other theme items
-----------------

The backdrop and font might also be considered part of a theme, it is assumed that these 
might be rolled into the same not-yet-written theme setup plugin but continue to
write to the same 
  Choices:Boot.Tasks.PinSetup
  Choices:Boot.PreDesk.FontSetup
as presently for backwards compatibility.

Plugin operation
----------------
Scan !ThemeDefs.Themes for the names of the themes available.
Offer these to the user.
 => user selects one
 => this writes Wimp$IconTheme to Choices:Boot.PreDesk.ThemeSetup
Option to disable loading of theme (eg. to save memory)
 => this sets ThemeDefs$Disabled as true in Choices:Boot.PreDesk.ThemeSetup
Importing/exporting themes
 => suggest rolling them up into a squash file for export
 => allow 3rd party themes to be dropped onto the plugin & merged
How to redo disc based application icons
 => send fake Message_SaveDesktop to the Filer
 => this gets the list of 'seen' applications (as Filer_Boot commands)
 => might be useful?
