Class: TPaint

Declaration: GrafAttribute.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCollectible

Inherited By:

TImagePatternPaint TColorPaint

Purpose:

TPaint is an abstract base class that represents a specification of a fill or frame paint. A paint is a way of coloring or filling in a graphical object. Normally the paint is stored as one of the attributes in the graphic's bundle, by invoking TGrafBundle::AdoptFillPaint and TGrafBundle::AdoptFramePaint. Some possible derived classes include colors, patterns, and gradients. TPaint establishes some basic protocol for derived classes, such as a paint style (one of the values kColorPaint, kGraphicPattern, kImagePattern, kHitPaint, kRegionPaint, or kCustomPaint). The use of a style rather than a separate derived class is an optimization for the rendering pipeline. However, separate classes are provided for two styles: TColorPaint and TImagePatternPaint.

Instantiation:

Abstract base class; do not allocate.

Deriving Classes:

Provided classes include TColorPaint and TImagePatternPaint. You can derive other classes. Deriving classes must override GetColor() and GetImagePattern() returning the correct behavior.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TPaint::~TPaint

virtual ~ TPaint ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPaint::GetColor

virtual const TColor * GetColor () const

Interface Category:

API.

Purpose:

Gets the color information for the paint object.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a pointer to the TPaint object's TColor object if one is defined, else it returns a pointer to a newly-created TColor object initialized to black.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPaint::GetImagePattern

virtual const TGImage * GetImagePattern () const

Interface Category:

API.

Purpose:

Gets the image pattern for the paint object.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a pointer to a TGImage pattern if one is defined, else it returns a pointer to a newly-created TA8R8G8B8Image.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPaint::operator>>=

virtual TStream & operator >>=(TStream &) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data. You can also call this function directly.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPaint::operator<<=

virtual TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPaint::TPaint

  1. TPaint ()
  2. TPaint (const TPaint &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

  1. Called by the stream-in operators and derived classes.
  2. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

These constructors are pure virtual functions and must be overridden by classes deriving from TPaint.

Member Function: TPaint::operator=

TPaint & operator =(const TPaint & source)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Call this function by using the operator in an assignment statement.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPaint::GetPaintStyle

virtual EPaintStyle GetPaintStyle () const

Interface Category:

API.

Purpose:

Returns the basic style of paint used by this class, as defined in EPaintStyle. This function is designed to be overridden by derived classes.

Calling Context:

Call this function directly, but you will usually be calling this function from a derived class.

Parameters:

Return Value:

Returns an EPaintStyle enumerated type with value kCustomPaint as a default.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.