It's been a while since I worked on this, but I didn't feel right about
releasing it without docs, so here goes.

AlegSkin
An Allegro Add-On
By Andy Clifton

AlegSkin is an add-on for the Allegro programming library that lets you "skin"
Allegro's GUI. The default GUI has an GEM-ish monochorme look to it, nice
if you like retrocomputing. If you want something more modern, AlegSkin can
help. Basically, AlegSkin is a modifed version of guiproc.c from the Allegro
sources. The GUI code has been modified so that the controls no longer draw
themselves, instead, they call functions to draw various common graphical
elements (3d raised rectangle, 3d lowered rectangle, text, etc.). You can
easily write your own functions to draw these elements, pass them to the GUI,
and have everything come out looking cool. Here's how it works:

1. Write functions to draw stuff (look in alegsk2.h for the
   prototypes for the various functions).
2. Set the skin variables for whatever routines you want to replace to
   point to your functions, like this:

   //Tell the skin to use your function my_flat_rect() to draw flat
   //rectangles.
   skn_flat_rect = my_flat_rect;

3. Link guiproc.c with your program (if you want to use the file selector,
   link with fsel.c).
4. Replace the calls to Allegro's GUI proc routines with AlegSkin's routine's
   (most are the same with '_s' appended).
5. That's it!

Notes: In addition to the usual controls, AlegSkin provides d_winbutton_proc.
It's a button that calls a function (pointed to by dp2) when it is clicked.
I have not tested this code much, so there are probably more than a few bugs.
The file alegskin.cc is an example program that includes a few skins. I've
included a RHIDE project file, and a makefile to build the example. I haven't
tested the makefile; if it doesn't work, figure it out for yourself.

I can be reached at:
andyclifton@cs.com
http://ourworld.cs.com/andyclifton/






