![]() | InDesign SDK 20.5 |
#include <ISprite.h>
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 IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
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.
| pure virtual |
Creates sprite
| 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). |
Implemented in CSprite.
| pure virtual |
Releases references to offscreens and cleans up.
| 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.
| 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.
| 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.
| 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
| 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.
| 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.
| gc | - IN: A pointer to the IGraphicsContext representing the device to which the sprite draws. |
| 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.
| 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
| 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.
| pure virtual |
Tells the sprite that the object's bbox has changed and to recalculate the cached version in the sprite.
Implemented in CSprite.
| 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.
| pure virtual |
Scroll the sprite. In general this recreates the background and repaints.
| 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. |
Implemented in CSprite.
| pure virtual |
Show the sprite.
| 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.
| pure virtual |
Tells whether the sprite has been initialized – that is, CreateSprite has been called.
Implemented in CSprite.