Location:
w32std.h
Link against: ws32.lib
CWsScreenDevice
Supported from 5.0
Software device screen.
An object of this class can be used to inquire or set parameters of the software screen, and determine the physical limits of the device.
|
Defined in CWsScreenDevice
:
AddFile()
, CWsScreenDevice()
, Construct()
, CopyScreenToBitmap()
, CreateContext()
, DisplayMode()
, FontHeightInPixels()
, FontHeightInTwips()
, GetDefaultScreenSizeAndRotation()
, GetFontById()
, GetNearestFontInPixels()
, GetNearestFontInTwips()
, GetPalette()
, GetPixel()
, GetRotationsList()
, GetScanLine()
, GetScreenModeSizeAndRotation()
, HorizontalPixelsToTwips()
, HorizontalTwipsToPixels()
, NumScreenModes()
, NumTypefaces()
, PaletteAttributes()
, PointerRect()
, RectCompare()
, ReleaseFont()
, RemoveFile()
, ScreenModeEnforcement()
, SetCurrentRotations()
, SetCustomPalette()
, SetPalette()
, SetScreenMode()
, SetScreenModeEnforcement()
, SetScreenSizeAndRotation()
, SizeInPixels()
, SizeInTwips()
, TypefaceSupport()
, VerticalPixelsToTwips()
, VerticalTwipsToPixels()
, ~CWsScreenDevice()
Inherited from CBase
:
operator new()
Inherited from CBitmapDevice
:
CreateBitmapContext()
Inherited from MGraphicsDeviceMap
:
PixelsToTwips()
,
TwipsToPixels()
Inherited from MWsClientClass
:
WsHandle()
CWsScreenDevice();
Default constructor. Developers should use the other constructor overload.
CWsScreenDevice(RWsSession &aWs);
Constructs a new screen device attached to a particular window server session.
|
TInt Construct();
Completes construction of the object.
|
TInt AddFile(const TDesC& aName,TInt& aId);
Adds a font file to the device's font store.
|
|
TInt CopyScreenToBitmap(const CFbsBitmap *aBitmap) const;
Saves the entire screen to a bitmap.
|
|
TInt CopyScreenToBitmap(const CFbsBitmap *aBitmap, const TRect &aRect) const;
Saves a region of the screen to a bitmap.
|
|
TInt CreateContext(CGraphicsContext*& aGc);
Creates a graphics context for this device.
|
|
TInt CreateContext(CWindowGc*& aGc);
Creates a window graphics context for this device.
|
|
TDisplayMode DisplayMode() const;
Gets the device display mode.
|
TInt FontHeightInPixels(TInt aTypefaceIndex,TInt aHeightIndex) const;
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
.
|
|
TInt FontHeightInTwips(TInt aTypefaceIndex,TInt aHeightIndex) const;
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
.
|
|
void GetDefaultScreenSizeAndRotation(TPixelsTwipsAndRotation& aSizeAndRotation) const;
Gets the current screen size and rotation — screen size is specified in both pixels and twips.
|
void GetDefaultScreenSizeAndRotation(TPixelsAndRotation &aSizeAndRotation) const;
Gets the current screen size and rotation — screen size is specified in pixels.
|
TInt GetFontById(CFont*& aFont, TUid aUid, const TAlgStyle& aAlgStyle);
Gets a font by its 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.
|
|
TInt GetNearestFontInPixels(CFont*& aFont,const TFontSpec& aFontSpec);
Gets the nearest font to that specified for use by a bitmapped graphics device.
The font and bitmap server returns a pointer to the nearest
matching font from those available, in aFont
.
|
|
TInt GetNearestFontInTwips(CFont*& aFont,const TFontSpec& aFontSpec);
Gets the nearest font, in twips, to that in the specified font specification.
The font and bitmap server returns a pointer to the nearest
matching font from those available, in aFont
.
|
|
TInt GetPalette(CPalette*& aPalette) const;
Supported from 6.1
Gets the screen device's palette.
|
|
void SetPalette(CPalette* aPalette);
Supported from 6.1
Sets the screen device's palette. Use of this class is deprecated.
|
void PaletteAttributes(TBool& aModifiable,TInt& aNumEntries) const;
Supported from 6.1
Gets the palette attributes of the device.
|
TInt SetCustomPalette(const CPalette* aPalette);
Supported from 6.1
Sets the custom palette.
|
|
void GetPixel(TRgb& aColor,const TPoint& aPixel) const;
Gets the RGB colour of an individual pixel on a screen device.
|
TInt GetRotationsList(TInt aMode, CArrayFixFlat<TInt> *aRotationList) const;
Supported from 5.1
Gets the list of valid rotations for a particular screen size.
The list of valid rotations for the screen size is set in WSINI.INI.
|
|
void GetScanLine(TDes8 &aBuf,const TPoint &aPixel,TInt aLength, TDisplayMode aDispMode) const;
Get a scanline into a buffer.
The pixels are converted from the bitmapped graphics device 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 bitmapped graphics device pixel row may be copied.
|
void GetScreenModeSizeAndRotation(TInt aMode, TPixelsTwipsAndRotation &aSizeAndRotation) const;
Get the screen rotation and size, in both pixels and twips, for the specified screen mode.
|
void GetScreenModeSizeAndRotation(TInt aMode, TPixelsAndRotation &aSizeAndRotation) const;
Get the screen rotation and size, in pixels, for the specified screen mode.
|
TInt HorizontalPixelsToTwips(TInt aPixels) const;
Translates a specified pixel value to a twips value.
|
|
TInt HorizontalTwipsToPixels(TInt aTwips) const;
Translates a specified twips value to a pixel value.
|
|
TInt NumScreenModes() const;
Gets the number of available screen size modes.
Each mode has a different size, and one or more possible rotations/orientations.
|
TInt NumTypefaces() const;
Gets the number of typefaces supported by the screen device.
|
TRect PointerRect() 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 possible factors.
|
TBool RectCompare(const TRect& aRect1, const TRect& aRect2);
Compares two areas of the screen to see if they have the same content.
|
|
void ReleaseFont(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 map. 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 particular device map.
|
void RemoveFile(TInt aId=0);
Removes a font file from the font store.
|
TScreenModeEnforcement ScreenModeEnforcement() const;
Gets the current screen size 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()
.
|
void SetCurrentRotations(TInt aMode, CFbsBitGc::TGraphicsOrientation aRotation) const;
Supported from 5.1
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.
|
|
void SetScreenMode(TInt aMode);
Sets the screen mode.
Note:
This function is only useful for testing. This is because normally the screen size mode reflects the state of real hardware, e.g. the flip in the Ericsson R380 smartphone.
|
void SetScreenModeEnforcement(TScreenModeEnforcement aMode) 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.
|
void SetScreenSizeAndRotation(const TPixelsTwipsAndRotation& aSizeAndRotation);
Sets the current screen size, in twips and pixels, and the rotation for the screen device.
|
void SetScreenSizeAndRotation(const TPixelsAndRotation& aSizeAndRotation);
Sets the current screen size in pixels, and the rotation for the screen device.
|
TSize SizeInPixels() const;
Get the size of the screen device area in pixels.
|
TSize SizeInTwips() const;
Get the size of the screen device area in twips.
|
void TypefaceSupport(TTypefaceSupport& aTypefaceSupport,TInt aTypefaceIndex) const;
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,
whether it is a scalable typeface.
|
TInt VerticalPixelsToTwips(TInt aPixels) const;
Translates a vertical dimension of a screen device in pixels to a vertical dimension in twips.
|
|
TInt VerticalTwipsToPixels(TInt aTwips) const;
Translates a vertical dimension of a screen device in twips to a vertical dimension in pixels.
|
|