CFbsBitmapDevice Class Reference

class CFbsBitmapDevice : public CFbsDevice

A graphics device to which a bitmap managed by the font and bitmap server can be drawn.

The class specialises the bitmap graphics device interface CBitmapDevice for drawing to in-memory bitmaps.

Public Member Functions
~CFbsBitmapDevice ()
IMPORT_C void DrawingBegin ( TBool )
IMPORT_C void DrawingEnd ( TBool )
IMPORT_C TInt GetPalette ( CPalette *&)
IMPORT_C void GetPixel ( TRgb &, const TPoint &)
IMPORT_C void GetScanLine ( TDes8 &, const TPoint &, TInt , TDisplayMode )
IMPORT_C TInt HorizontalPixelsToTwips ( TInt )
IMPORT_C TInt HorizontalTwipsToPixels ( TInt )
IMPORT_C CFbsBitmapDevice * NewL ( CFbsBitmap *)
IMPORT_C CFbsBitmapDevice * NewL ( CFbsBitmap *, const TDesC &)
IMPORT_C void PaletteAttributes ( TBool &, TInt &)
IMPORT_C TInt Resize (const TSize &)
IMPORT_C void SetPalette ( CPalette *)
IMPORT_C TSize SizeInTwips ()
IMPORT_C TInt SwapWidthAndHeight ()
IMPORT_C TInt VerticalPixelsToTwips ( TInt )
IMPORT_C TInt VerticalTwipsToPixels ( TInt )
Private Member Functions
CFbsBitmapDevice ()
void ConstructL ( CFbsBitmap *)
void ConstructL ( CFbsBitmap *, const TDesC &)
void SetBits ()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CBitmapDevice::CreateBitmapContext(CBitmapContext *&)
CFbsDevice::AddFile(const TDesC &,TInt &)
CFbsDevice::CFbsDevice()
CFbsDevice::CancelSprite()const
CFbsDevice::CreateContext(CFbsBitGc *&)
CFbsDevice::CreateContext(CGraphicsContext *&)
CFbsDevice::DisplayMode()const
CFbsDevice::DisplayMode16M()
CFbsDevice::DoGetScanLine(TDes8 &,const TPoint &,TInt,TDisplayMode)
CFbsDevice::DrawingBegin(const CFbsBitmap *,TBool)
CFbsDevice::DrawingEnd(const CFbsBitmap *,TBool)
CFbsDevice::FontHeightInPixels(TInt,TInt)const
CFbsDevice::FontHeightInTwips(TInt,TInt)const
CFbsDevice::GetDrawRect(TRect &)const
CFbsDevice::GetFontById(CFbsFont *&,TUid,const TAlgStyle &)
CFbsDevice::GetFontById(CFont *&,TUid,const TAlgStyle &)
CFbsDevice::GetNearestFbsFont(CFbsFont *&,const TFontSpec &)
CFbsDevice::GetNearestFontInPixels(CFbsFont *&,const TFontSpec &)
CFbsDevice::GetNearestFontInPixels(CFont *&,const TFontSpec &)
CFbsDevice::GetNearestFontInTwips(CFbsFont *&,const TFontSpec &)
CFbsDevice::GetNearestFontInTwips(CFont *&,const TFontSpec &)
CFbsDevice::GetNearestFontToDesignHeightInPixels(CFbsFont *&,const TFontSpec &)
CFbsDevice::GetNearestFontToDesignHeightInPixels(CFont *&,const TFontSpec &)
CFbsDevice::GetNearestFontToDesignHeightInTwips(CFbsFont *&,const TFontSpec &)
CFbsDevice::GetNearestFontToDesignHeightInTwips(CFont *&,const TFontSpec &)
CFbsDevice::GetNearestFontToMaxHeightInPixels(CFbsFont *&,const TFontSpec &,TInt)
CFbsDevice::GetNearestFontToMaxHeightInPixels(CFont *&,const TFontSpec &,TInt)
CFbsDevice::GetNearestFontToMaxHeightInTwips(CFbsFont *&,const TFontSpec &,TInt)
CFbsDevice::GetNearestFontToMaxHeightInTwips(CFont *&,const TFontSpec &,TInt)
CFbsDevice::GraphicsAccelerator()const
CFbsDevice::HideSprite()const
CFbsDevice::HideSprite(const TRect &,const TRegion *)const
CFbsDevice::NumTypefaces()const
CFbsDevice::Orientation()const
CFbsDevice::ReadLineDiffMode(TInt,TInt,TInt,TAny *,TDisplayMode)const
CFbsDevice::RectCompare(const TRect &,const CFbsDevice &,const TRect &)const
CFbsDevice::RegisterLinkedTypeface(const CLinkedTypefaceSpecification &,TInt &)
CFbsDevice::ReleaseFont(CFont *)
CFbsDevice::RemoveFile(TInt)
CFbsDevice::SetCustomPalette(const CPalette *)
CFbsDevice::SetDrawDeviceOffset(const TPoint &)
CFbsDevice::SetOrientation(CFbsBitGc::TGraphicsOrientation)
CFbsDevice::SetScalingFactor(const TPoint &,TInt,TInt,TInt,TInt)
CFbsDevice::ShowSprite(TSpriteBase *)const
CFbsDevice::ShowSprite(TSpriteBase *,const TRect &,const TRegion *)const
CFbsDevice::SizeInPixels()const
CFbsDevice::TruncateRect(TRect &)
CFbsDevice::TypefaceSupport(TTypefaceSupport &,TInt)const
CFbsDevice::~CFbsDevice()
Private Attributes
CFbsBitGcBitmap * iFbsBmp
Inherited Attributes
CFbsDevice::iBitBltMaskedBuffer
CFbsDevice::iDrawDevice
CFbsDevice::iFbs
CFbsDevice::iGraphicsAccelerator
CFbsDevice::iOrientation
CFbsDevice::iScreenDevice
CFbsDevice::iSpare
CFbsDevice::iTypefaceStore

