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

#include <IDrawMgr.h>

Inheritance diagram for IDrawMgr:
IPMUnknown

Classes

class  ClippingOrFilteringDisabler
 
struct  FilterInfo
 

Public Types

enum  { kDefaultIID = IID_IDRAWMGR }
 

Public Member Functions

virtual void BeginInterruptableDraw (DrawInterrupter *interruptChecker=nil)=0
 
virtual void EndInterruptableDraw ()=0
 
virtual void EnableInterruptableDraw (bool16 enable=kTrue)=0
 
virtual void DisableInterruptableDraw ()=0
 
virtual bool16 IsDrawingInterruptable ()=0
 
virtual void Abort ()=0
 
virtual bool16 DrawAtOnce (IGraphicsContext *gc, const UIDRef &thing, int32 flags)=0
 
virtual bool16 DrawIncrementallyUsingDrawbot (IGraphicsContext *gc, const UIDRef &thing, int32 flags, IDVPlatformOffscreen *srcOffscreen, dvaui::drawbot::Drawbot *dstDrawbot, SysRect updateBounds, int32 tickCount)=0
 
virtual void BeginCullToViewRect (const PMRect &r)=0
 
virtual void BeginCullToViewRegion (const SysRgn &rgn)=0
 
virtual bool16 EndLatestViewSpaceCulling ()=0
 
virtual SysRgn GetViewCullRegion () const =0
 
virtual uint32 GetSpreadFilterCount () const =0
 
virtual uint32 BeginFilterToSpreadRect (const PMRect &r, const PMMatrix &m=PMMatrix(1., 0., 0., 1., 0., 0.), const PMMatrix &rest=PMMatrix(0., 0., 0., 0., 0., 0.))=0
 
virtual uint32 EndFilterToSpreadRect (PMRect *r=nil, PMMatrix *m=nil, PMMatrix *rest=nil)=0
 
virtual FilterInfo GetNthSpreadFilter (uint32 which) const =0
 
virtual bool16 IsDrawAborted ()=0
 
virtual bool16 IsDrawClipped (IPMUnknown *thing, const PMMatrix *pb2view)=0
 
virtual bool16 BeginShape (IPMUnknown *theShape)=0
 
virtual void EndShape (IPMUnknown *theShape)=0
 
virtual void FlushOffscreenIfNecessary ()=0
 
virtual void Disable (UID item, bool16 disable)=0
 
virtual bool16 IsItemDisabled (UID item) const =0
 
virtual bool16 WasDrawAborted () const =0
 
virtual void ClearAborted ()=0
 
virtual void IterateDrawOrder_ (const PMMatrix *xform, const UIDRef &thing, ICallback *callbackInfo, int32 flags)=0
 
void IterateDrawOrder (const UIDRef &thing, ICallback *callbackInfo, int32 flags)
 
virtual bool16 DisableClippingOrFiltering ()=0
 
virtual void EnableClippingOrFiltering ()=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

The DrawMgr is a class that exists on each port and is used to set clipping areas as well as to initiate the drawing of any page element and its children. Optionally, this class can be used to iterate the draw order, calling a client provided callback routine for every page item in the hierarchy.

Member Enumeration Documentation

anonymous enum

default enum

Member Function Documentation

virtual void IDrawMgr::Abort ()
pure virtual

Interrupts drawing, with the side effect that the current update area will be invalidated, causing an update/paint event to occur such that the drawing will start again in the future.

virtual void IDrawMgr::BeginCullToViewRect (const PMRectr)
pure virtual

Set "clipping" region. Draw not called for items that fall outside the clip rect Beginning a new clip while a clip is already installed will push the new clip onto the draw mgr stack. The new clip does not union or intersect with the previous clip, it simply supercedes it. When endclip is called the clip is popped off the stack and the old clip takes over.

Parameters
rIN specifies clipping rect
virtual void IDrawMgr::BeginCullToViewRegion (const SysRgn & rgn)
pure virtual

