class CAlfCompositionSource : public CAlfCompositionClientBase |
Example1: // to set target semitransparent CAlfCompositionSource* me = CAlfCompositionSource::NewL(iMyDrawableWindow); me->EnableAlpha(); me->SetOpacity(0.5f); //... delete me; // deletion of client will restore state to original
Example2: // to fade in for composition target class CMyClass: public CBase, private MAlfCompositionObserver { CMyClass():iOpacity(0) { } ConstructL() { // ... iAlfCompositionSource = CAlfCompositionSource::NewL(iMyDrawableWindow); iAlfCompositionSource->EnableAlpha(); iAlfCompositionSource->SetOpacity(iOpacity); }
void FrameReady(TInt aScreenNumber) { if (iOpacity < 1) { iOpacity += 0.03; // just follow refresh linearly iAlfCompositionSource->SetOpacity(iOpacity); } else { // fade in complete, no need to have composition cntrl anymore delete iAlfCompositionSource; iAlfCompositionSource = 0; } }
Example 3: // To grant other application / process a priviledged rights to modify composition target const TInt mySuperSecretKeyForHost1 = 0x000FAB10; const TInt flagsForHost1 = EAlfAllowChangeExtent | EAlfAllowChangeAlpha; // but not rotation
CAlfCompositionSource* me = CAlfCompositionSource::NewL(iMyDrawableWindow); TInt generatedKey = me->CreatePermissionToken(0x000FAB10, flagsForHost1);
PassGeneratedKeyToHost(generatedKey); // it already knows the other key..
TBD, will the generates key work even after composition source destroys the CAlfCompositionSource instance
Public Member Functions | |
---|---|
~CAlfCompositionSource() | |
IMPORT_C void | AddCompositionObserverL(MAlfCompositionObserver &, TInt) |
IMPORT_C TInt | CreatePermissionToken(TInt, TInt) |
IMPORT_C TInt | EnableAlpha(TBool) |
IMPORT_C void | EnableKeyboard(TBool, TInt) |
IMPORT_C CAlfCompositionSource * | NewL(RWindow &) |
IMPORT_C void | RemoveObserver(MAlfCompositionObserver &) |
IMPORT_C TInt | SetExtent(const TRect &, TInt) |
IMPORT_C void | SetIsBackgroundAnim(TBool) |
IMPORT_C TInt | SetOpacity(TReal32) |
IMPORT_C TInt | SetRotation(TInt) |
IMPORT_C TInt | SetSourceRect(const TRect &) |
IMPORT_C TInt | SetZOrder(const CAlfCompositionClientBase &, TBool, TInt) |
Protected Member Functions | |
---|---|
void | ConstructL(TInt, TInt, TInt) |
void | ConstructL(RWindow &) |
TInt | Handle() |
IMPORT_C void | HandleEventL(TInt, TAny *) |
Inherited Enumerations | |
---|---|
CActive:TPriority | |
CAlfCompositionClientBase:TAlfCompositionPermission |
Protected Attributes | |
---|---|
CAlfCompositionSourceData * | iData |
Inherited Attributes | |
---|---|
CActive::iStatus |
IMPORT_C void | AddCompositionObserverL | ( | MAlfCompositionObserver & | aObserver, |
TInt | aScreenNumber = 0 | |||
) |
Adds composition observer for better synchronization
MAlfCompositionObserver & aObserver | |
TInt aScreenNumber = 0 |
void | ConstructL | ( | TInt | aHandle1, |
TInt | aHandle2, | |||
TInt | aScreenNumber | |||
) | [protected, virtual] |
void | ConstructL | ( | RWindow & | aClientWindow | ) | [protected, virtual] |
RWindow & aClientWindow |
IMPORT_C TInt | CreatePermissionToken | ( | TInt | aKey, |
TInt | aPermissionFlags | |||
) |
Creates handle based on key Flags define which kind of operations are allowed by host application using the token. Same token can be used multiple times for different clients.
IMPORT_C TInt | EnableAlpha | ( | TBool | aEnable = ETrue | ) |
Enables / disables alpha on composition target
TBool aEnable = ETrue |
IMPORT_C void | EnableKeyboard | ( | TBool | aEnable, |
TInt | aScreen | |||
) |
Internal For testing applications on extrenal screen
IMPORT_C void | HandleEventL | ( | TInt | aEventType, |
TAny * | aEventData | |||
) | [protected, virtual] |
IMPORT_C CAlfCompositionSource * | NewL | ( | RWindow & | aClientWindow | ) | [static] |
Constructor
RWindow & aClientWindow |
IMPORT_C void | RemoveObserver | ( | MAlfCompositionObserver & | aObserver | ) |
Removes composition observer
MAlfCompositionObserver & aObserver |
IMPORT_C TInt | SetExtent | ( | const TRect & | aRect, |
TInt | aScreen | |||
) |
Defines extent of the composition target on a defined screen Does not affect on hit testing, keyboard focus etc. but is just additional information for composition
IMPORT_C void | SetIsBackgroundAnim | ( | TBool | aIsBg | ) |
Makes this composition target system wide background surface any other target that was previously used as bg anim will be discarded < should this require some capability like WriteDeviceData ?>
TBool aIsBg |
IMPORT_C TInt | SetOpacity | ( | TReal32 | aOpacity | ) |
Set constant opacity 0.0 - 1.0f multiplier that will be applied to composition target <in practice, only 256 different shades supported>
TReal32 aOpacity |
IMPORT_C TInt | SetRotation | ( | TInt | aRotationInDegrees | ) |
rotation of composition target <in practice, only 90 degree steps supported, value given will be rounded to closest rotation>
TInt aRotationInDegrees |
IMPORT_C TInt | SetSourceRect | ( | const TRect & | aRect | ) |
Defines extent of the composition source rectangle
const TRect & aRect |
IMPORT_C TInt | SetZOrder | ( | const CAlfCompositionClientBase & | aNode, |
TBool | aAbove, | |||
TInt | aKey = -1 | |||
) |
Consult owner about the usage and restrictions
Defines the composition order. On success returns token that can be used to create new CAlfCompositionSource object to control union of theses two composition targets as single object for convenience
Does not affect on hit testing, keyboard focus etc.
const CAlfCompositionClientBase & aNode | |
TBool aAbove | |
TInt aKey = -1 |
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.