![]() | InDesign SDK 20.5 |
#include <ITextAdornment.h>

Public Types | |
| enum | { kDefaultIID = IID_ITEXTADORNMENT } |
Public Member Functions | |
| virtual Text::DrawPriority | GetDrawPriority ()=0 |
| virtual void | GetInkBounds (PMRect *inkBounds, const PMRect &runInkBounds, IWaxRun *waxRun, IWaxRenderData *renderData, IWaxGlyphs *waxGlyphs, const ITextAdornmentData *data)=0 |
| virtual void | Draw (GraphicsData *gd, int32 iShapeFlags, IWaxRun *waxRun, IWaxRenderData *renderData, IWaxGlyphs *waxGlyphs, const ITextAdornmentData *data)=0 |
| virtual ITextAdornmentData * | SplitAt (int32 offsetInRun, IWaxRun *waxRun, IWaxRun *newWaxRun, ITextAdornmentData *data)=0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
Text Adornments are bosses that are "attached" by ClassID to individual wax runs and, when the run is drawn, they are given control via this interface.
Adornments affect when they are called by the priority value they return via their GetPriority() method. Higher priorities (smaller numbers) are called before lower priorities (larger numbers).
In addition, drawing priorities are further broken down into two pieces - Pass (whole part) and Run (fractional part). For each unique Pass value across all the active adornments in a frame, a full iteration of the wax runs will be made calling all the adornments which share that pass value. Then, within each wax run, the adornments will be called based on their Run priority.
For performance reasons it is important to minimize the number of passes that are made over the wax. Try to piggyback your drawing on an existing pass, such as when text is drawn. The critical indicator is to decide if drawing your adornment on a particular run will be negatively effected by some other adornment drawn on another run within the same pass. This is usually the case with fill type operations. These types of adornments probably require their own pass.
To assist in selecting appropriate priorities, we have defined some values below for adornments that are part of the base implementation.
And now a word about Page Item Adornments... These aren't strictly related to text but it may be important for them to know when the text will be drawn related to their priorities. So in that vein:
Page Item Adornment Relative To Text "Priority" Adornment Draw Priority
kBeforeTextBackground BEFORE kMaxPriority kBeforeText kPassPriText (before any text adornment with same priority) kBeforeTextForeground kPassPriForeground (before any text adornment with same priority) kAfterTextForeground AFTER kMinPriority
| pure virtual |
Draw the text adornment.
Two important IShape flags must be observed:
IShape::kPrinting If set, indicates that we are printing.
IShape::kPreviewMode If set, indicates that we are previewing printing to the screen, text adornments that do not draw when printing should not draw for this either
| gd | IN Pointer to the GraphicsData. |
| iShapeFlags | IN The value of the flags parameter passed into IShape::Draw. |
| waxRun | IN An interface on this wax run boss. |
| renderData | An interface on this wax run boss. It can be nil, meaning the WaxRunis NOT a typical text run. |
| waxGlyphs | IN An interface on this wax run boss. It can be nil, meaning the WaxRunis NOT a typical text run. |
| data | IN pointer to optional ITextAdornmentData. It may be nil if no data is specified when the adornment was attached. |
Implemented in HidTxtAnchorTextAdornment, and BscTAAdornment.
| pure virtual |
Returns the Draw priority of the adornment.
Implemented in HidTxtAnchorTextAdornment, and BscTAAdornment.
| pure virtual |
Returns information about the adornment including whether it would draw on this run and what the ink bounds are.
The ink bounds are in waxLine coordinate space (i.e. "within the line" space). (The same space as the baseTextWaxRun itself - no xForm need be done at the waxLine level).
| inkBounds | OUT The inkBounds are passed in empty. If your adornment is guaranteed to draw within the Text bounds of the run and the vertical selection bounds of the line then you DO NOT have to return anything for the inkBounds, just leave them unchanged (empty). |
| runInkBounds | IN Value returned by CWaxRunShape::GetTextInkBounds() for this wax run boss. |
| waxRun | IN An interface on this wax run boss. |
| renderData | An interface on this wax run boss. It can be nil, meaning the WaxRunis NOT a typical text run. |
| waxGlyphs | IN An interface on this wax run boss. It can be nil, meaning the WaxRunis NOT a typical text run. |
| data | IN pointer to optional ITextAdornmentData. It may be nil if no data is specified when the adornment was attached. |
Implemented in HidTxtAnchorTextAdornment, and BscTAAdornment.
| pure virtual |
The adorned run is splitting: split the given data at the given offset and return the new data
| offsetInRun | IN Offset in original run. |
| waxRun | IN An interface on the original wax run boss. |
| newWaxRun | IN An interface on the new wax run boss the . |
| data | IN pointer to optional ITextAdornmentData. It may be nil if no data is specified when the adornment was attached. |
Implemented in HidTxtAnchorTextAdornment, and BscTAAdornment.