home *** CD-ROM | disk | FTP | other *** search
- # include "BlobMgr.h"
-
-
- /* -------------------------------------------------------------------- */
- /* Blob Movement Operations */
- /* -------------------------------------------------------------------- */
-
-
- /*
- * Offset a blob or part of a blob by (hoff, voff). If the blob is enabled,
- * hide it and redraw at the new location.
- */
-
- pascal void
- OffsetBlob (BlobHandle b, short partCode, short hoff, short voff)
- {
- Boolean vis;
-
- if ((hoff == 0) && (voff == 0)) return; /* avoid unnecessary redraw */
-
- vis = false;
- if (BlobEnabled (b))
- {
- vis = true;
- HideBlob (b);
- }
-
- if ((partCode == inDragBlob) || (partCode == inFullBlob))
- OffsetRgn ((**b).dragRgn, hoff, voff);
- if ((partCode == inStatBlob) || (partCode == inFullBlob))
- OffsetRgn ((**b).statRgn, hoff, voff);
-
- if (vis)
- ShowBlob (b);
- }
-
-
- /*
- * Move a blob or part of a blob to (h, v). If the blob is enabled,
- * hide it and redraw at the new location. If partCode is inDragBlob
- * or inStatBlob, move the appropriate region to the location. If
- * inFullBlob, move both regions in synchrony so static region is at
- * given location, drag region is at same location relative to the
- * static region as it was before.
- */
-
- pascal void
- MoveBlob (BlobHandle b, short partCode, short h, short v)
- {
- if (partCode == inDragBlob)
- {
- h -= (**((**b).dragRgn)).rgnBBox.left; /* convert to offsets */
- v -= (**((**b).dragRgn)).rgnBBox.top;
- }
- else /* it's inStatBlob or inFullBLob */
- {
- h -= (**((**b).statRgn)).rgnBBox.left;
- v -= (**((**b).statRgn)).rgnBBox.top;
- }
- OffsetBlob (b, partCode, h, v);
- }
-