home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-05-15 | 9.3 KB | 352 lines | [TEXT/PJMM] |
- unit Drag;
-
- { Pascal interface to the Macintosh Libraries: }
- { Drag Manager }
-
- { Based on material copyrighted by Apple Computer, Inc. }
-
- interface
- uses
- AppleEvents;
-
- const
-
- _DragDispatch = $ABED;
-
- { Gestalt Constants }
-
- gestaltDragMgrAttr = 'drag'; { Drag Manager attributes }
- gestaltDragMgrPresent = 0; { Drag Manager is present }
- gestaltDragMgrFloatingWind = 1; { Floating window support (?) }
- gestaltPPCDragLibPresent = 2; { PowerPC shared library available (?) }
- gestaltTEAttr = 'teat'; { TextEdit attributes }
- gestaltTEHasGetHiliteRgn = 0; { TextEdit has TEGetHiliteRgn }
-
- { Flavor Flags }
-
- flavorSenderOnly = $00000001; { flavor available to sender only }
- flavorSenderTranslated = $00000002; { flavor translated by sender }
- flavorNotSaved = $00000004; { flavor should not be saved }
- flavorSystemTranslated = $00000100; { flavor translated by system }
-
- { Drag Attributes }
-
- dragHasLeftSenderWindow = $00000001; { drag has left source window }
- dragInsideSenderApplication = $00000002; { drag is in the source app }
- dragInsideSenderWindow = $00000004; { drag is in the source window }
-
- { Special Flavor Type }
-
- flavorTypeHFS = 'hfs '; { flavor type for HFS data }
- flavorTypePromiseHFS = 'phfs'; { flavor type for promised HFS }
- flavorTypeDirectory = 'diry'; { flavor type for AOCE directory }
-
- { Drag Tracking Handler Messages }
-
- dragTrackingEnterHandler = 1; { drag has entered handler }
- dragTrackingEnterWindow = 2; { drag has entered window }
- dragTrackingInWindow = 3; { drag is moving within window }
- dragTrackingLeaveWindow = 4; { drag has exited window }
- dragTrackingLeaveHandler = 5; { drag has exited handler }
-
- { Drag Drawing Handler Messages }
-
- dragRegionBegin = 1; { initialize drawing }
- dragRegionDraw = 2; { draw drag feedback }
- dragRegionHide = 3; { hide drag feedback }
- dragRegionIdle = 4; { drag feedback idle time }
- dragRegionEnd = 5; { end of drawing }
-
- { Zooming Constants }
-
- zoomNoAcceleration = 0; { use linear interpolation }
- zoomAccelerate = 1; { ramp up step size }
- zoomDecelerate = 2; { ramp down step size }
-
- { Drag Manager result codes }
-
- badDragRefErr = -1850;
- badDragItemErr = -1851;
- badDragFlavorErr = -1852;
- duplicateFlavorErr = -1853;
- cantGetFlavorErr = -1854;
- duplicateHandlerErr = -1855;
- handlerNotFoundErr = -1856;
- dragNotAcceptedErr = -1857;
-
- type
-
- DragReference = LongInt;
- ItemReference = LongInt;
- FlavorType = ResType;
- FlavorFlags = LongInt;
- DragAttributes = LongInt;
- DragTrackingMessage = Integer;
- DragRegionMessage = Integer;
- ZoomAcceleration = Integer;
-
- { Special Flavor Data Types }
-
- HFSFlavor = record
- fileType: OSType; { file type }
- fileCreator: OSType; { file creator }
- fdFlags: Integer; { Finder flags }
- fileSpec: FSSpec; { file system specification }
- end;
-
- PromiseHFSFlavor = record
- fileType: OSType; { file type }
- fileCreator: OSType; { file creator }
- fdFlags: Integer; { Finder flags }
- promisedFlavor: FlavorType; { promised flavor containing FSSpec }
- end;
-
- { User Function Prototypes }
-
- DragTrackingHandler = ProcPtr;
- DragReceiveHandler = ProcPtr;
- DragSendDataProc = ProcPtr;
- DragInputProc = ProcPtr;
- DragDrawingProc = ProcPtr;
-
- { Drag Manager Routines Installing and Removing Drag Handlers }
-
- function InstallTrackingHandler (trackingHandler: DragTrackingHandler;
- theWindow: WindowPtr;
- handlerRefCon: univ Ptr): OSErr;
- inline
- $7001, _DragDispatch;
-
- function InstallReceiveHandler (receiveHandler: DragReceiveHandler;
- theWindow: WindowPtr;
- handlerRefCon: univ Ptr): OSErr;
- inline
- $7002, _DragDispatch;
-
- function RemoveTrackingHandler (trackingHandler: DragTrackingHandler;
- theWindow: WindowPtr): OSErr;
- inline
- $7003, _DragDispatch;
-
- function RemoveReceiveHandler (receiveHandler: DragReceiveHandler;
- theWindow: WindowPtr): OSErr;
- inline
- $7004, _DragDispatch;
-
- { Creating and Disposing of Drag References }
-
- function NewDrag (var theDragRef: DragReference): OSErr;
- inline
- $7005, _DragDispatch;
-
- function DisposeDrag (theDragRef: DragReference): OSErr;
- inline
- $7006, _DragDispatch;
-
- { Adding Drag Item Flavors }
-
- function AddDragItemFlavor (theDragRef: DragReference;
- theItemRef: ItemReference;
- theType: FlavorType;
- dataPtr: univ Ptr;
- dataSize: Size;
- theFlags: FlavorFlags): OSErr;
- inline
- $7007, _DragDispatch;
-
- function SetDragItemFlavorData (theDragRef: DragReference;
- theItemRef: ItemReference;
- theType: FlavorType;
- dataPtr: univ Ptr;
- dataSize: Size;
- dataOffset: LongInt): OSErr;
- inline
- $7009, _DragDispatch;
-
- { Providing Drag Callback Procedures }
-
- function SetDragSendProc (theDragRef: DragReference;
- sendProc: DragSendDataProc;
- dragSendRefCon: univ Ptr): OSErr;
- inline
- $700A, _DragDispatch;
-
- function SetDragInputProc (theDragRef: DragReference;
- inputProc: DragInputProc;
- dragInputRefCon: univ Ptr): OSErr;
- inline
- $700B, _DragDispatch;
-
- function SetDragDrawingProc (theDragRef: DragReference;
- drawingProc: DragDrawingProc;
- dragDrawingRefCon: univ Ptr): OSErr;
- inline
- $700C, _DragDispatch;
-
- { Performing a Drag }
-
- function TrackDrag (theDragRef: DragReference;
- theEvent: EventRecord;
- theRegion: RgnHandle): OSErr;
- inline
- $700D, _DragDispatch;
-
- { Getting Drag Item Information }
-
- function CountDragItems (theDragRef: DragReference;
- var numItems: Integer): OSErr;
- inline
- $700E, _DragDispatch;
-
- function GetDragItemReferenceNumber (theDragRef: DragReference;
- index: Integer;
- var theItemRef: ItemReference): OSErr;
- inline
- $700F, _DragDispatch;
-
- function CountDragItemFlavors (theDragRef: DragReference;
- theItemRef: ItemReference;
- var numFlavors: Integer): OSErr;
- inline
- $7010, _DragDispatch;
-
- function GetFlavorType (theDragRef: DragReference;
- theItemRef: ItemReference;
- index: Integer;
- var theType: FlavorType): OSErr;
- inline
- $7011, _DragDispatch;
-
- function GetFlavorFlags (theDragRef: DragReference;
- theItemRef: ItemReference;
- theType: FlavorType;
- var theFlags: FlavorFlags): OSErr;
- inline
- $7012, _DragDispatch;
-
- function GetFlavorDataSize (theDragRef: DragReference;
- theItemRef: ItemReference;
- theType: FlavorType;
- var dataSize: Size): OSErr;
- inline
- $7013, _DragDispatch;
-
- function GetFlavorData (theDragRef: DragReference;
- theItemRef: ItemReference;
- theType: FlavorType;
- dataPtr: univ Ptr;
- var dataSize: Size;
- dataOffset: LongInt): OSErr;
- inline
- $7014, _DragDispatch;
-
- function GetDragItemBounds (theDragRef: DragReference;
- theItemRef: ItemReference;
- var itemBounds: Rect): OSErr;
- inline
- $7015, _DragDispatch;
-
- function SetDragItemBounds (theDragRef: DragReference;
- theItemRef: ItemReference;
- itemBounds: Rect): OSErr;
- inline
- $7016, _DragDispatch;
-
- { Getting and Setting Drag Status Information }
-
- function GetDragAttributes (theDragRef: DragReference;
- var attributes: DragAttributes): OSErr;
- inline
- $7019, _DragDispatch;
-
- function GetDragMouse (theDragRef: DragReference;
- var mouse: Point;
- var pinnedMouse: Point): OSErr;
- inline
- $701A, _DragDispatch;
-
- function SetDragMouse (theDragRef: DragReference;
- pinnedMouse: Point): OSErr;
- inline
- $701B, _DragDispatch;
-
- function GetDragOrigin (theDragRef: DragReference;
- var initialMouse: Point): OSErr;
- inline
- $701C, _DragDispatch;
-
- function GetDragModifiers (theDragRef: DragReference;
- var modifiers: Integer;
- var mouseDownModifiers: Integer;
- var mouseUpModifiers: Integer): OSErr;
- inline
- $701D, _DragDispatch;
-
- function GetDropLocation (theDragRef: DragReference;
- var dropLocation: AEDesc): OSErr;
- inline
- $7017, _DragDispatch;
-
- function SetDropLocation (theDragRef: DragReference;
- dropLocation: AEDesc): OSErr;
- inline
- $7018, _DragDispatch;
-
- { Window Highlighting Utilities }
-
- function ShowDragHilite (theDragRef: DragReference;
- hiliteFrame: RgnHandle;
- inside: Boolean): OSErr;
- inline
- $701E, _DragDispatch;
-
- function HideDragHilite (theDragRef: DragReference): OSErr;
- inline
- $701F, _DragDispatch;
-
- function DragPreScroll (theDragRef: DragReference;
- dH: Integer;
- dV: Integer): OSErr;
- inline
- $7020, _DragDispatch;
-
- function DragPostScroll (theDragRef: DragReference): OSErr;
- inline
- $7021, _DragDispatch;
-
- function UpdateDragHilite (theDragRef: DragReference;
- updateRgn: RgnHandle): OSErr;
- inline
- $7022, _DragDispatch;
-
-
- { Drag Manager Utilities }
-
- function WaitMouseMoved (initialMouse: Point): Boolean;
- inline
- $7023, _DragDispatch;
-
- function ZoomRects (fromRect: Rect;
- toRect: Rect;
- zoomSteps: Integer;
- acceleration: ZoomAcceleration): OSErr;
- inline
- $7024, _DragDispatch;
-
- function ZoomRegion (region: RgnHandle;
- zoomDistance: Point;
- zoomSteps: Integer;
- acceleration: ZoomAcceleration): OSErr;
- inline
- $7025, _DragDispatch;
-
- { TextEdit Utilities }
-
- function TEGetHiliteRgn (region: RgnHandle;
- hTE: TEHandle): OSErr;
- inline
- $3F3C, $000F, $A83D;
-
- implementation
- end.
-