[as-devel] Themes policy
Sasha_Vasko@osca.state.mo.us
Tue, 17 Aug 1999 17:02:20 -0500
I've been giving some thoughts to the matter of making theme support in
AS as easy as possible and here is what I've come to:
1. Overview.
1.1. Everything theme related is located in two files: look and asetroot.
In addition to that there is *PagerDeskStyle setting in pager,
which is complicating things a bit.
1.2. Another moment is that pixmaps in the style definitions and background
definitions
could be located anywhere on the disk. As it is problematic to put those
pixmaps in exactly the same location - some steps needs to be taken
in order to prevent problems. The easiest thing from user standpoint would be to
have dedicated dir for theme pixmaps and have theme handler convert file
names to refer to this dir.
1.3. Some cleanup mechanism needs to be put into place to prevent had drive
littering with files from old themes.
1.4. To make theme installation as easy as possible for user, it's a good idea
to
have dedicated dir where theme tarball could be unpacked, so we don't have to
ask
questions where user want us to unpak it to.
1.5. Another dedicated dir is needed to store all downloaded themes tarballs,
so it gets included in start menu , similar to looks and feels.
We have a fine mess on our hands and here is the proposed way to sort it out :
2. Preparations. ( Changes to AfterStep )
2.1. Make Pager use "*PagerDesk#" MyStyle definitions by default. If user
wishes to override it - he could still use *PagerDeskStyle in pager file.
That allows us to completely exclude pager from theme making/using.
2.2. It is proposed to add non-configurable/theme subdir. When theme is
installed
it is atarred in to this dir. It will then hold all MyStyle pixmaps. Afterstep
will
check this dir for pixmaps and icons , prior to searching PixmapPath and
IconPath.
look and background images can be copied from there into non-configurable by
theme
handler and asetroot copied into ~/G/L/A.
2.3. When new theme is being unpacked - n-c/theme dir must be cleaned off
anything
it had before.
2.4. ~/G/L/A/themes subdir needs to be added, so user can place his/her theme
tarballs
in there, Start menu code needs to be changed to be able to pick up files in
that dir
and add them as items in Startmenu. When user selects appropriet item - AS
should
launch theme handler with this theme filename as parameter.
2.5 Menu item needs to be added to run theme handler to create new theme. It is
proposed
that new theme be created with generic name of [theme] and placed in /tmp dir,
so user
can rename it and move it to anywhere he wishes to.
3. Theme handler algorithm.
3.1. Creating the theme.
3.1.1. Theme handler starts with no parameters.
3.1.2. Theme handler creates /tmp/newtheme.afterstep dir ,
or cleans it up if it's already there.
3.1.3. Theme handler reads look file, in memory trims path off all the
filenames
and saves data in /tmp/newtheme.afterstep/look file
3.1.4. Theme handler reads asetroot file, removes all the background records
that are not
currently loaded, trimms path off the filenames and saves
it all in /tmp/newtheme.afterstep/asetroot file.
3.1.5. Theme handler copies all the image files
found in step 3 and 4 into /tmp/newtheme.afterstep dir.
3.1.6. Theme handler copies README and SCREENSHOT.jpg files from ~/G/L/A
to /tmp/newtheme.afterstep (if any found).
3.1.7. Theme handler tars/zips it all up into /tmp/theme file.
/tmp/newtheme.afterstep/ gets removed afterwards.
If user wants to do some custom steps - he can always untarr the tarball.
3.2. Installing the theme
3.2.1. Theme handler starts with single parameter - theme file name.
3.2.2. Theme handler rm everything from non-configurable/theme or creates that
dir.
3.2.3. Theme handler untars theme file in /non-configurable/theme.
3.2.4. Theme handler copies:
look file in n-c/look.#bpp,
asetroot file in ~/G/L/A/asetroot
every N_background file into non-configurable.
3.2.5. Theme handler restarts asetroot module if it's residently loaded,
3.2.6. Theme handler sneds message to update look and background to Afterstep.
4. PS
4.1. It's proposed to write theme handler in C as AS module and use config
parser to read
look and asetroot files and to write them back (on theme creation step).
4.2. It's possible to integrate support for current theme format if that will be
desired by users,
without drastic changes to proposed algorithm. ( Instead of copying look and
asetroot files
theme file will be parsed, and wrote into valid look and asetroot files).
Cheers
Sasha