Set "clipping" region. Draw not called for items that fall outside the clip rect Beginning a new clip while a clip is already installed will push the new clip onto the draw mgr stack. The new clip does not union or intersect with the previous clip, it simply supercedes it. When endclip is called the clip is popped off the stack and the old clip takes over. Makes a copy of rgn.

Parameters
rgnIN specifies clipping region
virtual uint32 IDrawMgr::BeginFilterToSpreadRect (const PMRectr,
const PMMatrixm = PMMatrix(1., 0., 0., 1., 0., 0.),
const PMMatrixrest = PMMatrix(0., 0., 0., 0., 0., 0.) 
)
pure virtual

A filter is a PMRect which specifies an area which must be intersected by a page item before it will be drawn. This filter does not affect how the page item is drawn (i.e. it does not clip). To clip the page item, use BeginClip.

Parameters
rIN the filter rect
virtual void IDrawMgr::BeginInterruptableDraw (DrawInterrupter * interruptChecker = nil)
pure virtual

Sets an interrupt checker before drawing to a port. If this method is called before calling Draw(), then the interrupt checker will periodically (usually before each page item in the hierarchy is drawn) be called to see if the draw should be aborted.

Parameters
interruptCheckerIN the DrawInterrupter
virtual bool16 IDrawMgr::BeginShape (IPMUnknowntheShape)
pure virtual

Do not use, this method is called by the Draw Event Handler at the beginning of every IShape::Draw implementation.

Parameters
theShapeIN the shape being drawn
Returns
kTrue if the IShape implementation should not continue with the drawing of this page item
virtual void IDrawMgr::ClearAborted ()
pure virtual

Clears flag if Draw was aborted during the last Begin/End Interruptable draw sequence.

virtual void IDrawMgr::Disable (UID item,
bool16 disable 
)
pure virtual

Disable an item. It is up to the page item to call back and ask if it is in fact disabled.

Parameters
itemIN UID of the page item to disable
disableIN specifies whether to disable item
virtual bool16 IDrawMgr::DisableClippingOrFiltering ()
pure virtual

Does a "global" disabling of any clipping or filtering. This method is useful for situations where a piece of content, such as a PageItem child or even Text content knows that it needs to draw but by the rules of the hierarchy it will get either clipped or filtered out.

Returns
kTrue if Clipping or Filtering was enabled, kFalse otherwise.
virtual void IDrawMgr::DisableInterruptableDraw ()
pure virtual

Same as EnableInterruptableDraw(kFalse).

virtual bool16 IDrawMgr::DrawAtOnce (IGraphicsContextgc,
const UIDRefthing,
int32 flags 
)
pure virtual

Main entry point - if kFalse is returned, any loops (ie hierarchy loops) should immediately abort.

Parameters
gcIN the graphics context. Contains info about the port.
thingIN the page item to draw
flagsIN see IShape.h for the drawing flags
Returns
if kFalse, any loops (ie hierarchy loops) should immediately abort
virtual bool16 IDrawMgr::DrawIncrementallyUsingDrawbot (IGraphicsContextgc,
const UIDRefthing,
int32 flags,
IDVPlatformOffscreensrcOffscreen,
dvaui::drawbot::Drawbot * dstDrawbot,
SysRect updateBounds,
int32 tickCount 
)
pure virtual

Draw with timed updates to the screen. The client passes in a droverized platform offscreen and a pointer to the screen. Make sure the update bounds encompasses the entire region that will be painted by thing and its children. tickCount is the update interval. Too small and the screen is updated far too often. Too large and the benefit is minimal. Suggested value is 1/2 second (500 ticks).

