RDirectGdiDrawableSource Class Reference

class RDirectGdiDrawableSource

This class is a handle to a DirectGDI adaptation-specific resource that is bound to a non-image resource (RSgDrawable). The intention of creating this class is to allow a non-image resource (global and sharable between processes) to be used as a source from the DirectGDI rendering API. This class and its DirectGDI adaptation-specific resource are non-sharable and will be local to the calling thread.

This class is part of generic code and will forward creation and deletion requests to the CDirectGdiDriver singleton object for the calling thread.

Public Member Functions
RDirectGdiDrawableSource()
RDirectGdiDrawableSource(CDirectGdiDriver &)
IMPORT_C voidClose()
IMPORT_C TIntCreate(const RSgDrawable &)
TInt Handle()
Private Attributes
CDirectGdiDriver *iDriver
TInt iHandle

Constructor & Destructor Documentation

RDirectGdiDrawableSource()

IMPORT_CRDirectGdiDrawableSource()

Default constructor. Only for embedding instances of RDirectGdiDrawableSource into other classes as data members. Before a RDirectGdiDrawableSource can be used the other constructor must be called.

RDirectGdiDrawableSource(CDirectGdiDriver &)

IMPORT_CRDirectGdiDrawableSource(CDirectGdiDriver &aDriver)

Constructor.

Pre-condition
The CDirectGdiDriver object has been initialised from the calling thread.
Post-condition
This handle has a pointer to the CDirectGdiDriver for this thread. This handle is not associated with any DirectGDI adaptation-specific resource.

Parameters

CDirectGdiDriver & aDriverThe CDirectGdiDriver for this thread.

Member Functions Documentation

Close()

IMPORT_C voidClose()

Destroys the DirectGDI adaptation-specific resource associated with this handle. Calling this method on a handle that is not associated with any DirectGDI adaptation-specific resource will do nothing. Once Close() is called, this handle can be reused.

Pre-condition
The CDirectGdiDriver object for this handle has been set.
Post-condition
The DirectGDI specific resource associated with this handle will be destroyed, at any time. This handle is no longer associated with a DirectGDI specific resource. The reference counter of the underlying drawable resource is decremented.
panic
DGDI 18, if this drawable source has no pointer to its assosicated CDirectGdiDriver. This may occur if constructed using the default constructor, and has not yet been assigned to another drawable source created with the constructor overload.

Create(const RSgDrawable &)

IMPORT_C TIntCreate(const RSgDrawable &aDrawable)

Creates a DirectGDI adaptation-specific resource that is bound to the specified drawable resource so it can be drawn using the DirectGDI rendering API.

Pre-condition
CDirectGdiDriver object for this handle has been set. The drawable resource has been fully constructed.
Post-condition
The DirectGDI adaptation-specific resource that is bound to the given non-pixel resource is created and this handle is now associated with it. The reference counter on the drawable resource is incremented.
panic
DGDI 18, if this drawable source has no pointer to its assosicated CDirectGdiDriver. This may occur if constructed using the default constructor, and has not yet been assigned to another drawable source created with the constructor overload.

Parameters

const RSgDrawable & aDrawableThe drawable resource.

Handle()

TInt Handle()const [inline]

Accessor for reference to adaptation object.

RDirectGdiImageTarget::SetHandle()

Member Data Documentation

CDirectGdiDriver * iDriver

CDirectGdiDriver *iDriver[private]

TInt iHandle

TInt iHandle[private]