InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IPathStroker Class Referenceabstract

#include <IPathStroker.h>

Inheritance diagram for IPathStroker:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IPATHSTROKER }
 

Public Member Functions

virtual ErrorCode StrokePath (IGraphicStyleDescriptor *pageitem, const IPathGeometry *srcPath, IGraphicsPort *gPort) const =0
 
virtual bool16 InStroke (IGraphicStyleDescriptor *pageitem, const IPathGeometry *srcPath, const PMRect &r, IGraphicsPort *gPort) const =0
 
virtual PMRect GetStrokePathBBox (IGraphicStyleDescriptor *pageitem, const PMReal &strokeWeight, const PMReal &miterLimit, int32 lineCap, int32 joinType, const IPathGeometry *srcPath, const PMMatrix &theMatrix) const =0
 
virtual PMRect GetPaintedStrokePathBBox (IGraphicStyleDescriptor *pageitem, const PMReal &strokeWeight, const PMReal &miterLimit, int32 lineCap, int32 joinType, const IPathGeometry *srcPath, const PMMatrix &theMatrix) const =0
 
virtual void GetPathStrokerName (PMString *pathStrokerName) const =0
 
virtual bool16 GetOptionsPanelRsrc (PluginID *retPluginID, RsrcID *retRsrcID) const =0
 
virtual ErrorCode StrokePathForUI (const IPathGeometry *srcPath, IGraphicsPort *gPort, PMReal const &strokeWidth) const =0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

IPathStroker defines the interface to be implemented by installable path strokers

Member Function Documentation

virtual bool16 IPathStroker::GetOptionsPanelRsrc (PluginIDretPluginID,
RsrcID * retRsrcID 
) const
pure virtual

Returns the plugin id and resource id for the panel to load into the stroke panel. If this service does not have a custom panel then return kFalse.

Parameters
retPluginIDOUT The PluginID for the options panel resource
retRsrcIDOUT The RsrcID for the options panel resource
Returns
kTrue if the stroker has a custom panel resource, else kFalse
virtual PMRect IPathStroker::GetPaintedStrokePathBBox (IGraphicStyleDescriptorpageitem,
const PMRealstrokeWeight,
const PMRealmiterLimit,
int32 lineCap,
int32 joinType,
const IPathGeometrysrcPath,
const PMMatrixtheMatrix 
) const
pure virtual

Returns the painted bounding box of the stroke transformed by theMatrix

Note: Won't be called if the item has no stroke.

Use the passed in values for stroke weight, line cap, join type, and miter limit because in certain instances they might be different than that in the descriptor. This should be a fast but sloppy computation of the bounds used for invalidation purposes only

Parameters
pageitemIN The pageitem's graphic style descriptor
strokeWeightIN The pageitem's stroke weight
miterLimitIN The pageitem's miter limit
lineCapIN The pageitem's line cap
joinTypeIN The pageitem's join type
srcPathIN The pageitem's geometry
theMatrixIN The matrix with which to transform the bounding box
Returns
the painted bounding box
See Also
IPathStroker::GetStrokePathBBox
IGraphicStyleDescriptor
IPathGeometry
virtual void IPathStroker::GetPathStrokerName (PMStringpathStrokerName) const
pure virtual

Fills in the text string that describes this type of stroke. Future versions of this interface will build an image representation of the stroke.

Parameters
pathStrokerNameOUT The name of the stroker
virtual PMRect IPathStroker::GetStrokePathBBox (IGraphicStyleDescriptorpageitem,
const PMRealstrokeWeight,
const PMRealmiterLimit,
int32 lineCap,
int32 joinType,
const IPathGeometrysrcPath,
const PMMatrixtheMatrix 
) const
pure virtual

Returns the bounding box of the stroke transformed by theMatrix

Note: Won't be called if the item has no stroke.

Use the passed in values for stroke weight, line cap, join type, and miter limit because in certain instances they might be different than that in the descriptor.

Parameters
pageitemIN The pageitem's graphic style descriptor
strokeWeightIN The pageitem's stroke weight
miterLimitIN The pageitem's miter limit
lineCapIN The pageitem's line cap
joinTypeIN The pageitem's join type
srcPathIN The pageitem's geometry
theMatrixIN The matrix with which to transform the bounding box
Returns
the stroked bounding box
See Also
IPathStroker::GetPaintedStrokePathBBox
IGraphicStyleDescriptor
IPathGeometry
virtual bool16 IPathStroker::InStroke (IGraphicStyleDescriptorpageitem,
const IPathGeometrysrcPath,
const PMRectr,
IGraphicsPortgPort 
) const
pure virtual

Returns kTrue if the rect intersects the pageitem's stroke, else kFalse

Note: Won't be called if the item has no stroke. Note: gPort is assumed to aggregate IRasterPort

Parameters
pageitemIN The pageitem's graphic style descriptor
srcPathIN The pageitem's geometry
rIN The rectangle to test against
gPortIN The port to use
Returns
whether the given rectangle intersects the pageitem's stroke
See Also
IGraphicStyleDescriptor
IPathGeometry
IGraphicsPort
virtual ErrorCode IPathStroker::StrokePath (IGraphicStyleDescriptorpageitem,
const IPathGeometrysrcPath,
IGraphicsPortgPort 
) const
pure virtual

Stroke the pageitem. The word stroke is overloaded to really mean set up the path and renderingobject and then call the appropriate marking function (e.g. stroke) on gPort. For solid lines StrokePath is a simple copy of the path into the port. For other styles, such as dotted or dashed, a more elaborate path setup/stroke is required.

The rendering object is set before calling this method. Also, the path already exists in the port – for solid strokes this means the implementation is very simple. If you want to change the path don't forget to call newpath first. gsave/grestore is called for the path stroker – no need to do it inside strokepath. If there is no stroke then StrokePath won't be called.

Parameters
pageitemIN The pageitem's graphic style descriptor
srcPathIN The pageitem's geometry
gPortIN The graphics port in which to draw the stroke
Returns
an ErrorCode describing the success/failure of the stroke operation
See Also
IGraphicStyleDescriptor
IPathGeometry
IGraphicsPort
virtual ErrorCode IPathStroker::StrokePathForUI (const IPathGeometrysrcPath,
IGraphicsPortgPort,
PMReal const & strokeWidth 
) const
pure virtual

Strokes the given path for use in the user interface. Implementations should use an appropriate default graphics state when drawing.

Note: A default rendering object has already been installed in the port

Parameters
srcPathIN The path geometry for the stroke
gPortIN The port in which to draw
strokeWidthIN The stroke weight for the stroke
See Also
IPathGeometry
IGraphicsPort