Location:
w32adll.h
Link against: N/A
CAnim
Supported from 5.0
Server side animated object base interface.
Animations implement this interface, which is called by the window server to pass commands from clients, perform a step in the animation, or to pass window server events (if required) — so that the animation can handle them before the application.
The class functions are all pure virtual, and must be implemented
by the user in the derived class to provide server side behaviour. The
functions will be called by the window server with optional arguments passed in
from the client side animation class RAnim
.
ER5 developer's should derive animation classes directly
from this class. Developers for releases after ER5, should derive from CWindowAnim
,
CFreeTimerWindowAnim
or CSpriteAnim
—
depending on whether the animation is to draw to a sprite or a window.
The derived class is constructed in the DLL factory class
CAnimDll::CreateInstanceL()
function, as explained in its
description.
The operation to perform an animation step is called by the window
server on a timer. The timing properties are set through an
MAnimGeneralFunctions
member, which also provides other utility
functions. In ER5, the timer and utility functions are accessed via the
CAnimFunctions
member.
|
Defined in CAnim
:
Animate()
, Command()
, CommandReplyL()
, ConstructL()
, FocusChanged()
, Redraw()
, iFunctions
, iGc
Inherited from CBase
:
operator new()
Inherited from MEventHandler
:
OfferRawEvent()
virtual void ConstructL(TAny* aArgs, TBool aHasFocus)=0;
Withdrawn in 5.1
Server side construction and initialisation of an animation class.
Implementations of this function should call
CAnimFunctions::SetRect()
or
MAnimWindowFunctions::SetRect()
to inform the window server of the
area in which the animation will be operating.
Note:
The aHasFocus
argument allows the animation to
start in a known focus state. For example, an animation may or may not have
focus, depending on how it was started. Together with the
FocusChanged()
function this allows an animation to always know
its focus state.
Post ER5, animations are not derived from
CAnim
, but from its derived classes: CSpriteAnim
,
CWindowAnim
, CFreeTimerWindowAnim
. As a result, the
responsibility for the construction of animation objects, and hence this
function, have been moved to the derived classes.
|
virtual void Animate(TDateTime* aDateTime)=0;
Main animation function — called by the window server.
The drawing code which implements a given animation should be provided here.
This function is called at a frequency determined by the
SetSync()
helper function. Note that if synch is not set, then
this function will never be called. This effect can be exploited to use the
animation framework — with its server side speed —
for what are strictly not animations, e.g. for streaming video images.
The aDateTime
parameter will be null if the current
time (as determined by the window server) matches the time implied by the synch
period, modulo normalisation, otherwise it will contain a valid
(non-normalised) time.
Normalisation is to some specified granularity, for example if one minute is specified as the animation frequency, then in effect the window server will decide whether the implied time is correct to the minute, but not to the second.
Implied time is the time implied by the (normalised) actual time
of the previous animation call plus the synch interval. For example if the last
call was at time 't' and the synch interval is 1 second then if
the time at this call is t + 1 second, then actual time and implied time match
and the value placed into aDateTime
will be NULL.
Cases in which the two may not match include, for example, system
time having been reset between animation calls (perhaps British Summer Time or
other daylight saving time has just come into effect). The intention is that
when system time changes, a mechanism is provided to alert the animation code
and allow it to reset itself. The assumption is that somewhere in its
initialisation code, the animation will have performed a
CAnimFunctions
utility call to set a base time, which is then
implicitly tracked by incrementing by a suitable interval; when
aDateTime
is non-NULL after a call to Animate()
, base
time should be reset.
|
virtual void Command(TInt aOpcode, TAny *aArgs)=0;
Implements client-side initiated commands.
The window server calls this function in response to application
calls to the client side command function RAnim::Command()
. The
arguments passed to the function by the window server are the same as were used
on the client side function call.
Because this function does not return errors, it is not safe for commands which might leave.
|
virtual TInt CommandReplyL(TInt aOpcode, TAny *aArgs)=0;
Implements client-side initiated commands, returning a value.
The window server calls this function in response to application
calls to the client side command function RAnim::CommandReplyL()
.
The arguments passed to the function by the window server are the same as were
used on the client side function call.
This function returns values to the client side, and should be used to return error codes for commands which might leave.
|
|
virtual void FocusChanged(TBool aState)=0;
Withdrawn in 5.1
Notifies change of focus.
The function is called by the window server to notify a change of focus — allowing the animation code to track whether it does or does not have focus.
Note:
After ER5 this function moved to the derived class
CWindowAnim
.
|
virtual void Redraw()=0;
Withdrawn in 5.1
Redraws the object.
The function is called by the window server when it needs to redraw the object — the object must provide all the low level drawing code.
Note:
After ER5 this function moved to the derived class
CWindowAnim
.
These data members point to a graphics context and utility functions maintained by the server. They are automatically pointed to the correct location, by the animation framework, when this object is created.
CAnimFunctions* iFunctions
Withdrawn in 5.1
Pointer to a class containing functions implemented by the window server.
These are available to any CAnim
derived class.
Note that this value is automatically set for you by the animation framework — you do not need to assign a value to this pointer.
CAnimGc* iGc
Withdrawn in 5.1
Pointer to the graphics context.
Note that this value is automatically set for you by the animation framework — you do not need to assign a value to this pointer.
MAnimGeneralFunctions* iFunctions
Supported from 5.1
Pointer to a class containing functions implemented by the window server.
These are available to any CAnim
derived class.
Note that this value is automatically set for you by the animation framework — you do not need to assign a value to this pointer.