InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TranFxAdornment Class Reference
Inheritance diagram for TranFxAdornment:
CPMUnknown< IAdornmentShape >IAdornmentShapeIPMUnknown

Public Member Functions

 TranFxAdornment (IPMUnknown *boss)
 
virtual ~TranFxAdornment ()
 
virtual AdornmentDrawOrder GetDrawOrderBits ()
 
virtual void DrawAdornment (IShape *iShape, AdornmentDrawOrder drawOrder, GraphicsData *gd, int32 flags)
 
virtual PMRect GetPaintedAdornmentBounds (IShape *iShape, AdornmentDrawOrder drawOrder, const PMRect &itemBounds, const PMMatrix &innertoview)
 
virtual PMRect GetPrintedAdornmentBounds (IShape *iShape, AdornmentDrawOrder drawOrder, const PMRect &itemBounds, const PMMatrix &innertoview)
 
virtual void AddToContentInkBounds (IShape *iShape, PMRect *inOutBounds)
 
virtual PMReal GetPriority ()
 
virtual void Inval (IShape *iShape, AdornmentDrawOrder drawOrder, GraphicsData *gd, ClassID reasonForInval, int32 flags)
 
virtual bool16 WillPrint ()
 
virtual bool16 WillDraw (IShape *iShape, AdornmentDrawOrder drawOrder, GraphicsData *gd, int32 flags)
 
virtual bool16 HitTest (IShape *iShape, AdornmentDrawOrder adornmentDrawOrder, IControlView *layoutView, const PMRect &r)
 
- Public Member Functions inherited from CPMUnknown< IAdornmentShape >
IPMUnknownQueryInterface (PMIID interfaceID) const
 
void AddRef () const
 
void Release () const
 
