CWsScreenDevice Class Reference

class CWsScreenDevice : public CBitmapDevice

Software device screen.

An object of this class can be used to enquire or set parameters of the software screen, and determine the physical limits of the device.

CWsScreenDevice gives access to the list of screen modes. These are the combinations of screen rotation and screen size supported by the device. One of them is selected as the current screen mode. The possible screen modes are initialised in wsini.ini.

CFbsScreenDevice

Inherits from

Nested Classes and Structures

Public Member Functions
CWsScreenDevice()
CWsScreenDevice(RWsSession &)
~CWsScreenDevice()
IMPORT_C TIntAddFile(const TDesC &, TInt &)
IMPORT_C TIntConstruct()
IMPORT_C TIntConstruct(TInt)
IMPORT_C TIntCopyScreenToBitmap(const CFbsBitmap *)
IMPORT_C TIntCopyScreenToBitmap(const CFbsBitmap *, const TRect &)
IMPORT_C TIntCreateContext(CGraphicsContext *&)
TInt CreateContext(CWindowGc *&)
IMPORT_C TIntCurrentScreenMode()
IMPORT_C TDisplayModeDisplayMode()
IMPORT_C TIntFontHeightInPixels(TInt, TInt)
IMPORT_C TIntFontHeightInTwips(TInt, TInt)
IMPORT_C TSizeModeGetCurrentScreenModeAttributes()
IMPORT_C TSizeGetCurrentScreenModeScale()
IMPORT_C TPointGetCurrentScreenModeScaledOrigin()
IMPORT_C TPointGetDefaultScreenModeOrigin()
IMPORT_C voidGetDefaultScreenSizeAndRotation(TPixelsTwipsAndRotation &)
IMPORT_C voidGetDefaultScreenSizeAndRotation(TPixelsAndRotation &)
IMPORT_C TIntGetFontById(CFont *&, TUid, const TAlgStyle &)
IMPORT_C TAny *GetInterface(TUint)
const TAny *GetInterface(TUint)
IMPORT_C TIntGetNearestFontInPixels(CFont *&, const TFontSpec &)
IMPORT_C TIntGetNearestFontInTwips(CFont *&, const TFontSpec &)
IMPORT_C TIntGetNearestFontToDesignHeightInPixels(CFont *&, const TFontSpec &)
IMPORT_C TIntGetNearestFontToDesignHeightInTwips(CFont *&, const TFontSpec &)
IMPORT_C TIntGetNearestFontToMaxHeightInPixels(CFont *&, const TFontSpec &, TInt)
IMPORT_C TIntGetNearestFontToMaxHeightInTwips(CFont *&, const TFontSpec &, TInt)
IMPORT_C TIntGetPalette(CPalette *&)
IMPORT_C voidGetPixel(TRgb &, const TPoint &)
IMPORT_C TIntGetRotationsList(TInt, CArrayFixFlat< TInt > *)
IMPORT_C voidGetScanLine(TDes8 &, const TPoint &, TInt, TDisplayMode)
IMPORT_C TDisplayModeGetScreenModeDisplayMode(const TInt &)
IMPORT_C TPointGetScreenModeOrigin(TInt)
IMPORT_C TSizeGetScreenModeScale(TInt)
IMPORT_C TPointGetScreenModeScaledOrigin(TInt)
IMPORT_C voidGetScreenModeSizeAndRotation(TInt, TPixelsTwipsAndRotation &)
IMPORT_C voidGetScreenModeSizeAndRotation(TInt, TPixelsAndRotation &)
IMPORT_C TIntGetScreenNumber()
IMPORT_C TIntGetScreenSizeModeList(RArray< TInt > *)
IMPORT_C TIntHorizontalPixelsToTwips(TInt)
IMPORT_C TIntHorizontalTwipsToPixels(TInt)
IMPORT_C TBoolIsCurrentModeDynamic()
IMPORT_C TBoolIsModeDynamic(TInt)
IMPORT_C TIntNumScreenModes()
IMPORT_C TIntNumTypefaces()
IMPORT_C voidPaletteAttributes(TBool &, TInt &)
IMPORT_C TRectPointerRect()
IMPORT_C TBoolRectCompare(const TRect &, const TRect &)
IMPORT_C TBoolRectCompare(const TRect &, const TRect &, TUint)
IMPORT_C voidReleaseFont(CFont *)
IMPORT_C voidRemoveFile(TInt)
IMPORT_C TScreenModeEnforcementScreenModeEnforcement()
IMPORT_C voidSetAppScreenMode(TInt)
IMPORT_C TIntSetBackLight(TBool)
IMPORT_C voidSetCurrentRotations(TInt, CFbsBitGc::TGraphicsOrientation)
IMPORT_C voidSetCurrentScreenModeAttributes(const TSizeMode &)
IMPORT_C TIntSetCustomPalette(const CPalette *)
IMPORT_C voidSetPalette(CPalette *)
IMPORT_C voidSetScreenMode(TInt)
IMPORT_C voidSetScreenModeEnforcement(TScreenModeEnforcement)
IMPORT_C voidSetScreenSizeAndRotation(const TPixelsTwipsAndRotation &)
IMPORT_C voidSetScreenSizeAndRotation(const TPixelsAndRotation &)
IMPORT_C TSizeSizeInPixels()
IMPORT_C TSizeSizeInTwips()
IMPORT_C voidTypefaceSupport(TTypefaceSupport &, TInt)
IMPORT_C TIntVerticalPixelsToTwips(TInt)
IMPORT_C TIntVerticalTwipsToPixels(TInt)
Private Member Functions
TSize DisplaySizeInPixels()
TSize PhysicalScreenSizeInTwips()
CFbsTypefaceStore *TypeFaceStore()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
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()
CBitmapDevice::CreateBitmapContext(CBitmapContext *&)
Public Member Enumerations
enumTSpriteInCompare { ERemoveSprite = 0, EIncludeSprite = 1, EIncludeTextCursor = 2 }
Private Attributes
TSize iDisplaySizeInPixels
CScrDevExtension *iExtension
TSize iPhysicalScreenSizeInTwips

Constructor & Destructor Documentation

CWsScreenDevice()

IMPORT_CCWsScreenDevice()

Default constructor. Developers should use the other constructor overload.

CWsScreenDevice(RWsSession &)

IMPORT_CCWsScreenDevice(RWsSession &aWs)

Constructs a new screen device attached to a particular window server session.

Parameters

RWsSession & aWsThe window server session this screen should be attached to.

~CWsScreenDevice()

IMPORT_C~CWsScreenDevice()

Destructor.

Member Functions Documentation

AddFile(const TDesC &, TInt &)

IMPORT_C TIntAddFile(const TDesC &aName,
TInt &aId
)[virtual]

Adds a font file to the device's typeface store. The specified font file must be accessible to any process, i.e. not located inside an application's private directory.

CBitmapDevice::AddFile()

Parameters

const TDesC & aNameName of the font file.
TInt & aIdID for the font file.

Construct()

IMPORT_C TIntConstruct()

Completes construction of the object.

This method invokes Construct(TInt aDefaultScreenNumber) with default Screen number.

Construct(TInt)

IMPORT_C TIntConstruct(TIntaDefaultScreenNumber)

Completes construction of the object.

This function always causes a flush of the window server buffer.
panic
TW32Panic 17 in debug builds if called on an already constructed object.

Parameters

TInt aDefaultScreenNumber- This is the screen on which an application will start

CopyScreenToBitmap(const CFbsBitmap *)

IMPORT_C TIntCopyScreenToBitmap(const CFbsBitmap *aBitmap)const

Saves the entire screen to a bitmap.

This function always causes a flush of the window server buffer.

Parameters

const CFbsBitmap * aBitmapBitmap to be filled with the screen image.

CopyScreenToBitmap(const CFbsBitmap *, const TRect &)

IMPORT_C TIntCopyScreenToBitmap(const CFbsBitmap *aBitmap,
const TRect &aRect
)const

Saves a region of the screen to a bitmap.

This function always causes a flush of the window server buffer.

Parameters

const CFbsBitmap * aBitmapBitmap to be filled with the screen region image.
const TRect & aRectScreen region to be saved.

CreateContext(CGraphicsContext *&)

IMPORT_C TIntCreateContext(CGraphicsContext *&aGc)[virtual]

Creates a graphics context for this device.

This function always causes a flush of the window server buffer.

CGraphicsDevice::CreateContext()

Parameters

CGraphicsContext *& aGcOn successful return, contains a new graphics context referring to this screen device.

CreateContext(CWindowGc *&)

TInt CreateContext(CWindowGc *&aGc)[inline]

Creates a graphics context for this device.

This function always causes a flush of the window server buffer.

CGraphicsDevice::CreateContext()

Parameters

CWindowGc *& aGcOn successful return, contains a new graphics context referring to this screen device.

CurrentScreenMode()

IMPORT_C TIntCurrentScreenMode()const

Gets the current screen mode index.

This function always causes a flush of the window server buffer.

DisplayMode()

IMPORT_C TDisplayModeDisplayMode()const [virtual]

Gets the device's display mode.

This function always causes a flush of the window server buffer.

CGraphicsDevice::DisplayMode()

DisplaySizeInPixels()

TSize DisplaySizeInPixels()const [private]

FontHeightInPixels(TInt, TInt)

IMPORT_C TIntFontHeightInPixels(TIntaTypefaceIndex,
TIntaHeightIndex
)const [virtual]

Gets the height of the specified font in pixels.

The value returned is rounded up or down to the nearest font height in pixels.

The specified font is the one with height index number aHeightIndex of the typeface with index number aTypefaceIndex.

CBitmapDevice::FontHeightInPixels()

Parameters

TInt aTypefaceIndexA typeface index number, in the range: 0 to (NumTypefaces() - 1).
TInt aHeightIndexA font height index number, in the range: 0 to (iNumHeights - 1).

FontHeightInTwips(TInt, TInt)

IMPORT_C TIntFontHeightInTwips(TIntaTypefaceIndex,
TIntaHeightIndex
)const [virtual]

Gets the height in twips of the specified font.

The value returned is rounded up or down to the nearest font height in twips.

The specified font is the one with height index number aHeightIndex of the typeface with index number aTypefaceIndex.

CGraphicsDevice::FontHeightInTwips()

Parameters

TInt aTypefaceIndexA typeface index number, in the range: 0 to (NumTypefaces() - 1).
TInt aHeightIndexA font height index number, in the range: 0 to (iNumHeights - 1).

GetCurrentScreenModeAttributes()

IMPORT_C TSizeModeGetCurrentScreenModeAttributes()const

Used for testing purposes only.

GetCurrentScreenModeScale()

IMPORT_C TSizeGetCurrentScreenModeScale()const

Gets the scale for the current screen mode.

This function always causes a flush of the window server buffer.

GetCurrentScreenModeScaledOrigin()

IMPORT_C TPointGetCurrentScreenModeScaledOrigin()const

Gets the current screen mode's scaled origin.

The formula used is (A+B-1)/B

where:

  • A is the screen mode origin in physical coordinates,

  • B is the screen mode scale width.

The result obtained is the scaled origin of the present screen mode.

GetDefaultScreenModeOrigin()

IMPORT_C TPointGetDefaultScreenModeOrigin()const

Gets the origin for the current screen mode

This function always causes a flush of the window server buffer.

GetDefaultScreenSizeAndRotation(TPixelsTwipsAndRotation &)

IMPORT_C voidGetDefaultScreenSizeAndRotation(TPixelsTwipsAndRotation &aSizeAndRotation)const

Gets the current screen size (in both pixels and twips) and rotation.

This function always causes a flush of the window server buffer.

Parameters

TPixelsTwipsAndRotation & aSizeAndRotationThe default screen size and rotation, defining screen size in both pixels and twips.

GetDefaultScreenSizeAndRotation(TPixelsAndRotation &)

IMPORT_C voidGetDefaultScreenSizeAndRotation(TPixelsAndRotation &aSizeAndRotation)const

Gets the current screen size (in pixels) and the rotation.

This function always causes a flush of the window server buffer.

Parameters

TPixelsAndRotation & aSizeAndRotationThe default screen size in pixels and the rotation.

GetFontById(CFont *&, TUid, const TAlgStyle &)

IMPORT_C TIntGetFontById(CFont *&aFont,
TUidaUid,
const TAlgStyle &aAlgStyle
)

Gets a font by its bitmap UID.

Within a font file each font has its own UID. An algorithmic style is not part of the actual font description, but is applied to it. For example algorithmic bolding applies an algorithm to increase the apparent weight of each character in the font. Note that the algorithm is applied blindly, and that a typeface may already have a style e.g. it may already be bold or italic. Thus a bold face will appear extra-bold if algorithmic bolding is applied to it. Algorithmic effects are not necessarily a substitute for typeface design and should be used with care.

Parameters

CFont *& aFontOn a successful return, contains a pointer to the new CFont.
TUid aUidUID of the bitmap font.
const TAlgStyle & aAlgStyleThe algorithmic style to apply.

GetInterface(TUint)

IMPORT_C TAny *GetInterface(TUintaInterfaceId)

Interface Extension capability Use of this interface going forward will allow the published client interface to be dynamically extended. Note that the pointer returned is only good for the lifetime of the called CBase derived object.

Parameters

TUint aInterfaceIduniqueid or well known id of interface

GetInterface(TUint)

const TAny *GetInterface(TUintaInterfaceId)const [inline]

Parameters

TUint aInterfaceId

GetNearestFontInPixels(CFont *&, const TFontSpec &)

IMPORT_C TIntGetNearestFontInPixels(CFont *&aFont,
const TFontSpec &aFontSpec
)[virtual]

Gets the nearest font to that specified for use by a bitmapped graphics device.

This function is replaced by GetNearestFontToDesignHeightInPixels()

The font and bitmap server returns a pointer to the nearest matching font from those available, in aFont.

CBitmapDevice::GetNearestFontInPixels()

Parameters

CFont *& aFontOn return, this is set to point to the device font that is closest to the font specification passed in the second argument
const TFontSpec & aFontSpecAn absolute font specification

GetNearestFontInTwips(CFont *&, const TFontSpec &)

IMPORT_C TIntGetNearestFontInTwips(CFont *&aFont,
const TFontSpec &aFontSpec
)[virtual]

Gets the nearest font, in twips, to that in the specified font specification.

This function is replaced by GetNearestFontToDesignHeightInTwips()

The font and bitmap server returns a pointer to the nearest matching font from those available, in aFont.

MGraphicsDeviceMap::GetNearestFontInTwips()

Parameters

CFont *& aFontOn return, this is set to point to the device font closest to the font specification passed in the second argument.
const TFontSpec & aFontSpecAn absolute font specification.

GetNearestFontToDesignHeightInPixels(CFont *&, const TFontSpec &)

IMPORT_C TIntGetNearestFontToDesignHeightInPixels(CFont *&aFont,
const TFontSpec &aFontSpec
)[virtual]

Gets the nearest font in pixels to that specified.

The font and bitmap server returns a pointer to the nearest matching font from those available. Matches to design height of font - this gives no guarantees on the actual physical size of the font.

This function replaces GetNearestFontInTwips

CBitmapDevice::GetNearestFontToDesignHeightInPixels()

Parameters

CFont *& aFontOn return, the pointer is set to point to the device font which most closely approximates to the required font specification.
const TFontSpec & aFontSpecAn absolute font specification.

GetNearestFontToDesignHeightInTwips(CFont *&, const TFontSpec &)

IMPORT_C TIntGetNearestFontToDesignHeightInTwips(CFont *&aFont,
const TFontSpec &aFontSpec
)[virtual]

Gets the nearest font in twips to that specified.

The font and bitmap server returns a pointer to the nearest matching font from those available. Matches to design height of font - this gives no guarantees on the actual physical size of the font.

This function replaces GetNearestFontInTwips

MGraphicsDeviceMap::GetNearestFontToDesignHeightInTwips()

Parameters

CFont *& aFontOn return, the pointer is set to point to the device font which most closely approximates to the required font specification.
const TFontSpec & aFontSpecAn absolute font specification.

GetNearestFontToMaxHeightInPixels(CFont *&, const TFontSpec &, TInt)

IMPORT_C TIntGetNearestFontToMaxHeightInPixels(CFont *&aFont,
const TFontSpec &aFontSpec,
TIntaMaxHeight
)[virtual]

Gets the nearest font in pixels to that specified.

The font and bitmap server returns a pointer to the nearest matching font from those available. Matches to max height of font - this does its best to return a font that will fit within the maximum height specified (but note that variations due to hinting algorithms may rarely result in this height being exceeded by up to one pixel). Problems can also be encountered with bitmap fonts where the typeface exists but doesn't have a font small enough.

CBitmapDevice::GetNearestFontToMaxHeightInPixels()

Parameters

CFont *& aFontOn return, the pointer is set to point to the device font which most closely approximates to the required font specification.
const TFontSpec & aFontSpecAn absolute font specification.
TInt aMaxHeightThe maximum height within which the font must fit - this overrides the height specified in the TFontSpec.

GetNearestFontToMaxHeightInTwips(CFont *&, const TFontSpec &, TInt)

IMPORT_C TIntGetNearestFontToMaxHeightInTwips(CFont *&aFont,
const TFontSpec &aFontSpec,
TIntaMaxHeight
)[virtual]

Gets the nearest font, in twips, to that specified.

The font and bitmap server returns a pointer to the nearest matching font from those available. Matches to max height of font - this does its best to return a font that will fit within the maximum height specified (but note that variations due to hinting algorithms may rarely result in this height being exceeded by up to one pixel). Problems can also be encountered with bitmap fonts where the typeface exists but doesn't have a font small enough.

MGraphicsDeviceMap::GetNearestFontToMaxHeightInTwips()

Parameters

CFont *& aFontOn return, the pointer is set to point to the device font which most closely approximates to the required font specification.
const TFontSpec & aFontSpecAn absolute font specification.
TInt aMaxHeightThe maximum height within which the font must fit - this overrides the height specified in the TFontSpec.

GetPalette(CPalette *&)

IMPORT_C TIntGetPalette(CPalette *&aPalette)const [virtual]

Gets the screen device's palette.

This function always causes a flush of the window server buffer.

CFbsScreenDevice::GetPalette()

Parameters

CPalette *& aPaletteOn return, contains the screen device's palette. The caller takes responsibility for discarding the palette.

GetPixel(TRgb &, const TPoint &)

IMPORT_C voidGetPixel(TRgb &aColor,
const TPoint &aPixel
)const [virtual]

Gets the RGB colour of an individual pixel on a screen device.

This function always causes a flush of the window server buffer.

CBitmapDevice::GetPixel()

Parameters

TRgb & aColorOn return, contains the RGB colour of the pixel.
const TPoint & aPixelThe x,y co-ordinates of the pixel. The top left pixel is (0,0).

GetRotationsList(TInt, CArrayFixFlat< TInt > *)

IMPORT_C TIntGetRotationsList(TIntaMode,
CArrayFixFlat< TInt > *aRotationList
)const

Gets the list of valid rotations for a particular screen size.

The list is initialised in wsini.ini.

This function always causes a flush of the window server buffer.

SetCurrentRotations()

Parameters

TInt aModeThe index of the screen mode for which the rotation list is required.
CArrayFixFlat< TInt > * aRotationListThe list of valid screen orientations.

GetScanLine(TDes8 &, const TPoint &, TInt, TDisplayMode)

IMPORT_C voidGetScanLine(TDes8 &aScanLine,
const TPoint &aStartPixel,
TIntaPixelLength,
TDisplayModeaDispMode
)const [virtual]

Gets a scanline into a buffer.

The pixels are converted from the current screen display mode format to the format of the specified device display mode.

By specifying the start pixel and number of pixels either the whole or a portion of a row of screen pixels may be copied.

This function always causes a flush of the window server buffer.

CBitmapDevice::GetScanLine()

Parameters

TDes8 & aScanLineA buffer into which pixels are copied, it must be sufficiently large to store all the scanline pixels.
const TPoint & aStartPixelThe (x,y) co-ordinates of the first pixel of the bitmap scanline to be put into the buffer.
TInt aPixelLengthThe number of pixels to put into the buffer.
TDisplayMode aDispModeThe display mode into which to convert the pixels.

GetScreenModeDisplayMode(const TInt &)

IMPORT_C TDisplayModeGetScreenModeDisplayMode(const TInt &aMode)const

Gets the display mode of the screen for the specified screen mode

This function always causes a flush of the window server buffer.

Parameters

const TInt & aModeThe index of the screen mode for which the display mode is required

GetScreenModeOrigin(TInt)

IMPORT_C TPointGetScreenModeOrigin(TIntaMode)const

Get the origin of the screen for the specified screen mode.

This function always causes a flush of the window server buffer.

Parameters

TInt aModeThe index of the screen mode for which the screen origin is required.

GetScreenModeScale(TInt)

IMPORT_C TSizeGetScreenModeScale(TIntaMode)const

Gets the scale for the specified screen mode.

This function always causes a flush of the window server buffer.

Parameters

TInt aModeThe index of the screen mode for which the screen scale is required.

GetScreenModeScaledOrigin(TInt)

IMPORT_C TPointGetScreenModeScaledOrigin(TIntaMode)const

Gets the specfied screen mode's scaled origin.

The functionality is same as CWsScreenDevice::GetCurrentScreenModeScaledOrigin().

It always causes a flush of the window server buffer.

Parameters

TInt aModeThe index of the screen mode for which the scaled origin is required.

GetScreenModeSizeAndRotation(TInt, TPixelsTwipsAndRotation &)

IMPORT_C voidGetScreenModeSizeAndRotation(TIntaMode,
TPixelsTwipsAndRotation &aSizeAndRotation
)const

Get the screen rotation and size, in both pixels and twips, for the specified screen mode.

This function always causes a flush of the window server buffer.

Parameters

TInt aModeThe index of the screen mode for which the screen size and rotation are required.
TPixelsTwipsAndRotation & aSizeAndRotationThe orientation of the specified screen mode, and its size in both pixels and twips.

GetScreenModeSizeAndRotation(TInt, TPixelsAndRotation &)

IMPORT_C voidGetScreenModeSizeAndRotation(TIntaMode,
TPixelsAndRotation &aSizeAndRotation
)const

Get the screen rotation and size (in pixels) for the specified screen mode.

This function always causes a flush of the window server buffer.

Parameters

TInt aModeThe index of the screen mode for which the screen size and rotation are required.
TPixelsAndRotation & aSizeAndRotationThe orientation of the specified screen mode, and its size in pixels.

GetScreenNumber()

IMPORT_C TIntGetScreenNumber()const

GetScreenSizeModeList(RArray< TInt > *)

IMPORT_C TIntGetScreenSizeModeList(RArray< TInt > *aModeList)const

Gets the available screen size modes.

This function retrieves all available screen size modes which are supported by the server.

Parameters

RArray< TInt > * aModeListOn return, the list of available screen size modes.

HorizontalPixelsToTwips(TInt)

IMPORT_C TIntHorizontalPixelsToTwips(TIntaPixels)const

Translates a specified pixel value to a twips value.

Parameters

TInt aPixelsThe value in pixels to be translated.

HorizontalTwipsToPixels(TInt)

IMPORT_C TIntHorizontalTwipsToPixels(TIntaTwips)const

Translates a twips to a pixel value.

MGraphicsDeviceMap::HorizontalTwipsToPixels()

Parameters

TInt aTwipsThe value in twips.

IsCurrentModeDynamic()

IMPORT_C TBoolIsCurrentModeDynamic()const

Returns whether the current screen size mode is dynamic or not.

IsModeDynamic

IsModeDynamic(TInt)

IMPORT_C TBoolIsModeDynamic(TIntaSizeMode)const

Returns whether the given screen size mode is dynamic or not. Dynamic screen size modes may change their size in pixels and/or twips and other attributes at run time, so they must not be cached. Static size mode attributes will not change at run time, but may not make full use of the display. Invalid size modes shall return EFalse.

Parameters

TInt aSizeModeThe screen size mode to check.

NumScreenModes()

IMPORT_C TIntNumScreenModes()const

Gets the number of available screen modes.

Each mode has a different size, and one or more possible rotations/orientations.

This function always causes a flush of the window server buffer.

NumTypefaces()

IMPORT_C TIntNumTypefaces()const [virtual]

Gets the number of typefaces supported by the screen device.

CGraphicsDevice::NumTypefaces()

PaletteAttributes(TBool &, TInt &)

IMPORT_C voidPaletteAttributes(TBool &aModifiable,
TInt &aNumEntries
)const [virtual]

Gets the attributes of the device's palette.

This function always causes a flush of the window server buffer.

CFbsScreenDevice::PaletteAttributes()

Parameters

TBool & aModifiableOn return, indicates whether or not the device's palette is modifiable (true) or fixed (false).
TInt & aNumEntriesOn return, holds the number of entries in the device's palette.

PhysicalScreenSizeInTwips()

TSize PhysicalScreenSizeInTwips()const [private]

PointerRect()

IMPORT_C TRectPointerRect()const

Gets the active area for the pointing device.

This is a device-dependent parameter, and will typically depend on the screen size and other factors.

This function always causes a flush of the window server buffer.

RectCompare(const TRect &, const TRect &)

IMPORT_C TBoolRectCompare(const TRect &aRect1,
const TRect &aRect2
)const

Compares two areas of the screen to see if they have the same content.

If there are any sprites on the screen they are not included in the comparison.

This function always causes a flush of the window server buffer.

Parameters

const TRect & aRect1A rectangle.
const TRect & aRect2Another rectangle.

RectCompare(const TRect &, const TRect &, TUint)

IMPORT_C TBoolRectCompare(const TRect &aRect1,
const TRect &aRect2,
TUintaFlags
)const

Compares two areas of the screen to see if they have the same content.

This function always causes a flush of the window server buffer.

Parameters

const TRect & aRect1A rectangle.
const TRect & aRect2Another rectangle.
TUint aFlagsEIncludeSprite to include the sprite in the compare or ERemoveSprite to remove the sprite.

ReleaseFont(CFont *)

IMPORT_C voidReleaseFont(CFont *aFont)

Releases a specified font.

This function is used to indicate that the specified font is no longer needed for use by the screen device. As fonts can be shared between applications, this function does not delete the copy of the font from RAM, unless the font was only being used by this device.

MGraphicsDeviceMap::ReleaseFont()

Parameters

CFont * aFontA pointer to the font to be released.

RemoveFile(TInt)

IMPORT_C voidRemoveFile(TIntaId = 0)[virtual]

Removes a font file from the font store.

CBitmapDevice::RemoveFile()

Parameters

TInt aId = 0The ID of the font file to be removed, default 0.

ScreenModeEnforcement()

IMPORT_C TScreenModeEnforcementScreenModeEnforcement()const

Gets the current screen mode enforcement settings.

The global screen mode enforcement setting defines the requirements that a group window must meet to be displayed. The requirements may have been set in wsini.ini, or using SetScreenModeEnforcement().

This function always causes a flush of the window server buffer.

SetAppScreenMode(TInt)

IMPORT_C voidSetAppScreenMode(TIntaMode)

Sets the application's screen mode; this also sets all the attributes of the screen mode.

Note: although this API was added in Symbian OS v8.0, the functionality is only available from Symbian OS v8.1 onwards.

Parameters

TInt aModeThe index of the application's new screen mode.

SetBackLight(TBool)

IMPORT_C TIntSetBackLight(TBoolaBackLight)
Set back light.
capability
EikServ SID

Parameters

TBool aBackLight

SetCurrentRotations(TInt, CFbsBitGc::TGraphicsOrientation)

IMPORT_C voidSetCurrentRotations(TIntaMode,
CFbsBitGc::TGraphicsOrientationaRotation
)const

Sets the screen rotation that should be used with a particular screen size.

After calling this function, whenever you change into the screen size specified by aMode you will have the rotation aRotation. The setting remains in force until it is explicitly changed using this function.

Panics if the specified rotation is not allowed by the given screen mode.

GetRotationsList()
capability
WriteDeviceData

Parameters

TInt aModeThe index of the screen mode the rotation applies to.
CFbsBitGc::TGraphicsOrientation aRotationThe new screen orientation.

SetCurrentScreenModeAttributes(const TSizeMode &)

IMPORT_C voidSetCurrentScreenModeAttributes(const TSizeMode &aModeAtt)

Used for testing purposes only.

Parameters

const TSizeMode & aModeAttScreen size mode to be set.

SetCustomPalette(const CPalette *)

IMPORT_C TIntSetCustomPalette(const CPalette *aPalette)

Sets the custom palette.

This function always causes a flush of the window server buffer.

panic
W32 6 aPalette is NULL.
capability
WriteDeviceData

Parameters

const CPalette * aPaletteThe custom palette.

SetPalette(CPalette *)

IMPORT_C voidSetPalette(CPalette *aPalette)[virtual]

Sets the screen device's palette.

This function always causes a flush of the window server buffer.

Use of this function is deprecated. SetCustomPalette() should be used instead.

Parameters

CPalette * aPaletteThe screen device's new palette.

SetScreenMode(TInt)

IMPORT_C voidSetScreenMode(TIntaMode)

Sets the current screen mode.

Note that this function is only useful for testing. This is because the screen mode normally reflects the state of real hardware, e.g. whether the cover is open or closed on a phone that supports screen flipping.

This function always causes a flush of the window server buffer.

capability
WriteDeviceData

Parameters

TInt aModeThe screen mode index, starting from zero.

SetScreenModeEnforcement(TScreenModeEnforcement)

IMPORT_C voidSetScreenModeEnforcement(TScreenModeEnforcementaMode)const

Sets the screen mode enforcement requirements.

This global setting defines the requirements that a group window must meet to be displayed. The value may be set using this function, but is more likely to be defined in wsini.ini.

capability
WriteDeviceData

Parameters

TScreenModeEnforcement aModeThe screen mode enforcement requirements.

SetScreenSizeAndRotation(const TPixelsTwipsAndRotation &)

IMPORT_C voidSetScreenSizeAndRotation(const TPixelsTwipsAndRotation &aSizeAndRotation)

Sets the current screen size in twips and pixels, and the rotation for the screen device.

Parameters

const TPixelsTwipsAndRotation & aSizeAndRotationThe new rotation and the screen size in both pixels and twips.

SetScreenSizeAndRotation(const TPixelsAndRotation &)

IMPORT_C voidSetScreenSizeAndRotation(const TPixelsAndRotation &aSizeAndRotation)

Sets the current screen size in pixels, and the rotation for the screen device.

This function always causes a flush of the window server buffer.

Parameters

const TPixelsAndRotation & aSizeAndRotationThe new rotation and the screen size in pixels.

SizeInPixels()

IMPORT_C TSizeSizeInPixels()const [virtual]

Gets the size of the screen device area in pixels.

This function always causes a flush of the window server buffer.

CGraphicsDevice::SizeInPixels()

SizeInTwips()

IMPORT_C TSizeSizeInTwips()const [virtual]

Gets the size of the screen device area in twips.

This function always causes a flush of the window server buffer.

CGraphicsDevice::SizeInTwips()

TypeFaceStore()

CFbsTypefaceStore *TypeFaceStore()const [private]

Helper member fn to access the movable typeface store.

TypefaceSupport(TTypefaceSupport &, TInt)

IMPORT_C voidTypefaceSupport(TTypefaceSupport &aTypefaceSupport,
TIntaTypefaceIndex
)const [virtual]

Gets typeface information for a particular typeface index number.

This information is returned in aTypefaceSupport, and includes: the typeface name and typeface attributes (in a TTypeface object), the number of font heights, the maximum and minimum font heights and whether it is a scalable typeface.

CGraphicsDevice::TypefaceSupport()

Parameters

TTypefaceSupport & aTypefaceSupportOn return, if the function executed successfully, this contains the typeface information.
TInt aTypefaceIndexA typeface index number, in the range zero to (NumTypefaces()1).

VerticalPixelsToTwips(TInt)

IMPORT_C TIntVerticalPixelsToTwips(TIntaPixels)const

Translates a vertical dimension of a screen device in pixels into twips.

MGraphicsDeviceMap::VerticalPixelsToTwips()

Parameters

TInt aPixelsA vertical dimension of a device in pixels.

VerticalTwipsToPixels(TInt)

IMPORT_C TIntVerticalTwipsToPixels(TIntaTwips)const

Translates a vertical dimension of a screen device in twips into pixels.

Parameters

TInt aTwipsA vertical dimension of a device in twips.

Member Enumerations Documentation

Enum TSpriteInCompare

Whether or not to include sprites when comparing areas of the screen

Enumerators

ERemoveSprite = 0

This enum can be specified as the 3rd parameter to CWsScreenDevice::RectCompare(const TRect &aRect1, const TRect &aRect2,TUint aFlags). When called with the value ERemoveSprite if there are any sprites visible in the areas of the screen being compared then these will not be included in the comparison. The function CWsScreenDevice::RectCompare(const TRect &aRect1,const TRect &aRect2) will not include sprites in the comparison.

EIncludeSprite = 1

This enum can be specified as the 3rd parameter to CWsScreenDevice::RectCompare(const TRect &aRect1, const TRect &aRect2,TUint aFlags). When called with the value EIncludeSprite if there are any sprites visible in the areas of the screen being compared then these will be included in the comparison.

EIncludeTextCursor = 2

This enum can be specified as the 3rd parameter to CWsScreenDevice::RectCompare(const TRect &aRect1, const TRect &aRect2,TUint aFlags). When called with the value EIncludeTextCursor if there are any text cursors visible in the areas of the screen being compared then these will be included in the comparison.

Member Data Documentation

TSize iDisplaySizeInPixels

TSize iDisplaySizeInPixels[private]

CScrDevExtension * iExtension

CScrDevExtension *iExtension[private]

TSize iPhysicalScreenSizeInTwips

TSize iPhysicalScreenSizeInTwips[private]