![]() | InDesign SDK 20.5 |
#include <CSprite.h>
Public Member Functions | |
| CSprite (IPMUnknown *boss) | |
| virtual | ~CSprite () |
| virtual bool16 | CreateSprite (IGraphicsContext *gc, UIDList *itemList, const PMPoint &startPt, bool16 bDrawItemList) |
| virtual void | DestroySprite (IGraphicsContext *gc) |
| virtual bool16 | Show (IGraphicsContext *gc, const PMPoint &where, int32 flags, PMMatrix *xForm) |
| virtual bool16 | Scroll (IGraphicsContext *gc, const PMPoint &delta, int32 flags, PMMatrix *xForm) |
| virtual void | Erase (IGraphicsContext *gc, const PMPoint &where, int32 flags, PMMatrix *xForm) |
| virtual void | Hide (IGraphicsContext *gc, bool16 bForceRedraw, PMMatrix *extraXform) |
| virtual void | InvalidateBBox () |
| virtual void | DisableShapes (IGraphicsContext *gc, bool16 disable) |
| virtual SysRect | GetDeviceBounds (IGraphicsContext *gc, int32 flags, PMMatrix *xForm) |
| virtual bool16 | ValidSprite () const |
| virtual bool16 | NeedsUpdate (const PMPoint &where, int32 flags) const |
Protected Member Functions | |
| virtual void | DisableHandleShapes (IGraphicsContext *gc, bool16 disable) |
| virtual PMRect | GetShapeDeviceBounds (IGraphicsContext *gc, int32 flags) |
| virtual PMRect | GetHandleDeviceBounds (IGraphicsContext *gc, int32 flags, PMMatrix *xForm) |
| virtual PMRect | GetTrackerBounds (IGraphicsContext *gc, int32 flags) |
| virtual PMRect | GetSelectionBounds (IGraphicsContext *gc) |
| virtual void | DrawTrackerExtra (IGraphicsContext *gc, int32 flags) |
| virtual void | ShowFirstTime (IGraphicsContext *gc, const PMPoint &where, int32 flags, PMMatrix *xForm) |
| virtual void | ShowSprite (IGraphicsContext *gc, const PMPoint &where, int32 flags, PMMatrix *xForm) |
| virtual void | ScrollSprite (IGraphicsContext *gc, const PMPoint &delta, int32 flags, PMMatrix *xForm) |
| virtual void | ShowLowMemory (IGraphicsContext *gc, const PMPoint &where, int32 flags, PMMatrix *xForm) |
| virtual void | ShowLowMemoryFirstTime (IGraphicsContext *gc, const PMPoint &where, int32 flags, PMMatrix *xForm) |
| virtual void | ScrollLowMemory (IGraphicsContext *gc, const PMPoint &delta, int32 flags, PMMatrix *xForm) |
| virtual void | HideSprite (IGraphicsContext *gc, bool16 bForceRedraw, PMMatrix *extraXform) |
| virtual void | HideLowMemory (IGraphicsContext *gc, bool16 bForceRedraw, PMMatrix *extraXform) |
| virtual void | EraseAndRedrawShapes (IGraphicsContext *gc, const PMPoint &where, int32 flags, PMMatrix *xForm) |
| virtual void | SetHiliteColor (UID layerUID) |
| virtual void | DrawShapes (IGraphicsContext *gc, SysRgn clipRgn=nil, bool16 bDisable=kFalse) |
| virtual void | DrawSelection (IGraphicsContext *gc) |
| virtual void | DrawSpriteShapes (IGraphicsContext *gc, int32 flags) |
| virtual void | DrawSpriteHandles (IGraphicsContext *gc, int32 flags, PMMatrix *xForm) |
| virtual void | CreateTrackerPaths (IGraphicsContext *gc) |
| virtual void | CreateHandlePaths (IGraphicsContext *gc, bool16 bDoDirectionHandles=kTrue) |
| virtual void | ClipToView (IGraphicsContext *gc, SysRect *bounds) |
| virtual void | ClipToView (IGraphicsContext *gc, PMRect &bounds) |
| virtual PMRect | GetStandOffBBox (IShape *pShape, IGraphicsContext *gc, int32 flags, const PMRect &bBox) |
| virtual int32 | GetDrawFlags () const |
| virtual bool16 | UseDisplayList (int32 flags) |
| void | AddInvalidOffscreenBounds (IControlView *iView, PMRect *invalidBounds) |
| void | AddInvalidLayoutBounds (IControlView *iView, PMRect *invalidBounds) |
| void | DrawSmartGuides (IGraphicsContext *gc, const PBPMPoint where, const PMMatrix *xForm) |
Static Protected Member Functions | |
| static void | DrawCenterX (IGraphicsPort *gPort, const PBPMPoint ¢er) |
Protected Attributes | |
| PMMatrix | fXformFromLastShow |
| SysRect | fLastBounds |
| ColorArray | fRGBColorValue |
| PMPoint | fStartPoint |
| PMPoint | fCurrentPoint |
| SysPoint | fLastMouseLoc |
| IControlView * | fControlView |
| UIDList * | fItemList |
| IDVOffscreenPortData * | fBackgroundVP |
| IDVOffscreenPortData * | fForegroundVP |
| IDataBase * | fDataBase |
| int32 | fDrawFlags |
| bool16 | fValidDeviceBounds |
| bool16 | fFirstTime |
| bool16 | fValidSprite |
| bool16 | fLowMemory |
| bool16 | fIsFrontView |
| bool16 | fDrawItemList |
| bool16 | fIsPathSelection |
| bool16 | fHandlesDisabled |
| bool16 | fDoRevealAllImageData |
| bool16 | fSmartGuidesDrawn |
| bool16 | fDrawSmartGuides |
Additional Inherited Members | |
Public Types inherited from ISprite | |
| enum | { kDefaultIID = IID_ISPRITE } |
CSprite is an implementation of ISprite 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.
| CSprite::CSprite | ( | IPMUnknown * | boss | ) |
Constructor
| virtual |
Destructor
| protected |
Called when we are setting up our offscreens to obtain any additional area to be updated. Only used in offscreen mode (i.e., not in low memory mode).
| iView | - IN: Used to obtain pending invals for the offscreen. |
| invalidBounds | - OUT: Pending invals for the provided view are unioned with invalidBounds. |
| protected |
Called when we are setting up our offscreens to obtain pending invals for the offscreen. Only used in offscreen mode (i.e., not in low memory mode).
| iView | - IN: Used to obtain offscreen's pending inval areas. |
| invalidBounds | - OUT: Pending invals for the provided offscreen are unioned with invalidBounds. |
| protectedvirtual |
Given a rectangle, clip it to the view referenced by the provided IGraphicsContext.
| gc | - IN: A pointer to the IGraphicsContext representing the device to which the sprite draws. |
| bounds | - IN/OUT: The rectangle to intersect with the view bounds. |
| protectedvirtual |
Given a rectangle, clip it to the view referenced by the provided IGraphicsContext.
| gc | - IN: A pointer to the IGraphicsContext representing the device to which the sprite draws. |
| bounds | - IN/OUT: The rectangle to intersect with the view bounds. |
| protectedvirtual |
Helpers to draw the handles and paths
| gc | - IN: The IGraphicsContext. |
| bDoDirectionHandles | - IN: Include the control handles for each point? |
Reimplemented in NoHandleSprite.
| virtual |
Create 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 | - IN: 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). |
Implements ISprite.
| protectedvirtual |
Override CreateTrackerPaths to do something special such as the reference line in the rotate sprite. CSprite's implementation walks/draws the path stored in the IPathGeometry of the sprite's boss and then draws the handle vectors.
| gc | - IN: The IGraphicsContext. |
Reimplemented in NoHandleSprite.
| 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. |
Implements ISprite.
| protectedvirtual |
Obsolete.
| 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. |
Implements ISprite.
| staticprotected |
Draws dragging a wire frame sprite, a small X is drawn in XOr mode at the center of each page item.
| gPort | - IN: The port to draw into. |
| center | - IN: Where, in pasteboard coordinates, to draw the X. |
| protectedvirtual |
Draw any selection highlighting.
| gc | - IN: A pointer to the IGraphicsContext to draw into. |
| protectedvirtual |
Draw the shapes intersecting the union of the clipRgn and any pending invalidation areas for the view represented by the provided GraphicsContext.
| gc | - IN: A pointer to the IGraphicsContext to draw into. |
| clipRgn | - IN: May be nil. Actually represents any additional area to update. This region gets unioned with any pending invalidations for the view represented by the gc. |
| bDisable | - IN: indicates whether to allow the sprite uid list objects to draw or not. |
| protected |
Draw smart alignment guides.
| gc | - IN: A pointer to the IGraphicsContext representing the device to which the sprite draws. |
| 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. |
| protectedvirtual |
Calls DrawCenterX in XOr mode for each of the items in the itemList passed into CreateSprite.
| 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. |
Reimplemented in NoHandleSprite.
| protectedvirtual |
Draws the itemList passed into CreateSprite to the provided gc, using the IShape::flags
| gc | - IN: A pointer to the IGraphicsContext to draw into. |
| flags | - IN: flags are IShape::flags. |
| protectedvirtual |
Draws the dynamic part of the changes when not in patient-user mode. Draws the paths in xor mode.
| gc | - IN: A pointer to the IGraphicsContext representing the device to which the sprite draws. |
| flags | - IN: flags are IShape::flags. |
| 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. |
Implements ISprite.
| protectedvirtual |
In the provided gc, erases and redraws the update area defined by GetDeviceBounds.
| 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. |
| virtual |
Gets device bounds
| 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. |
Implements ISprite.
| protectedvirtual |
Returns the draw flags to use when when calling DrawMgr::Draw. For standard sprites this value is cached during CreateSprite. However, some sprites (TextOffscreen) may need to calculate the draw flags more often than that
| protectedvirtual |
Gets handle device bounds
| 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. |
| protectedvirtual |
Gets selection bounds
| gc | - IN: A pointer to the IGraphicsContext representing the device to which the sprite draws. Used to obtain the view that is passed into the GetSelectionRgn call. |
| protectedvirtual |
Gets shape device bounds
| gc | - IN: A pointer to the IGraphicsContext representing the device to which the sprite draws. |
| flags | - IN: flags are IShape::flags. |
| protectedvirtual |
Gets standOff bounding box
| pShape | - IN: The page item whose text wrap we are interested in. |
| gc | - IN: A pointer to the IGraphicsContext representing the device to which the sprite draws. |
| flags | - IN: flags are IShape::flags. |
| bBox | - IN: The rect to return if there is no text wrap. |
| protectedvirtual |
Allows the tracker to dynamically change the update area used by the sprite.
| gc | - IN: A pointer to the IGraphicsContext representing the device to which the sprite draws. |
| flags | - IN: flags are IShape::flags. |
Reimplemented in NoHandleSprite.
| 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. |
| extraXform | - 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. |
Implements ISprite.
| protectedvirtual |
Called by Hide to do all the work when in a low memory state and offscreens cannot be used.
| 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. |
| extraXform | - 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. |
| protectedvirtual |
Called by Hide to do all the work when not in a low memory state.
| 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. |
| extraXform | - 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. |
| virtual |
Tells the sprite that the objects bbox has changed and to recalculate the cached version in the sprite.
Implements ISprite.
| inlinevirtual |
Returns kTrue when sprite needs to update, kFalse otherwise.
Implements ISprite.
| 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. |
Implements ISprite.
| protectedvirtual |
Called by Scroll when in a low memory situation and offscreens cannot be used.
| 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. |
| protectedvirtual |
Called by Scroll when we are not in a low memory situation. When in a low memory situation, Scroll will call ScrollLowMemory.
| 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. |
| protectedvirtual |
Override this method if the client wants a different tracker hilite color.
| layerUID | - IN: The UID of the layer whose layer color to use for hilighting. |
| 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. |
Implements ISprite.
| protectedvirtual |
The first time that Show is called, ShowFirstTime will be called to set up its offscreens.
| 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. |
| protectedvirtual |
Called by Show when in a low memory state. Draws in XOr mode.
| 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. |
| protectedvirtual |
Same as ShowLowMemory, except that it erases and redraws the gc first.
| 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. |
| protectedvirtual |
Show calls ShowSprite every time except the first time, where it calls ShowFirstTime. ShowSprite uses the offscreens set up by ShowFirstTime.
| 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. |
| protectedvirtual |
Obsolete. CSprite does not currently use display lists for drawing.
| flags | - IN: flags are IShape::flags. |
Reimplemented in NoHandleSprite.
| inlinevirtual |
Returns whether the sprite has been initialized – that is, that CreateSprite has been called.
Implements ISprite.