#include <bitdev.h>
class CFbsDevice : public CBitmapDevice |
Protected Member Functions | |
---|---|
CFbsDevice() | |
virtual void | CancelSprite() |
void | DoGetScanLine(TDes8 &, const TPoint &, TInt, TDisplayMode) |
virtual void | DrawingBegin(TBool) |
void | DrawingBegin(const CFbsBitmap *, TBool) |
virtual void | DrawingEnd(TBool) |
void | DrawingEnd(const CFbsBitmap *, TBool) |
TInt | GetNearestFbsFont(CFbsFont *&, const TFontSpec &) |
virtual TSpriteBase * | HideSprite() |
virtual TSpriteBase * | HideSprite(const TRect &, const TRegion *) |
void | ReadLineDiffMode(TInt, TInt, TInt, TAny *, TDisplayMode) |
virtual void | SetBits() |
TBool | SetOrientation(CFbsBitGc::TGraphicsOrientation) |
virtual void | ShowSprite(TSpriteBase *) |
virtual void | ShowSprite(TSpriteBase *, const TRect &, const TRegion *) |
void | TruncateRect(TRect &) |
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.
See also: CFbsBitmapDevice CFbsScreenDevice
IMPORT_C | ~CFbsDevice | ( | ) |
Frees all resources owned by the object prior to its destruction.
Reimplemented from CBitmapDevice::AddFile(const TDesC &,TInt &)
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.
Parameter | Description |
---|---|
aName | The name of the font file. |
aId | On return, the UID value of the font file. |
Returns: 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. Deprecated
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.
Parameter | Description |
---|---|
aGc | On return, contains a pointer to the graphics context. |
Returns: KErrNone if successful, otherwise, another one of the system-wide error codes.
TInt | CreateContext | ( | CGraphicsContext *& | aGc | ) | [inline, virtual] |
Reimplemented from CGraphicsDevice::CreateContext(CGraphicsContext *&)
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.
Parameter | Description |
---|---|
aGc | On return, contains a pointer to the graphics context. |
Returns: KErrNone if successful, otherwise, another one of the system-wide error codes.
IMPORT_C TDisplayMode | DisplayMode | ( | ) | const [virtual] |
Reimplemented from CGraphicsDevice::DisplayMode()const
Gets the device's display mode.
Returns: The display mode of the device.
IMPORT_C TDisplayMode | DisplayMode16M | ( | ) | [static] |
Depending on the current graphics hardware this will return one of the 16M video modes defined in TDisplayMode, or ENone if a 16M video mode is not supported.
See also: TDisplayMode
Returns: a 16M display mode or ENone.
void | DoGetScanLine | ( | TDes8 & | aBuf, |
const TPoint & | aPixel, | |||
TInt | aLength, | |||
TDisplayMode | aDispMode | |||
) | [protected] |
The method gets a scanline and puts the scanline data into aBuf.
Parameter | Description |
---|---|
aBuf | The destination buffer. It should be with enough length to collect requested scanline data. |
aPixel | The first pixel of the requested scanline data |
aLength | The length in pixels of requested data |
aDispMode | requested scanline should be converted regarding aDispMode parameter |
void | DrawingBegin | ( | const CFbsBitmap * | aBitmap, |
TBool | aAlways = EFalse | |||
) | [protected] |
An overloaded version of DrawingBegin(TBool). Similarly to that method, calls to DrawingBegin(const CFbsBitmap*, TBool) must be paired with a subsequent call to DrawingEnd(const CFbsBitmap*, TBool). Also, code must not leave between a DrawingBegin(const CFbsBitmap*, TBool) - DrawingEnd(const CFbsBitmap*, TBool) pair.
See also: CFbsBitmapDevice::DrawingBegin()
Parameter | Description |
---|---|
aBitmap | An additional parameter compared to the basic overload. aBitmap is a pointer to a CFbsBitmap object to be frozen. If a null pointer is given then the method panics. |
aAlways | Not used. |
void | DrawingEnd | ( | const CFbsBitmap * | aBitmap, |
TBool | aAlways = EFalse | |||
) | [protected] |
This must always be called after DrawingBegin(const CFbsBitmap*, TBool). Like DrawingBegin(const CFbsBitmap*, TBool) it will panic in debug builds if passed a null pointer.
See also: CFbsBitmapDevice::DrawingEnd()
Parameter | Description |
---|---|
aBitmap | A pointer to a CFbsBitmap object to be unfrozen. |
aAlways | Not used. |
Reimplemented from CBitmapDevice::FontHeightInPixels(TInt,TInt)const
Gets the height, in pixels, of the specified typeface at one of its defined heights.
This is an implementation of CBitMapDevice::FontHeightInPixels().
Reimplemented from CGraphicsDevice::FontHeightInTwips(TInt,TInt)const
Gets the height of a font in twips.
This is an implementation of CGraphicsDevice::FontHeightInTwips().
IMPORT_C void | GetDrawRect | ( | TRect & | aRect | ) | const |
Gets logical coordinates of the drawing rectangle. If the device is not scaled, logocal coordinates of the drawing rectangle are the same as its physical coordinates.
Parameter | Description |
---|---|
aRect | Upon return aRect contains drawing rectangle logical coordinates. |
Gets a specific bitmap font, identified by its UID, from the device's typeface store.
When the font is no longer needed, call ReleaseFont().
Parameter | Description |
---|---|
aFont | On return, set to point to the font. |
aFileId | The UID identifying the bitmap font. |
aStyle | Algorithmic style for the font. |
Returns: KErrNone if successful; otherwise, another of the system-wide error codes.
Gets a specific bitmap font, identified by its UID, from the device's typeface store.
When the font is no longer needed, call ReleaseFont().
Parameter | Description |
---|---|
aFont | On return, set to point to the font. |
aFileId | The UID identifying the bitmap font. |
aStyle | Algorithmic style for the font. |
Returns: KErrNone if successful; otherwise, another of the system-wide error codes.
Reimplemented from CBitmapDevice::GetNearestFontInPixels(CFont *&,const TFontSpec &)
Creates a client-side 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().
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.
Parameter | Description |
---|---|
aFont | On return, points to the font which most closely matches the specified font. |
aFontSpec | An absolute font specification. Its iHeight member is interpreted as being in pixels. |
Returns: KErrNone if successful; otherwise, another of the system-wide error codes.
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().
Parameter | Description |
---|---|
aFont | On return, points to the font which most closely matches the specified font. |
aFontSpec | An absolute font specification. Its iHeight member is interpreted as being in pixels. |
Returns: KErrNone if successful; otherwise, another of the system-wide error codes.
Provides access to a client-side font object in the device's typeface store that most closely matches a 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.
Parameter | Description |
---|---|
aFont | On return, points to the font which most closely matches the specified font. |
aFontSpec | An absolute font specification. Its iHeight member is interpreted as being in twips. |
Returns: KErrNone if successful; otherwise, another one of the system-wide error codes.
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().
Parameter | Description |
---|---|
aFont | On return, points to the font which most closely matches the specified font. |
aFontSpec | An absolute font specification. Its iHeight member is interpreted as being in twips. |
Returns: KErrNone if successful; otherwise, another one of the system-wide error codes.
IMPORT_C TInt | GetNearestFontToDesignHeightInPixels | ( | CFont *& | aFont, |
const TFontSpec & | aFontSpec | |||
) | [virtual] |
Creates a client-side 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 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.
Parameter | Description |
---|---|
aFont | On return, points to the font which most closely matches the specified font. |
aFontSpec | An absolute font specification. Its iHeight member is interpreted as being in pixels. |
Returns: KErrNone if successful; otherwise, another one of the system-wide error codes.
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().
Parameter | Description |
---|---|
aFont | On return, points to the font which most closely matches the specified font. |
aFontSpec | An absolute font specification. Its iHeight member is interpreted as being in pixels. |
Returns: KErrNone if successful; otherwise, another of the system-wide error codes.
IMPORT_C TInt | GetNearestFontToDesignHeightInTwips | ( | CFont *& | aFont, |
const TFontSpec & | aFontSpec | |||
) | [virtual] |
Creates a client-side 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 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.
Parameter | Description |
---|---|
aFont | On return, points to the font which most closely matches the specified font. |
aFontSpec | An absolute font specification. Its iHeight member is interpreted as being in twips. |
Returns: KErrNone if successful; otherwise, another one of the system-wide error codes.
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().
Parameter | Description |
---|---|
aFont | On return, points to the font which most closely matches the specified font. |
aFontSpec | An absolute font specification. Its iHeight member is interpreted as being in twips. |
Returns: KErrNone if successful; otherwise, another one of the system-wide error codes.
IMPORT_C TInt | GetNearestFontToMaxHeightInPixels | ( | CFont *& | aFont, |
const TFontSpec & | aFontSpec, | |||
TInt | aMaxHeight | |||
) | [virtual] |
Reimplemented from CBitmapDevice::GetNearestFontToMaxHeightInPixels(CFont *&,const TFontSpec &,TInt)
Creates a client-side 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.
Parameter | Description |
---|---|
aFont | On return, the pointer is set to point to the device font which most closely approximates to the required font specification. |
aFontSpec | An absolute font specification. |
aMaxHeight | The maximum height in pixels within which the font must fit - this overrides the height specified in aFontSpec. If maximum height is greater than 1024 pixels, the function returns KErrTooBig. And returns KErrArgument if equals to 1 pixel. |
Returns: KErrNone, if successful; otherwise, another of the system-wide error codes.
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.
Parameter | Description |
---|---|
aFont | On return, the pointer is set to point to the device font which most closely approximates to the required font specification. |
aFontSpec | An absolute font specification. |
aMaxHeight | The maximum height in pixels within which the font must fit - this overrides the height specified in aFontSpec. |
Returns: KErrNone, if successful; otherwise, another of the system-wide error codes.
IMPORT_C TInt | GetNearestFontToMaxHeightInTwips | ( | CFont *& | aFont, |
const TFontSpec & | aFontSpec, | |||
TInt | aMaxHeight | |||
) | [virtual] |
Creates a client-side 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.
Parameter | Description |
---|---|
aFont | On return, the pointer is set to point to the device font which most closely approximates to the required font specification. |
aFontSpec | An absolute font specification. |
aMaxHeight | The maximum height in twips within which the font must fit - this overrides the height specified in aFontSpec. If maximum height is greater than 1024 pixels, the function returns KErrTooBig. And returns KErrArgument if equals to 1 pixel. |
Returns: KErrNone, if successful; otherwise, another of the system-wide error codes.
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.
Parameter | Description |
---|---|
aFont | On return, the pointer is set to point to the device font which most closely approximates to the required font specification. |
aFontSpec | An absolute font specification. |
aMaxHeight | The maximum height in twips within which the font must fit - this overrides the height specified in aFontSpec. |
Returns: KErrNone, if successful; otherwise, another of the system-wide error codes.
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.
See also: CFbsBitmapDevice::NewL()
Returns: 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. Deprecated
Returns: 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. Deprecated
Returns: TSpriteBase* NULL.
IMPORT_C TInt | NumTypefaces | ( | ) | const [virtual] |
Reimplemented from CGraphicsDevice::NumTypefaces()const
Gets the number of typefaces supported by the device.
Returns: The number of typefaces supported.
CFbsBitGc::TGraphicsOrientation | Orientation | ( | ) | const [inline] |
Gets the device's orientation. The orientation can be set using CFbsBitGc::SetOrientation().
Returns: The device's orientation.
void | ReadLineDiffMode | ( | TInt | , |
TInt | , | |||
TInt | , | |||
TAny * | , | |||
TDisplayMode | ||||
) | const [protected] |
IMPORT_C TBool | RectCompare | ( | const TRect & | aSourceRect, |
const CFbsDevice & | aDevice, | |||
const TRect & | aDeviceRect | |||
) | const |
Compares two rectangles, including their contents.
This function is intended for use by test code only.
Parameter | Description |
---|---|
aSourceRect | The first rectangle to be compared (in this device). |
aDevice | The font and bitmap server device in which the second rectangle is found. |
aDeviceRect | The second rectangle to be compared. |
Returns: ETrue if the rectangles are the same; EFalse otherwise.
IMPORT_C TInt | RegisterLinkedTypeface | ( | const CLinkedTypefaceSpecification & | aLinkedTypefaceSpec, |
TInt & | aId | |||
) |
See also: CLinkedTypefaceSpecification
Returns: an global error code
IMPORT_C void | ReleaseFont | ( | CFont * | aFont | ) |
Marks the specified font as no longer needed by the user of the device.
As fonts can be shared between applications, this function does not delete the copy of the font from RAM unless the font is only being used by this device.
Parameter | Description |
---|---|
aFont | A pointer to the font to be released. |
IMPORT_C void | RemoveFile | ( | TInt | aId = 0 | ) | [virtual] |
Reimplemented from CBitmapDevice::RemoveFile(TInt)
Decrements the reference count of a file which was added using AddFile(), and removes the file from the typeface store if the reference count reaches zero.
If zero is passed as parameter, then an attempt is made to remove all font objects from the device's typeface store provided none of the fonts in the store are currently accessed, otherwise it has no effect.
Parameter | Description |
---|---|
aId | The UID value of the font file to be removed. The default is 0. |
Sets the variable 8 bits per pixel colour palette, replacing the system default one. Only the entries in the system default palette which have corresponding entries in aPalette are overwritten, i.e. if aPalette contains fewer than 256 colours, some will remain unchanged. If aPalette has more than 256 entries, the additional entries are ignored.
Parameter | Description |
---|---|
aPalette | The custom palette. |
Returns: KErrNone if successful; otherwise, another of the system-wide error codes.
TBool | SetOrientation | ( | CFbsBitGc::TGraphicsOrientation | aOrientation | ) | [protected] |
IMPORT_C TInt | SetScalingFactor | ( | const TPoint & | aOrigin, |
TInt | aFactorX, | |||
TInt | aFactorY, | |||
TInt | aDivisorX, | |||
TInt | aDivisorY | |||
) |
Sets scaling factor by which the drawing device should scale the drawing images. If you want to un-scale the device, call SetScalingFactor() with Origin (0,0), factorX = 1, factorY = 1, divisorX = 1, divisorY = 1.
Note: The existing graphics acceleration interface does not have support for scaling.
Note: All graphics contexts, already created by the scaled device, should be re-activated calling CFbsBitGc::Activate().
Parameter | Description |
---|---|
aOrigin | Specifies physical coordinates of the new scaling origin of the drawing device. The drawing device maps the logical point [0, 0] to the "aOrigin" physical point . |
aFactorX | Scaling factor for the X-axis of the screen device. |
aFactorY | Scaling factor for the y-axis of the screen device. |
aDivisorX | Not used. Should be set to 1. |
aDivisorY | Not used. Should be set to 1. |
Returns: KErrNone If the method succeeds. KErrNotSupported The drawing device does not have scaling capabilities.
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. Deprecated
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. Deprecated
IMPORT_C TSize | SizeInPixels | ( | ) | const [virtual] |
Reimplemented from CGraphicsDevice::SizeInPixels()const
Gets the size of the device, in pixels.
Returns: The width and height of the device, in pixels
IMPORT_C void | TypefaceSupport | ( | TTypefaceSupport & | aTypefaceSupport, |
TInt | aTypefaceIndex | |||
) | const [virtual] |
Reimplemented from CGraphicsDevice::TypefaceSupport(TTypefaceSupport &,TInt)const
Gets information about an indexed typeface.
See also: CGraphicsDevice::TypefaceSupport()
Parameter | Description |
---|---|
aTypefaceSupport | Provides information about the typeface, including its name and attributes. |
aTypefaceIndex | The index of the requested typeface in the device's typeface store; between zero and NumTypefaces() 1 inclusive. |