CDirectScreenAccess Class Reference

class CDirectScreenAccess : public CActive

An active object used to start direct screen access.

Direct screen access is a way of drawing to the screen without using the window server. As this avoids client-server communication, it is much faster, and may be useful for games and video. Note that some interaction with the window server is needed in order to prevent the application from drawing over other application's data.

The object's (private) RunL() function is called by the window server in order to abort direct screen access. This might occur when another window needs to be displayed in front or when the window with direct screen access is moved. The active object's priority is RDirectScreenAccess::EPriorityVeryHigh so that direct screen access will be aborted as quickly as possible.

Inherits from

Public Member Functions
~CDirectScreenAccess()
RRegion *DrawingRegion()
CFbsBitGc *Gc()
IMPORT_C CDirectScreenAccess *NewL(RWsSession &, CWsScreenDevice &, RWindowBase &, MDirectScreenAccess &)
IMPORT_C CDirectScreenAccess *NewL(RWsSession &, CWsScreenDevice &, RWindowBase &, MDirectScreenAccess &, TBool)
CFbsScreenDevice *&ScreenDevice()
IMPORT_C voidStartL()
Private Member Functions
CDirectScreenAccess(RWsSession &, CWsScreenDevice *, RWindowBase &, MDirectScreenAccess &)
voidConstructL(RWsSession &, TBool)
voidCreateScreenObjectsL(TDisplayMode)
voidDoCancel()
TInt Restart(TAny *)
voidRestart()
voidRunL()
voidUpdateSizeAndRotation(CFbsBitGc *)
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::RunError(TInt)
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Member Enumerations
enumTFlags { EDirectCheckModeChange = 0x01, EDirectCheckSizeModeChange = 0x02, EDirectRegionTrackingOnly = 0x04 }
Inherited Enumerations
CActive:TPriority
Private Attributes
MDirectScreenAccess &iAbort
TBool iAborting
RDirectScreenAccess iDirectAccess
RRegion *iDrawingRegion
TUint iFlags
CFbsBitGc *iGc
RDirectScreenAccess::TTerminationReasons iReason
CIdle *iRestart
CFbsScreenDevice *iScreenDevice
TInt iScreenNumber
TSize iScreenSize
RWindowBase &iWindow
CWsScreenDevice *iWsScreenDevice
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CDirectScreenAccess(RWsSession &, CWsScreenDevice *, RWindowBase &, MDirectScreenAccess &)

CDirectScreenAccess(RWsSession &aWs,
CWsScreenDevice *aScreenDevice,
RWindowBase &aWindow,
MDirectScreenAccess &aAbort
)[private, inline]

Parameters

RWsSession & aWs
CWsScreenDevice * aScreenDevice
RWindowBase & aWindow
MDirectScreenAccess & aAbort

~CDirectScreenAccess()

~CDirectScreenAccess()

Member Functions Documentation

ConstructL(RWsSession &, TBool)

voidConstructL(RWsSession &aWs,
TBoolaRegionTrackingOnly
)[private]

Parameters

RWsSession & aWs
TBool aRegionTrackingOnly

CreateScreenObjectsL(TDisplayMode)

voidCreateScreenObjectsL(TDisplayModeaCurrentMode)[private]

Parameters

TDisplayMode aCurrentMode

DoCancel()

voidDoCancel()[private, virtual]

Implements cancellation of an outstanding request.

This function is called as part of the active object's Cancel().

It must call the appropriate cancel function offered by the active object's asynchronous service provider. The asynchronous service provider's cancel is expected to act immediately.

DoCancel() must not wait for event completion; this is handled by Cancel().

CActive::Cancel

DrawingRegion()

RRegion *DrawingRegion()[inline]

Gets the clipping region to draw to.

You must not draw outside of this region.

The clipping region is calculated when StartL() is called, and is only updated if StartL() is called again.

The region is specified in screen coordinates. This can be useful if you need to reapply the clipping region to the graphics context (CFbsBitGc::SetClippingRegion()).

The clipping region to draw to.

Gc()

CFbsBitGc *Gc()[inline]

Gets the graphics context for drawing to the screen.

