CSpriteSet Class Reference
class CSpriteSet : public CBase |
The CSpriteSet class allows a window server sprite to be drawn to a window. The class supports storage of any number of bitmap/mask pairs, though allowing only one of these bitmap/mask members to be displayed at any one time. The client of this class should provide the source bitmap/mask pairs which can be resized to fit a specified rectangle. Also provided for at runtime is the ability to draw onto the sprite as though it were a regular CWindowGc and using the same coordinate offsets as the window it exists in.
Public Member Functions |
---|
| ~CSpriteSet() |
IMPORT_C void | AddMemberL(CGulIcon *) |
IMPORT_C CSpriteSet * | NewL(RWindowTreeNode &, RWsSession &, CWsScreenDevice &, CGulIcon *, TBool) |
IMPORT_C CSpriteSet * | NewLC(RWindowTreeNode &, RWsSession &, CWsScreenDevice &, CGulIcon *, TBool) |
IMPORT_C void | PrepareSpriteForDisplayL(TInt, const TPoint &, const TSize &, TSpriteResizeMode) |
IMPORT_C void | RemoveMember(TInt) |
IMPORT_C void | SetClippingRect(const TRect &) |
IMPORT_C CWindowGc * | SpriteGc() |
IMPORT_C void | StartDisplayingSpriteL() |
IMPORT_C void | StopDisplayingSprite() |
IMPORT_C void | TranslateSpritePosition(const TPoint &) |
Private Member Functions |
---|
| CSpriteSet(TBool) |
void | AdjustSpriteSizeAccordingToResizeMode(TSize &, const TSize &, TSpriteResizeMode) |
void | ComputeInternalResizeMode(TInternalSpriteResizeMode &, TSpriteResizeMode, const TSize &, const TSize &) |
void | ConstructL(RWindowTreeNode &, RWsSession &, CWsScreenDevice &) |
void | CreateSpriteMember() |
void | RenderSprite(TInt, TInternalSpriteResizeMode, const TSize &, const TSize &) |
Constructor & Destructor Documentation
CSpriteSet(TBool)
CSpriteSet | ( | TBool | aInvertMask | ) | [private] |
Member Functions Documentation
AddMemberL(CGulIcon *)
IMPORT_C void | AddMemberL | ( | CGulIcon * | aSpriteSetMember | ) | |
Adds aSpriteSetMember to the sprite set. Panics if a null member is passed in, or if the argument does not include a bitmap and mask.
AdjustSpriteSizeAccordingToResizeMode(TSize &, const TSize &, TSpriteResizeMode)
void | AdjustSpriteSizeAccordingToResizeMode | ( | TSize & | aTargetSize, |
| const TSize & | aSourceSize, |
| TSpriteResizeMode | aSpriteResizeMode |
| ) | const [private] |
ComputeInternalResizeMode(TInternalSpriteResizeMode &, TSpriteResizeMode, const TSize &, const TSize &)
ConstructL(RWindowTreeNode &, RWsSession &, CWsScreenDevice &)
CreateSpriteMember()
void | CreateSpriteMember | ( | ) | [private] |
NewL(RWindowTreeNode &, RWsSession &, CWsScreenDevice &, CGulIcon *, TBool)
Creates and returns a pointer to a CSpriteSet object clipped to the parent aWindow. The sprite set is initialized with aSpriteSetMember and the sprite set takes ownership of this parameter. aWs is the window session used. aInvertMask specifies whether the bitmap/mask pairs which will be added will use an inverted mask.
NewLC(RWindowTreeNode &, RWsSession &, CWsScreenDevice &, CGulIcon *, TBool)
Creates and returns a pointer to a CSpriteSet object clipped to the parent aWindow. The sprite set is initialized with aSpriteSetMember and the sprite set takes ownership of this parameter. aWs is the window session used. aInvertMask specifies whether the bitmap/mask pairs which will be added will use an inverted mask. Leaves the returned pointer on the cleanup stack.
PrepareSpriteForDisplayL(TInt, const TPoint &, const TSize &, TSpriteResizeMode)
Prepares the sprite in the set of type aSpriteType to be displayed at aSpritePos with size aSpriteSize. The sprite will be resized as necessary under the restriction of aSpriteResizeMode.
RemoveMember(TInt)
IMPORT_C void | RemoveMember | ( | TInt | aSpriteSetMemberIndex | ) | |
Removes a member (indexed by aSpriteSetMemberIndex) from the array. Panics if the member index is not within the existing array's range.
Parameters
TInt aSpriteSetMemberIndex | |
RenderSprite(TInt, TInternalSpriteResizeMode, const TSize &, const TSize &)
SetClippingRect(const TRect &)
IMPORT_C void | SetClippingRect | ( | const TRect & | aRect | ) | |
Bounds the drawing of the sprite within aRect, stopping it drawing over surrounding components.
SpriteGc()
Allows use of the Gc which the sprite uses for it's drawing. This enables the client to effectively draw onto the sprite.
StartDisplayingSpriteL()
IMPORT_C void | StartDisplayingSpriteL | ( | ) | |
Brings the sprite onto the visible area of the screen. Must also call this if the sprite set member which is being used has changed.
StopDisplayingSprite()
IMPORT_C void | StopDisplayingSprite | ( | ) | |
Stops the display of the sprite on the visible area of the screen.
TranslateSpritePosition(const TPoint &)
IMPORT_C void | TranslateSpritePosition | ( | const TPoint & | aSpritePos | ) | |
Method for moving the postion of the sprite by aSpritePos from the current position.
Member Enumerations Documentation
Enum TFlags
Enumerators
EMaskIsInverted = 0x01 | |
ESpriteIsCurrentlyDisplayed = 0x02 | |
Enum TInternalSpriteResizeMode
Enumerators
EHSameVSame | |
EHSameVShrink | |
EHSameVStretch | |
EHShrinkVSame | |
EHShrinkVShrink | |
EHShrinkVStretch | |
EHStretchVSame | |
EHStretchVShrink | |
EHStretchVStretch | |
Enum TSpriteResizeMode
Enumerators
ENoResizing | |
EResizeHorizToFit | |
EResizeVertToFit | |
EResizeHorizAndVertToFit | |
Member Data Documentation
TRect
iClippingRect
TRect
| iClippingRect | [private] |
CFbsBitmapDevice * iMainBmpDevice
CFbsBitGc * iMainFbsBitGc
CFbsBitmapDevice * iMaskBmpDevice
CFbsBitGc * iMaskFbsBitGc
RPointerArray< CGulIcon > iSourceMembers
TSpriteMember
iSpriteMember
TPoint
iSpritePosition
TPoint
| iSpritePosition | [private] |
CWsBitmap * iTargetBitmap
CWsBitmap * iTargetMaskBitmap
CWindowToBitmapMappingGc * iWindowToBitmapMappingGc
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.