CHuiBrush Class Reference

class CHuiBrush : public CBase

A brush implements a series of graphics drawing operations. Brushes are attached to visuals and drawn whenever the visual is drawn. Brushes can be used for augmenting the normal appearance of visuals with graphical features such as background pictures, gradients, overlay icons, and selection highlights. Technically, a brush is a simple class whose most important method is Draw() that draws the brush into the specified area of the display.

CHuiVisual::EnableBrushesL() CHuiBrushArray

Inherits from

Constructor & Destructor Documentation

CHuiBrush()

IMPORT_CCHuiBrush()[protected]

Constructor.

~CHuiBrush()

IMPORT_C~CHuiBrush()

Destructor.

Member Functions Documentation

ActivateBrushGuide(const CHuiVisual *)

voidActivateBrushGuide(const CHuiVisual *aNewGuide)const

Notifies change in the brush guide

Parameters

const CHuiVisual * aNewGuide

BeginDraw(CHuiGc &, const MHuiBrushGuide &)

IMPORT_C voidBeginDraw(CHuiGc &aGc,
const MHuiBrushGuide &aGuide
)const [virtual]

The brush is about to get drawn, usually gc parameters are set here

Parameters

CHuiGc & aGc
const MHuiBrushGuide & aGuide

BrushExtension(const TUid &, TAny **)

IMPORT_C voidBrushExtension(const TUid &aExtensionUid,
TAny **aExtensionParameters
)[protected, virtual]

Parameters

const TUid & aExtensionUid
TAny ** aExtensionParameters

BrushGuide()

CHuiVisual *BrushGuide()const

Returns active brush guide as a visual if it exist.

Changed()

IMPORT_C TBoolChanged()const [virtual]

Determines whether the brush has been changed and needs to be redrawn.

ClearChanged()

IMPORT_C voidClearChanged()[virtual]

Clears the changed status of the brush. This is called automatically by the refresh loop after a frame has been drawn.

ClipToVisual()

IMPORT_C TBoolClipToVisual()const

Draw(CHuiGc &, const MHuiBrushGuide &)

IMPORT_C voidDraw(CHuiGc &aGc,
const MHuiBrushGuide &aGuide
)const [virtual]

Draw the brush using the current drawing parameters.

Parameters

CHuiGc & aGc
const MHuiBrushGuide & aGuide

EndDraw(CHuiGc &, const MHuiBrushGuide &)

IMPORT_C voidEndDraw(CHuiGc &aGc,
const MHuiBrushGuide &aGuide
)const [virtual]

The brush has been drawn, usually parameters changed in BeginDraw are reset here

Parameters

CHuiGc & aGc
const MHuiBrushGuide & aGuide

ExpandVisualRect(TRect &)

IMPORT_C voidExpandVisualRect(TRect &aRect)const [virtual]

Expands the dirty region of a visual. Called when a visual's dirty region is being determined. The brush is allowed to expand the rectangle to cover any additional drawing the brush is doing. This is not called when the brush is clipped to the visual rectangle, because in that case no drawing can occur outside the visual's area.

Parameters

TRect & aRectRectangle to expand. Visual's dirty region.

Layer()

IMPORT_C THuiBrushLayerLayer()const

SessionId()

IMPORT_C TIntSessionId()const

Gets the session id for object.

SetChanged()

IMPORT_C voidSetChanged()

Mark the brush as changed or unchanged.

SetClipToVisual(TBool)

IMPORT_C voidSetClipToVisual(TBoolaClipToVisual)

Defines whether the brush can draw outside brush guide (i.e. visual's) rect

Parameters

TBool aClipToVisual

SetLayer(THuiBrushLayer)

IMPORT_C voidSetLayer(THuiBrushLayeraLayer)

Defines the layer where brush is drawn (on top of / below visual) THuiBrushLayer

Parameters

THuiBrushLayer aLayer

SetSessionId(TInt)

IMPORT_C voidSetSessionId(TIntaSessionId)

Sets the session id for object.

Parameters

TInt aSessionId

Type()

IMPORT_C TTypeType()const

Gets the object type.

Type2()

TInt Type2()const [inline, virtual]

Member Enumerations Documentation

Enum TType2

Enumerators

ENotKnown
EImageBrush
ECmdBufferBrush

Member Data Documentation

TBool iChanged

TBool iChanged[private]

ETrue if the brush needs to be redrawn.

TBool iClipToVisual

TBool iClipToVisual[private]

Clip brush to the visual.

TBool iEnabled

TBool iEnabled[private]

ETrue if the brush will be drawn.

CHuiVisual * iGuideVisual

CHuiVisual *iGuideVisual[private]

THuiBrushLayer iLayer

THuiBrushLayer iLayer[private]

Layer determines drawing order.

THuiTimedValue iOpacity

THuiTimedValue iOpacity

Opacity of the shadow.

TInt iSessionId

TInt iSessionId[private]

Session id