#include <w32adll.h>
class CAnim : public CBase |
Protected Attributes | |
---|---|
MAnimGeneralFunctions * | iFunctions |
Public Member Functions | |
---|---|
pure virtual void | Animate(TDateTime *) |
pure virtual void | Command(TInt, TAny *) |
pure virtual TInt | CommandReplyL(TInt, TAny *) |
virtual void | HandleNotification(const TWsEvent &) |
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 functions are all pure virtual, and must be implemented 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.
You should derive from CWindowAnim, CFreeTimerWindowAnim or CSpriteAnim, depending on whether the animation is to draw to a sprite or a window, rather than directly from this class.
The derived class is constructed in the DLL factory class CAnimDll::CreateInstanceL() function.
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.
MAnimGeneralFunctions * | iFunctions | [protected] |
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.
void | Animate | ( | TDateTime * | aDateTime | ) | [pure virtual] |
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 sync 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 sync 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 sync interval. For example if the last call was at time 't' and the sync 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.
Parameter | Description |
---|---|
aDateTime | Null if the current time w.r.t. the window server matches the time implied by the synch period. Otherwise a valid (non-normalised) time. |
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.
See also: RAnim
Parameter | Description |
---|---|
aOpcode | Opcode understood by the class |
aArgs | Arguments packaged on the client side, for example as a struct of a type determined by the aOpcode argument. These mirror the aArgs argument passed in to RAnim::Command(). |
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.
See also: RAnim
Parameter | Description |
---|---|
aOpcode | Opcode understood by the class. |
aArgs | Arguments packaged on the client side, for example as a struct of a type determined by the aOpcode argument. These mirror the aArgs argument passed in to RAnim::CommandReply(). |
Returns: Value passed back to client side function when this function completes. Typically this would be KErrNone or another of the system-wide error codes. However any value may be returned to the client side.