Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: w32adll.h
Link against: N/A

Class MAnimGeneralFunctions

MAnimGeneralFunctions

Support

Supported from 5.1

Description

General animation utility functions interface. The interface provides functions to set the animation timing, event functions, and other general functions.

You do NOT have to create an object of this type. The class is implemented by the window server, and provides utility functions to all CAnim derived classes via the CAnim::iFunctions pointer.

It is not intended for user derivation.

Note:

Defined in MAnimGeneralFunctions:
Animate(), Client(), CloseFont(), DuplicateBitmapL(), DuplicateFontL(), ESyncDay, ESyncFlash, ESyncMinute, ESyncNone, ESyncSecond, FlashStateOn(), GetRawEvents(), Panic(), PostKeyEvent(), PostRawEvent(), ScreenDevice(), SetInterval(), SetNextInterval(), SetSync(), Sync(), SystemTime(), TAnimSync


Timing functions


Animate()

void Animate(TDateTime *aDateTime);

Description

Calls the DLL's Animate() function then deactivates the graphics context. This allows users to do drawing from their own active object.

Note:

Parameters

TDateTime *aDateTime

The parameter passed into the animation DLL’s Animate() function.


SetSync()

void SetSync(TAnimSync aSyncMode);

Description

Sets the synchronisation mode. This determines the time intervals between calls to the Animate() function.

Parameters

TAnimSync aSyncMode

The synchronisation mode.


SetInterval()

void SetInterval(TInt aInterval);

Description

Sets the repeat interval.

If the synchronisation mode is TAnimSync::ESyncNone, then the Animate() function is called at intervals defined by some number of flash ticks. There are two flash ticks a second, with a 7/12 second — 5/12 second cycle. If the function is called when the synchronisation mode is not TAnimSync::ESyncNone, then the window server panics the client.

If the new interval is greater than the current countdown, then the call does not affect the current countdown. For example, if the countdown has 10 flash ticks remaining, and the interval is set to 20, the new interval does not apply until the current countdown is complete.

However if the new interval is less the current countdown, then the new interval applies immediately i.e. the countdown is reset to the interval value.

If the interval is set to zero the countdown stops, and the Animate() function is no longer called.

Parameters

TInt aInterval

The number of flash ticks between calls to the Animate() function.


SetNextInterval()

void SetNextInterval(TInt aInterval);

Description

Sets the next interval.

This function immediately resets the current countdown to the specified number of flash ticks, irrespective of its current value. After the countdown expires the interval returns to its usual rate — note that this may be zero (i.e. not at all).

To call this function the synchronisation mode must be TAnimSync::ESyncNone — otherwise the window server panics the client.

Note:

Parameters

TInt aInterval

The interval to the next Animate(). If the value is less than 1 it automatically gets set to 1.

See also:


SystemTime()

TDateTime SystemTime() const;

Description

Gets the system time as it was when Animate() was last called.

Return value

TDateTime

The system time when Animate() was last called.


FlashStateOn()

TBool FlashStateOn() const;

Description

Tests the flash cycle state. The flash cycle has 2 states — on (7/12 second) or off (5/12 second).

Return value

TBool

ETrue if in the on part of the flash cycle, otherwise EFalse.


Sync()

TAnimSync Sync() const;

Description

Gets the current synchronisation mode.

Return value

TAnimSync

The current sync mode.

[Top]


General functions


ScreenDevice()

const CFbsScreenDevice* ScreenDevice();

Description

Gets a pointer to the screen device. This might be used, for example, to gain access to twix to pixel conversion functions.

Return value

CFbsScreenDevice*

A pointer to the screen device.


DuplicateBitmapL()

CFbsBitmap* DuplicateBitmapL(TInt aHandle);

Description

Creates and duplicates a bitmap from a handle. This function might be used to duplicate client side bitmaps on the server side — actually to provide a handle to the same bitmap in the font and bitmap server as the client.

Parameters

TInt aHandle

A handle to the bitmap to be duplicated.

Return value

CFbsBitmap*

A pointer to the duplicate bitmap.


DuplicateFontL()

CFbsFont* DuplicateFontL(TInt aHandle);

Description

Creates and duplicates a font from a handle. This function might be used to duplicate client side fonts on the server side — actually to provide a handle to the same font in the font and bitmap server as the client.

Parameters

TInt aHandle

A handle to the font to be duplicated.

Return value

CFbsFont*

A pointer to the duplicate font.


CloseFont()

void CloseFont(CFbsFont *);

Description

Close a duplicate font.

Parameters

CFbsFont *

Pointer to the duplicate font.

See also:


Client()

const RThread& Client();

Description

Gets a reference to the calling client's thread.

Return value

RThread&

A reference to the calling client’s thread.


Panic()

void Panic();

Description

Panics the client. This will result in the client thread being destroyed.

[Top]


Event functions


GetRawEvents()

void GetRawEvents(TBool aGetEvents) const;    

Description

Switches animation raw event handling on and off. If raw event handling is switched on, then raw events, e.g. pen events, key presses, power events etc., are all offered to the animation event handling code — MEventHandler::OfferRawEventL().

Parameters

TBool aGetEvents

If ETrue, subsequent raw events are passed to the animation event handling code. If EFalse, events are not passed to the animation.


PostRawEvent()

void PostRawEvent(const TRawEvent &aRawEvent) const;    

Description

Posts a raw event, just as if it had come from the kernel.

Parameters

const TRawEvent &aRawEvent

The raw event


PostKeyEvent()

void PostKeyEvent(const TRawEvent &aRawEvent) const;    

Support

Withdrawn in 6.0

Description

Posts a key event. The function is similar to PostRawEvent() but should be used for posting key events.

The function was superseded by the following function after ER5u. This was because TRawEvent does not allow the modifier states for the key event to be specified.

Parameters

const TRawEvent& aRawEvent

The key event.


PostKeyEvent()

void PostKeyEvent(const TKeyEvent& aRawEvent) const;

Support

Supported from 6.0

Description

Posts a key event. The function is similar to PostRawEvent() but should be used for posting key events.

Parameters

const TKeyEvent& aRawEvent

The key event.

[Top]


Enumerations


Enum TAnimSync

TAnimSync

Description

Animation synchronisation flags. The animation can be synchronised to any of the below, the Animate() call will take place at the start of the new unit (day, hour, etc...).

ESyncNone

Not synchronised. Animate() is called after some number of flash cycles — set by SetSync().

ESyncFlash

Animate() every flash tick. This occurs twice a second, on the second and after 7/12ths of a second, e.g. the function is called in a flash-on (7/12 seconds) — flash-off (5/12 seconds) cycle.

ESyncSecond

Animate() called as soon after every second as system activity allows.

ESyncMinute

Animate() called as soon after every minute as system activity allows.

ESyncDay

Animate() called as soon after midnight every day as system activity allows.