Blanket, BlanketServer and the Blanket Kit are Copyright © 1997, 1998 by Duncan
Wilcox
Portions Copyright © 1996, 1997 by Hiroshi Lockheimer
Update Blanket on the Blanket page.
The headers
directory contains among others the main API header,
BlanketModule.h
, you should check that to get a feel
of the framework and for useful comments.
The library
directory contains the framework implementation source,
you can check how it works if you want. The first time you use the
framework you should open the library.proj
project file
and compile it, to generate the library used by the sample modules
and (hopefully) by your code.
The samples
directory contains two sample projects of modules
written against Blanket's C++ API. Fader is a simple module showing the use
of a preview window, while Spots is a module that takes over the desktop.
The saver
directory contains the C API documentation and template
module that Hiroshi Lockheimer had written for Saver.
It's up to you to choose the one you feel more comfortable with. Here are some details that might help you choose.
The C API is Blanket's native API (that it inherits from Saver, for compatibility), so modules written against it have more flexibility and less overhead.
However most developers are writing modules as a low profile or learning project -- maybe also in spare time. In this respect the C++ API hides some rough edges of the native API. In doing this it might of course sacrifice some power.
Additionally, the C++ API is layered on top of the C API and the C++ API sources are provided, so openness is guaranteed -- i.e. you are not getting tied up to Blanket.
The best comments are in the headers but this is an overview.
The key class is BlanketModule. This is the base class that embodies the traditional blanker in an OO way. BlanketModule handles the interfaces required to load and save settings (using BArchivable) and to provide instantiate functions for a single run of a saver, or configuration view.
Two key supporting classes are BlanketModule::Saver and BlanketModule::Config (hereinafter referred to as Saver and Config).
Saver embodies a single run of the saver in a view. Construct one to start, destruct it to stop (note contruction is done though a factory method called InstantiateSaver on BlanketModule). It also provides all the thread handling and locking and the ability to regularly call a virtual method called Tick where the actual drawing goes. Care was taken to ensure that Tick is only called after the saver view actually becomes visible and is painted, this helps a lot for the module taking over the desktop.
Config embodies a single configure in a view. Construct one to start, destruct it to stop (note contruction is done though a factory method called InstantiateConfig on BlanketModule).
NOTE! Saver objects and Config objects are independant, you can use one, or the other, or both.
DesktopSaver is a Saver class that makes a module that takes over the
desktop. The only special care you have to take to use this class is to
call inherited::Tick()
in your Tick() method, otherwise the
background won't be painted. You can also use the class' screenbitmap
BBitmap to patch the view with the original content. Note that it isn't a very
good idea to make a preview of a DesktopSaver: it's slow, it doesn't look very good and it
doesn't repaint correctly.
These are some of the known bugs or potential enhancements for the next release of the Blanket Kit.
If you have spotted a bug or want your favourite feature added, don't hesitate to contact the me, at duncan@mclink.it.
For new versions of Blanket or links to related software, check the Blanket page.
The Blanket Kit is public domain, you can do whatever you like with the library sources. I'd like to know about any cool module you develop, of course.
DUNCAN WILCOX PROVIDES THIS SOFTWARE "AS IS", WITH NO WARRANTY OF ANY KIND EITHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT WILL DUNCAN WILCOX BE LIABLE FOR ANY INDIRECT DAMAGES OR OTHER RELIEF ARISING OUT OF YOUR USE OR INABILITY TO USE THE PROGRAM INCLUDING, BY WAY OF ILLUSTRATION AND NOT LIMITATION, LOST PROFITS, LOST BUSINESS OR LOST OPPORTUNITY, OR ANY SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF SUCH USE OR INABILITY TO USE THE PROGRAM, EVEN IF DUNCAN WILCOX HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
For any comment or information request you can contact Duncan Wilcox, the author, at duncan@mclink.it.
The C API is of course work of Hiroshi Lockheimer, while the C++ API that this kit introduces is largely the work of Andy Philpotts, who I wish to thank for pushing the common module framework ideas in the right direction.
Released on January 18, 1998
Released on November 9, 1997
© Copyright Duncan Wilcox 1997, 1998