Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
CBitmapDevice Class Referenceabstract

Defines an abstract interface for the capabilities and attributes of a bitmapped graphics device. More...

#include <gdi.h>

Inheritance diagram for CBitmapDevice:
CGraphicsDevice CBase MGraphicsDeviceMap CWsScreenDevice

Public Member Functions

virtual void GetPixel (TRgb &aColor, const TPoint &aPixel) const =0
 Gets the RGB colour of an individual pixel on a bitmapped graphics device.
 
virtual void GetScanLine (TDes8 &aBuf, const TPoint &aStartPixel, TInt aLength, TDisplayMode aDispMode) const =0
 Copies a scanline into a buffer.
 
virtual TInt AddFile (const TDesC &aName, TInt &aId)=0
 Adds a font file to the device's typeface store.
 
virtual void RemoveFile (TInt aId=0)=0
 Removes a font file from the font store.
 
virtual TInt GetNearestFontInPixels (CFont *&aFont, const TFontSpec &aFontSpec)=0
 
virtual TInt GetNearestFontToDesignHeightInPixels (CFont *&, const TFontSpec &)
 
virtual TInt GetNearestFontToMaxHeightInPixels (CFont *&, const TFontSpec &, TInt)
 
virtual TInt FontHeightInPixels (TInt aTypefaceIndex, TInt aHeightIndex) const =0
 Gets the height, in pixels, of the specified typeface at one of its defined heights.
 
TInt CreateBitmapContext (CBitmapContext *&aGC)
 Creates a bitmap context for this bitmap device.
 
- Public Member Functions inherited from CGraphicsDevice
virtual TDisplayMode DisplayMode () const =0
 Gets the display mode of the device.
 
virtual TSize SizeInPixels () const =0
 Gets the size of the device area in pixels.
 
virtual TSize SizeInTwips () const =0
 Gets the size of the device area in twips.
 
virtual TInt CreateContext (CGraphicsContext *&aGC)=0
 Creates a graphics context for the device.
 
virtual TInt NumTypefaces () const =0
 Gets the number of typefaces supported by the graphics device.
 
virtual void TypefaceSupport (TTypefaceSupport &aTypefaceSupport, TInt aTypefaceIndex) const =0
 Gets typeface information for a specified typeface.
 
virtual TInt FontHeightInTwips (TInt aTypefaceIndex, TInt aHeightIndex) const =0
 Get the height of a font in twips.
 
virtual void PaletteAttributes (TBool &aModifiable, TInt &aNumEntries) const =0
 Gets the palette attributes of the device.
 
virtual void SetPalette (CPalette *aPalette)=0
 Sets the device's palette.
 
virtual TInt GetPalette (CPalette *&aPalette) const =0
 Gets the device's current palette.
 
- Public Member Functions inherited from CBase
 CBase ()
 Default constructor.
 
virtual IMPORT_C ~CBase ()
 Virtual destructor.
 
TAny * operator new (TUint aSize, TAny *aBase) __NO_THROW
 Initialises the object to binary zeroes.
 
TAny * operator new (TUint aSize) __NO_THROW
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TLeave)
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TUint aExtraSize) __NO_THROW
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TLeave, TUint aExtraSize)
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
- Public Member Functions inherited from MGraphicsDeviceMap
IMPORT_C MGraphicsDeviceMap ()
 Default constructor.
 
virtual IMPORT_C ~MGraphicsDeviceMap ()
 Destructor.
 
IMPORT_C TPoint TwipsToPixels (const TPoint &aTwipPoint) const
 Converts a point in twips to a point in pixels.
 
IMPORT_C TRect TwipsToPixels (const TRect &aTwipRect) const
 Converts a rectangle in twips to a rectangle in pixels.
 
IMPORT_C TPoint PixelsToTwips (const TPoint &aPixelPoint) const
 Converts a point in pixels to a point in twips.
 
IMPORT_C TRect PixelsToTwips (const TRect &aPixelRect) const
 Converts a rectangle in pixels to a rectangle in twips.
 
virtual TInt HorizontalTwipsToPixels (TInt aTwips) const =0
 Converts a horizontal dimension from twips to pixels.
 
virtual TInt VerticalTwipsToPixels (TInt aTwips) const =0
 Converts a vertical dimension from twips to pixels.
 
virtual TInt HorizontalPixelsToTwips (TInt aPixels) const =0
 Converts a horizontal dimension from pixels to twips.
 
virtual TInt VerticalPixelsToTwips (TInt aPixels) const =0
 Converts a vertical dimension from pixels to twips.
 
virtual TInt GetNearestFontInTwips (CFont *&aFont, const TFontSpec &aFontSpec)=0
 
virtual TInt GetNearestFontToDesignHeightInTwips (CFont *&, const TFontSpec &)
 
virtual TInt GetNearestFontToMaxHeightInTwips (CFont *&, const TFontSpec &, TInt)
 
virtual void ReleaseFont (CFont *aFont)=0
 Releases the specified font.
 

Additional Inherited Members

- Static Public Member Functions inherited from CBase
static IMPORT_C void Delete (CBase *aPtr)
 Deletes the specified object.
 
- Protected Member Functions inherited from CBase
virtual IMPORT_C TInt Extension_ (TUint aExtensionId, TAny *&a0, TAny *a1)
 Extension function.
 

Detailed Description

Defines an abstract interface for the capabilities and attributes of a bitmapped graphics device.

