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.
Private Member Functions | |
---|---|
TSize | DisplaySizeInPixels() |
TSize | PhysicalScreenSizeInTwips() |
CFbsTypefaceStore * | TypeFaceStore() |
Public Member Enumerations | |
---|---|
enum | TSpriteInCompare { ERemoveSprite = 0, EIncludeSprite = 1, EIncludeTextCursor = 2 } |
Private Attributes | |
---|---|
TSize | iDisplaySizeInPixels |
CScrDevExtension * | iExtension |
TSize | iPhysicalScreenSizeInTwips |
IMPORT_C TInt | AddFile | ( | 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.
This pure virtual function is implemented in derived classes.
KErrNone, if successful; otherwise, another of the system-wide error codes.
IMPORT_C TInt | Construct | ( | TInt | aDefaultScreenNumber | ) |
TInt aDefaultScreenNumber |
IMPORT_C TInt | CopyScreenToBitmap | ( | const CFbsBitmap * | aBitmap | ) | const |
const CFbsBitmap * aBitmap |
IMPORT_C TInt | CopyScreenToBitmap | ( | const CFbsBitmap * | aBitmap, |
const TRect & | aRect | |||
) | const |
const CFbsBitmap * aBitmap | |
const TRect & aRect |
IMPORT_C TInt | CreateContext | ( | CGraphicsContext *& | aGC | ) | [virtual] |
Creates a graphics context for the device.
KErrNone, if successful; otherwise, another of the system-wide error codes.
CGraphicsContext *& aGC | On return, contains a pointer to the created graphics context. |
TInt | CreateContext | ( | CWindowGc *& | aGc | ) | [inline] |
Creates a graphics context for this device.
This function always causes a flush of the window server buffer.
KErrNone if successful, otherwise one of the system-wide error codes.
CWindowGc *& aGc | On successful return, contains a new graphics context referring to this screen device. |
IMPORT_C TDisplayMode | DisplayMode | ( | ) | const [virtual] |
Gets the display mode of the device.
The display mode of the device.
IMPORT_C TInt | FontHeightInPixels | ( | TInt | aTypefaceIndex, |
TInt | aHeightIndex | |||
) | const [virtual] |
Gets the height, in pixels, of the specified typeface at one of its defined heights.
The typeface is identified by by an index. For a given typeface, there are a discrete number of heights; the specific height is also identified by an index.
The value returned is rounded up or down to the nearest font height in pixels.
This pure virtual function is implemented in derived classes.
The height of the font, in pixels.
IMPORT_C TInt | FontHeightInTwips | ( | TInt | aTypefaceIndex, |
TInt | aHeightIndex | |||
) | const [virtual] |
Get the height of a font in twips.
The font is identified by typeface and height.
The value returned is rounded up or down to the nearest font height in twips.
The height of the font, in twips.
IMPORT_C void | GetDefaultScreenSizeAndRotation | ( | TPixelsTwipsAndRotation & | aSizeAndRotation | ) | const |
TPixelsTwipsAndRotation & aSizeAndRotation |
IMPORT_C void | GetDefaultScreenSizeAndRotation | ( | TPixelsAndRotation & | aSizeAndRotation | ) | const |
TPixelsAndRotation & aSizeAndRotation |
IMPORT_C TInt | GetFontById | ( | CFont *& | aFont, |
TUid | aUid, | |||
const TAlgStyle & | aAlgStyle | |||
) |
const TAny * | GetInterface | ( | TUint | aInterfaceId | ) | const [inline] |
TUint aInterfaceId |
IMPORT_C TInt | GetNearestFontInPixels | ( | CFont *& | aFont, |
const TFontSpec & | aFontSpec | |||
) | [virtual] |
Gets the font which is the nearest to the given font specification.
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.
KErrNone if successful; a system-wide error code otherwise.
Use GetNearestFontToDesignHeightInPixels
IMPORT_C TInt | GetNearestFontInTwips | ( | CFont *& | aFont, |
const TFontSpec & | aFontSpec | |||
) | [virtual] |
IMPORT_C TInt | GetNearestFontToDesignHeightInPixels | ( | CFont *& | , |
const TFontSpec & | ||||
) | [virtual] |
Gets the font which is the nearest to the given font specification.
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.
KErrNone if successful; a system-wide error code otherwise.
IMPORT_C TInt | GetNearestFontToDesignHeightInTwips | ( | CFont *& | aFont, |
const TFontSpec & | aFontSpec | |||
) | [virtual] |
IMPORT_C TInt | GetNearestFontToMaxHeightInPixels | ( | CFont *& | , |
const TFontSpec & | , | |||
TInt | ||||
) | [virtual] |
Gets the font which is the nearest to the given font specification.
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.
KErrNone if successful; a system-wide error code otherwise.
IMPORT_C TInt | GetNearestFontToMaxHeightInTwips | ( | CFont *& | aFont, |
const TFontSpec & | aFontSpec, | |||
TInt | aMaxHeight | |||
) | [virtual] |
IMPORT_C TInt | GetPalette | ( | CPalette *& | aPalette | ) | const [virtual] |
Gets the device's current palette.
This function is only supported if the device has a modifiable palette, which can be determined by calling PaletteAttributes().
KErrNone, if successful; otherwise, another of the system-wide error codes.
CPalette *& aPalette | On return, holds the device's current palette. |
IMPORT_C void | GetPixel | ( | TRgb & | aColor, |
const TPoint & | aPixel | |||
) | const [virtual] |
Gets the RGB colour of an individual pixel on a bitmapped graphics device.
This pure virtual function is implemented in derived classes.
IMPORT_C TInt | GetRotationsList | ( | TInt | aMode, |
CArrayFixFlat< TInt > * | aRotationList | |||
) | const |
TInt aMode | |
CArrayFixFlat< TInt > * aRotationList |
IMPORT_C void | GetScanLine | ( | TDes8 & | aBuf, |
const TPoint & | aStartPixel, | |||
TInt | aLength, | |||
TDisplayMode | aDispMode | |||
) | const [virtual] |
Copies a scanline into a buffer.
The pixels are converted from the display mode format on the bitmapped graphics device to the format of the specified device display mode.
By specifying the start pixel and the number of pixels, either the whole or a portion of a bitmapped graphics device pixel row may be copied.
This pure virtual function is implemented in derived classes.
TDes8 & aBuf | An 8 bit modifiable descriptor 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 aLength | The number of pixels to put into the buffer. |
TDisplayMode aDispMode | The display mode into which to convert the pixels. |
IMPORT_C TDisplayMode | GetScreenModeDisplayMode | ( | const TInt & | aMode | ) | const |
const TInt & aMode |
IMPORT_C TPoint | GetScreenModeScaledOrigin | ( | TInt | aMode | ) | const |
TInt aMode |
IMPORT_C void | GetScreenModeSizeAndRotation | ( | TInt | aMode, |
TPixelsTwipsAndRotation & | aSizeAndRotation | |||
) | const |
TInt aMode | |
TPixelsTwipsAndRotation & aSizeAndRotation |
IMPORT_C void | GetScreenModeSizeAndRotation | ( | TInt | aMode, |
TPixelsAndRotation & | aSizeAndRotation | |||
) | const |
TInt aMode | |
TPixelsAndRotation & aSizeAndRotation |
IMPORT_C TInt | GetScreenSizeModeList | ( | RArray< TInt > * | aModeList | ) | const |
IMPORT_C TInt | HorizontalPixelsToTwips | ( | TInt | aPixels | ) | const |
TInt aPixels |
IMPORT_C TInt | HorizontalTwipsToPixels | ( | TInt | aTwips | ) | const |
TInt aTwips |
IMPORT_C TInt | NumTypefaces | ( | ) | const [virtual] |
Gets the number of typefaces supported by the graphics device.
The number of typefaces supported.
IMPORT_C void | PaletteAttributes | ( | TBool & | aModifiable, |
TInt & | aNumEntries | |||
) | const [virtual] |
Gets the palette attributes of the device.
IMPORT_C TBool | RectCompare | ( | const TRect & | aRect1, |
const TRect & | aRect2 | |||
) | const |
IMPORT_C TBool | RectCompare | ( | const TRect & | aRect1, |
const TRect & | aRect2, | |||
TUint | aFlags | |||
) | const |
IMPORT_C void | RemoveFile | ( | TInt | aId = 0 | ) | [virtual] |
Removes a font file from the font store.
This pure virtual function is implemented in derived classes.
TInt aId = 0 | The ID of the font file to be removed. The default is 0. |
IMPORT_C void | SetCurrentRotations | ( | TInt | aMode, |
CFbsBitGc::TGraphicsOrientation | aRotation | |||
) | const |
TInt aMode | |
CFbsBitGc::TGraphicsOrientation aRotation |
IMPORT_C void | SetCurrentScreenModeAttributes | ( | const TSizeMode & | aModeAtt | ) |
const TSizeMode & aModeAtt |
IMPORT_C TInt | SetCustomPalette | ( | const CPalette * | aPalette | ) |
const CPalette * aPalette |
IMPORT_C void | SetPalette | ( | CPalette * | aPalette | ) | [virtual] |
Sets the device's palette.
Setting the palette is only possible if the device has a modifiable palette, which can be determined by calling PaletteAttributes().
CPalette * aPalette | The new palette for the device. |
IMPORT_C void | SetScreenModeEnforcement | ( | TScreenModeEnforcement | aMode | ) | const |
TScreenModeEnforcement aMode |
IMPORT_C void | SetScreenSizeAndRotation | ( | const TPixelsTwipsAndRotation & | aSizeAndRotation | ) |
const TPixelsTwipsAndRotation & aSizeAndRotation |
IMPORT_C void | SetScreenSizeAndRotation | ( | const TPixelsAndRotation & | aSizeAndRotation | ) |
const TPixelsAndRotation & aSizeAndRotation |
IMPORT_C TSize | SizeInPixels | ( | ) | const [virtual] |
Gets the size of the device area in pixels.
The width and height of the device area, in pixels
IMPORT_C TSize | SizeInTwips | ( | ) | const [virtual] |
Gets the size of the device area in twips.
The width and height of the device area, in twips
IMPORT_C void | TypefaceSupport | ( | TTypefaceSupport & | aTypefaceSupport, |
TInt | aTypefaceIndex | |||
) | const [virtual] |
Gets typeface information for a specified typeface.
This information is returned in aTypefaceSupport, and includes:
the typeface name and typeface attributes
the number of font heights
the maximum and minimum font heights
whether it is a scalable typeface
TTypefaceSupport & aTypefaceSupport | On return, contains the typeface information. |
TInt aTypefaceIndex | A typeface index number, in the range: zero to (NumTypefaces() - 1). |
IMPORT_C TInt | VerticalPixelsToTwips | ( | TInt | aPixels | ) | const |
TInt aPixels |
IMPORT_C TInt | VerticalTwipsToPixels | ( | TInt | aTwips | ) | const |
TInt aTwips |
Whether or not to include sprites when comparing areas of the screen
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. |