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.
virtual TStream & operator <<= (TStream & fromWhere)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & fromWhere -The stream the object streams itself in from.
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.
virtual TStream & operator >>=(TStream & toWhere) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & toWhere -The stream the object streams itself out to.
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.
virtual bool operator ==(const TStyle & thatStyle) const
Interface Category:
API.
Purpose:
Equality operator.
Calling Context:
Called to compare two objects.
Parameters:
- const TStyle & thatStyle -The object to compare with this object.
Return Value:
Returns true if the objects are equal.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
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.
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:
- const UniChar & code -The character used in this computation.
- TSingleLineOrientation::ELineOrientation direction -The line direction used in this computation.
- const TStyleSet & characterStyles -The character styles used in this computation.
- const TStyleSet & paragraphStyles -The paragraph styles used in this computation.
- GCoordinate & advance -The width of the graphic in a horizontal line. The height of the graphic in a vertical line.
- GCoordinate & ascender -The amount of the graphic that displays above the origin in a horizontal line. The amount of the graphic that displays to the right of the origin in a vertical line.
- GCoordinate & descender -The amount of the graphic that displays below the origin in a horizontal line. The amount of the graphic that displays to the left of the origin in a vertical line.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
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:
- TGrafPort * port -The grafport in which to draw.
- const TGPoint & origin -The point at which to draw.
- GCoordinate ascent -The amount before the baseline.
- GCoordinate descent -The amount after the baseline.
- const UniChar & code -The character to draw.
- TSingleLineOrientation :: ELineOrientation direction -The line direction used in this drawing.
- const TStyleSet & characterStyles -The character styles used for this drawing.
- const TStyleSet & paragraphStyles -The paragraph styles used for this drawing.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
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:
- GCoordinate & horizontalAdvance -The horizontal advance for this style object.
- GCoordinate & verticalAdvance -The vertical advance for this style object.
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.
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:
- TGPoint & horizontal -The horizontal hot spot for this style object.
- TGPoint & vertical -The vertical hot spot for this style object.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
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.
- virtual void AdoptMGraphic (MGraphic * graphic, const TGPoint & horizontalHotSpot, const TGPoint & verticalHotSpot =fNullPoint)
- virtual void AdoptMGraphic (MGraphic * graphic, const TGPoint & horizontalHotSpot, const TGPoint & verticalHotSpot, GCoordinate horizontalAdvance, GCoordinate verticalAdvance)
Interface Category:
API.
Purpose:
- Gets the object to adopt as the MGraphic for use in drawing.
- Gets the object to adopt as the MGraphic for use in drawing.
Calling Context:
- Call to adopt an MGraphic for use in drawing.
- Call to adopt an MGraphic for use in drawing.
Parameters:
- MGraphic * graphic -The MGraphic to adopt.
- const TGPoint & horizontalHotSpot -The horizontal hot spot for this drawing.
- const TGPoint & verticalHotSpot =fNullPoint -The vertical hot spot for this drawing.
- MGraphic * graphic -The MGraphic to adopt.
- const TGPoint & horizontalHotSpot -The horizontal hot spot for this drawing.
- const TGPoint & verticalHotSpot -The vertical hot spot for this drawing.
- GCoordinate horizontalAdvance -The horizontal advance for this style object.
- GCoordinate verticalAdvance -The vertical advance for this style object.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
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.
- TMGraphicObjectStyle ()
- TMGraphicObjectStyle (const MGraphic & graphic)
- TMGraphicObjectStyle (const MGraphic & graphic, const TGPoint & horizontalHotSpot, const TGPoint & verticalHotSpot =fNullPoint)
- TMGraphicObjectStyle (const MGraphic & graphic, const TGPoint & horizontalHotSpot, const TGPoint & verticalHotSpot, GCoordinate horizontalAdvance, GCoordinate verticalAdvance)
- TMGraphicObjectStyle (const TMGraphicObjectStyle &)
Interface Category:
API.
Purpose:
- Default constructor.
- Constructs an MGraphic object style instance with a specified MGraphic instance.
- Constructs an MGraphic object style instance with a specified MGraphic instance and other specified values.
- Constructs an MGraphic object style instance with a specified MGraphic instance and other specified values.
- Copy constructor.
Calling Context:
- Called by the stream-in operators.
- Call directly to instantiate this class.
- Call directly to instantiate this class.
- Call directly to instantiate this class.
- Called to copy an object.
Parameters:
- Takes no parameters.
- const MGraphic & graphic -The MGraphic to use when drawing.
- const MGraphic & graphic -The MGraphic to use when drawing.
- const TGPoint & horizontalHotSpot -The horizontal hot spot for this style object.
- const TGPoint & verticalHotSpot =fNullPoint -The vertical hot spot for this style object.
- const MGraphic & graphic -The MGraphic to use when drawing.
- const TGPoint & horizontalHotSpot -The horizontal hot spot for this style object.
- const TGPoint & verticalHotSpot -The vertical hot spot for this style object.
- GCoordinate horizontalAdvance -The horizontal advance for this style object.
- GCoordinate verticalAdvance -The vertical advance for this style object.
- const TMGraphicObjectStyle & -The object to copy.
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.