This is set up by calling StartL(). Its origin is set so that you should use window coordinates to specify which part of the screen to draw to and its clipping region is set to the visible part of the window.

Code built to run on the Emulator must call CFbsScreenDevice::Update() in order to see the results of drawing to this graphics context, but this may not be required on all target hardware.

The graphics context for drawing to the screen.

NewL(RWsSession &, CWsScreenDevice &, RWindowBase &, MDirectScreenAccess &)

IMPORT_C CDirectScreenAccess *NewL(RWsSession &aWs,
CWsScreenDevice &aScreenDevice,
RWindowBase &aWin,
MDirectScreenAccess &aAbort
)[static]

Parameters

RWsSession & aWs
CWsScreenDevice & aScreenDevice
RWindowBase & aWin
MDirectScreenAccess & aAbort

NewL(RWsSession &, CWsScreenDevice &, RWindowBase &, MDirectScreenAccess &, TBool)

IMPORT_C CDirectScreenAccess *NewL(RWsSession &aWs,
CWsScreenDevice &aScreenDevice,
RWindowBase &aWin,
MDirectScreenAccess &aAbort,
TBoolaRegionTrackingOnly
)[static]

Parameters

RWsSession & aWs
CWsScreenDevice & aScreenDevice
RWindowBase & aWin
MDirectScreenAccess & aAbort
TBool aRegionTrackingOnly

Restart(TAny *)

TInt Restart(TAny *aDirect)[private, static]

Parameters

TAny * aDirect

Restart()

voidRestart()[private]

RunL()

voidRunL()[private, virtual]

Handles an active object's request completion event.

A derived class must provide an implementation to handle the completed request. If appropriate, it may issue another request.

The function is called by the active scheduler when a request completion event occurs, i.e. after the active scheduler's WaitForAnyRequest() function completes.

Before calling this active object's RunL() function, the active scheduler has:

1. decided that this is the highest priority active object with a completed request

2. marked this active object's request as complete (i.e. the request is no longer outstanding)

RunL() runs under a trap harness in the active scheduler. If it leaves, then the active scheduler calls RunError() to handle the leave.

Note that once the active scheduler's Start() function has been called, all user code is run under one of the program's active object's RunL() or RunError() functions.

CActiveScheduler::Start

CActiveScheduler::Error

CActiveScheduler::WaitForAnyRequest

TRAPD

ScreenDevice()

CFbsScreenDevice *&ScreenDevice()[inline]

Gets the screen device to draw to.

You should not use this screen device to create fonts because the object is deleted and recreated when direct screen access is aborted and restarted. Instead, create and use your own CFbsScreenDevice object to create fonts.

The target screen device.

StartL()

IMPORT_C voidStartL()

UpdateSizeAndRotation(CFbsBitGc *)

voidUpdateSizeAndRotation(CFbsBitGc *aGc)[private]

Parameters

CFbsBitGc * aGc

Member Enumerations Documentation

Enum TFlags

Enumerators

EDirectCheckModeChange = 0x01
EDirectCheckSizeModeChange = 0x02
EDirectRegionTrackingOnly = 0x04

Member Data Documentation

MDirectScreenAccess & iAbort

MDirectScreenAccess &iAbort[private]

TBool iAborting

TBool iAborting[private]

RDirectScreenAccess iDirectAccess

RDirectScreenAccess iDirectAccess[private]

RRegion * iDrawingRegion

RRegion *iDrawingRegion[private]

TUint iFlags

TUint iFlags[private]

CFbsBitGc * iGc

CFbsBitGc *iGc[private]

RDirectScreenAccess::TTerminationReasons iReason

RDirectScreenAccess::TTerminationReasons iReason[private]

CIdle * iRestart

CIdle *iRestart[private]

CFbsScreenDevice * iScreenDevice

CFbsScreenDevice *iScreenDevice[private]

TInt iScreenNumber

TInt iScreenNumber[private]

TSize iScreenSize

TSize iScreenSize[private]

RWindowBase & iWindow

RWindowBase &iWindow[private]

CWsScreenDevice * iWsScreenDevice

CWsScreenDevice *iWsScreenDevice[private]