class CFbsDevice : public CBitmapDevice |
Abstract base class for graphics devices to which bitmaps and fonts can be drawn.
The class implements the pure virtual CBitmapDevice functions and additionally provides:
support for creating and enquiring about fonts
comparing two device rectangles
creating a graphics context for the device.
CFbsBitmapDevice and CFbsScreenDevice are derived fom this class.
Protected Member Functions | |
---|---|
CFbsDevice() | |
void | CancelSprite() |
void | DoGetScanLine(TDes8 &, const TPoint &, TInt, TDisplayMode) |
void | DrawingBegin(TBool) |
void | DrawingBegin(const CFbsBitmap *, TBool) |
void | DrawingEnd(TBool) |
void | DrawingEnd(const CFbsBitmap *, TBool) |
TInt | GetNearestFbsFont(CFbsFont *&, const TFontSpec &) |
TSpriteBase * | HideSprite() |
TSpriteBase * | HideSprite(const TRect &, const TRegion *) |
void | ReadLineDiffMode(TInt, TInt, TInt, TAny *, TDisplayMode) |
void | SetBits() |
TBool | SetOrientation(CFbsBitGc::TGraphicsOrientation) |
void | ShowSprite(TSpriteBase *) |
void | ShowSprite(TSpriteBase *, const TRect &, const TRegion *) |
void | TruncateRect(TRect &) |
Protected Attributes | |
---|---|
TUint8 * | iBitBltMaskedBuffer |
CFbsDrawDevice * | iDrawDevice |
RFbsSession * | iFbs |
CGraphicsAccelerator * | iGraphicsAccelerator |
CFbsBitGc::TGraphicsOrientation | iOrientation |
TBool | iScreenDevice |
TInt | iSpare |
CFbsTypefaceStore * | iTypefaceStore |
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.
void | CancelSprite | ( | ) | const [protected, inline, virtual] |
This method has been deprecated. Sprites are no longer supported in BitGDI. Calling this method has no effect.
TInt | CreateContext | ( | CGraphicsContext *& | aGc | ) | [inline, virtual] |
Creates a font and bitmap server graphics context for the device and activates it.
It is the responsibility of the caller to delete the graphics context when it is no longer needed.
KErrNone if successful, otherwise, another one of the system-wide error codes.
CGraphicsContext *& aGc | On return, contains a pointer to the graphics context. |
IMPORT_C TDisplayMode | DisplayMode | ( | ) | const [virtual] |
Gets the display mode of the device.
The display mode of the device.
void | DoGetScanLine | ( | TDes8 & | aBuf, |
const TPoint & | aPixel, | |||
TInt | aLength, | |||
TDisplayMode | aDispMode | |||
) | [protected] |
TDes8 & aBuf | |
const TPoint & aPixel | |
TInt aLength | |
TDisplayMode aDispMode |
void | DrawingBegin | ( | TBool | = EFalse | ) | [protected, inline, virtual] |
TBool = EFalse |
void | DrawingBegin | ( | const CFbsBitmap * | aBitmap, |
TBool | aAlways = EFalse | |||
) | [protected] |
const CFbsBitmap * aBitmap | |
TBool aAlways = EFalse |
void | DrawingEnd | ( | TBool | = EFalse | ) | [protected, inline, virtual] |
TBool = EFalse |
void | DrawingEnd | ( | const CFbsBitmap * | aBitmap, |
TBool | aAlways = EFalse | |||
) | [protected] |
const CFbsBitmap * aBitmap | |
TBool aAlways = EFalse |
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 TInt | GetFontById | ( | CFont *& | aFont, |
TUid | aFileId, | |||
const TAlgStyle & | aStyle | |||
) |
TInt | GetFontById | ( | CFbsFont *& | aFont, |
TUid | aFileId, | |||
const TAlgStyle & | aStyle | |||
) | [inline] |
Gets a specific bitmap font, identified by its UID, from the device's typeface store.
When the font is no longer needed, call ReleaseFont().
KErrNone if successful; otherwise, another of the system-wide error codes.
TInt | GetNearestFbsFont | ( | CFbsFont *& | aFont, |
const TFontSpec & | aFontSpec | |||
) | [protected] |
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
TInt | GetNearestFontInPixels | ( | CFbsFont *& | aFont, |
const TFontSpec & | aFontSpec | |||
) | [inline] |
Creates a client-side FBSERV font from those available in the device's typeface store that most closely matches a font specification.
When the font is no longer needed, call ReleaseFont().
This function is replaced by GetNearestFontToDesignHeightInPixels().
KErrNone if successful; otherwise, another of the system-wide error codes.
IMPORT_C TInt | GetNearestFontInTwips | ( | CFont *& | aFont, |
const TFontSpec & | aFontSpec | |||
) | [virtual] |
TInt | GetNearestFontInTwips | ( | CFbsFont *& | aFont, |
const TFontSpec & | aFontSpec | |||
) | [inline] |
Creates a client-side FBSERV font from those available in the device's typeface store that most closely matches a font specification.
When the font is no longer needed, call ReleaseFont().
This function is replaced by GetNearestFontToDesignHeightInTwips().
KErrNone if successful; otherwise, another one of the system-wide error codes.
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.
TInt | GetNearestFontToDesignHeightInPixels | ( | CFbsFont *& | aFont, |
const TFontSpec & | aFontSpec | |||
) | [inline] |
Creates a client-side FBSERV font from those available in the device's typeface store that most closely matches a font specification.
When the font is no longer needed, call ReleaseFont().
This function replaces GetNearestFontInPixels().
KErrNone if successful; otherwise, another of the system-wide error codes.
IMPORT_C TInt | GetNearestFontToDesignHeightInTwips | ( | CFont *& | aFont, |
const TFontSpec & | aFontSpec | |||
) | [virtual] |
TInt | GetNearestFontToDesignHeightInTwips | ( | CFbsFont *& | aFont, |
const TFontSpec & | aFontSpec | |||
) | [inline] |
Creates a client-side FBSERV font from those available in the device's typeface store that most closely matches a font specification.
When the font is no longer needed, call ReleaseFont().
This function replaces GetNearestFontInTwips().
KErrNone if successful; otherwise, another one of the system-wide error codes.
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.
TInt | GetNearestFontToMaxHeightInPixels | ( | CFbsFont *& | aFont, |
const TFontSpec & | aFontSpec, | |||
TInt | aMaxHeight | |||
) | [inline] |
Creates a client-side FBSERV font from those available in the device's typeface store that most closely matches a 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; otherwise, another of the system-wide error codes.
CFbsFont *& 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 in pixels within which the font must fit - this overrides the height specified in aFontSpec. |
IMPORT_C TInt | GetNearestFontToMaxHeightInTwips | ( | CFont *& | aFont, |
const TFontSpec & | aFontSpec, | |||
TInt | aMaxHeight | |||
) | [virtual] |
TInt | GetNearestFontToMaxHeightInTwips | ( | CFbsFont *& | aFont, |
const TFontSpec & | aFontSpec, | |||
TInt | aMaxHeight | |||
) | [inline] |
Creates a client-side FBSERV font from those available in the device's typeface store that most closely matches a 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; otherwise, another of the system-wide error codes.
CFbsFont *& 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 in twips within which the font must fit - this overrides the height specified in aFontSpec. |
CGraphicsAccelerator * | GraphicsAccelerator | ( | ) | const [inline] |
Gets a pointer to the 2D graphics accelerator owned by the device. If one is available, it is used to accelerate various CFbsBitGc graphics operations.
Pointer to the graphics accelerator or NULL if not supported.
TSpriteBase * | HideSprite | ( | ) | const [protected, inline, virtual] |
This method has been deprecated. Sprites are no longer supported in BitGDI. Calling this method has no effect. TSpriteBase* NULL.
TSpriteBase * | HideSprite | ( | const TRect & | , |
const TRegion * | ||||
) | const [protected, inline, virtual] |
This method has been deprecated. Sprites are no longer supported in BitGDI. Calling this method has no effect. TSpriteBase* NULL.
IMPORT_C TInt | NumTypefaces | ( | ) | const [virtual] |
Gets the number of typefaces supported by the graphics device.
The number of typefaces supported.
CFbsBitGc::TGraphicsOrientation | Orientation | ( | ) | const [inline] |
Gets the device's orientation. The orientation can be set using CFbsBitGc::SetOrientation().
The device's orientation.
void | ReadLineDiffMode | ( | TInt | , |
TInt | , | |||
TInt | , | |||
TAny * | , | |||
TDisplayMode | ||||
) | const [protected] |
TInt | |
TInt | |
TInt | |
TAny * | |
TDisplayMode |
IMPORT_C TBool | RectCompare | ( | const TRect & | aSourceRect, |
const CFbsDevice & | aDevice, | |||
const TRect & | aDeviceRect | |||
) | const |
const TRect & aSourceRect | |
const CFbsDevice & aDevice | |
const TRect & aDeviceRect |
IMPORT_C TInt | RegisterLinkedTypeface | ( | const CLinkedTypefaceSpecification & | aLinkedTypefaceSpec, |
TInt & | aId | |||
) |
const CLinkedTypefaceSpecification & aLinkedTypefaceSpec | |
TInt & aId |
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 TInt | SetCustomPalette | ( | const CPalette * | aPalette | ) |
const CPalette * aPalette |
IMPORT_C TInt | SetDrawDeviceOffset | ( | const TPoint & | aOrigin | ) |
const TPoint & aOrigin |
TBool | SetOrientation | ( | CFbsBitGc::TGraphicsOrientation | aOrientation | ) | [protected] |
CFbsBitGc::TGraphicsOrientation aOrientation |
IMPORT_C TInt | SetScalingFactor | ( | const TPoint & | aOrigin, |
TInt | aFactorX, | |||
TInt | aFactorY, | |||
TInt | aDivisorX, | |||
TInt | aDivisorY | |||
) |
void | ShowSprite | ( | TSpriteBase * | ) | const [protected, inline, virtual] |
This method has been deprecated. Sprites are no longer supported in BitGDI. Calling this method has no effect.
TSpriteBase * |
void | ShowSprite | ( | TSpriteBase * | , |
const TRect & | , | |||
const TRegion * | ||||
) | const [protected, inline, virtual] |
This method has been deprecated. Sprites are no longer supported in BitGDI. Calling this method has no effect.
TSpriteBase * | |
const TRect & | |
const TRegion * |
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 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). |
CFbsBitGc::TGraphicsOrientation | iOrientation | [protected] |