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

#include <ISprite.h>

Inheritance diagram for ISprite:
IPMUnknownCSpriteNoHandleSprite

Public Types

enum  { kDefaultIID = IID_ISPRITE }
 

Public Member Functions

virtual bool16 CreateSprite (IGraphicsContext *gc, UIDList *itemList, const PMPoint &startPt, bool16 bDrawItems=kTrue)=0
 
virtual void DestroySprite (IGraphicsContext *gc)=0
 
virtual void DisableShapes (IGraphicsContext *gc, bool16 disable)=0
 
virtual bool16 Show (IGraphicsContext *gc, const PMPoint &where, int32 flags, PMMatrix *xForm=nil)=0
 
virtual bool16 Scroll (IGraphicsContext *gc, const PMPoint &delta, int32 flags, PMMatrix *xForm=nil)=0
 
virtual void Erase (IGraphicsContext *gc, const PMPoint &where, int32 flags, PMMatrix *xForm=nil)=0
 
virtual void Hide (IGraphicsContext *gc, bool16 bForceRedraw, PMMatrix *xForm=nil)=0
 
virtual SysRect GetDeviceBounds (IGraphicsContext *gc, int32 flags, PMMatrix *xForm=nil)=0
 
virtual void InvalidateBBox ()=0
 
virtual bool16 ValidSprite () const =0
 
virtual bool16 NeedsUpdate (const PMPoint &where, int32 flags) 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

ISprite is an interface used by trackers to update the screen while tracking. For example, when resizing a page item, a resize tracker will create a sprite. The sprite represents the page item that is being resized and is called by the tracker to "Show" every time the mouse is moved. Sprites can draw in wire frame mode or in "patient user" mode. When in wire frame mode, the original page item continues to draw unchanged while an outline of the page item is dynamically updated to show the effect of the change made by the tracker. In patient-user mode, the layout is continually redrawn to show the full effect of the change made by the tracker, as if the user released the mouse after each step.

See Also
IShape

Member Function Documentation

virtual bool16 ISprite::CreateSprite (IGraphicsContextgc,
UIDListitemList,
const PMPointstartPt,
bool16 bDrawItems = kTrue 
)
pure virtual

Creates sprite

Parameters
gc- IN: A pointer to the IGraphicsContext representing the device that the sprite will draw to.
itemList- IN: The uidlist indicates those items that the sprite is rendering. It uses those items to compute the offscreen bounding box. If drawItemList is kTrue then the sprite will draw the items in the uid list during show. If itemList is nil that means the sprite should draw its own paths (if any) and ignore the item list related drawing. The path creation trackers use a nil item list because the actual page item isn't created until the end of dynamics.
startPt- start point
bDrawItems- IN: tells the sprite whether or not to draw the uid items during show. Set to kFalse only if the sprite implementation has another way that it draws the updated paths/shapes (such as spline editting).
Returns
returns kFalse if low memory. In that case the sprite might do nothing or use XOR in ISprite::Show(). If returns kTrue the sprite succeed in creating offscreens.

Implemented in CSprite.

virtual void ISprite::DestroySprite (IGraphicsContextgc)
pure virtual

Releases references to offscreens and cleans up.

Parameters
gc- IN: A pointer to the IGraphicsContext representing the device to which the sprite draws. Used to issue an draw invalidations or screen redraws that may be necessary as part of the cleanup process.

Implemented in CSprite.

virtual void ISprite::DisableShapes (IGraphicsContextgc,
bool16 disable 
)
pure virtual

If called, this will disable the shapes in the uidlist from drawing in the background offscreen. This is different than the bDrawItems flag in CreateSprite. DisableShapes specifically affects only the items drawing during the creation of the background.

Parameters
gc- IN: A pointer to the IGraphicsContext representing the device to which the sprite draws. Necessary to obtain the IDrawMgr for the port in order to tell the IDrawMgr to Disable the shape.
disable- IN: kTrue to disable the drawing of the shape. kFalse to enable the drawing.

Implemented in CSprite.

virtual void ISprite::Erase (IGraphicsContextgc,
const PMPointwhere,
int32 flags,
PMMatrixxForm = nil 
)
pure virtual

For the case when the sprite fails to create an offscreen you can still use it for dynamics. But to do so requires the user to call erase so the old drawing is cleaned up. Erase should be called with the previous position. i.e., if the object is moving call show, then erase, then move the object, then show, then erase, then move the object, then show, etc. Of course erase should only be called immediately before moving the object (and only if the object is to move). flags are IShape::flags

Parameters
gc- IN: A pointer to the IGraphicsContext representing the device to which the sprite draws.
where- IN: Obsolete. Not used.
flags- IN: flags are IShape::flags.
xForm- IN: The matrix represents the transformation that is passed into all the IHandleShapes in the item list (See CreateSprite). The matrix is a pasteboard relative transformation.

Implemented in CSprite.

virtual SysRect ISprite::GetDeviceBounds (IGraphicsContextgc,
int32 flags,
PMMatrixxForm = nil 
)
pure virtual

Returns the bounds used by the sprite. The bounds includes everything the sprite would draw during show given the same flags and matrix.

Parameters
gc- IN: A pointer to the IGraphicsContext representing the device to which the sprite draws.
flags- IN: flags are IShape::flags.
See Also
IShape.h
Parameters
xForm- IN: The matrix represents the transformation that is passed into all the IHandleShapes in the item list (See CreateSprite). The matrix is a pasteboard relative transformation.
Returns
the bounds used by the sprite.

Implemented in CSprite.

virtual void ISprite::Hide (IGraphicsContextgc,
bool16 bForceRedraw,
PMMatrixxForm = nil 
)
pure virtual

Removes any sprite related extra drawing. Restores the screen to reflect what is in the spread. This function is somewhat implementation dependent. For instance, in path creation it may be used to update with the newly created segment, or for rotation getting rid of the tracker line

Parameters
gc- IN: A pointer to the IGraphicsContext representing the device to which the sprite draws.
bForceRedraw- IN: Whether or not to force the gc to redraw before returning.
xForm- IN: The matrix represents the transformation that is passed into all the IHandleShapes in the item list (See CreateSprite). The matrix is a pasteboard relative transformation.

Implemented in CSprite.

virtual void ISprite::InvalidateBBox ()
pure virtual

Tells the sprite that the object's bbox has changed and to recalculate the cached version in the sprite.

Implemented in CSprite.

virtual bool16 ISprite::NeedsUpdate (const PMPointwhere,
int32 flags 
) const
pure virtual

Returns kTrue when sprite needs to update, kFalse otherwise. Typically a sprite won't need updating unless it has moved, but this hook allows clients to override.

Implemented in CSprite.

virtual bool16 ISprite::Scroll (IGraphicsContextgc,
const PMPointdelta,
int32 flags,
PMMatrixxForm = nil 
)
pure virtual

Scroll the sprite. In general this recreates the background and repaints.

Parameters
gc- IN: A pointer to the IGraphicsContext representing the device to which the sprite draws.
delta- IN: The amount to scroll.
flags- IN: flags are IShape::flags.
xForm- IN: The matrix represents the transformation that is passed into all the IHandleShapes in the item list (See CreateSprite). The matrix is a pasteboard relative transformation.
Returns
kFalse means the sprite is in low memory and that it drew the objects directly to gc.

Implemented in CSprite.

virtual bool16 ISprite::Show (IGraphicsContextgc,
const PMPointwhere,
int32 flags,
PMMatrixxForm = nil 
)
pure virtual

Show the sprite.

Parameters
gc- IN: A pointer to the IGraphicsContext representing the device to which the sprite draws.
where- IN: Obsolete. Not used.
flags- IN: flags are IShape::flags.
See Also
IShape.h
Parameters
xForm- IN: The matrix represents the transformation that is passed into all the IHandleShapes in the item list (See CreateSprite). The matrix is a pasteboard relative transformation.
Returns
kFalse means the sprite is in low memory and that it drew the objects directly to gc.

Implemented in CSprite.

virtual bool16 ISprite::ValidSprite () const
pure virtual

Tells whether the sprite has been initialized – that is, CreateSprite has been called.

Implemented in CSprite.