Constructor & Destructor Documentation

CFbsBitmapDevice()

CFbsBitmapDevice ( ) [private]

~CFbsBitmapDevice()

IMPORT_C ~CFbsBitmapDevice ( ) [virtual]

Frees all resources owned by the object prior to its destruction.

Member Functions Documentation

ConstructL(CFbsBitmap *)

void ConstructL ( CFbsBitmap * aFbsBitmap ) [private]

Parameters

CFbsBitmap * aFbsBitmap

ConstructL(CFbsBitmap *, const TDesC &)

void ConstructL ( CFbsBitmap * aFbsBitmap,
const TDesC & aLibname
) [private]

Parameters

CFbsBitmap * aFbsBitmap
const TDesC & aLibname

DrawingBegin(TBool)

IMPORT_C void DrawingBegin ( TBool aAlways = EFalse ) [virtual]

This method is called when you are about to start direct drawing to the bitmap memory. Calls to DrawingBegin() must be paired with a subsequent call to DrawingEnd() . Also, code must not leave between a DrawingBegin() - DrawingEnd() pair. CFbsBitmapDevice::DrawingEnd()

Parameters

TBool aAlways = EFalse Not used.

DrawingEnd(TBool)

IMPORT_C void DrawingEnd ( TBool aAlways = EFalse ) [virtual]

This method is called when you have finished direct drawing to the bitmap memory. Calls to DrawingEnd() must correspond to a prior call to DrawingBegin() . CFbsBitmapDevice::DrawingBegin()

Parameters

TBool aAlways = EFalse Not used.

GetPalette(CPalette *&)

IMPORT_C TInt GetPalette ( CPalette *& aPalette ) const [virtual]

Gets the device's current palette.

This function is only supported if the device has a modifiable palette, which can be determined by calling PaletteAttributes() .

The function provides a concrete implementation of the pure virtual function CGraphicsDevice::GetPalette() .

Parameters

CPalette *& aPalette

GetPixel(TRgb &, const TPoint &)

IMPORT_C void GetPixel ( TRgb & aColor,
const TPoint & aPixel
) const [virtual]

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

The function provides a concrete implementation of the pure virtual function CBitmapDevice::GetPixel() .

Parameters

TRgb & aColor
const TPoint & aPixel

GetScanLine(TDes8 &, const TPoint &, TInt, TDisplayMode)

IMPORT_C void GetScanLine ( TDes8 & aBuf,
const TPoint & aStartPixel,
TInt aLength,
TDisplayMode iDispMode
) const [virtual]

Copies a scanline into a buffer.

The function provides a concrete implementation of the pure virtual function CBitmapDevice::GetScanLine() .

Parameters

TDes8 & aBuf
const TPoint & aStartPixel
TInt aLength
TDisplayMode iDispMode

HorizontalPixelsToTwips(TInt)

IMPORT_C TInt HorizontalPixelsToTwips ( TInt aPixels ) const [virtual]

Converts a horizontal dimension of a device in pixels to a horizontal dimension in twips.

The function provides a concrete implementation of the pure virtual function MGraphicsDeviceMap::HorizontalPixelsToTwips() .

Parameters

TInt aPixels

HorizontalTwipsToPixels(TInt)

IMPORT_C TInt HorizontalTwipsToPixels ( TInt aTwips ) const [virtual]

Converts a horizontal dimension of a device in twips to a horizontal dimension in pixels.

The function provides a concrete implementation of the pure virtual function MGraphicsDeviceMap::HorizontalTwipsToPixels() .

Parameters

TInt aTwips

NewL(CFbsBitmap *)

IMPORT_C CFbsBitmapDevice * NewL ( CFbsBitmap * aFbsBitmap ) [static]

Allocates and constructs the device with the bitmap. Also creates a 2D graphics accelerator which is owned and used by the device.

leave
KErrArgument The bitmap's handle is zero.
leave
KErrAccessDenied The bitmap is in the ROM.
panic
EBitgdiPanicInvalidBitmap aFbsBitmap is NULL.

Parameters

CFbsBitmap * aFbsBitmap A pointer to the font and bitmap server managed bitmap.

NewL(CFbsBitmap *, const TDesC &)

IMPORT_C CFbsBitmapDevice * NewL ( CFbsBitmap * aFbsBitmap,
const TDesC & aLibname
) [static]

Constructs the object from the specified Font and Bitmap server managed bitmap.

Parameters

CFbsBitmap * aFbsBitmap A pointer to a Font and Bitmap server managed bitmap.
const TDesC & aLibname Name of the library to create the low-level CFbsDrawDevice object from.

PaletteAttributes(TBool &, TInt &)

IMPORT_C void PaletteAttributes ( TBool & aModifiable,
TInt & aNumEntries
) const [virtual]

Gets the palette attributes of the device.

The function provides a concrete implementation of the pure virtual function CGraphicsDevice::PaletteAttributes() .

Parameters

TBool & aModifiable
TInt & aNumEntries

Resize(const TSize &)

IMPORT_C TInt Resize ( const TSize & aSize )

Resizes the device.

Parameters

const TSize & aSize The new size in pixels.

SetBits()

void SetBits ( ) [private, virtual]

Sets the bit level.

SetPalette(CPalette *)

IMPORT_C void SetPalette ( CPalette * aPalette ) [virtual]

Sets the device's palette to the specified palette.

Setting the palette is only possible if the device has a modifiable palette, which can be determined by calling PaletteAttributes() .

The function provides a concrete implementation of the pure virtual function CGraphicsDevice::SetPalette() .

Parameters

CPalette * aPalette

SizeInTwips()

IMPORT_C TSize SizeInTwips ( ) const [virtual]

Gets the size of the device, in twips.

SwapWidthAndHeight()

IMPORT_C TInt SwapWidthAndHeight ( )

The method swaps bitmap device's width and height. For example: if the size is (40, 20), the swapped size will be (20, 40). The device's content is not preserved. The method leaves CFbsBitmapDevice object in a consistent state - scaling settings will be set with their default values (the scaling is switched off), the device's dither origin will be set to (0,0), scaling origin to (0,0).

Note: If the device was scaled or its dither origin was set with a non-default value, it has to be rescaled again, respectivelly the dither origin has to be set again.

Note: All graphics contexts, already created by the device, should be re-activated calling CFbsBitGc::Activate() .

Note: Do not call SwapWidthAndHeight() between DrawingBegin() and DrawingEnd() calls!

VerticalPixelsToTwips(TInt)

IMPORT_C TInt VerticalPixelsToTwips ( TInt aPixels ) const [virtual]

Converts a vertical dimension of a device in pixels to a vertical dimension in twips.

The function provides a concrete implementation of the pure virtual function MGraphicsDeviceMap::VerticalPixelsToTwips() .

Parameters

TInt aPixels

VerticalTwipsToPixels(TInt)

IMPORT_C TInt VerticalTwipsToPixels ( TInt aTwips ) const [virtual]

Converts a vertical dimension of a device in twips to a vertical dimension in pixels.

The function provides a concrete implementation of the pure virtual function MGraphicsDeviceMap::VerticalTwipsToPixels() .

Parameters

TInt aTwips

Member Data Documentation

CFbsBitGcBitmap * iFbsBmp

CFbsBitGcBitmap * iFbsBmp [private]