This API defines a framework for polymorphic DLLs that perform animations. These animation DLLs plug in to the Window Server, and so are run in the Window Server's high-priority thread, rather than the application thread.
The Window Server Client-Side API defines base classes for client interfaces that applications use to control animation DLLs. Providers of animation DLLs specialise these client interfaces appropriately.
The API has four key concepts: animation factory, animation base class, window animation base class, and sprite animation base class.
Each animation DLL must define a factory for the animations it provides. The DLL must export at ordinal 1 a function to create an instance of this factory class.
The base class for such factories is
CAnimDll
.
Every animation implements an interface that is called by the window server to:
pass commands from clients
perform a step in the animation
pass window server events (if required), so that the animation can handle them before the application
This interface is CAnim
, with its base class
MEventHandler
. The operation to perform an animation step
is called by the window server on a timer: the animation is informed if for any
reason timer events are missed or become out of sync. The timing properties are
set through an MAnimGeneralFunctions
member (an abstract
interface that is implemented by the window server). This also provides other
utility functions.
For animations other than sprites, animation providers derive
classes from the window animation base class, CWindowAnim
,
based on CAnim
. This adds access to an interface for
querying and manipulating the window in which the animation takes place,
MAnimWindowFunctions
.
A further specialised base class allows animations to be provided
that implement their own animation timers. This is
CFreeTimerWindowAnim
, based on
CWindowAnim
, with related utility functions provided by
MAnimFreeTimerWindowFunctions
.
Sprites are bitmaps that can overlay a window. A sprite animation
can be provided by deriving a class from CSpriteAnim
,
based on CAnim
. This adds access to an interface for
querying and manipulating a sprite,
MAnimSpriteFunctions
.