Location:
BITDEV.H
Link against: bitgdi.lib
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.
MGraphicsDeviceMap
- Interface class for mapping between twips and device-specific units (pixels)
CBase
- Base class for all classes to be instantiated on the heap
CGraphicsDevice
- Specifies the interface for concrete device classes
CBitmapDevice
- Defines an abstract interface for the capabilities and attributes of a bitmapped graphics device
CFbsDevice
- Abstract base class for graphics devices to which bitmaps and fonts can be drawn
Defined in CFbsDevice
:
AddFile()
, CancelSprite()
, CreateContext()
, CreateContext()
, DisplayMode()
, DisplayMode16M()
, DrawingBegin()
, DrawingEnd()
, FontHeightInPixels()
, FontHeightInTwips()
, GetDrawRect()
, GetFontById()
, GetFontById()
, GetNearestFontInPixels()
, GetNearestFontInPixels()
, GetNearestFontInTwips()
, GetNearestFontInTwips()
, GetNearestFontToDesignHeightInPixels()
, GetNearestFontToDesignHeightInPixels()
, GetNearestFontToDesignHeightInTwips()
, GetNearestFontToDesignHeightInTwips()
, GetNearestFontToMaxHeightInPixels()
, GetNearestFontToMaxHeightInPixels()
, GetNearestFontToMaxHeightInTwips()
, GetNearestFontToMaxHeightInTwips()
, GraphicsAccelerator()
, HideSprite()
, HideSprite()
, NumTypefaces()
, Orientation()
, RectCompare()
, ReleaseFont()
, RemoveFile()
, SetBits()
, SetCustomPalette()
, SetScalingFactor()
, ShowSprite()
, ShowSprite()
, SizeInPixels()
, TypefaceSupport()
, iBitBltMaskedBuffer
, iDrawDevice
, iFbs
, iGraphicsAccelerator
, iOrientation
, iScreenDevice
, iSpare
, iTypefaceStore
, ~CFbsDevice()
Inherited from CBase
:
Delete()
,
Extension_()
,
operator new()
Inherited from CBitmapDevice
:
CreateBitmapContext()
,
GetPixel()
,
GetScanLine()
Inherited from CGraphicsDevice
:
GetPalette()
,
PaletteAttributes()
,
SetPalette()
,
SizeInTwips()
Inherited from MGraphicsDeviceMap
:
HorizontalPixelsToTwips()
,
HorizontalTwipsToPixels()
,
PixelsToTwips()
,
TwipsToPixels()
,
VerticalPixelsToTwips()
,
VerticalTwipsToPixels()
IMPORT_C ~CFbsDevice();
Frees all resources owned by the object prior to its destruction.
IMPORT_C TInt CreateContext(CFbsBitGc *&aGc);
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.
|
|
virtual inline TInt CreateContext(CGraphicsContext *&aGc);
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.
|
|
virtual IMPORT_C TDisplayMode DisplayMode() const;
Gets the device's display mode.
|
virtual IMPORT_C TSize SizeInPixels() const;
Gets the size of the device, in pixels.
|
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.
|
|
virtual IMPORT_C TInt AddFile(const TDesC &aName, TInt &aId);
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.
|
|
virtual IMPORT_C void RemoveFile(TInt aId=0);
Removes the specified font file from the device's typeface store. If the default value of zero is used, this deletes all font files.
|
virtual IMPORT_C TInt GetNearestFontInTwips(CFont *&aFont, const TFontSpec &aFontSpec);
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 function is replaced by GetNearestFontToDesignHeightInTwips()
|
|
virtual IMPORT_C TInt GetNearestFontInPixels(CFont *&aFont, const TFontSpec &aFontSpec);
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 function is replaced by GetNearestFontToDesignHeightInPixels()
|
|
virtual IMPORT_C TInt GetNearestFontToDesignHeightInTwips(CFont *&aFont, const TFontSpec &aFontSpec);
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 function replaces GetNearestFontInTwips()
|
|
virtual IMPORT_C TInt GetNearestFontToDesignHeightInPixels(CFont *&aFont, const TFontSpec &aFontSpec);
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 function replaces GetNearestFontInPixels()
|
|
virtual IMPORT_C TInt GetNearestFontToMaxHeightInTwips(CFont *&aFont, const TFontSpec &aFontSpec, TInt aMaxHeight);
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.
|
|
virtual IMPORT_C TInt GetNearestFontToMaxHeightInPixels(CFont *&aFont, const TFontSpec &aFontSpec, TInt aMaxHeight);
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.
|
|
IMPORT_C TInt GetFontById(CFont *&aFont, TUid aFileId, const TAlgStyle &aStyle);
Gets a specific bitmap font, identified by its UID, from the device's typeface store.
When the font is no longer needed, call ReleaseFont()
.
|
|
inline TInt GetNearestFontInTwips(CFbsFont *&aFont, const TFontSpec &aFontSpec);
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()
.
|
|
inline TInt GetNearestFontInPixels(CFbsFont *&aFont, const TFontSpec &aFontSpec);
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()
.
|
|
inline TInt GetNearestFontToDesignHeightInTwips(CFbsFont *&aFont, const TFontSpec &aFontSpec);
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()
.
|
|
inline TInt GetNearestFontToDesignHeightInPixels(CFbsFont *&aFont, const TFontSpec &aFontSpec);
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()
.
|
|
inline TInt GetNearestFontToMaxHeightInTwips(CFbsFont *&aFont, const TFontSpec &aFontSpec, TInt aMaxHeight);
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.
|
|
inline TInt GetNearestFontToMaxHeightInPixels(CFbsFont *&aFont, const TFontSpec &aFontSpec, TInt aMaxHeight);
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.
|
|
inline TInt GetFontById(CFbsFont *&aFont, TUid aFileId, const TAlgStyle &aStyle);
Gets a specific bitmap font, identified by its UID, from the device's typeface store.
When the font is no longer needed, call ReleaseFont()
.
|
|
virtual 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.
|
virtual IMPORT_C TInt FontHeightInTwips(TInt aTypefaceIndex, TInt aHeightIndex) const;
Gets the height of a font in twips.
This is an implementation of CGraphicsDevice::FontHeightInTwips()
.
|
|
virtual IMPORT_C TInt FontHeightInPixels(TInt aTypefaceIndex, TInt aHeightIndex) const;
Gets the height, in pixels, of the specified typeface at one of its defined heights.
This is an implementation of CBitMapDevice::FontHeightInPixels().
|
|
virtual IMPORT_C TInt NumTypefaces() const;
Gets the number of typefaces supported by the device.
|
virtual IMPORT_C void TypefaceSupport(TTypefaceSupport &aTypefaceSupport, TInt aTypefaceIndex) const;
Gets information about an indexed typeface.
|
IMPORT_C TInt SetCustomPalette(const CPalette *aPalette);
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.
|
|
inline CGraphicsAccelerator *GraphicsAccelerator() const;
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.
|
inline CFbsBitGc::TGraphicsOrientation Orientation() const;
Gets the device's orientation. The orientation can be set using CFbsBitGc::SetOrientation()
.
|
static IMPORT_C TDisplayMode DisplayMode16M();
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.
|
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()
.
|
|
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.
|
protected: inline virtual TSpriteBase *HideSprite() const;
Hides the sprite over the whole screen.
|
protected: inline virtual TSpriteBase *HideSprite(const TRect &, const TRegion *) const;
Hides the sprite within a particular region.
|
|
protected: inline virtual void ShowSprite(TSpriteBase *) const;
Shows the specified sprite over the whole screen.
|
protected: inline virtual void ShowSprite(TSpriteBase *, const TRect &, const TRegion *) const;
Shows the specified sprite within a particular region.
|
protected: CFbsBitGc::TGraphicsOrientation iOrientation;