Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: w32adll.h
Link against: N/A

Class CAnimFunctions

CAnimFunctions

Support

Withdrawn in 5.1
Supported from 5.0

Description

Server side utility functions. These include functions to set the animation timings, to set the drawing rectangle, to panic the client from the server, etc.

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:

Derivation

CAnimFunctionsServer side utility functions
CBaseBase class for all classes to be instantiated on the heap
CObjectImplements reference counting to track concurrent references to itself

Defined in CAnimFunctions:
Animate(), Client(), CloseFont(), DuplicateBitmapL(), DuplicateFontL(), ESyncDay, ESyncFlash, ESyncMinute, ESyncNone, ESyncSecond, FlashStateOn(), Invalidate(), IsHidden(), Panic(), ScreenDevice(), SetInterval(), SetNextInterval(), SetRect(), SetSync(), SetVisible(), Sync(), SystemTime(), TAnimSync, WindowSize(), void ActivateGc()

Inherited from CBase:
operator new()

Inherited from CObject:
AccessCount(), Close(), Dec(), FullName(), Inc(), Name(), Open(), Owner(), SetName(), SetNameL(), SetOwner(), UniqueID()


Member functions


void ActivateGc()

void ActivateGc();

Description

Activate graphics context. This function should be called to enable drawing in the CAnim derived classes’ Command(), Animate(), or FocusChanged() functions.

Note:


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.


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.


CloseFont()

void CloseFont(CFbsFont *);

Description

Close a duplicate font.

Parameters

CFbsFont *

Pointer to the duplicate font.

See also:


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.

Parameters

TInt aHandle

A handle to the font to be duplicated.

Return value

CFbsFont*

A pointer to the duplicate font.


FlashStateOn()

TBool FlashStateOn() const;

Description

Tests the flash cycle state. The flash cycle has 2 states — on or off.

Return value

TBool

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


Invalidate()

void Invalidate(const TRect& aRect);

Description

Forces redraw of a rectangular part of the window. The function causes a redraw message on the part of the window specified, which provides a non-immediate way to do drawing.

It can be used to redraw the whole of the window, not just the part used by the animation.

Parameters

const TRect& aRect

The rectangle to be re-drawn.


IsHidden()

TBool IsHidden();

Description

Tests whether to draw the animation.

If the window is completely hidden/obscured there is normally no need to draw the animation. However in some conditions the animation should be drawn even if it is obscured. The window server is aware of these cases, and returns ETrue if it is safe to NOT draw the animation.

Return value

TBool

True if the window is completely hidden AND there is no requirement to continue drawing the animation, otherwise false.


Panic()

void Panic();

Description

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


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.


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:


SetRect()

void SetRect(const TRect &aRect);

Description

Sets the rectangle that this instance wants to draw to.

This function must be called as part of the initialisation/construction of the CAnim derived object, i.e. in CAnim::ConstructL(). This is so that the window server knows which area the animation is operating in.

Parameters

const TRect &aRect

The rectangle to be drawn to.


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.


SetVisible()

void SetVisible(TBool aState);

Description

Sets the visibility of the window the animation is drawing to. This does the same as RWindowBase::SetVisible().

Parameters

TBool aState

True for visible, false otherwise.


Sync()

TAnimSync Sync() const;

Description

Gets the current synchronisation mode.

Return value

TAnimSync

The current sync mode.

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.


WindowSize()

TSize WindowSize() const;

Description

Gets the window size.

Return value

TSize

The window size.

[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.