Parameters
gcIN the graphics context. Contains info about the port.
thingIN the page item to draw
flagsIN see IShape.h for the drawing flags
srcOffscreenIN a pointer to the droverized offscreen we are drawing to
dstDrawbotIN a pointer to the destination drawbot we are drawing to
updateBoundsIN the area of the port or offscreen we are updating
tickCountIN how frequently to update the port using the srcOffscreen
Returns
kTrue if drawing was successful
virtual void IDrawMgr::EnableClippingOrFiltering ()
pure virtual

Re-enables clipping or filtering disabled by a call to the previous method.

virtual void IDrawMgr::EnableInterruptableDraw (bool16 enable = kTrue)
pure virtual

Enables/disables the ability to interrupt drawing. When enabled, BeginInterruptableDraw() has no effect. Useful in some tracking situations.

Parameters
enableIN whether to enable drawing interrupt
virtual uint32 IDrawMgr::EndFilterToSpreadRect (PMRectr = nil,
PMMatrixm = nil,
PMMatrixrest = nil 
)
pure virtual

End the current filter.

virtual void IDrawMgr::EndInterruptableDraw ()
pure virtual

Removes the interrupt checker set by BeginInterruptableDraw.

virtual bool16 IDrawMgr::EndLatestViewSpaceCulling ()
pure virtual

Removes the current clipping from the stack.

Returns
kTrue if there are still clips on the draw mgr stack, kFalse otherwise
virtual void IDrawMgr::EndShape (IPMUnknowntheShape)
pure virtual

Do not use, this method is called by the Draw Event Handler at the end of every IShape::Draw implementation. Every call to BeginShape should be paired with a call to EndShape, even if the drawing was aborted.

Parameters
theShapeIN the shape being drawn
virtual void IDrawMgr::FlushOffscreenIfNecessary ()
pure virtual

IsDrawAborted flushes the offscreen to the screen every few seconds. Sometimes, you want to flush the offscreen, but you don't want to set the aborted flag, even if the user has done something to abort. This will accomplish that. You can call it alot, it will only have an effect every few seconds or so, just like IsDrawAborted.

virtual SysRgn IDrawMgr::GetViewCullRegion () const
pure virtual

Returns a copy of the current clipping region. If there is no clipping region, then nil is returned. Caller is responsible for disposing of the result if non-nil.

Returns
SysRgn of the current clipping region
virtual bool16 IDrawMgr::IsDrawAborted ()
pure virtual

Do not use, use ProcessEvent() with the kAbortCheckMessage event to check for interruption.

virtual bool16 IDrawMgr::IsDrawClipped (IPMUnknownthing,
const PMMatrixpb2view 
)
pure virtual

Do not use, use ProcessEvent() with the kFilterCheckMessage event to check for clipping.

virtual bool16 IDrawMgr::IsDrawingInterruptable ()
pure virtual

Used to determine whether or not interruptable drawing has been disabled via a call to EnableInterruptableDraw() or DisableInterruptableDraw().

Returns
kTrue if interrupts are allowed, kFalse if interrupts have been disabled
virtual bool16 IDrawMgr::IsItemDisabled (UID item) const
pure virtual

Returns whether page item is disabled.

Parameters
itemUID of the page item
virtual void IDrawMgr::IterateDrawOrder_ (const PMMatrixxform,
const UIDRefthing,
ICallbackcallbackInfo,
int32 flags 
)
pure virtual

To walk the display hierarchy in the same order as Draw, use this. the transform matrix is passed instead of a graphics context (which may not exist); callees can modify the transform for their own purposes (e.g. master pages will concatenate a translation).

Parameters
xformIN specifies transform matrix.
thingIN UIDRef of the shape to iterate from.
callbackInfoIN the ICallback interface to use to for callback.
flagsIN see IShape.h for the drawing flags
virtual bool16 IDrawMgr::WasDrawAborted () const
pure virtual

Returns whether draw was aborted or not during the last Begin/End Interruptable draw sequence. The flag is cleared either by a successful Begin/End Interruptable draw or by calling ClearAborted()

Returns
kTrue if the draw was aborted, kFalse otherwise.