void PreDirty (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
void PreDirtyNoMessage (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
 CPMUnknown (const CPMUnknown &)=delete
 
CPMUnknownoperator= (const CPMUnknown &)=delete
 

Additional Inherited Members

- Public Types inherited from IAdornmentShape
enum  { kDefaultIID = IID_IADORNMENTSHAPE }
 
enum  AdornmentDrawOrder {
  kNone = 0, kBeforeShape = 1, kAfterFill = 2, kBeforeTextBackground = 4,
  kBeforeText = 8, kBeforeTextForeground = 16, kAfterTextForeground = 32, kBeforeStroke = 64,
  kAfterStroke = 128, kAfterShape = 256, kBeforeFill = 512, kBeforeContent = 1024,
  kAfterContent = 2048, kAfterEndShape = 4096, kAfterSpread = 8192, kAllAdornmentFlags = 16383
}
 
enum  AdornmentDrawNumber { kNumberOfAdornments = 14 }
 
- Protected Member Functions inherited from CPMUnknown< IAdornmentShape >
 CPMUnknown (IPMUnknown *boss)
 
- Protected Attributes inherited from CPMUnknown< IAdornmentShape >
HelperInterface fHelperInterface
 

Detailed Description

Draws a transparent matte effect behind the page item at the x and y offset given by the graphic attributes below:

The adornment takes a snapshot of the page item offscreen as a gray level image, then manipulates it as indicated by the custom graphic attributes below:

To draw the effect, the adornment uses the resultant grey level image as an alpha paint server. Once the image is thus applied as an alpha mask, the adornment fills the image area with black. The alpha mask controls the opacity of each resultant pixel. If the alpha mask has a value of 255 it will be drawn as an opaque black pixel, if it has a value of 0 it will be transparent, and if it has a value of 1..254 it will be a grey pixel of increasing darkness and opacity.

See Also
TranFxMatteFactory helper used to create the image mask.
TranFxUtils helper used to access the graphic attributes that control the image processing and drawing.

Constructor & Destructor Documentation

TranFxAdornment::TranFxAdornment (IPMUnknownboss)

Constructor.

Parameters
boss
TranFxAdornment::~TranFxAdornment ()
virtual

Destructor.

Member Function Documentation

void TranFxAdornment::AddToContentInkBounds (IShapeiShape,
PMRectinOutBounds 
)
virtual

Not yet implemented.

Parameters
iShapeIN the page item that owns the adornment.
inOutBounds

Implements IAdornmentShape.

void TranFxAdornment::DrawAdornment (IShapeiShape,
IAdornmentShape::AdornmentDrawOrder drawOrder,
GraphicsDatagd,
int32 flags 
)
virtual

Draws the adornment. The method creates a mask image of the page item that owns the adornment, applies it as an alpha paint server then fills the area with black. The result is a greyscale image of the page item of varying transparency.

Parameters
iShapeIN the page item that owns the adornment.
drawOrderIN significant for adornments that registered for more than one order.
gdthe graphics context to draw into.
flagsthe draw flags (see IShape).

Implements IAdornmentShape.

IAdornmentShape::AdornmentDrawOrder TranFxAdornment::GetDrawOrderBits ()
virtual

Registers for kBeforeShape since the adornment draws behind the item that owns it. Note: You are only called for at the draw order(s) you request so you must override this, else you won't be called at all.

Returns
kBeforeShape.

Implements IAdornmentShape.

PMRect TranFxAdornment::GetPaintedAdornmentBounds (IShapeiShape,
AdornmentDrawOrder drawOrder,
const PMRectitemBounds,
const PMMatrixinnertoview 
)
virtual

Return the bounds of the adornment in view co-ordinates adjusting as necessary for any x and y offsets that are applied.

Parameters
iShapeIN the page item that owns the adornment.
drawOrderIN significant for adornments that registered for more than one order.
itemBoundsIN stroke bounds of page item that owns the adornment in view co-ordinates.
innerToViewIN matrix to be used to transform bounds into view co-ordinates.
Returns
bounds of the adornment in view co-ordinates.

Implements IAdornmentShape.

PMRect TranFxAdornment::GetPrintedAdornmentBounds (IShapeiShape,
AdornmentDrawOrder drawOrder,
const PMRectitemBounds,
const PMMatrixinnertoview 
)
virtual

Return the bounds of the adornment in view co-ordinates adjusting as necessary for any x and y offsets that are applied. If this adornment were not included during printing, then we'd simply return the itemBounds. However, for this adornment, the printed bounds is the same as the painted bounds.

Parameters
iShapeIN the page item that owns the adornment.
drawOrderIN significant for adornments that registered for more than one order.
itemBoundsIN stroke bounds of page item that owns the adornment in view co-ordinates.
innerToViewIN matrix to be used to transform bounds into view co-ordinates.
Returns
bounds of the adornment in view co-ordinates.

Implements IAdornmentShape.

PMReal TranFxAdornment::GetPriority ()
virtual

Return the draw priority of thius adornment relative to other adornments in the draw order.

Returns
0.0 since the priority is not significant.

Implements IAdornmentShape.

virtual bool16 TranFxAdornment::HitTest (IShapeiShape,
AdornmentDrawOrder adornmentDrawOrder,
IControlViewlayoutView,
const PMRectr 
)
inlinevirtual
void TranFxAdornment::Inval (IShapeiShape,
IAdornmentShape::AdornmentDrawOrder drawOrder,
GraphicsDatagd,
ClassID reasonForInval,
int32 flags 
)
virtual

Purges any effect image for the page item that has been saved in the image cache.

Note: Previously a scheme that used a document observer was used to purge the cache as objects were transformed or invalidated. This was moved to here because this method always gets called when these events occur. The benefit is we only get called for objects that have the effect applied. The document observer was watching for changes on all object and then detecting those that have the effect. Putting the cache purge here seems more efficient.

Parameters
iShapeIN the page item that owns the adornment.
drawOrderIN significant for adornments that registered for more than one order.
gdIN the graphics context to draw into.
reasonForInvalIN
flagsIN the draw flags (see IShape).

Implements IAdornmentShape.

bool16 TranFxAdornment::WillDraw (IShapeiShape,
AdornmentDrawOrder drawOrder,
GraphicsDatagd,
int32 flags 
)
virtual

Checks the state that controls whether or not this adornment will draw.

Parameters
iShapeIN the page item that owns the adornment.
drawOrderIN significant for adornments that registered for more than one order
gdIN the graphics context to draw into.
flagsIN the draw flags (see IShape).
Returns
kTrue if the adornment will draw, kFalse otherwise.

Implements IAdornmentShape.

bool16 TranFxAdornment::WillPrint (void )
virtual
Returns
kTrue since this adornment prints.

Implements IAdornmentShape.