Class: TMGraphicObjectStyle

Declaration: LineLayoutStyles.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TGraphicObjectStyle

Inherited By:

None.

Purpose:

A concrete derived class of TGraphicObjectStyle that can draw MGraphicObjects. The hot spot is the point of the text object that intersects the line's base line and the start position of the character. In horizontal text, it is measured from the bottom right of the MGraphic, up and right being positive directions. For vertical text, it is measured from the top center, down and right being positive directions. If a width other than the width automatically computed from the hot spot and bounding box is needed, then it should be passed into the constructor that takes advance widths.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Derive classes to provide a different implementation of the Draw member function.

Concurrency:

Multithread safe.

Resource Use:

No special requirements.

Member Function: TMGraphicObjectStyle::operator<<=

virtual TStream & operator <<= (TStream & fromWhere)

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:

Multithread safe.

Other Considerations:

None.

Member Function: TMGraphicObjectStyle::operator>>=

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

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

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

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TMGraphicObjectStyle::operator==

virtual bool operator ==(const TStyle & thatStyle) const

Interface Category:

API.

Purpose:

Equality operator.

Calling Context:

Called to compare two objects.

Parameters:

Return Value:

Returns true if the objects are equal.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TMGraphicObjectStyle::Hash

virtual long Hash () const

Interface Category:

API.

Purpose:

Overrides inherited MCollectible function.

Calling Context:

Same as for base class.

Parameters:

Return Value:

The numeric value of the hash.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TMGraphicObjectStyle::Info

virtual void Info (const UniChar & code, TSingleLineOrientation :: ELineOrientation direction, const TStyleSet & characterStyles, const TStyleSet & paragraphStyles, GCoordinate & advance, GCoordinate & ascender, GCoordinate & descender) const

Interface Category:

API.

Purpose:

Calculates where a graphic will be displayed relative to other characters.

Calling Context:

Called when drawing to calculate where a graphic will be displayed relative to other characters.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TMGraphicObjectStyle::Draw

virtual void Draw (TGrafPort * port, const TGPoint & origin, GCoordinate ascent, GCoordinate descent, const UniChar & code, TSingleLineOrientation :: ELineOrientation direction, const TStyleSet & characterStyles, const TStyleSet & paragraphStyles) const

Interface Category:

API.

Purpose:

Draws an image into the port at the origin. The origin is at the intersection of the baseline and the left side of the image in horizontal text. In vertical text, the origin is at the intersection of the baseline and the top of the image; for the best results with vertical text, the image should center around the origin. The ascent is the amount before the baseline, and the descent is the amount after the baseline. These values will usually be ignore by derived classes.

Calling Context:

Called to draw an image into the port at the origin.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TMGraphicObjectStyle::GetAdvances

virtual bool GetAdvances (GCoordinate & horizontalAdvance, GCoordinate & verticalAdvance) const

Interface Category:

API.

Purpose:

Returns the values of the advances for this style object.

Calling Context:

Call when drawing to get the advances for this style object.

Parameters:

Return Value:

Returns true if the advance values are successfully returned.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TMGraphicObjectStyle::GetHotSpots

virtual void GetHotSpots (TGPoint & horizontal, TGPoint & vertical) const

Interface Category:

API.

Purpose:

Gets the hot spots for this style object.

Calling Context:

Called when drawing to get the hot spots for this style object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TMGraphicObjectStyle::CreateMGraphic

virtual MGraphic * CreateMGraphic () const

Interface Category:

API.

Purpose:

Returns a copy of the MGraphic used in drawing by this style object.

Calling Context:

Called when drawing to get a copy of the MGraphic used by this style object.

Parameters:

Return Value:

A copy of the MGraphic used in drawing by this style object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TMGraphicObjectStyle::AdoptMGraphic

  1. virtual void AdoptMGraphic (MGraphic * graphic, const TGPoint & horizontalHotSpot, const TGPoint & verticalHotSpot =fNullPoint)
  2. virtual void AdoptMGraphic (MGraphic * graphic, const TGPoint & horizontalHotSpot, const TGPoint & verticalHotSpot, GCoordinate horizontalAdvance, GCoordinate verticalAdvance)

Interface Category:

API.

Purpose:

  1. Gets the object to adopt as the MGraphic for use in drawing.
  2. Gets the object to adopt as the MGraphic for use in drawing.

Calling Context:

  1. Call to adopt an MGraphic for use in drawing.
  2. Call to adopt an MGraphic for use in drawing.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TMGraphicObjectStyle::~TMGraphicObjectStyle

virtual ~ TMGraphicObjectStyle ()

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:

Multithread safe.

Other Considerations:

None.

Member Function: TMGraphicObjectStyle::TMGraphicObjectStyle

  1. TMGraphicObjectStyle ()
  2. TMGraphicObjectStyle (const MGraphic & graphic)
  3. TMGraphicObjectStyle (const MGraphic & graphic, const TGPoint & horizontalHotSpot, const TGPoint & verticalHotSpot =fNullPoint)
  4. TMGraphicObjectStyle (const MGraphic & graphic, const TGPoint & horizontalHotSpot, const TGPoint & verticalHotSpot, GCoordinate horizontalAdvance, GCoordinate verticalAdvance)
  5. TMGraphicObjectStyle (const TMGraphicObjectStyle &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Constructs an MGraphic object style instance with a specified MGraphic instance.
  3. Constructs an MGraphic object style instance with a specified MGraphic instance and other specified values.
  4. Constructs an MGraphic object style instance with a specified MGraphic instance and other specified values.
  5. Copy constructor.

Calling Context:

  1. Called by the stream-in operators.
  2. Call directly to instantiate this class.
  3. Call directly to instantiate this class.
  4. Call directly to instantiate this class.
  5. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

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.