Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: w32std.h
Link against: ws32.lib

Class RWsSpriteBase

RWsSpriteBase

Support

Supported from 5.0

Description

Sprite base class.

Derivation

MWsClientClassBase class for all classes whose objects are clients of the window server engine
RWsSpriteBaseSprite base class

Defined in RWsSpriteBase:
Activate(), AppendMember(), Close(), RWsSpriteBase(), UpdateMember()

Inherited from MWsClientClass:
WsHandle()

Notes:

See also:


Construction and destruction


RWsSpriteBase()

protected: RWsSpriteBase();

Description

Protected constructor.

The existence of this protected constructor prevents objects of this type being directly created.


RWsSpriteBase()

protected: RWsSpriteBase(RWsSession& aWs);

Description

Protected constructor with window server session.

The existence of this protected constructor prevents objects of this type being directly created.

Parameters

RWsSession& aWs

The window server session owning the sprite.


Activate()

TInt Activate();

Description

Activates the sprite or pointer cursor.

Sprites are displayed on the screen when they are activated; pointer cursors are not displayed until they are set into a window using either RWindowTreeNode::SetCustomPointerCursor() or RWindowTreeNode::SetPointerCursor().

This function should not be called until the sprite or pointer cursor has been fully initialised, and its sprite members have been added.

Before it can call this function, a sprite must be fully constructed using the RWsSprite::RWsSprite(RWsSession& aWs) and RWsSprite::Construct() functions, and must have at least one sprite member. Otherwise, a panic will occur. Similarly, a pointer cursor must have at least one sprite member and must call RWsPointerCursor::RWsPointerCursor(RWsSession& aWs) and RWsPointerCursor::Construct().

Return value

TInt

KErrNone if successful, otherwise one of the system-wide error codes.


Close()

void Close();

Description

Destroys the sprite or pointer cursor in the window server, and frees client-side resources used by the sprite.

Any application which constructs an RWsSprite or RWsPointerCursor should call this function when the sprite or cursor is no longer needed.

Note that this function does not free resources used by sprite members.

[Top]


Sprite member control


AppendMember()

TInt AppendMember(const TSpriteMember& aSpriteList);

Description

Adds a sprite member to a sprite or pointer cursor.

Sprite members are displayed by the sprite in the order in which they were added to the sprite. This function can be called before and after the sprite has been activated.

Parameters

const TSpriteMember& aSpriteList

The sprite member to add

Return value

Tint

KErrNone if successful, otherwise one of the system-wide error codes.

Notes:


UpdateMember()

void UpdateMember(TInt aIndex);

Description

Updates the displayed sprite, taking into account any change to the content of the bitmaps for the specified member.

The appearance of a sprite can be changed after it has been activated by drawing to the appropriate TSpriteMember::iBitmap member, and then calling this function. Alternatively, a new sprite member can be created, containing a new bitmap, and the sprite can be updated to contain this new member by calling the following UpdateMember() overload.

Parameters

Tint aIndex

Index of the sprite member. Sprite members are indexed in the order they were added to the sprite, beginning with 0.

Notes:


UpdateMember()

TInt UpdateMember(TInt aIndex, const TSpriteMember& aMemberData);

Description

Replaces one of a sprite's TSpriteMember members.

This allows the appearance of the sprite to be modified after it has been activated.

Parameters

Tint aIndex

Index of the sprite member. Sprite members are indexed in the order they were added to the sprite, beginning with 0.

Const TSpriteMember& aMemberData

New data for the sprite member.

Return value

TInt

KErrNone if successful, otherwise one of the system-wide error codes.

Notes: