Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <W32STD.H>

Class CWsScreenDevice

class CWsScreenDevice : public CBitmapDevice, public MWsClientClass;

Description

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.

Derivation

Members

Defined in CWsScreenDevice:

Inherited from CBase:

Inherited from CBitmapDevice:

Inherited from MGraphicsDeviceMap:

Inherited from MWsClientClass:

See also:


Construction and destruction


CWsScreenDevice()

IMPORT_C CWsScreenDevice();

Description

Default constructor. Developers should use the other constructor overload.


CWsScreenDevice(RWsSession &)

IMPORT_C CWsScreenDevice(RWsSession &aWs);

Description

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

Parameters

RWsSession &aWs

The window server session this screen should be attached to.


~CWsScreenDevice()

IMPORT_C ~CWsScreenDevice();

Description

Destructor.

[Top]


Member functions


Construct()

IMPORT_C TInt Construct();

Description

Completes construction of the object.

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

Return value

TInt

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


Construct(TInt)

IMPORT_C TInt Construct(TInt aDefaultScreenNumber);

Description

Completes construction of the object.

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

Parameters

TInt aDefaultScreenNumber

- This is the screen on which an application will start

Return value

TInt

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


DisplayMode()const

IMPORT_C virtual TDisplayMode DisplayMode() const;

Description

Gets the device's display mode.

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

Return value

TDisplayMode

The device's display mode.

See also:


SizeInPixels()const

IMPORT_C virtual TSize SizeInPixels() const;

Description

Gets the size of the screen device area in pixels.

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

Return value

TSize

The x and y dimensions of the screen device area, in pixels.

See also:


SizeInTwips()const

IMPORT_C virtual TSize SizeInTwips() const;

Description

Gets the size of the screen device area in twips.

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

Return value

TSize

The x and y dimensions of the screen device area, in twips.

See also:


HorizontalTwipsToPixels(TInt)const

IMPORT_C virtual TInt HorizontalTwipsToPixels(TInt aTwips) const;

Description

Translates a twips to a pixel value.

Parameters

TInt aTwips

The value in twips.

Return value

TInt

The equivalent number of pixels.

See also:


VerticalTwipsToPixels(TInt)const

IMPORT_C virtual TInt VerticalTwipsToPixels(TInt aTwips) const;

Description

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

Parameters

TInt aTwips

A vertical dimension of a device in twips.

Return value

TInt

The vertical dimension in pixels.


HorizontalPixelsToTwips(TInt)const

IMPORT_C virtual TInt HorizontalPixelsToTwips(TInt aPixels) const;

Description

Translates a specified pixel value to a twips value.

Parameters

TInt aPixels

The value in pixels to be translated.

Return value

TInt

The equivalent number of twips.


VerticalPixelsToTwips(TInt)const

IMPORT_C virtual TInt VerticalPixelsToTwips(TInt aPixels) const;

Description

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

Parameters

TInt aPixels

A vertical dimension of a device in pixels.

Return value

TInt

The vertical dimension in twips.

See also:


PointerRect()const

IMPORT_C TRect PointerRect() const;

Description

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.

Return value

TRect

The active area, measured in pixels.


CreateContext(CGraphicsContext *&)

IMPORT_C virtual TInt CreateContext(CGraphicsContext *&aGc);

Description

Creates a graphics context for this device.

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

Parameters

CGraphicsContext *&aGc

On successful return, contains a new graphics context referring to this screen device.

Return value

TInt

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

See also:


CreateContext(CWindowGc *&)

inline TInt CreateContext(CWindowGc *&aGc);

Description

Creates a graphics context for this device.

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

Parameters

CWindowGc *&aGc

On successful return, contains a new graphics context referring to this screen device.

Return value

TInt

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

See also:


GetNearestFontInTwips(CFont *&,const TFontSpec &)

Interface status: deprecated

IMPORT_C virtual TInt GetNearestFontInTwips(CFont *&aFont, const TFontSpec &aFontSpec);

Description

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

When the font is no longer needed, call ReleaseFont() .

Note that this deprecated function is replaced by the new GetNearestFontToDesignHeightInTwips() yielding (virtually) the same result. However clients are strongly encouraged to use the new GetNearestFontToMaxHeightInTwips() function instead. This will guarantee that every character within any given text string will fit within the given amount of twips, whereas the design height is an aesthetic unit decided by the font designer without strict physical meaning, which may result in cropped characters.

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

Parameters

CFont *&aFont

On return, this is set to point to the device font closest to the font specification passed in the second argument.

const TFontSpec &aFontSpec

An absolute font specification.

Return value

TInt

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

See also:


GetNearestFontToDesignHeightInTwips(CFont *&,const TFontSpec &)

IMPORT_C virtual TInt GetNearestFontToDesignHeightInTwips(CFont *&aFont, const TFontSpec &aFontSpec);

Description

Gets the nearest font in twips to that specified.

When the font is no longer needed, call ReleaseFont() .

This new function replaces the deprecated GetNearestFontInTwips() yielding (virtually) the same result. However clients are strongly encouraged to use the new GetNearestFontToMaxHeightInTwips() function instead. This will guarantee that every character within any given text string will fit within the given amount of twips, whereas the design height is an aesthetic unit decided by the font designer without strict physical meaning, which may result in cropped characters.

Parameters

CFont *&aFont

On return, the pointer is set to point to the device font which most closely approximates to the required font specification.

const TFontSpec &aFontSpec

An absolute font specification.

Return value

TInt

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

See also:


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

IMPORT_C virtual TInt GetNearestFontToMaxHeightInTwips(CFont *&aFont, const TFontSpec &aFontSpec, TInt aMaxHeight);

Description

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

When the font is no longer needed, call ReleaseFont() .

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.

Parameters

CFont *&aFont

On return, the pointer is set to point to the device font which most closely approximates to the required font specification.

const TFontSpec &aFontSpec

An absolute font specification.

TInt aMaxHeight

The maximum height within which the font must fit - this overrides the height specified in the TFontSpec. If maximum height is greater than 1024 pixels, the function returns KErrTooBig. And returns KErrArgument if equals to 1 pixel.

Return value

TInt

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

See also:


NumTypefaces()const

IMPORT_C virtual TInt NumTypefaces() const;

Description

Gets the number of typefaces supported by the screen device.

Return value

TInt

The number of typefaces supported.

See also:


TypefaceSupport(TTypefaceSupport &,TInt)const

IMPORT_C virtual void TypefaceSupport(TTypefaceSupport &aTypefaceSupport, TInt aTypefaceIndex) const;

Description

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.

Parameters

TTypefaceSupport &aTypefaceSupport

On return, if the function executed successfully, this contains the typeface information.

TInt aTypefaceIndex

A typeface index number, in the range zero to (CWsScreenDevice::NumTypefaces()const

See also:


FontHeightInTwips(TInt,TInt)const

IMPORT_C virtual TInt FontHeightInTwips(TInt aTypefaceIndex, TInt aHeightIndex) const;

Description

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.

Parameters

TInt aTypefaceIndex

A typeface index number, in the range: 0 to (CWsScreenDevice::NumTypefaces()const - 1).

TInt aHeightIndex

A font height index number, in the range: 0 to (iNumHeights - 1).

Return value

TInt

The height of the font in twips.

See also:


GetPixel(TRgb &,const TPoint &)const

IMPORT_C virtual void GetPixel(TRgb &aColor, const TPoint &aPixel) const;

Description

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

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

Parameters

TRgb &aColor

On return, contains the RGB colour of the pixel.

const TPoint &aPixel

The x,y co-ordinates of the pixel. The top left pixel is (0,0).

See also:


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

IMPORT_C virtual void GetScanLine(TDes8 &aScanLine, const TPoint &aStartPixel, TInt aPixelLength, TDisplayMode aDispMode) const;

Description

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.

Parameters

TDes8 &aScanLine

A buffer into which pixels are copied, it must be sufficiently large to store all the scanline pixels.

const TPoint &aStartPixel

The (x,y) co-ordinates of the first pixel of the bitmap scanline to be put into the buffer.

TInt aPixelLength

The number of pixels to put into the buffer.

TDisplayMode aDispMode

The display mode into which to convert the pixels.

See also:


AddFile(const TDesC &,TInt &)

IMPORT_C virtual TInt AddFile(const TDesC &aName, TInt &aId);

Description

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.

Parameters

const TDesC16 &aName

Name of the font file.

TInt &aId

ID for the font file.

Return value

TInt

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

See also:


RemoveFile(TInt)

IMPORT_C virtual void RemoveFile(TInt aId=0);

Description

Removes a font file from the font store.

Parameters

TInt aId

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

See also:


GetNearestFontInPixels(CFont *&,const TFontSpec &)

Interface status: deprecated

IMPORT_C virtual TInt GetNearestFontInPixels(CFont *&aFont, const TFontSpec &aFontSpec);

Description

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

When the font is no longer needed, call ReleaseFont() .

Note that this deprecated function is replaced by the new GetNearestFontToDesignHeightInPixels() yielding (virtually) the same result. However clients are strongly encouraged to use the new GetNearestFontToMaxHeightInPixels() function instead. This will guarantee that every character within any given text string will fit within the given amount of pixels, whereas the design height is an aesthetic unit decided by the font designer without strict physical meaning, which may result in cropped characters.

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

Parameters

CFont *&aFont

On return, this is set to point to the device font that is closest to the font specification passed in the second argument

const TFontSpec &aFontSpec

An absolute font specification

Return value

TInt

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

See also:


GetNearestFontToDesignHeightInPixels(CFont *&,const TFontSpec &)

IMPORT_C virtual TInt GetNearestFontToDesignHeightInPixels(CFont *&aFont, const TFontSpec &aFontSpec);

Description

Gets the nearest font in pixels to that specified.

When the font is no longer needed, call ReleaseFont() .

This new function replaces the deprecated GetNearestFontInPixels() yielding (virtually) the same result. However clients are strongly encouraged to use the new GetNearestFontToMaxHeightInPixels() function instead. This will guarantee that every character within any given text string will fit within the given amount of pixels, whereas the design height is an aesthetic unit decided by the font designer without strict physical meaning, which may result in cropped characters.

Parameters

CFont *&aFont

On return, the pointer is set to point to the device font which most closely approximates to the required font specification.

const TFontSpec &aFontSpec

An absolute font specification.

Return value

TInt

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

See also:


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

IMPORT_C virtual TInt GetNearestFontToMaxHeightInPixels(CFont *&aFont, const TFontSpec &aFontSpec, TInt aMaxHeight);

Description

Gets the nearest font in pixels to that specified.

When the font is no longer needed, call ReleaseFont() .

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.

Parameters

CFont *&aFont

On return, the pointer is set to point to the device font which most closely approximates to the required font specification.

const TFontSpec &aFontSpec

An absolute font specification.

TInt aMaxHeight

The maximum height within which the font must fit - this overrides the height specified in the TFontSpec. If maximum height is greater than 1024 pixels, the function returns KErrTooBig. And returns KErrArgument if equals to 1 pixel.

Return value

TInt

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

See also:


FontHeightInPixels(TInt,TInt)const

IMPORT_C virtual TInt FontHeightInPixels(TInt aTypefaceIndex, TInt aHeightIndex) const;

Description

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.

Parameters

TInt aTypefaceIndex

A typeface index number, in the range: 0 to (CWsScreenDevice::NumTypefaces()const - 1).

TInt aHeightIndex

A font height index number, in the range: 0 to (iNumHeights - 1).

Return value

TInt

The height of the font in pixels.

See also:


ReleaseFont(CFont *)

IMPORT_C virtual void ReleaseFont(CFont *aFont);

Description

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.

Parameters

CFont *aFont

A pointer to the font to be released.

See also:


PaletteAttributes(TBool &,TInt &)const

IMPORT_C virtual void PaletteAttributes(TBool &aModifiable, TInt &aNumEntries) const;

Description

Gets the attributes of the device's palette.

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

Parameters

TBool &aModifiable

On return, indicates whether or not the device's palette is modifiable (true) or fixed (false).

TInt &aNumEntries

On return, holds the number of entries in the device's palette.

See also:


SetPalette(CPalette *)

Interface status: deprecated SetCustomPalette() should be used instead.
Capability: WriteDeviceData

IMPORT_C virtual void SetPalette(CPalette *aPalette);

Description

Sets the screen device's palette.

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

Parameters

CPalette *aPalette

The screen device's new palette.

Panic codes

W32

6 aPalette is NULL.


GetPalette(CPalette *&)const

IMPORT_C virtual TInt GetPalette(CPalette *&aPalette) const;

Description

Gets the screen device's palette.

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

Parameters

CPalette *&aPalette

On return, contains the screen device's palette. The caller takes responsibility for discarding the palette.

Return value

TInt

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

See also:


SetCustomPalette(const CPalette *)

Capability: WriteDeviceData

IMPORT_C TInt SetCustomPalette(const CPalette *aPalette);

Description

Sets the custom palette.

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

Parameters

const CPalette *aPalette

The custom palette.

Return value

TInt

KErrNone if sucessful, or one of the system error codes.

Panic codes

W32

6 aPalette is NULL.


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

IMPORT_C TInt GetFontById(CFont *&aFont, TUid aUid, const TAlgStyle &aAlgStyle);

Description

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 *&aFont

On a successful return, contains a pointer to the new CFont.

TUid aUid

UID of the bitmap font.

const TAlgStyle &aAlgStyle

The algorithmic style to apply.

Return value

TInt

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


RectCompare(const TRect &,const TRect &)

IMPORT_C TBool RectCompare(const TRect &aRect1, const TRect &aRect2);

Description

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 &aRect1

A rectangle.

const TRect &aRect2

Another rectangle.

Return value

TBool

ETrue if the two screen areas are identical.


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

IMPORT_C TBool RectCompare(const TRect &aRect1, const TRect &aRect2, TUint aFlags) const;

Description

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 &aRect1

A rectangle.

const TRect &aRect2

Another rectangle.

TUint aFlags

EIncludeSprite to include the sprite in the compare or ERemoveSprite to remove the sprite.

Return value

TBool

ETrue if the two screen areas are identical.


CopyScreenToBitmap(const CFbsBitmap *)const

IMPORT_C TInt CopyScreenToBitmap(const CFbsBitmap *aBitmap) const;

Description

Saves the entire screen to a bitmap.

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

Parameters

const CFbsBitmap *aBitmap

Bitmap to be filled with the screen image.

Return value

TInt

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


CopyScreenToBitmap(const CFbsBitmap *,const TRect &)const

IMPORT_C TInt CopyScreenToBitmap(const CFbsBitmap *aBitmap, const TRect &aRect) const;

Description

Saves a region of the screen to a bitmap.

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

Parameters

const CFbsBitmap *aBitmap

Bitmap to be filled with the screen region image.

const TRect &aRect

Screen region to be saved.

Return value

TInt

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


SetBackLight(TBool)

IMPORT_C TInt SetBackLight(TBool aBackLight);

Description

Set the back light state.

If the back light is disabled, or the client process SID does not match the EikSrv one (0x10003a4a), KErrPermissionDenied is returned. If the system is in a low power state, KErrBadPower may be returned.

Parameters

TBool aBackLight

Return value

TInt

KErrNone if successful, otherwise a system-wide error code.


SetScreenSizeAndRotation(const TPixelsTwipsAndRotation &)

IMPORT_C void SetScreenSizeAndRotation(const TPixelsTwipsAndRotation &aSizeAndRotation);

Description

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

Parameters

const TPixelsTwipsAndRotation &aSizeAndRotation

The new rotation and the screen size in both pixels and twips.


GetDefaultScreenSizeAndRotation(TPixelsTwipsAndRotation &)const

IMPORT_C void GetDefaultScreenSizeAndRotation(TPixelsTwipsAndRotation &aSizeAndRotation) const;

Description

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 &aSizeAndRotation

The default screen size and rotation, defining screen size in both pixels and twips.


SetScreenSizeAndRotation(const TPixelsAndRotation &)

IMPORT_C void SetScreenSizeAndRotation(const TPixelsAndRotation &aSizeAndRotation);

Description

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 &aSizeAndRotation

The new rotation and the screen size in pixels.


GetDefaultScreenSizeAndRotation(TPixelsAndRotation &)const

IMPORT_C void GetDefaultScreenSizeAndRotation(TPixelsAndRotation &aSizeAndRotation) const;

Description

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

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

Parameters

TPixelsAndRotation &aSizeAndRotation

The default screen size in pixels and the rotation.


ScreenModeEnforcement()const

IMPORT_C TScreenModeEnforcement ScreenModeEnforcement() const;

Description

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 CWsScreenDevice::SetScreenModeEnforcement(TScreenModeEnforcement)const.

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

Return value

TScreenModeEnforcement

The screen mode enforcement requirements.


GetScreenModeSizeAndRotation(TInt,TPixelsTwipsAndRotation &)const

IMPORT_C void GetScreenModeSizeAndRotation(TInt aMode, TPixelsTwipsAndRotation &aSizeAndRotation) const;

Description

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 aMode

The index of the screen mode for which the screen size and rotation are required.

TPixelsTwipsAndRotation &aSizeAndRotation

The orientation of the specified screen mode, and its size in both pixels and twips.


GetScreenModeSizeAndRotation(TInt,TPixelsAndRotation &)const

IMPORT_C void GetScreenModeSizeAndRotation(TInt aMode, TPixelsAndRotation &aSizeAndRotation) const;

Description

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 aMode

The index of the screen mode for which the screen size and rotation are required.

TPixelsAndRotation &aSizeAndRotation

The orientation of the specified screen mode, and its size in pixels.


GetRotationsList(TInt,CArrayFixFlat< TInt > *)const

IMPORT_C TInt GetRotationsList(TInt aMode, CArrayFixFlat< TInt > *aRotationList) const;

Description

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.

Parameters

TInt aMode

The index of the screen mode for which the rotation list is required.

CArrayFixFlat< TInt > *aRotationList

The list of valid screen orientations.

Return value

TInt

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


NumScreenModes()const

IMPORT_C TInt NumScreenModes() const;

Description

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.

Return value

TInt

The number of screen modes.


CurrentScreenMode()const

IMPORT_C TInt CurrentScreenMode() const;

Description

Gets the current screen mode index.

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

Return value

TInt

The index into the list of available screen modes of the current screen mode.


SetAppScreenMode(TInt)

IMPORT_C void SetAppScreenMode(TInt aMode);

Description

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 aMode

The index of the application's new screen mode.


GetDefaultScreenModeOrigin()const

IMPORT_C TPoint GetDefaultScreenModeOrigin() const;

Description

Gets the origin for the current screen mode

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

Return value

TPoint


GetScreenModeOrigin(TInt)const

IMPORT_C TPoint GetScreenModeOrigin(TInt aMode) const;

Description

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

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

Parameters

TInt aMode

The index of the screen mode for which the screen origin is required.

Return value

TPoint


GetCurrentScreenModeScale()const

IMPORT_C TSize GetCurrentScreenModeScale() const;

Description

Gets the scale for the current screen mode.

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

Return value

TSize

The scale for the current screen mode.


GetScreenModeScale(TInt)const

IMPORT_C TSize GetScreenModeScale(TInt aMode) const;

Description

Gets the scale for the specified screen mode.

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

Parameters

TInt aMode

The index of the screen mode for which the screen scale is required.

Return value

TSize

The scale for the specified screen mode.


GetCurrentScreenModeScaledOrigin()const

IMPORT_C TPoint GetCurrentScreenModeScaledOrigin() const;

Description

Gets the current screen mode's scaled origin.

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

where:

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

Return value

TPoint

The scaled origin for the current screen mode.


GetScreenModeScaledOrigin(TInt)const

IMPORT_C TPoint GetScreenModeScaledOrigin(TInt aMode) const;

Description

Gets the specfied screen mode's scaled origin.

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

It always causes a flush of the window server buffer.

Parameters

TInt aMode

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

Return value

TPoint

The scaled origin for the specified screen mode.


GetScreenSizeModeList(RArray< TInt > *)

IMPORT_C TInt GetScreenSizeModeList(RArray< TInt > *aModeList);

Description

Gets the available screen size modes.

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

Parameters

RArray< TInt > *aModeList

On return, the list of available screen size modes.

Return value

TInt

The number of supported screen size modes if successful otherwise returns KErrNoMemory if there is insufficient memory to create the array.


GetScreenModeDisplayMode(const TInt &)const

IMPORT_C TDisplayMode GetScreenModeDisplayMode(const TInt &aMode) const;

Description

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 &aMode

The index of the screen mode for which the display mode is required

Return value

TDisplayMode

The display mode for the specified screen mode.


GetScreenNumber()const

IMPORT_C TInt GetScreenNumber() const;

Description

Get device's screen number

Return value

TInt

The device's screen number

See also:

[Top]


Member enumerations


Enum TSpriteInCompare

TSpriteInCompare

Description

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

ERemoveSprite

This enum can be specified as the 3rd parameter to CWsScreenDevice::RectCompare(const TRect &,const TRect &)(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 &,const TRect &) will not include sprites in the comparison.

EIncludeSprite

This enum can be specified as the 3rd parameter to CWsScreenDevice::RectCompare(const TRect &,const TRect &)(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

This enum can be specified as the 3rd parameter to CWsScreenDevice::RectCompare(const TRect &,const TRect &)(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.