A transform that allows the implementation to be provided externally. More...
#include <customtransform.h>
Classes | |
class | IImplementation |
Callback interface that provides methods for actually doing the work. Override the cases for the objects you wish to edit or are otherwise interested in. More... | |
Static Public Member Functions | |
static JAWSMAKO_API ICustomTransformPtr | create (const IJawsMakoPtr &jawsMako, IImplementation *implementation, const IAbortPtr &abort=IAbortPtr(), bool dependsOnClipBounds=true, bool dependsOnGroupSpace=true, bool dependsOnRenderingIntent=true, bool dependsOnTransform=true, bool dependsOnBrushUsage=true, bool dependsOnEdgeMode=true, bool dependsOnUncoloredTilingBrush=true) |
Create an ICustomTransform object whose underlying methods are supported by the implementation object. Note - this creation routine will be removed in a future version of Mako and replaced with a version that is equivalent to calling this function with default arguments. | |
static JAWSMAKO_API ICustomTransformPtr | create (const IJawsMakoPtr &jawsMako, IImplementation *implementation, const IAbortPtr &abort, bool dependsOnClipBounds, bool dependsOnGroupSpace, bool dependsOnRenderingIntent, bool dependsOnTransformScale, bool dependsOnTransformOffset, bool dependsOnBrushUsage, bool dependsOnEdgeMode, bool dependsOnUncoloredTilingBrush) |
Create an ICustomTransform object whose underlying methods are supported by the implementation object. | |
Additional Inherited Members | |
Public Member Functions inherited from JawsMako::ITransform | |
virtual IDOMBrushPtr | transform (const IDOMBrushPtr &brush, eBrushUsage usage=eBUGeneral, const CTransformState &state=CTransformState())=0 |
Apply the transform to the given brush, if applicable. These transforms are thread safe. | |
virtual IDOMImagePtr | transform (const IDOMImagePtr &image, const CTransformState &state=CTransformState())=0 |
Apply the transform to the given image, if applicable. These transforms are thread safe. | |
virtual IDOMColorPtr | transform (const IDOMColorPtr &color, const CTransformState &state=CTransformState())=0 |
Apply the transform to the given color, if applicable. These transforms are thread safe. | |
virtual IDOMColorSpacePtr | transform (const IDOMColorSpacePtr &colorSpace, const CTransformState &state=CTransformState())=0 |
Apply the transform to the given colorspace, if applicable. These transforms are thread safe. | |
virtual IDOMNodePtr | transform (const IDOMNodePtr &node, bool &changed, bool transformChildren=true, const CTransformState &state=CTransformState())=0 |
Apply the transform to the given node, if applicable. These transforms are thread safe, providing no other transforms are being applied to the same nodes at the same time. | |
virtual void | transformPage (const IPagePtr &page, bool transformContent=true, bool transformAnnotations=true)=0 |
Apply the transform to the given page, if applicable. These transforms are thread safe, providing no other transforms are being applied to the same nodes at the same time. The transform will also apply to the annotations appearances. | |
virtual void | flushCaches ()=0 |
Flush the caches used by the transform. Most transforms cache recently transformed results to improve the performance of repeated transformations of equivalent results. However, it is possible that some cached results may point to entities that no longer exist, such as content inside an XPS file that no longer exists. If you are deleting or replacing files where transforms have been used, it is advisable to invoke this routine to clear the caches. | |
virtual void | setProgressMonitor (const IProgressMonitorPtr &progressMonitor)=0 |
Set the IProgressMonitor object for this transform to allow for monitoring the progress of the transform. | |
Public Member Functions inherited from IRCObject | |
virtual void | addRef () const =0 |
Increases the reference count of the actual object pointed to. This would take place during an assignment or copying. | |
virtual bool | decRef () const =0 |
Decreases the reference count of the actual object pointed to. When the reference count falls to Zero, it deletes the actual object pointed to. | |
virtual int32 | getRefCount () const =0 |
Retrieve the current reference count of the actual object pointed to. | |
Protected Member Functions inherited from IRCObject | |
virtual | ~IRCObject () |
Virtual destructor. | |
A transform that allows the implementation to be provided externally.
This class allows Mako users to create their own transforms. In Mako, transforms are a convenient method of performing operations on items in the DOM tree with a minimum of fuss.
To create a transform, provide your own implementation of the ICustomTransform::IImplementation. Here you can override the default handlers for a given graphical node, color, colorspace, font etc, making the edits you wish to that object, while the custom transform mechanism will update the DOM with your result, taking care of its use in shared objects like forms and patterns automatically. Once you have an IImplementation, use ICustomTransform::create() and use the resulting transform as you would any other. These transforms can also be inserted into ITransformChains.
For most objects, a CTransformState will be provided, providing some context for edits that rely on scaling, the group color space, clip, etc.
This can also be used for scanning purposes. For example, let's say you wanted to find out information for every image in a document. You could write a custom transform to override transformImageBrush(). Your code will be called every time a unique imagebrush (IDOMImageBush) is encountered, and from there get to the image (IDOMImage) and its frame (IDOMFrame) to obtain all the information you need - size, resolution, colorspace etc in conjunction with the CTransformState.