The class specialises the graphics device interface CGraphicsDevice for bitmaps graphics. The Window Server Client-Side API provides one implementation of the interface, CWsScreenDevice, for screen drawing. Another implementation, CFbsBitmapDevice, is used for drawing to in-memory bitmaps. A third, CFbsScreenDevice, is used (rarely) to access the screen directly, without the mediation of the window server.

API status
Published to all clients. Released API.

Definition at line 3357 of file gdi.h.

Member Function Documentation

◆ AddFile()

virtual TInt CBitmapDevice::AddFile ( const TDesC &  aName,
TInt &  aId 
)
pure 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.

Parameters
aNameThe name of the font file.
aIdOn return, contains an ID for the font file.
Returns
KErrNone, if successful; otherwise, another of the system-wide error codes.

Implemented in CWsScreenDevice.

◆ CreateBitmapContext()

TInt CBitmapDevice::CreateBitmapContext ( CBitmapContext *&  aGC)
inline

Creates a bitmap context for this bitmap device.

Parameters
aGCOn return, holds a pointer to the created bitmap context.

(generated from Symbian Developer Library)

◆ FontHeightInPixels()

virtual TInt CBitmapDevice::FontHeightInPixels ( TInt  aTypefaceIndex,
TInt  aHeightIndex 
) const
pure 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.

Parameters
aTypefaceIndexA typeface index number, in the range: 0 to (NumTypefaces() - 1).
aHeightIndexA font height index number, in the range: 0 to (iNumHeights - 1) where iNumHeights is a public data member of the TTypefaceSupport object returned by TypefaceSupport().
Returns
The height of the font, in pixels.
See also
TTypefaceSupport
CGraphicsDevice::NumTypefaces()
CGraphicsDevice::TypefaceSupport()

Implemented in CWsScreenDevice.

◆ GetNearestFontInPixels()

TInt CBitmapDevice::GetNearestFontInPixels ( CFont *&  aFont,
const TFontSpec &  aFontSpec 
)
pure virtual
Gets the font which is the nearest to the given font specification.

When the font is no longer needed, call @c ReleaseFont().

Note that this deprecated function is replaced by the new @c GetNearestFontToDesignHeightInPixels() 
yielding (virtually) the same result. However clients are strongly encouraged to use the new
@c 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.

@param aFont On return, contains a pointer to the nearest font.
@param aFontSpec The specification of the font to be matched.
@return KErrNone if successful; a system-wide error code otherwise.
@deprecated Use GetNearestFontToDesignHeightInPixels
API status
Published to all clients.
Parameters
aFontOn return, contains a pointer to the nearest font.
aFontSpecThe specification of the font to be matched.

(generated from Symbian Developer Library)

Implemented in CWsScreenDevice.

◆ GetNearestFontToDesignHeightInPixels()

virtual TInt CBitmapDevice::GetNearestFontToDesignHeightInPixels ( CFont *&  ,
const TFontSpec &   
)
inlinevirtual
Gets the font which is the nearest to the given font specification.

When the font is no longer needed, call @c ReleaseFont().

This new function replaces the deprecated @c GetNearestFontInPixels() yielding (virtually) the 
same result. However clients are strongly encouraged to use the new
@c 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.

@param aFont On return, contains a pointer to the nearest font.
@param aFontSpec The specification of the font to be matched.
@return KErrNone if successful; a system-wide error code otherwise.
API status
Published to all clients. Released API.

Reimplemented in CWsScreenDevice.

Definition at line 3449 of file gdi.h.

◆ GetNearestFontToMaxHeightInPixels()

virtual TInt CBitmapDevice::GetNearestFontToMaxHeightInPixels ( CFont *&  ,
const TFontSpec &  ,
TInt   
)
inlinevirtual
Gets the font which is the nearest to the given font specification.

When the font is no longer needed, call @c 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.

@param aFont On return, contains a pointer to the nearest font.
@param aFontSpec The specification of the font to be matched.
@param aMaxHeight The maximum height within which the font must fit.
This overrides the height specified in aFontSpec.
@return KErrNone if successful; a system-wide error code otherwise.
API status
Published to all clients. Released API.

Reimplemented in CWsScreenDevice.

Definition at line 3475 of file gdi.h.

◆ GetPixel()

virtual void CBitmapDevice::GetPixel ( TRgb &  aColor,
const TPoint &  aPixel 
) const
pure virtual

Gets the RGB colour of an individual pixel on a bitmapped graphics device.

This pure virtual function is implemented in derived classes.

Parameters
aColorOn return, should contain the RGB colour of the pixel.
aPixelThe (x,y) co-ordinates of the pixel. The top left pixel is (0,0).

Implemented in CWsScreenDevice.

◆ GetScanLine()

virtual void CBitmapDevice::GetScanLine ( TDes8 &  aBuf,
const TPoint &  aStartPixel,
TInt  aLength,
TDisplayMode  aDispMode 
) const
pure 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.

Parameters
aBufAn 8 bit modifiable descriptor buffer into which pixels are copied; it must be sufficiently large to store all the scanline pixels.
aStartPixelThe (x,y) co-ordinates of the first pixel of the bitmap scanline to be put into the buffer.
aLengthThe number of pixels to put into the buffer.
aDispModeThe display mode into which to convert the pixels.

Implemented in CWsScreenDevice.

◆ RemoveFile()

virtual void CBitmapDevice::RemoveFile ( TInt  aId = 0)
pure virtual

Removes a font file from the font store.

This pure virtual function is implemented in derived classes.

Parameters
aIdThe ID of the font file to be removed. The default is 0.

Implemented in CWsScreenDevice.


The documentation for this class was generated from the following files: