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.

Inherits from

Public Member Functions
~CFbsBitmapDevice()
IMPORT_C voidDrawingBegin(TBool)
IMPORT_C voidDrawingEnd(TBool)
IMPORT_C TIntGetPalette(CPalette *&)
IMPORT_C voidGetPixel(TRgb &, const TPoint &)
IMPORT_C voidGetScanLine(TDes8 &, const TPoint &, TInt, TDisplayMode)
IMPORT_C TIntHorizontalPixelsToTwips(TInt)
IMPORT_C TIntHorizontalTwipsToPixels(TInt)
IMPORT_C CFbsBitmapDevice *NewL(CFbsBitmap *)
IMPORT_C CFbsBitmapDevice *NewL(CFbsBitmap *, const TDesC &)
IMPORT_C voidPaletteAttributes(TBool &, TInt &)
IMPORT_C TIntResize(const TSize &)
IMPORT_C voidSetPalette(CPalette *)
IMPORT_C TSizeSizeInTwips()
IMPORT_C TIntSwapWidthAndHeight()
IMPORT_C TIntVerticalPixelsToTwips(TInt)
IMPORT_C TIntVerticalTwipsToPixels(TInt)
Private Member Functions
CFbsBitmapDevice()
voidConstructL(CFbsBitmap *)
voidConstructL(CFbsBitmap *, const TDesC &)
voidSetBits()
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 *)

voidConstructL(CFbsBitmap *aFbsBitmap)[private]

Parameters

CFbsBitmap * aFbsBitmap

ConstructL(CFbsBitmap *, const TDesC &)

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

Parameters

CFbsBitmap * aFbsBitmap
const TDesC & aLibname

DrawingBegin(TBool)

IMPORT_C voidDrawingBegin(TBoolaAlways = 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 = EFalseNot used.

DrawingEnd(TBool)

IMPORT_C voidDrawingEnd(TBoolaAlways = 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 = EFalseNot used.

GetPalette(CPalette *&)

IMPORT_C TIntGetPalette(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 voidGetPixel(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 voidGetScanLine(TDes8 &aBuf,
const TPoint &aStartPixel,
TIntaLength,
TDisplayModeiDispMode
)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 TIntHorizontalPixelsToTwips(TIntaPixels)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 TIntHorizontalTwipsToPixels(TIntaTwips)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 * aFbsBitmapA 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 * aFbsBitmapA pointer to a Font and Bitmap server managed bitmap.
const TDesC & aLibnameName of the library to create the low-level CFbsDrawDevice object from.

PaletteAttributes(TBool &, TInt &)

IMPORT_C voidPaletteAttributes(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 TIntResize(const TSize &aSize)

Resizes the device.

Parameters

const TSize & aSizeThe new size in pixels.

SetBits()

voidSetBits()[private, virtual]

Sets the bit level.

SetPalette(CPalette *)

IMPORT_C voidSetPalette(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 TSizeSizeInTwips()const [virtual]

Gets the size of the device, in twips.

SwapWidthAndHeight()

IMPORT_C TIntSwapWidthAndHeight()

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 TIntVerticalPixelsToTwips(TIntaPixels)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 TIntVerticalTwipsToPixels(TIntaTwips)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]