Drag.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:35k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       Drag.h
  3.  
  4.      Contains:   Drag and Drop Interfaces.
  5.  
  6.      Version:    Technology: Mac OS 9
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1992-2001 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __DRAG__
  18. #define __DRAG__
  19. #ifndef __MACTYPES__
  20. #include "MacTypes.h"
  21. #endif
  22. #ifndef __EVENTS__
  23. #include "Events.h"
  24. #endif
  25. #ifndef __FILES__
  26. #include "Files.h"
  27. #endif
  28. #ifndef __APPLEEVENTS__
  29. #include "AppleEvents.h"
  30. #endif
  31. #ifndef __QUICKDRAW__
  32. #include "Quickdraw.h"
  33. #endif
  34. #if PRAGMA_ONCE
  35. #pragma once
  36. #endif
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40. #if PRAGMA_IMPORT
  41. #pragma import on
  42. #endif
  43. #if PRAGMA_STRUCT_ALIGN
  44.     #pragma options align=mac68k
  45. #elif PRAGMA_STRUCT_PACKPUSH
  46.     #pragma pack(push, 2)
  47. #elif PRAGMA_STRUCT_PACK
  48.     #pragma pack(2)
  49. #endif
  50. /*
  51.   _________________________________________________________________________________________________________
  52.       
  53.    o DRAG MANAGER DATA TYPES
  54.   _________________________________________________________________________________________________________
  55. */
  56. typedef struct OpaqueDragRef*           DragRef;
  57. typedef UInt32                          DragItemRef;
  58. typedef OSType                          FlavorType;
  59. /*
  60.   _________________________________________________________________________________________________________
  61.       
  62.    o DRAG ATTRIBUTES
  63.   _________________________________________________________________________________________________________
  64. */
  65. typedef UInt32 DragAttributes;
  66. enum {
  67.     kDragHasLeftSenderWindow    = (1L << 0),                    /* drag has left the source window since TrackDrag*/
  68.     kDragInsideSenderApplication = (1L << 1),                   /* drag is occurring within the sender application*/
  69.     kDragInsideSenderWindow     = (1L << 2)                     /* drag is occurring within the sender window*/
  70. };
  71. /*
  72.   _________________________________________________________________________________________________________
  73.       
  74.    o DRAG BEHAVIORS
  75.   _________________________________________________________________________________________________________
  76. */
  77. typedef UInt32 DragBehaviors;
  78. enum {
  79.     kDragBehaviorNone           = 0,
  80.     kDragBehaviorZoomBackAnimation = (1L << 0)                  /* do zoomback animation for failed drags (normally enabled).*/
  81. };
  82. /*
  83.   _________________________________________________________________________________________________________
  84.       
  85.    o DRAG IMAGE FLAGS
  86.   _________________________________________________________________________________________________________
  87. */
  88. typedef UInt32 DragImageFlags;
  89. enum {
  90.     kDragRegionAndImage         = (1L << 4)                     /* drag region and image*/
  91. };
  92. /*
  93.   _________________________________________________________________________________________________________
  94.       
  95.    o DRAG IMAGE TRANSLUCENCY LEVELS
  96.   _________________________________________________________________________________________________________
  97. */
  98. enum {
  99.     kDragStandardTranslucency   = 0L,                           /* 65% image translucency (standard)*/
  100.     kDragDarkTranslucency       = 1L,                           /* 50% image translucency*/
  101.     kDragDarkerTranslucency     = 2L,                           /* 25% image translucency*/
  102.     kDragOpaqueTranslucency     = 3L                            /* 0% image translucency (opaque)*/
  103. };
  104. /*
  105.   _________________________________________________________________________________________________________
  106.       
  107.    o DRAG DRAWING PROCEDURE MESSAGES
  108.   _________________________________________________________________________________________________________
  109. */
  110. typedef SInt16 DragRegionMessage;
  111. enum {
  112.     kDragRegionBegin            = 1,                            /* initialize drawing*/
  113.     kDragRegionDraw             = 2,                            /* draw drag feedback*/
  114.     kDragRegionHide             = 3,                            /* hide drag feedback*/
  115.     kDragRegionIdle             = 4,                            /* drag feedback idle time*/
  116.     kDragRegionEnd              = 5                             /* end of drawing*/
  117. };
  118. /*
  119.   _________________________________________________________________________________________________________
  120.       
  121.    o ZOOM ACCELERATION
  122.   _________________________________________________________________________________________________________
  123. */
  124. typedef SInt16 ZoomAcceleration;
  125. enum {
  126.     kZoomNoAcceleration         = 0,                            /* use linear interpolation*/
  127.     kZoomAccelerate             = 1,                            /* ramp up step size*/
  128.     kZoomDecelerate             = 2                             /* ramp down step size*/
  129. };
  130. /*
  131.   _________________________________________________________________________________________________________
  132.       
  133.    o FLAVOR FLAGS
  134.   _________________________________________________________________________________________________________
  135. */
  136. typedef UInt32 FlavorFlags;
  137. enum {
  138.     flavorSenderOnly            = (1 << 0),                     /* flavor is available to sender only*/
  139.     flavorSenderTranslated      = (1 << 1),                     /* flavor is translated by sender*/
  140.     flavorNotSaved              = (1 << 2),                     /* flavor should not be saved*/
  141.     flavorSystemTranslated      = (1 << 8)                      /* flavor is translated by system*/
  142. };
  143. /*
  144.   _________________________________________________________________________________________________________
  145.       
  146.    o SPECIAL FLAVORS
  147.   _________________________________________________________________________________________________________
  148. */
  149. enum {
  150.     flavorTypeHFS               = FOUR_CHAR_CODE('hfs '),       /* flavor type for HFS data*/
  151.     flavorTypePromiseHFS        = FOUR_CHAR_CODE('phfs'),       /* flavor type for promised HFS data*/
  152.     flavorTypeDirectory         = FOUR_CHAR_CODE('diry')        /* flavor type for AOCE directories*/
  153. };
  154. /*
  155.   _________________________________________________________________________________________________________
  156.       
  157.    o FLAVORS FOR FINDER 8.0 AND LATER
  158.   _________________________________________________________________________________________________________
  159. */
  160. enum {
  161.     kFlavorTypeClippingName     = FOUR_CHAR_CODE('clnm'),       /* name hint for clipping file (preferred over 'clfn')*/
  162.     kFlavorTypeClippingFilename = FOUR_CHAR_CODE('clfn'),       /* name for clipping file*/
  163.     kFlavorTypeDragToTrashOnly  = FOUR_CHAR_CODE('fdtt'),       /* for apps that want to allow dragging private data to the trash*/
  164.     kFlavorTypeFinderNoTrackingBehavior = FOUR_CHAR_CODE('fntb') /* Finder completely ignores any drag containing this flavor*/
  165. };
  166. /*
  167.   _________________________________________________________________________________________________________
  168.       
  169.    o DRAG TRACKING HANDLER MESSAGES
  170.   _________________________________________________________________________________________________________
  171. */
  172. typedef SInt16 DragTrackingMessage;
  173. enum {
  174.     kDragTrackingEnterHandler   = 1,                            /* drag has entered handler*/
  175.     kDragTrackingEnterWindow    = 2,                            /* drag has entered window*/
  176.     kDragTrackingInWindow       = 3,                            /* drag is moving within window*/
  177.     kDragTrackingLeaveWindow    = 4,                            /* drag has exited window*/
  178.     kDragTrackingLeaveHandler   = 5                             /* drag has exited handler*/
  179. };
  180. /*
  181.   _________________________________________________________________________________________________________
  182.       
  183.    o HFS FLAVORS
  184.   _________________________________________________________________________________________________________
  185. */
  186. struct HFSFlavor {
  187.     OSType                          fileType;                   /* file type */
  188.     OSType                          fileCreator;                /* file creator */
  189.     UInt16                          fdFlags;                    /* Finder flags */
  190.     FSSpec                          fileSpec;                   /* file system specification */
  191. };
  192. typedef struct HFSFlavor                HFSFlavor;
  193. struct PromiseHFSFlavor {
  194.     OSType                          fileType;                   /* file type */
  195.     OSType                          fileCreator;                /* file creator */
  196.     UInt16                          fdFlags;                    /* Finder flags */
  197.     FlavorType                      promisedFlavor;             /* promised flavor containing an FSSpec */
  198. };
  199. typedef struct PromiseHFSFlavor         PromiseHFSFlavor;
  200. /*
  201.   _________________________________________________________________________________________________________
  202.       
  203.    o APPLICATION-DEFINED DRAG HANDLER ROUTINES
  204.   _________________________________________________________________________________________________________
  205. */
  206. typedef CALLBACK_API( OSErr , DragTrackingHandlerProcPtr )(DragTrackingMessage message, WindowRef theWindow, void *handlerRefCon, DragRef theDrag);
  207. typedef CALLBACK_API( OSErr , DragReceiveHandlerProcPtr )(WindowRef theWindow, void *handlerRefCon, DragRef theDrag);
  208. typedef STACK_UPP_TYPE(DragTrackingHandlerProcPtr)              DragTrackingHandlerUPP;
  209. typedef STACK_UPP_TYPE(DragReceiveHandlerProcPtr)               DragReceiveHandlerUPP;
  210. #if OPAQUE_UPP_TYPES
  211.     EXTERN_API(DragTrackingHandlerUPP)
  212.     NewDragTrackingHandlerUPP      (DragTrackingHandlerProcPtr userRoutine);
  213.     EXTERN_API(DragReceiveHandlerUPP)
  214.     NewDragReceiveHandlerUPP       (DragReceiveHandlerProcPtr userRoutine);
  215.     EXTERN_API(void)
  216.     DisposeDragTrackingHandlerUPP    (DragTrackingHandlerUPP userUPP);
  217.     EXTERN_API(void)
  218.     DisposeDragReceiveHandlerUPP    (DragReceiveHandlerUPP  userUPP);
  219.     EXTERN_API(OSErr)
  220.     InvokeDragTrackingHandlerUPP    (DragTrackingMessage    message,
  221.                                     WindowRef               theWindow,
  222.                                     void *                  handlerRefCon,
  223.                                     DragRef                 theDrag,
  224.                                     DragTrackingHandlerUPP  userUPP);
  225.     EXTERN_API(OSErr)
  226.     InvokeDragReceiveHandlerUPP    (WindowRef               theWindow,
  227.                                     void *                  handlerRefCon,
  228.                                     DragRef                 theDrag,
  229.                                     DragReceiveHandlerUPP   userUPP);
  230. #else
  231.     enum { uppDragTrackingHandlerProcInfo = 0x00003FA0 };           /* pascal 2_bytes Func(2_bytes, 4_bytes, 4_bytes, 4_bytes) */
  232.     enum { uppDragReceiveHandlerProcInfo = 0x00000FE0 };            /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes) */
  233.     #define NewDragTrackingHandlerUPP(userRoutine)                  (DragTrackingHandlerUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragTrackingHandlerProcInfo, GetCurrentArchitecture())
  234.     #define NewDragReceiveHandlerUPP(userRoutine)                   (DragReceiveHandlerUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragReceiveHandlerProcInfo, GetCurrentArchitecture())
  235.     #define DisposeDragTrackingHandlerUPP(userUPP)                  DisposeRoutineDescriptor(userUPP)
  236.     #define DisposeDragReceiveHandlerUPP(userUPP)                   DisposeRoutineDescriptor(userUPP)
  237.     #define InvokeDragTrackingHandlerUPP(message, theWindow, handlerRefCon, theDrag, userUPP)  (OSErr)CALL_FOUR_PARAMETER_UPP((userUPP), uppDragTrackingHandlerProcInfo, (message), (theWindow), (handlerRefCon), (theDrag))
  238.     #define InvokeDragReceiveHandlerUPP(theWindow, handlerRefCon, theDrag, userUPP)  (OSErr)CALL_THREE_PARAMETER_UPP((userUPP), uppDragReceiveHandlerProcInfo, (theWindow), (handlerRefCon), (theDrag))
  239. #endif
  240. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  241. #define NewDragTrackingHandlerProc(userRoutine)                 NewDragTrackingHandlerUPP(userRoutine)
  242. #define NewDragReceiveHandlerProc(userRoutine)                  NewDragReceiveHandlerUPP(userRoutine)
  243. #define CallDragTrackingHandlerProc(userRoutine, message, theWindow, handlerRefCon, theDrag) InvokeDragTrackingHandlerUPP(message, theWindow, handlerRefCon, theDrag, userRoutine)
  244. #define CallDragReceiveHandlerProc(userRoutine, theWindow, handlerRefCon, theDrag) InvokeDragReceiveHandlerUPP(theWindow, handlerRefCon, theDrag, userRoutine)
  245. /*
  246.   _________________________________________________________________________________________________________
  247.       
  248.    o APPLICATION-DEFINED ROUTINES
  249.   _________________________________________________________________________________________________________
  250. */
  251. typedef CALLBACK_API( OSErr , DragSendDataProcPtr )(FlavorType theType, void *dragSendRefCon, DragItemRef theItemRef, DragRef theDrag);
  252. typedef CALLBACK_API( OSErr , DragInputProcPtr )(Point *mouse, SInt16 *modifiers, void *dragInputRefCon, DragRef theDrag);
  253. typedef CALLBACK_API( OSErr , DragDrawingProcPtr )(DragRegionMessage message, RgnHandle showRegion, Point showOrigin, RgnHandle hideRegion, Point hideOrigin, void *dragDrawingRefCon, DragRef theDrag);
  254. typedef STACK_UPP_TYPE(DragSendDataProcPtr)                     DragSendDataUPP;
  255. typedef STACK_UPP_TYPE(DragInputProcPtr)                        DragInputUPP;
  256. typedef STACK_UPP_TYPE(DragDrawingProcPtr)                      DragDrawingUPP;
  257. #if OPAQUE_UPP_TYPES
  258.     EXTERN_API(DragSendDataUPP)
  259.     NewDragSendDataUPP             (DragSendDataProcPtr     userRoutine);
  260.     EXTERN_API(DragInputUPP)
  261.     NewDragInputUPP                (DragInputProcPtr        userRoutine);
  262.     EXTERN_API(DragDrawingUPP)
  263.     NewDragDrawingUPP              (DragDrawingProcPtr      userRoutine);
  264.     EXTERN_API(void)
  265.     DisposeDragSendDataUPP         (DragSendDataUPP         userUPP);
  266.     EXTERN_API(void)
  267.     DisposeDragInputUPP            (DragInputUPP            userUPP);
  268.     EXTERN_API(void)
  269.     DisposeDragDrawingUPP          (DragDrawingUPP          userUPP);
  270.     EXTERN_API(OSErr)
  271.     InvokeDragSendDataUPP          (FlavorType              theType,
  272.                                     void *                  dragSendRefCon,
  273.                                     DragItemRef             theItemRef,
  274.                                     DragRef                 theDrag,
  275.                                     DragSendDataUPP         userUPP);
  276.     EXTERN_API(OSErr)
  277.     InvokeDragInputUPP             (Point *                 mouse,
  278.                                     SInt16 *                modifiers,
  279.                                     void *                  dragInputRefCon,
  280.                                     DragRef                 theDrag,
  281.                                     DragInputUPP            userUPP);
  282.     EXTERN_API(OSErr)
  283.     InvokeDragDrawingUPP           (DragRegionMessage       message,
  284.                                     RgnHandle               showRegion,
  285.                                     Point                   showOrigin,
  286.                                     RgnHandle               hideRegion,
  287.                                     Point                   hideOrigin,
  288.                                     void *                  dragDrawingRefCon,
  289.                                     DragRef                 theDrag,
  290.                                     DragDrawingUPP          userUPP);
  291. #else
  292.     enum { uppDragSendDataProcInfo = 0x00003FE0 };                  /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  293.     enum { uppDragInputProcInfo = 0x00003FE0 };                     /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  294.     enum { uppDragDrawingProcInfo = 0x000FFFA0 };                   /* pascal 2_bytes Func(2_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  295.     #define NewDragSendDataUPP(userRoutine)                         (DragSendDataUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragSendDataProcInfo, GetCurrentArchitecture())
  296.     #define NewDragInputUPP(userRoutine)                            (DragInputUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragInputProcInfo, GetCurrentArchitecture())
  297.     #define NewDragDrawingUPP(userRoutine)                          (DragDrawingUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragDrawingProcInfo, GetCurrentArchitecture())
  298.     #define DisposeDragSendDataUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  299.     #define DisposeDragInputUPP(userUPP)                            DisposeRoutineDescriptor(userUPP)
  300.     #define DisposeDragDrawingUPP(userUPP)                          DisposeRoutineDescriptor(userUPP)
  301.     #define InvokeDragSendDataUPP(theType, dragSendRefCon, theItemRef, theDrag, userUPP)  (OSErr)CALL_FOUR_PARAMETER_UPP((userUPP), uppDragSendDataProcInfo, (theType), (dragSendRefCon), (theItemRef), (theDrag))
  302.     #define InvokeDragInputUPP(mouse, modifiers, dragInputRefCon, theDrag, userUPP)  (OSErr)CALL_FOUR_PARAMETER_UPP((userUPP), uppDragInputProcInfo, (mouse), (modifiers), (dragInputRefCon), (theDrag))
  303.     #define InvokeDragDrawingUPP(message, showRegion, showOrigin, hideRegion, hideOrigin, dragDrawingRefCon, theDrag, userUPP)  (OSErr)CALL_SEVEN_PARAMETER_UPP((userUPP), uppDragDrawingProcInfo, (message), (showRegion), (showOrigin), (hideRegion), (hideOrigin), (dragDrawingRefCon), (theDrag))
  304. #endif
  305. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  306. #define NewDragSendDataProc(userRoutine)                        NewDragSendDataUPP(userRoutine)
  307. #define NewDragInputProc(userRoutine)                           NewDragInputUPP(userRoutine)
  308. #define NewDragDrawingProc(userRoutine)                         NewDragDrawingUPP(userRoutine)
  309. #define CallDragSendDataProc(userRoutine, theType, dragSendRefCon, theItemRef, theDrag) InvokeDragSendDataUPP(theType, dragSendRefCon, theItemRef, theDrag, userRoutine)
  310. #define CallDragInputProc(userRoutine, mouse, modifiers, dragInputRefCon, theDrag) InvokeDragInputUPP(mouse, modifiers, dragInputRefCon, theDrag, userRoutine)
  311. #define CallDragDrawingProc(userRoutine, message, showRegion, showOrigin, hideRegion, hideOrigin, dragDrawingRefCon, theDrag) InvokeDragDrawingUPP(message, showRegion, showOrigin, hideRegion, hideOrigin, dragDrawingRefCon, theDrag, userRoutine)
  312. /*
  313.   _________________________________________________________________________________________________________
  314.       
  315.    o INSTALLING AND REMOVING HANDLERS API'S
  316.   _________________________________________________________________________________________________________
  317. */
  318. EXTERN_API( OSErr )
  319. InstallTrackingHandler          (DragTrackingHandlerUPP  trackingHandler,
  320.                                  WindowRef              theWindow,
  321.                                  void *                 handlerRefCon)                      TWOWORDINLINE(0x7001, 0xABED);
  322. EXTERN_API( OSErr )
  323. InstallReceiveHandler           (DragReceiveHandlerUPP  receiveHandler,
  324.                                  WindowRef              theWindow,
  325.                                  void *                 handlerRefCon)                      TWOWORDINLINE(0x7002, 0xABED);
  326. EXTERN_API( OSErr )
  327. RemoveTrackingHandler           (DragTrackingHandlerUPP  trackingHandler,
  328.                                  WindowRef              theWindow)                          TWOWORDINLINE(0x7003, 0xABED);
  329. EXTERN_API( OSErr )
  330. RemoveReceiveHandler            (DragReceiveHandlerUPP  receiveHandler,
  331.                                  WindowRef              theWindow)                          TWOWORDINLINE(0x7004, 0xABED);
  332. /*
  333.   _________________________________________________________________________________________________________
  334.       
  335.    o CREATING & DISPOSING
  336.   _________________________________________________________________________________________________________
  337. */
  338. EXTERN_API( OSErr )
  339. NewDrag                         (DragRef *              theDrag)                            TWOWORDINLINE(0x7005, 0xABED);
  340. EXTERN_API( OSErr )
  341. DisposeDrag                     (DragRef                theDrag)                            TWOWORDINLINE(0x7006, 0xABED);
  342. /*
  343.   _________________________________________________________________________________________________________
  344.       
  345.    o ADDING DRAG ITEM FLAVORS
  346.   _________________________________________________________________________________________________________
  347. */
  348. EXTERN_API( OSErr )
  349. AddDragItemFlavor               (DragRef                theDrag,
  350.                                  DragItemRef            theItemRef,
  351.                                  FlavorType             theType,
  352.                                  const void *           dataPtr,
  353.                                  Size                   dataSize,
  354.                                  FlavorFlags            theFlags)                           TWOWORDINLINE(0x7007, 0xABED);
  355. EXTERN_API( OSErr )
  356. SetDragItemFlavorData           (DragRef                theDrag,
  357.                                  DragItemRef            theItemRef,
  358.                                  FlavorType             theType,
  359.                                  const void *           dataPtr,
  360.                                  Size                   dataSize,
  361.                                  UInt32                 dataOffset)                         TWOWORDINLINE(0x7009, 0xABED);
  362. /*
  363.   _________________________________________________________________________________________________________
  364.       
  365.    o PROVIDING CALLBACK PROCEDURES
  366.   _________________________________________________________________________________________________________
  367. */
  368. EXTERN_API( OSErr )
  369. SetDragSendProc                 (DragRef                theDrag,
  370.                                  DragSendDataUPP        sendProc,
  371.                                  void *                 dragSendRefCon)                     TWOWORDINLINE(0x700A, 0xABED);
  372. EXTERN_API( OSErr )
  373. SetDragInputProc                (DragRef                theDrag,
  374.                                  DragInputUPP           inputProc,
  375.                                  void *                 dragInputRefCon)                    TWOWORDINLINE(0x700B, 0xABED);
  376. EXTERN_API( OSErr )
  377. SetDragDrawingProc              (DragRef                theDrag,
  378.                                  DragDrawingUPP         drawingProc,
  379.                                  void *                 dragDrawingRefCon)                  TWOWORDINLINE(0x700C, 0xABED);
  380. /*
  381.   _________________________________________________________________________________________________________
  382.       
  383.    o SETTING THE DRAG IMAGE
  384.   _________________________________________________________________________________________________________
  385. */
  386. EXTERN_API( OSErr )
  387. SetDragImage                    (DragRef                theDrag,
  388.                                  PixMapHandle           imagePixMap,
  389.                                  RgnHandle              imageRgn,
  390.                                  Point                  imageOffsetPt,
  391.                                  DragImageFlags         theImageFlags)                      TWOWORDINLINE(0x7027, 0xABED);
  392. /*
  393.   _________________________________________________________________________________________________________
  394.       
  395.    o ALTERING THE BEHAVIOR OF A DRAG
  396.   _________________________________________________________________________________________________________
  397. */
  398. EXTERN_API( OSErr )
  399. ChangeDragBehaviors             (DragRef                theDrag,
  400.                                  DragBehaviors          inBehaviorsToSet,
  401.                                  DragBehaviors          inBehaviorsToClear)                 TWOWORDINLINE(0x7028, 0xABED);
  402. /*
  403.   _________________________________________________________________________________________________________
  404.       
  405.    o PERFORMING A DRAG
  406.   _________________________________________________________________________________________________________
  407. */
  408. EXTERN_API( OSErr )
  409. TrackDrag                       (DragRef                theDrag,
  410.                                  const EventRecord *    theEvent,
  411.                                  RgnHandle              theRegion)                          TWOWORDINLINE(0x700D, 0xABED);
  412. /*
  413.   _________________________________________________________________________________________________________
  414.       
  415.    o GETTING DRAG ITEM INFORMATION
  416.   _________________________________________________________________________________________________________
  417. */
  418. EXTERN_API( OSErr )
  419. CountDragItems                  (DragRef                theDrag,
  420.                                  UInt16 *               numItems)                           TWOWORDINLINE(0x700E, 0xABED);
  421. EXTERN_API( OSErr )
  422. GetDragItemReferenceNumber      (DragRef                theDrag,
  423.                                  UInt16                 index,
  424.                                  DragItemRef *          theItemRef)                         TWOWORDINLINE(0x700F, 0xABED);
  425. EXTERN_API( OSErr )
  426. CountDragItemFlavors            (DragRef                theDrag,
  427.                                  DragItemRef            theItemRef,
  428.                                  UInt16 *               numFlavors)                         TWOWORDINLINE(0x7010, 0xABED);
  429. EXTERN_API( OSErr )
  430. GetFlavorType                   (DragRef                theDrag,
  431.                                  DragItemRef            theItemRef,
  432.                                  UInt16                 index,
  433.                                  FlavorType *           theType)                            TWOWORDINLINE(0x7011, 0xABED);
  434. EXTERN_API( OSErr )
  435. GetFlavorFlags                  (DragRef                theDrag,
  436.                                  DragItemRef            theItemRef,
  437.                                  FlavorType             theType,
  438.                                  FlavorFlags *          theFlags)                           TWOWORDINLINE(0x7012, 0xABED);
  439. EXTERN_API( OSErr )
  440. GetFlavorDataSize               (DragRef                theDrag,
  441.                                  DragItemRef            theItemRef,
  442.                                  FlavorType             theType,
  443.                                  Size *                 dataSize)                           TWOWORDINLINE(0x7013, 0xABED);
  444. EXTERN_API( OSErr )
  445. GetFlavorData                   (DragRef                theDrag,
  446.                                  DragItemRef            theItemRef,
  447.                                  FlavorType             theType,
  448.                                  void *                 dataPtr,
  449.                                  Size *                 dataSize,
  450.                                  UInt32                 dataOffset)                         TWOWORDINLINE(0x7014, 0xABED);
  451. /*
  452.   _________________________________________________________________________________________________________
  453.       
  454.    o DRAG ITEM BOUNDS
  455.   _________________________________________________________________________________________________________
  456. */
  457. EXTERN_API( OSErr )
  458. GetDragItemBounds               (DragRef                theDrag,
  459.                                  DragItemRef            theItemRef,
  460.                                  Rect *                 itemBounds)                         TWOWORDINLINE(0x7015, 0xABED);
  461. EXTERN_API( OSErr )
  462. SetDragItemBounds               (DragRef                theDrag,
  463.                                  DragItemRef            theItemRef,
  464.                                  const Rect *           itemBounds)                         TWOWORDINLINE(0x7016, 0xABED);
  465. /*
  466.   _________________________________________________________________________________________________________
  467.       
  468.    o DROP LOCATIONS
  469.   _________________________________________________________________________________________________________
  470. */
  471. EXTERN_API( OSErr )
  472. GetDropLocation                 (DragRef                theDrag,
  473.                                  AEDesc *               dropLocation)                       TWOWORDINLINE(0x7017, 0xABED);
  474. EXTERN_API( OSErr )
  475. SetDropLocation                 (DragRef                theDrag,
  476.                                  const AEDesc *         dropLocation)                       TWOWORDINLINE(0x7018, 0xABED);
  477. /*
  478.   _________________________________________________________________________________________________________
  479.       
  480.    o GETTING INFORMATION ABOUT A DRAG
  481.   _________________________________________________________________________________________________________
  482. */
  483. EXTERN_API( OSErr )
  484. GetDragAttributes               (DragRef                theDrag,
  485.                                  DragAttributes *       flags)                              TWOWORDINLINE(0x7019, 0xABED);
  486. EXTERN_API( OSErr )
  487. GetDragMouse                    (DragRef                theDrag,
  488.                                  Point *                mouse,
  489.                                  Point *                globalPinnedMouse)                  TWOWORDINLINE(0x701A, 0xABED);
  490. EXTERN_API( OSErr )
  491. SetDragMouse                    (DragRef                theDrag,
  492.                                  Point                  globalPinnedMouse)                  TWOWORDINLINE(0x701B, 0xABED);
  493. EXTERN_API( OSErr )
  494. GetDragOrigin                   (DragRef                theDrag,
  495.                                  Point *                globalInitialMouse)                 TWOWORDINLINE(0x701C, 0xABED);
  496. EXTERN_API( OSErr )
  497. GetDragModifiers                (DragRef                theDrag,
  498.                                  SInt16 *               modifiers,
  499.                                  SInt16 *               mouseDownModifiers,
  500.                                  SInt16 *               mouseUpModifiers)                   TWOWORDINLINE(0x701D, 0xABED);
  501. /*
  502.   _________________________________________________________________________________________________________
  503.       
  504.    o DRAG HIGHLIGHTING
  505.   _________________________________________________________________________________________________________
  506. */
  507. EXTERN_API( OSErr )
  508. ShowDragHilite                  (DragRef                theDrag,
  509.                                  RgnHandle              hiliteFrame,
  510.                                  Boolean                inside)                             TWOWORDINLINE(0x701E, 0xABED);
  511. EXTERN_API( OSErr )
  512. HideDragHilite                  (DragRef                theDrag)                            TWOWORDINLINE(0x701F, 0xABED);
  513. EXTERN_API( OSErr )
  514. DragPreScroll                   (DragRef                theDrag,
  515.                                  SInt16                 dH,
  516.                                  SInt16                 dV)                                 TWOWORDINLINE(0x7020, 0xABED);
  517. EXTERN_API( OSErr )
  518. DragPostScroll                  (DragRef                theDrag)                            TWOWORDINLINE(0x7021, 0xABED);
  519. EXTERN_API( OSErr )
  520. UpdateDragHilite                (DragRef                theDrag,
  521.                                  RgnHandle              updateRgn)                          TWOWORDINLINE(0x7022, 0xABED);
  522. EXTERN_API( OSErr )
  523. GetDragHiliteColor              (WindowRef              window,
  524.                                  RGBColor *             color)                              TWOWORDINLINE(0x7026, 0xABED);
  525. /*
  526.   _________________________________________________________________________________________________________
  527.       
  528.    o UTILITIES
  529.   _________________________________________________________________________________________________________
  530. */
  531. EXTERN_API( Boolean )
  532. WaitMouseMoved                  (Point                  initialMouse)                       TWOWORDINLINE(0x7023, 0xABED);
  533. EXTERN_API( OSErr )
  534. ZoomRects                       (const Rect *           fromRect,
  535.                                  const Rect *           toRect,
  536.                                  SInt16                 zoomSteps,
  537.                                  ZoomAcceleration       acceleration)                       TWOWORDINLINE(0x7024, 0xABED);
  538. EXTERN_API( OSErr )
  539. ZoomRegion                      (RgnHandle              region,
  540.                                  Point                  zoomDistance,
  541.                                  SInt16                 zoomSteps,
  542.                                  ZoomAcceleration       acceleration)                       TWOWORDINLINE(0x7025, 0xABED);
  543. /*
  544.   _________________________________________________________________________________________________________
  545.    o OLD NAMES
  546.      These are provided for compatiblity with older source bases.  It is recommended to not use them since
  547.      they may removed from this interface file at any time.
  548.   _________________________________________________________________________________________________________
  549. */
  550. typedef DragRef                         DragReference;
  551. typedef DragItemRef                     ItemReference;
  552. #if OLDROUTINENAMES
  553. enum {
  554.     dragHasLeftSenderWindow     = kDragHasLeftSenderWindow,     /* drag has left the source window since TrackDrag */
  555.     dragInsideSenderApplication = kDragInsideSenderApplication, /* drag is occurring within the sender application */
  556.     dragInsideSenderWindow      = kDragInsideSenderWindow       /* drag is occurring within the sender window */
  557. };
  558. enum {
  559.     dragTrackingEnterHandler    = kDragTrackingEnterHandler,    /* drag has entered handler */
  560.     dragTrackingEnterWindow     = kDragTrackingEnterWindow,     /* drag has entered window */
  561.     dragTrackingInWindow        = kDragTrackingInWindow,        /* drag is moving within window */
  562.     dragTrackingLeaveWindow     = kDragTrackingLeaveWindow,     /* drag has exited window */
  563.     dragTrackingLeaveHandler    = kDragTrackingLeaveHandler     /* drag has exited handler */
  564. };
  565. enum {
  566.     dragRegionBegin             = kDragRegionBegin,             /* initialize drawing */
  567.     dragRegionDraw              = kDragRegionDraw,              /* draw drag feedback */
  568.     dragRegionHide              = kDragRegionHide,              /* hide drag feedback */
  569.     dragRegionIdle              = kDragRegionIdle,              /* drag feedback idle time */
  570.     dragRegionEnd               = kDragRegionEnd                /* end of drawing */
  571. };
  572. enum {
  573.     zoomNoAcceleration          = kZoomNoAcceleration,          /* use linear interpolation */
  574.     zoomAccelerate              = kZoomAccelerate,              /* ramp up step size */
  575.     zoomDecelerate              = kZoomDecelerate               /* ramp down step size */
  576. };
  577. enum {
  578.     kDragStandardImage          = kDragStandardTranslucency,    /* 65% image translucency (standard)*/
  579.     kDragDarkImage              = kDragDarkTranslucency,        /* 50% image translucency*/
  580.     kDragDarkerImage            = kDragDarkerTranslucency,      /* 25% image translucency*/
  581.     kDragOpaqueImage            = kDragOpaqueTranslucency       /* 0% image translucency (opaque)*/
  582. };
  583. #endif  /* OLDROUTINENAMES */
  584. #if PRAGMA_STRUCT_ALIGN
  585.     #pragma options align=reset
  586. #elif PRAGMA_STRUCT_PACKPUSH
  587.     #pragma pack(pop)
  588. #elif PRAGMA_STRUCT_PACK
  589.     #pragma pack()
  590. #endif
  591. #ifdef PRAGMA_IMPORT_OFF
  592. #pragma import off
  593. #elif PRAGMA_IMPORT
  594. #pragma import reset
  595. #endif
  596. #ifdef __cplusplus
  597. }
  598. #endif
  599. #endif /* __DRAG__ */