Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1734 lines
57 KiB

  1. /*
  2. File: Drag.h
  3. Contains: Drag and Drop Interfaces.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1992-2001 by Apple Computer, Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __DRAG__
  11. #define __DRAG__
  12. #ifndef __MACTYPES__
  13. #include <MacTypes.h>
  14. #endif
  15. #ifndef __FILES__
  16. #include <Files.h>
  17. #endif
  18. #ifndef __APPLEEVENTS__
  19. #include <AppleEvents.h>
  20. #endif
  21. #ifndef __QUICKDRAW__
  22. #include <Quickdraw.h>
  23. #endif
  24. #ifndef __EVENTS__
  25. #include <Events.h>
  26. #endif
  27. #if PRAGMA_ONCE
  28. #pragma once
  29. #endif
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. #if PRAGMA_IMPORT
  34. #pragma import on
  35. #endif
  36. #if PRAGMA_STRUCT_ALIGN
  37. #pragma options align=mac68k
  38. #elif PRAGMA_STRUCT_PACKPUSH
  39. #pragma pack(push, 2)
  40. #elif PRAGMA_STRUCT_PACK
  41. #pragma pack(2)
  42. #endif
  43. /*
  44. * HIPoint
  45. *
  46. * Discussion:
  47. * HIPoint is a new, floating point-based type to help express
  48. * coordinates in a much richer fashion than the classic QuickDraw
  49. * points. It will, in time, be more heavily used throughout the
  50. * Toolbox. For now, it is replacing our use of typeQDPoint in mouse
  51. * events. This is to better support sub-pixel tablet coordinates.
  52. * If you ask for a mouse location with typeQDPoint, and the point
  53. * is actually stored as typeHIPoint, it will automatically be
  54. * coerced to typeQDPoint for you, so this change should be largely
  55. * transparent to applications. HIPoints are in screen space, i.e.
  56. * the top left of the screen is 0, 0.
  57. */
  58. typedef CGPoint HIPoint;
  59. /*
  60. * HISize
  61. *
  62. * Discussion:
  63. * HISize is a floating point-based type to help express dimensions
  64. * in a much richer fashion than the classic QuickDraw coordinates.
  65. */
  66. typedef CGSize HISize;
  67. /*
  68. * HIRect
  69. *
  70. * Discussion:
  71. * HIRect is a new, floating point-based type to help express
  72. * rectangles in a much richer fashion than the classic QuickDraw
  73. * rects. It will, in time, be more heavily used throughout the
  74. * Toolbox. HIRects are in screen space, i.e. the top left of the
  75. * screen is 0, 0.
  76. */
  77. typedef CGRect HIRect;
  78. /*
  79. _________________________________________________________________________________________________________
  80. o DRAG MANAGER DATA TYPES
  81. _________________________________________________________________________________________________________
  82. */
  83. typedef struct OpaqueDragRef* DragRef;
  84. typedef UInt32 DragItemRef;
  85. typedef OSType FlavorType;
  86. /*
  87. _________________________________________________________________________________________________________
  88. o DRAG ATTRIBUTES
  89. _________________________________________________________________________________________________________
  90. */
  91. typedef UInt32 DragAttributes;
  92. enum {
  93. kDragHasLeftSenderWindow = (1L << 0), /* drag has left the source window since TrackDrag*/
  94. kDragInsideSenderApplication = (1L << 1), /* drag is occurring within the sender application*/
  95. kDragInsideSenderWindow = (1L << 2) /* drag is occurring within the sender window*/
  96. };
  97. /*
  98. _________________________________________________________________________________________________________
  99. o DRAG BEHAVIORS
  100. _________________________________________________________________________________________________________
  101. */
  102. typedef UInt32 DragBehaviors;
  103. enum {
  104. kDragBehaviorNone = 0,
  105. kDragBehaviorZoomBackAnimation = (1L << 0) /* do zoomback animation for failed drags (normally enabled).*/
  106. };
  107. /*
  108. _________________________________________________________________________________________________________
  109. o DRAG IMAGE FLAGS
  110. _________________________________________________________________________________________________________
  111. */
  112. typedef UInt32 DragImageFlags;
  113. enum {
  114. kDragRegionAndImage = (1L << 4) /* drag region and image*/
  115. };
  116. /*
  117. _________________________________________________________________________________________________________
  118. o DRAG IMAGE TRANSLUCENCY LEVELS
  119. _________________________________________________________________________________________________________
  120. */
  121. enum {
  122. kDragStandardTranslucency = 0L, /* 65% image translucency (standard)*/
  123. kDragDarkTranslucency = 1L, /* 50% image translucency*/
  124. kDragDarkerTranslucency = 2L, /* 25% image translucency*/
  125. kDragOpaqueTranslucency = 3L /* 0% image translucency (opaque)*/
  126. };
  127. /*
  128. _________________________________________________________________________________________________________
  129. o DRAG DRAWING PROCEDURE MESSAGES
  130. _________________________________________________________________________________________________________
  131. */
  132. typedef SInt16 DragRegionMessage;
  133. enum {
  134. kDragRegionBegin = 1, /* initialize drawing*/
  135. kDragRegionDraw = 2, /* draw drag feedback*/
  136. kDragRegionHide = 3, /* hide drag feedback*/
  137. kDragRegionIdle = 4, /* drag feedback idle time*/
  138. kDragRegionEnd = 5 /* end of drawing*/
  139. };
  140. /*
  141. _________________________________________________________________________________________________________
  142. o ZOOM ACCELERATION
  143. _________________________________________________________________________________________________________
  144. */
  145. typedef SInt16 ZoomAcceleration;
  146. enum {
  147. kZoomNoAcceleration = 0, /* use linear interpolation*/
  148. kZoomAccelerate = 1, /* ramp up step size*/
  149. kZoomDecelerate = 2 /* ramp down step size*/
  150. };
  151. /*
  152. _________________________________________________________________________________________________________
  153. o FLAVOR FLAGS
  154. _________________________________________________________________________________________________________
  155. */
  156. typedef UInt32 FlavorFlags;
  157. enum {
  158. flavorSenderOnly = (1 << 0), /* flavor is available to sender only*/
  159. flavorSenderTranslated = (1 << 1), /* flavor is translated by sender*/
  160. flavorNotSaved = (1 << 2), /* flavor should not be saved*/
  161. flavorSystemTranslated = (1 << 8), /* flavor is translated by system*/
  162. flavorDataPromised = (1 << 9) /* flavor data is promised by sender*/
  163. };
  164. /*
  165. _________________________________________________________________________________________________________
  166. o FILE SYSTEM CONSTANTS
  167. _________________________________________________________________________________________________________
  168. */
  169. enum {
  170. kDragFlavorTypeHFS = FOUR_CHAR_CODE('hfs '), /* flavor type for HFS data*/
  171. kDragFlavorTypePromiseHFS = FOUR_CHAR_CODE('phfs'), /* flavor type for promised HFS data*/
  172. flavorTypeHFS = kDragFlavorTypeHFS, /* old name*/
  173. flavorTypePromiseHFS = kDragFlavorTypePromiseHFS /* old name*/
  174. };
  175. enum {
  176. kDragPromisedFlavorFindFile = FOUR_CHAR_CODE('rWm1'), /* promisedFlavor value for Find File*/
  177. kDragPromisedFlavor = FOUR_CHAR_CODE('fssP') /* promisedFlavor value for everything else*/
  178. };
  179. enum {
  180. kDragPseudoCreatorVolumeOrDirectory = FOUR_CHAR_CODE('MACS'), /* "creator code" for volume or directory*/
  181. kDragPseudoFileTypeVolume = FOUR_CHAR_CODE('disk'), /* "file type" for volume*/
  182. kDragPseudoFileTypeDirectory = FOUR_CHAR_CODE('fold') /* "file type" for directory*/
  183. };
  184. /*
  185. _________________________________________________________________________________________________________
  186. o SPECIAL FLAVORS
  187. _________________________________________________________________________________________________________
  188. */
  189. enum {
  190. flavorTypeDirectory = FOUR_CHAR_CODE('diry') /* flavor type for AOCE directories*/
  191. };
  192. /*
  193. _________________________________________________________________________________________________________
  194. o FLAVORS FOR FINDER 8.0 AND LATER
  195. _________________________________________________________________________________________________________
  196. */
  197. enum {
  198. kFlavorTypeClippingName = FOUR_CHAR_CODE('clnm'), /* name hint for clipping file (preferred over 'clfn')*/
  199. kFlavorTypeClippingFilename = FOUR_CHAR_CODE('clfn'), /* name for clipping file*/
  200. kFlavorTypeUnicodeClippingName = FOUR_CHAR_CODE('ucln'), /* unicode name hint for clipping file (preferred over 'uclf')*/
  201. kFlavorTypeUnicodeClippingFilename = FOUR_CHAR_CODE('uclf'), /* unicode name for clipping file*/
  202. kFlavorTypeDragToTrashOnly = FOUR_CHAR_CODE('fdtt'), /* for apps that want to allow dragging private data to the trash*/
  203. kFlavorTypeFinderNoTrackingBehavior = FOUR_CHAR_CODE('fntb') /* Finder completely ignores any drag containing this flavor*/
  204. };
  205. /*
  206. _________________________________________________________________________________________________________
  207. o DRAG TRACKING HANDLER MESSAGES
  208. _________________________________________________________________________________________________________
  209. */
  210. typedef SInt16 DragTrackingMessage;
  211. enum {
  212. kDragTrackingEnterHandler = 1, /* drag has entered handler*/
  213. kDragTrackingEnterWindow = 2, /* drag has entered window*/
  214. kDragTrackingInWindow = 3, /* drag is moving within window*/
  215. kDragTrackingLeaveWindow = 4, /* drag has exited window*/
  216. kDragTrackingLeaveHandler = 5 /* drag has exited handler*/
  217. };
  218. /*
  219. ---------------------------------------------------------------------------------------------------------
  220. o STANDARD DROP LOCATIONS
  221. ---------------------------------------------------------------------------------------------------------
  222. */
  223. /*
  224. * Summary:
  225. * Standard Drop Location constants
  226. *
  227. * Discussion:
  228. * The following constants define common "meta" drop locations.
  229. */
  230. enum {
  231. /*
  232. * The drop location was in the trash. This is set when a drag is
  233. * dropped on the trash icon. Setting this standard drop location
  234. * sets the traditional drop location to an alias to the trash folder
  235. * automatically.
  236. */
  237. kDragStandardDropLocationTrash = FOUR_CHAR_CODE('trsh'),
  238. /*
  239. * The receiver did not specify a drop lcoation. This is the default.
  240. */
  241. kDragStandardDropLocationUnknown = FOUR_CHAR_CODE('unkn')
  242. };
  243. typedef OSType StandardDropLocation;
  244. /*
  245. _________________________________________________________________________________________________________
  246. o DRAG ACTIONS
  247. _________________________________________________________________________________________________________
  248. */
  249. /*
  250. * Summary:
  251. * Drag Action constants
  252. *
  253. * Discussion:
  254. * The following constants define, in a general way, what actions a
  255. * drag should or has performed. Some drag actions enforce a mode
  256. * of operation while others are flexible suggestions. These
  257. * constants are used in conjunction with the
  258. * Get/SetDragAllowableActions() and Get/SetDragDropAction() APIs.
  259. * Adopting the Drag Action APIs increases compatability with the
  260. * Cocoa drag operation model.
  261. */
  262. enum {
  263. /*
  264. * Suggests nothing should be/was done with the data in a drag. When
  265. * set as an allowable action for remote drags, the drag will not be
  266. * sent to apps other than the sender.
  267. */
  268. kDragActionNothing = 0L,
  269. /*
  270. * Suggests the data contained within the drag can be/was copied.
  271. */
  272. kDragActionCopy = 1L,
  273. /*
  274. * Suggests the data contained within the drag can be/is shared.
  275. */
  276. kDragActionAlias = (1L << 1),
  277. /*
  278. * Suggests the drag action is can be defined by the drag destination
  279. * or was not defined by the drag destination.
  280. */
  281. kDragActionGeneric = (1L << 2),
  282. /*
  283. * Suggests the drag action should be negotiated privately between
  284. * the drag source and destination.
  285. */
  286. kDragActionPrivate = (1L << 3),
  287. /*
  288. * Description forthcoming.
  289. */
  290. kDragActionMove = (1L << 4),
  291. /*
  292. * Description forthcoming.
  293. */
  294. kDragActionDelete = (1L << 5),
  295. /*
  296. * All of the above drag actions are allowed.
  297. */
  298. kDragActionAll = (long)0xFFFFFFFF
  299. };
  300. typedef UInt32 DragActions;
  301. /*
  302. _________________________________________________________________________________________________________
  303. o HFS FLAVORS
  304. _________________________________________________________________________________________________________
  305. */
  306. struct HFSFlavor {
  307. OSType fileType; /* file type */
  308. OSType fileCreator; /* file creator */
  309. UInt16 fdFlags; /* Finder flags */
  310. FSSpec fileSpec; /* file system specification */
  311. };
  312. typedef struct HFSFlavor HFSFlavor;
  313. struct PromiseHFSFlavor {
  314. OSType fileType; /* file type */
  315. OSType fileCreator; /* file creator */
  316. UInt16 fdFlags; /* Finder flags */
  317. FlavorType promisedFlavor; /* promised flavor containing an FSSpec */
  318. };
  319. typedef struct PromiseHFSFlavor PromiseHFSFlavor;
  320. /*
  321. _________________________________________________________________________________________________________
  322. o APPLICATION-DEFINED DRAG HANDLER ROUTINES
  323. _________________________________________________________________________________________________________
  324. */
  325. typedef CALLBACK_API( OSErr , DragTrackingHandlerProcPtr )(DragTrackingMessage message, WindowRef theWindow, void *handlerRefCon, DragRef theDrag);
  326. typedef CALLBACK_API( OSErr , DragReceiveHandlerProcPtr )(WindowRef theWindow, void *handlerRefCon, DragRef theDrag);
  327. typedef STACK_UPP_TYPE(DragTrackingHandlerProcPtr) DragTrackingHandlerUPP;
  328. typedef STACK_UPP_TYPE(DragReceiveHandlerProcPtr) DragReceiveHandlerUPP;
  329. /*
  330. * NewDragTrackingHandlerUPP()
  331. *
  332. * Availability:
  333. * Non-Carbon CFM: available as macro/inline
  334. * CarbonLib: in CarbonLib 1.0 and later
  335. * Mac OS X: in version 10.0 and later
  336. */
  337. EXTERN_API_C( DragTrackingHandlerUPP )
  338. NewDragTrackingHandlerUPP(DragTrackingHandlerProcPtr userRoutine);
  339. #if !OPAQUE_UPP_TYPES
  340. enum { uppDragTrackingHandlerProcInfo = 0x00003FA0 }; /* pascal 2_bytes Func(2_bytes, 4_bytes, 4_bytes, 4_bytes) */
  341. #ifdef __cplusplus
  342. inline DEFINE_API_C(DragTrackingHandlerUPP) NewDragTrackingHandlerUPP(DragTrackingHandlerProcPtr userRoutine) { return (DragTrackingHandlerUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragTrackingHandlerProcInfo, GetCurrentArchitecture()); }
  343. #else
  344. #define NewDragTrackingHandlerUPP(userRoutine) (DragTrackingHandlerUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragTrackingHandlerProcInfo, GetCurrentArchitecture())
  345. #endif
  346. #endif
  347. /*
  348. * NewDragReceiveHandlerUPP()
  349. *
  350. * Availability:
  351. * Non-Carbon CFM: available as macro/inline
  352. * CarbonLib: in CarbonLib 1.0 and later
  353. * Mac OS X: in version 10.0 and later
  354. */
  355. EXTERN_API_C( DragReceiveHandlerUPP )
  356. NewDragReceiveHandlerUPP(DragReceiveHandlerProcPtr userRoutine);
  357. #if !OPAQUE_UPP_TYPES
  358. enum { uppDragReceiveHandlerProcInfo = 0x00000FE0 }; /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes) */
  359. #ifdef __cplusplus
  360. inline DEFINE_API_C(DragReceiveHandlerUPP) NewDragReceiveHandlerUPP(DragReceiveHandlerProcPtr userRoutine) { return (DragReceiveHandlerUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragReceiveHandlerProcInfo, GetCurrentArchitecture()); }
  361. #else
  362. #define NewDragReceiveHandlerUPP(userRoutine) (DragReceiveHandlerUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragReceiveHandlerProcInfo, GetCurrentArchitecture())
  363. #endif
  364. #endif
  365. /*
  366. * DisposeDragTrackingHandlerUPP()
  367. *
  368. * Availability:
  369. * Non-Carbon CFM: available as macro/inline
  370. * CarbonLib: in CarbonLib 1.0 and later
  371. * Mac OS X: in version 10.0 and later
  372. */
  373. EXTERN_API_C( void )
  374. DisposeDragTrackingHandlerUPP(DragTrackingHandlerUPP userUPP);
  375. #if !OPAQUE_UPP_TYPES
  376. #ifdef __cplusplus
  377. inline DEFINE_API_C(void) DisposeDragTrackingHandlerUPP(DragTrackingHandlerUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  378. #else
  379. #define DisposeDragTrackingHandlerUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  380. #endif
  381. #endif
  382. /*
  383. * DisposeDragReceiveHandlerUPP()
  384. *
  385. * Availability:
  386. * Non-Carbon CFM: available as macro/inline
  387. * CarbonLib: in CarbonLib 1.0 and later
  388. * Mac OS X: in version 10.0 and later
  389. */
  390. EXTERN_API_C( void )
  391. DisposeDragReceiveHandlerUPP(DragReceiveHandlerUPP userUPP);
  392. #if !OPAQUE_UPP_TYPES
  393. #ifdef __cplusplus
  394. inline DEFINE_API_C(void) DisposeDragReceiveHandlerUPP(DragReceiveHandlerUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  395. #else
  396. #define DisposeDragReceiveHandlerUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  397. #endif
  398. #endif
  399. /*
  400. * InvokeDragTrackingHandlerUPP()
  401. *
  402. * Availability:
  403. * Non-Carbon CFM: available as macro/inline
  404. * CarbonLib: in CarbonLib 1.0 and later
  405. * Mac OS X: in version 10.0 and later
  406. */
  407. EXTERN_API_C( OSErr )
  408. InvokeDragTrackingHandlerUPP(
  409. DragTrackingMessage message,
  410. WindowRef theWindow,
  411. void * handlerRefCon,
  412. DragRef theDrag,
  413. DragTrackingHandlerUPP userUPP);
  414. #if !OPAQUE_UPP_TYPES
  415. #ifdef __cplusplus
  416. inline DEFINE_API_C(OSErr) InvokeDragTrackingHandlerUPP(DragTrackingMessage message, WindowRef theWindow, void * handlerRefCon, DragRef theDrag, DragTrackingHandlerUPP userUPP) { return (OSErr)CALL_FOUR_PARAMETER_UPP(userUPP, uppDragTrackingHandlerProcInfo, message, theWindow, handlerRefCon, theDrag); }
  417. #else
  418. #define InvokeDragTrackingHandlerUPP(message, theWindow, handlerRefCon, theDrag, userUPP) (OSErr)CALL_FOUR_PARAMETER_UPP((userUPP), uppDragTrackingHandlerProcInfo, (message), (theWindow), (handlerRefCon), (theDrag))
  419. #endif
  420. #endif
  421. /*
  422. * InvokeDragReceiveHandlerUPP()
  423. *
  424. * Availability:
  425. * Non-Carbon CFM: available as macro/inline
  426. * CarbonLib: in CarbonLib 1.0 and later
  427. * Mac OS X: in version 10.0 and later
  428. */
  429. EXTERN_API_C( OSErr )
  430. InvokeDragReceiveHandlerUPP(
  431. WindowRef theWindow,
  432. void * handlerRefCon,
  433. DragRef theDrag,
  434. DragReceiveHandlerUPP userUPP);
  435. #if !OPAQUE_UPP_TYPES
  436. #ifdef __cplusplus
  437. inline DEFINE_API_C(OSErr) InvokeDragReceiveHandlerUPP(WindowRef theWindow, void * handlerRefCon, DragRef theDrag, DragReceiveHandlerUPP userUPP) { return (OSErr)CALL_THREE_PARAMETER_UPP(userUPP, uppDragReceiveHandlerProcInfo, theWindow, handlerRefCon, theDrag); }
  438. #else
  439. #define InvokeDragReceiveHandlerUPP(theWindow, handlerRefCon, theDrag, userUPP) (OSErr)CALL_THREE_PARAMETER_UPP((userUPP), uppDragReceiveHandlerProcInfo, (theWindow), (handlerRefCon), (theDrag))
  440. #endif
  441. #endif
  442. #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
  443. /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
  444. #define NewDragTrackingHandlerProc(userRoutine) NewDragTrackingHandlerUPP(userRoutine)
  445. #define NewDragReceiveHandlerProc(userRoutine) NewDragReceiveHandlerUPP(userRoutine)
  446. #define CallDragTrackingHandlerProc(userRoutine, message, theWindow, handlerRefCon, theDrag) InvokeDragTrackingHandlerUPP(message, theWindow, handlerRefCon, theDrag, userRoutine)
  447. #define CallDragReceiveHandlerProc(userRoutine, theWindow, handlerRefCon, theDrag) InvokeDragReceiveHandlerUPP(theWindow, handlerRefCon, theDrag, userRoutine)
  448. #endif /* CALL_NOT_IN_CARBON */
  449. /*
  450. _________________________________________________________________________________________________________
  451. o APPLICATION-DEFINED ROUTINES
  452. _________________________________________________________________________________________________________
  453. */
  454. typedef CALLBACK_API( OSErr , DragSendDataProcPtr )(FlavorType theType, void *dragSendRefCon, DragItemRef theItemRef, DragRef theDrag);
  455. typedef CALLBACK_API( OSErr , DragInputProcPtr )(Point *mouse, SInt16 *modifiers, void *dragInputRefCon, DragRef theDrag);
  456. typedef CALLBACK_API( OSErr , DragDrawingProcPtr )(DragRegionMessage message, RgnHandle showRegion, Point showOrigin, RgnHandle hideRegion, Point hideOrigin, void *dragDrawingRefCon, DragRef theDrag);
  457. typedef STACK_UPP_TYPE(DragSendDataProcPtr) DragSendDataUPP;
  458. typedef STACK_UPP_TYPE(DragInputProcPtr) DragInputUPP;
  459. typedef STACK_UPP_TYPE(DragDrawingProcPtr) DragDrawingUPP;
  460. /*
  461. * NewDragSendDataUPP()
  462. *
  463. * Availability:
  464. * Non-Carbon CFM: available as macro/inline
  465. * CarbonLib: in CarbonLib 1.0 and later
  466. * Mac OS X: in version 10.0 and later
  467. */
  468. EXTERN_API_C( DragSendDataUPP )
  469. NewDragSendDataUPP(DragSendDataProcPtr userRoutine);
  470. #if !OPAQUE_UPP_TYPES
  471. enum { uppDragSendDataProcInfo = 0x00003FE0 }; /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  472. #ifdef __cplusplus
  473. inline DEFINE_API_C(DragSendDataUPP) NewDragSendDataUPP(DragSendDataProcPtr userRoutine) { return (DragSendDataUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragSendDataProcInfo, GetCurrentArchitecture()); }
  474. #else
  475. #define NewDragSendDataUPP(userRoutine) (DragSendDataUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragSendDataProcInfo, GetCurrentArchitecture())
  476. #endif
  477. #endif
  478. /*
  479. * NewDragInputUPP()
  480. *
  481. * Availability:
  482. * Non-Carbon CFM: available as macro/inline
  483. * CarbonLib: in CarbonLib 1.0 and later
  484. * Mac OS X: in version 10.0 and later
  485. */
  486. EXTERN_API_C( DragInputUPP )
  487. NewDragInputUPP(DragInputProcPtr userRoutine);
  488. #if !OPAQUE_UPP_TYPES
  489. enum { uppDragInputProcInfo = 0x00003FE0 }; /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  490. #ifdef __cplusplus
  491. inline DEFINE_API_C(DragInputUPP) NewDragInputUPP(DragInputProcPtr userRoutine) { return (DragInputUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragInputProcInfo, GetCurrentArchitecture()); }
  492. #else
  493. #define NewDragInputUPP(userRoutine) (DragInputUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragInputProcInfo, GetCurrentArchitecture())
  494. #endif
  495. #endif
  496. /*
  497. * NewDragDrawingUPP()
  498. *
  499. * Availability:
  500. * Non-Carbon CFM: available as macro/inline
  501. * CarbonLib: in CarbonLib 1.0 and later
  502. * Mac OS X: in version 10.0 and later
  503. */
  504. EXTERN_API_C( DragDrawingUPP )
  505. NewDragDrawingUPP(DragDrawingProcPtr userRoutine);
  506. #if !OPAQUE_UPP_TYPES
  507. enum { uppDragDrawingProcInfo = 0x000FFFA0 }; /* pascal 2_bytes Func(2_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  508. #ifdef __cplusplus
  509. inline DEFINE_API_C(DragDrawingUPP) NewDragDrawingUPP(DragDrawingProcPtr userRoutine) { return (DragDrawingUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragDrawingProcInfo, GetCurrentArchitecture()); }
  510. #else
  511. #define NewDragDrawingUPP(userRoutine) (DragDrawingUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragDrawingProcInfo, GetCurrentArchitecture())
  512. #endif
  513. #endif
  514. /*
  515. * DisposeDragSendDataUPP()
  516. *
  517. * Availability:
  518. * Non-Carbon CFM: available as macro/inline
  519. * CarbonLib: in CarbonLib 1.0 and later
  520. * Mac OS X: in version 10.0 and later
  521. */
  522. EXTERN_API_C( void )
  523. DisposeDragSendDataUPP(DragSendDataUPP userUPP);
  524. #if !OPAQUE_UPP_TYPES
  525. #ifdef __cplusplus
  526. inline DEFINE_API_C(void) DisposeDragSendDataUPP(DragSendDataUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  527. #else
  528. #define DisposeDragSendDataUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  529. #endif
  530. #endif
  531. /*
  532. * DisposeDragInputUPP()
  533. *
  534. * Availability:
  535. * Non-Carbon CFM: available as macro/inline
  536. * CarbonLib: in CarbonLib 1.0 and later
  537. * Mac OS X: in version 10.0 and later
  538. */
  539. EXTERN_API_C( void )
  540. DisposeDragInputUPP(DragInputUPP userUPP);
  541. #if !OPAQUE_UPP_TYPES
  542. #ifdef __cplusplus
  543. inline DEFINE_API_C(void) DisposeDragInputUPP(DragInputUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  544. #else
  545. #define DisposeDragInputUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  546. #endif
  547. #endif
  548. /*
  549. * DisposeDragDrawingUPP()
  550. *
  551. * Availability:
  552. * Non-Carbon CFM: available as macro/inline
  553. * CarbonLib: in CarbonLib 1.0 and later
  554. * Mac OS X: in version 10.0 and later
  555. */
  556. EXTERN_API_C( void )
  557. DisposeDragDrawingUPP(DragDrawingUPP userUPP);
  558. #if !OPAQUE_UPP_TYPES
  559. #ifdef __cplusplus
  560. inline DEFINE_API_C(void) DisposeDragDrawingUPP(DragDrawingUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  561. #else
  562. #define DisposeDragDrawingUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  563. #endif
  564. #endif
  565. /*
  566. * InvokeDragSendDataUPP()
  567. *
  568. * Availability:
  569. * Non-Carbon CFM: available as macro/inline
  570. * CarbonLib: in CarbonLib 1.0 and later
  571. * Mac OS X: in version 10.0 and later
  572. */
  573. EXTERN_API_C( OSErr )
  574. InvokeDragSendDataUPP(
  575. FlavorType theType,
  576. void * dragSendRefCon,
  577. DragItemRef theItemRef,
  578. DragRef theDrag,
  579. DragSendDataUPP userUPP);
  580. #if !OPAQUE_UPP_TYPES
  581. #ifdef __cplusplus
  582. inline DEFINE_API_C(OSErr) InvokeDragSendDataUPP(FlavorType theType, void * dragSendRefCon, DragItemRef theItemRef, DragRef theDrag, DragSendDataUPP userUPP) { return (OSErr)CALL_FOUR_PARAMETER_UPP(userUPP, uppDragSendDataProcInfo, theType, dragSendRefCon, theItemRef, theDrag); }
  583. #else
  584. #define InvokeDragSendDataUPP(theType, dragSendRefCon, theItemRef, theDrag, userUPP) (OSErr)CALL_FOUR_PARAMETER_UPP((userUPP), uppDragSendDataProcInfo, (theType), (dragSendRefCon), (theItemRef), (theDrag))
  585. #endif
  586. #endif
  587. /*
  588. * InvokeDragInputUPP()
  589. *
  590. * Availability:
  591. * Non-Carbon CFM: available as macro/inline
  592. * CarbonLib: in CarbonLib 1.0 and later
  593. * Mac OS X: in version 10.0 and later
  594. */
  595. EXTERN_API_C( OSErr )
  596. InvokeDragInputUPP(
  597. Point * mouse,
  598. SInt16 * modifiers,
  599. void * dragInputRefCon,
  600. DragRef theDrag,
  601. DragInputUPP userUPP);
  602. #if !OPAQUE_UPP_TYPES
  603. #ifdef __cplusplus
  604. inline DEFINE_API_C(OSErr) InvokeDragInputUPP(Point * mouse, SInt16 * modifiers, void * dragInputRefCon, DragRef theDrag, DragInputUPP userUPP) { return (OSErr)CALL_FOUR_PARAMETER_UPP(userUPP, uppDragInputProcInfo, mouse, modifiers, dragInputRefCon, theDrag); }
  605. #else
  606. #define InvokeDragInputUPP(mouse, modifiers, dragInputRefCon, theDrag, userUPP) (OSErr)CALL_FOUR_PARAMETER_UPP((userUPP), uppDragInputProcInfo, (mouse), (modifiers), (dragInputRefCon), (theDrag))
  607. #endif
  608. #endif
  609. /*
  610. * InvokeDragDrawingUPP()
  611. *
  612. * Availability:
  613. * Non-Carbon CFM: available as macro/inline
  614. * CarbonLib: in CarbonLib 1.0 and later
  615. * Mac OS X: in version 10.0 and later
  616. */
  617. EXTERN_API_C( OSErr )
  618. InvokeDragDrawingUPP(
  619. DragRegionMessage message,
  620. RgnHandle showRegion,
  621. Point showOrigin,
  622. RgnHandle hideRegion,
  623. Point hideOrigin,
  624. void * dragDrawingRefCon,
  625. DragRef theDrag,
  626. DragDrawingUPP userUPP);
  627. #if !OPAQUE_UPP_TYPES
  628. #ifdef __cplusplus
  629. inline DEFINE_API_C(OSErr) InvokeDragDrawingUPP(DragRegionMessage message, RgnHandle showRegion, Point showOrigin, RgnHandle hideRegion, Point hideOrigin, void * dragDrawingRefCon, DragRef theDrag, DragDrawingUPP userUPP) { return (OSErr)CALL_SEVEN_PARAMETER_UPP(userUPP, uppDragDrawingProcInfo, message, showRegion, showOrigin, hideRegion, hideOrigin, dragDrawingRefCon, theDrag); }
  630. #else
  631. #define InvokeDragDrawingUPP(message, showRegion, showOrigin, hideRegion, hideOrigin, dragDrawingRefCon, theDrag, userUPP) (OSErr)CALL_SEVEN_PARAMETER_UPP((userUPP), uppDragDrawingProcInfo, (message), (showRegion), (showOrigin), (hideRegion), (hideOrigin), (dragDrawingRefCon), (theDrag))
  632. #endif
  633. #endif
  634. #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
  635. /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
  636. #define NewDragSendDataProc(userRoutine) NewDragSendDataUPP(userRoutine)
  637. #define NewDragInputProc(userRoutine) NewDragInputUPP(userRoutine)
  638. #define NewDragDrawingProc(userRoutine) NewDragDrawingUPP(userRoutine)
  639. #define CallDragSendDataProc(userRoutine, theType, dragSendRefCon, theItemRef, theDrag) InvokeDragSendDataUPP(theType, dragSendRefCon, theItemRef, theDrag, userRoutine)
  640. #define CallDragInputProc(userRoutine, mouse, modifiers, dragInputRefCon, theDrag) InvokeDragInputUPP(mouse, modifiers, dragInputRefCon, theDrag, userRoutine)
  641. #define CallDragDrawingProc(userRoutine, message, showRegion, showOrigin, hideRegion, hideOrigin, dragDrawingRefCon, theDrag) InvokeDragDrawingUPP(message, showRegion, showOrigin, hideRegion, hideOrigin, dragDrawingRefCon, theDrag, userRoutine)
  642. #endif /* CALL_NOT_IN_CARBON */
  643. /*
  644. _________________________________________________________________________________________________________
  645. o INSTALLING AND REMOVING HANDLERS API'S
  646. _________________________________________________________________________________________________________
  647. */
  648. /*
  649. * InstallTrackingHandler()
  650. *
  651. * Availability:
  652. * Non-Carbon CFM: in DragLib 1.1 and later
  653. * CarbonLib: in CarbonLib 1.0 and later
  654. * Mac OS X: in version 10.0 and later
  655. */
  656. EXTERN_API( OSErr )
  657. InstallTrackingHandler(
  658. DragTrackingHandlerUPP trackingHandler,
  659. WindowRef theWindow,
  660. void * handlerRefCon) TWOWORDINLINE(0x7001, 0xABED);
  661. /*
  662. * InstallReceiveHandler()
  663. *
  664. * Availability:
  665. * Non-Carbon CFM: in DragLib 1.1 and later
  666. * CarbonLib: in CarbonLib 1.0 and later
  667. * Mac OS X: in version 10.0 and later
  668. */
  669. EXTERN_API( OSErr )
  670. InstallReceiveHandler(
  671. DragReceiveHandlerUPP receiveHandler,
  672. WindowRef theWindow,
  673. void * handlerRefCon) TWOWORDINLINE(0x7002, 0xABED);
  674. /*
  675. * RemoveTrackingHandler()
  676. *
  677. * Availability:
  678. * Non-Carbon CFM: in DragLib 1.1 and later
  679. * CarbonLib: in CarbonLib 1.0 and later
  680. * Mac OS X: in version 10.0 and later
  681. */
  682. EXTERN_API( OSErr )
  683. RemoveTrackingHandler(
  684. DragTrackingHandlerUPP trackingHandler,
  685. WindowRef theWindow) TWOWORDINLINE(0x7003, 0xABED);
  686. /*
  687. * RemoveReceiveHandler()
  688. *
  689. * Availability:
  690. * Non-Carbon CFM: in DragLib 1.1 and later
  691. * CarbonLib: in CarbonLib 1.0 and later
  692. * Mac OS X: in version 10.0 and later
  693. */
  694. EXTERN_API( OSErr )
  695. RemoveReceiveHandler(
  696. DragReceiveHandlerUPP receiveHandler,
  697. WindowRef theWindow) TWOWORDINLINE(0x7004, 0xABED);
  698. /*
  699. _________________________________________________________________________________________________________
  700. o CREATING & DISPOSING
  701. _________________________________________________________________________________________________________
  702. */
  703. /*
  704. * NewDrag()
  705. *
  706. * Availability:
  707. * Non-Carbon CFM: in DragLib 1.1 and later
  708. * CarbonLib: in CarbonLib 1.0 and later
  709. * Mac OS X: in version 10.0 and later
  710. */
  711. EXTERN_API( OSErr )
  712. NewDrag(DragRef * theDrag) TWOWORDINLINE(0x7005, 0xABED);
  713. /*
  714. * DisposeDrag()
  715. *
  716. * Availability:
  717. * Non-Carbon CFM: in DragLib 1.1 and later
  718. * CarbonLib: in CarbonLib 1.0 and later
  719. * Mac OS X: in version 10.0 and later
  720. */
  721. EXTERN_API( OSErr )
  722. DisposeDrag(DragRef theDrag) TWOWORDINLINE(0x7006, 0xABED);
  723. /*
  724. _________________________________________________________________________________________________________
  725. o ADDING DRAG ITEM FLAVORS
  726. _________________________________________________________________________________________________________
  727. */
  728. /*
  729. The method for setting Drag Manager promises differs from that for Scrap Manger promises. This chart
  730. describes the method for setting drag promises via AddDragItemFlavor().
  731. dataPtr dataSize result
  732. pointer value actual data size The data of size dataSize pointed to by dataPtr is added to the drag.
  733. NULL ignored A promise is placed on the drag.
  734. */
  735. /*
  736. * AddDragItemFlavor()
  737. *
  738. * Availability:
  739. * Non-Carbon CFM: in DragLib 1.1 and later
  740. * CarbonLib: in CarbonLib 1.0 and later
  741. * Mac OS X: in version 10.0 and later
  742. */
  743. EXTERN_API( OSErr )
  744. AddDragItemFlavor(
  745. DragRef theDrag,
  746. DragItemRef theItemRef,
  747. FlavorType theType,
  748. const void * dataPtr,
  749. Size dataSize,
  750. FlavorFlags theFlags) TWOWORDINLINE(0x7007, 0xABED);
  751. /*
  752. * SetDragItemFlavorData()
  753. *
  754. * Availability:
  755. * Non-Carbon CFM: in DragLib 1.1 and later
  756. * CarbonLib: in CarbonLib 1.0 and later
  757. * Mac OS X: in version 10.0 and later
  758. */
  759. EXTERN_API( OSErr )
  760. SetDragItemFlavorData(
  761. DragRef theDrag,
  762. DragItemRef theItemRef,
  763. FlavorType theType,
  764. const void * dataPtr,
  765. Size dataSize,
  766. UInt32 dataOffset) TWOWORDINLINE(0x7009, 0xABED);
  767. /*
  768. _________________________________________________________________________________________________________
  769. o PROVIDING CALLBACK PROCEDURES
  770. _________________________________________________________________________________________________________
  771. */
  772. /*
  773. * SetDragSendProc()
  774. *
  775. * Availability:
  776. * Non-Carbon CFM: in DragLib 1.1 and later
  777. * CarbonLib: in CarbonLib 1.0 and later
  778. * Mac OS X: in version 10.0 and later
  779. */
  780. EXTERN_API( OSErr )
  781. SetDragSendProc(
  782. DragRef theDrag,
  783. DragSendDataUPP sendProc,
  784. void * dragSendRefCon) TWOWORDINLINE(0x700A, 0xABED);
  785. /*
  786. * SetDragInputProc()
  787. *
  788. * Availability:
  789. * Non-Carbon CFM: in DragLib 1.1 and later
  790. * CarbonLib: in CarbonLib 1.0 and later
  791. * Mac OS X: in version 10.0 and later
  792. */
  793. EXTERN_API( OSErr )
  794. SetDragInputProc(
  795. DragRef theDrag,
  796. DragInputUPP inputProc,
  797. void * dragInputRefCon) TWOWORDINLINE(0x700B, 0xABED);
  798. /*
  799. * SetDragDrawingProc()
  800. *
  801. * Availability:
  802. * Non-Carbon CFM: in DragLib 1.1 and later
  803. * CarbonLib: in CarbonLib 1.0 and later
  804. * Mac OS X: in version 10.0 and later
  805. */
  806. EXTERN_API( OSErr )
  807. SetDragDrawingProc(
  808. DragRef theDrag,
  809. DragDrawingUPP drawingProc,
  810. void * dragDrawingRefCon) TWOWORDINLINE(0x700C, 0xABED);
  811. /*
  812. _________________________________________________________________________________________________________
  813. o SETTING THE DRAG IMAGE
  814. _________________________________________________________________________________________________________
  815. */
  816. /*
  817. * SetDragImage()
  818. *
  819. * Availability:
  820. * Non-Carbon CFM: in DragLib 7.5 and later
  821. * CarbonLib: in CarbonLib 1.0 and later
  822. * Mac OS X: in version 10.0 and later
  823. */
  824. EXTERN_API( OSErr )
  825. SetDragImage(
  826. DragRef theDrag,
  827. PixMapHandle imagePixMap,
  828. RgnHandle imageRgn,
  829. Point imageOffsetPt,
  830. DragImageFlags theImageFlags) TWOWORDINLINE(0x7027, 0xABED);
  831. /*
  832. * SetDragImageWithCGImage()
  833. *
  834. * Discussion:
  835. * Used by the sender of the drag to set the image, in CGImage
  836. * format, to be displayed as user feedback during the drag. This
  837. * API may be called at any point during the drag to update the
  838. * image.
  839. *
  840. * Parameters:
  841. *
  842. * inDrag:
  843. * The drag reference for which the image will be displayed.
  844. *
  845. * inCGImage:
  846. * The CGImageRef for the image to be displayed during the drag.
  847. * The image is retained internally by the Drag Manager for the
  848. * duration of the drag so it may be released by the client
  849. * immediately after setting.
  850. *
  851. * inImageOffsetPt:
  852. * A pointer to the offset from the mouse to the upper left of the
  853. * image (normally expressed in negative values). This differs
  854. * from the usage of the offset passed to SetDragImage(). Here,
  855. * an offset of ( -30, -30 ) will center a 60x60 pixel image on
  856. * the drag mouse.
  857. *
  858. * inImageFlags:
  859. * The flags determining image drawing during the drag.
  860. *
  861. * Result:
  862. * An operating system result code.
  863. *
  864. * Availability:
  865. * Non-Carbon CFM: not available
  866. * CarbonLib: not available
  867. * Mac OS X: in version 10.2 and later
  868. */
  869. EXTERN_API_C( OSStatus )
  870. SetDragImageWithCGImage(
  871. DragRef inDrag,
  872. CGImageRef inCGImage,
  873. const HIPoint * inImageOffsetPt,
  874. DragImageFlags inImageFlags);
  875. /*
  876. _________________________________________________________________________________________________________
  877. o ALTERING THE BEHAVIOR OF A DRAG
  878. _________________________________________________________________________________________________________
  879. */
  880. /*
  881. * ChangeDragBehaviors()
  882. *
  883. * Availability:
  884. * Non-Carbon CFM: in DragLib 9.0 and later
  885. * CarbonLib: in CarbonLib 1.0 and later
  886. * Mac OS X: in version 10.0 and later
  887. */
  888. EXTERN_API( OSErr )
  889. ChangeDragBehaviors(
  890. DragRef theDrag,
  891. DragBehaviors inBehaviorsToSet,
  892. DragBehaviors inBehaviorsToClear) TWOWORDINLINE(0x7028, 0xABED);
  893. /*
  894. _________________________________________________________________________________________________________
  895. o PERFORMING A DRAG
  896. _________________________________________________________________________________________________________
  897. */
  898. /*
  899. * TrackDrag()
  900. *
  901. * Availability:
  902. * Non-Carbon CFM: in DragLib 1.1 and later
  903. * CarbonLib: in CarbonLib 1.0 and later
  904. * Mac OS X: in version 10.0 and later
  905. */
  906. EXTERN_API( OSErr )
  907. TrackDrag(
  908. DragRef theDrag,
  909. const EventRecord * theEvent,
  910. RgnHandle theRegion) TWOWORDINLINE(0x700D, 0xABED);
  911. /*
  912. _________________________________________________________________________________________________________
  913. o GETTING DRAG ITEM INFORMATION
  914. _________________________________________________________________________________________________________
  915. */
  916. /*
  917. * CountDragItems()
  918. *
  919. * Availability:
  920. * Non-Carbon CFM: in DragLib 1.1 and later
  921. * CarbonLib: in CarbonLib 1.0 and later
  922. * Mac OS X: in version 10.0 and later
  923. */
  924. EXTERN_API( OSErr )
  925. CountDragItems(
  926. DragRef theDrag,
  927. UInt16 * numItems) TWOWORDINLINE(0x700E, 0xABED);
  928. /*
  929. * GetDragItemReferenceNumber()
  930. *
  931. * Availability:
  932. * Non-Carbon CFM: in DragLib 1.1 and later
  933. * CarbonLib: in CarbonLib 1.0 and later
  934. * Mac OS X: in version 10.0 and later
  935. */
  936. EXTERN_API( OSErr )
  937. GetDragItemReferenceNumber(
  938. DragRef theDrag,
  939. UInt16 index,
  940. DragItemRef * theItemRef) TWOWORDINLINE(0x700F, 0xABED);
  941. /*
  942. * CountDragItemFlavors()
  943. *
  944. * Availability:
  945. * Non-Carbon CFM: in DragLib 1.1 and later
  946. * CarbonLib: in CarbonLib 1.0 and later
  947. * Mac OS X: in version 10.0 and later
  948. */
  949. EXTERN_API( OSErr )
  950. CountDragItemFlavors(
  951. DragRef theDrag,
  952. DragItemRef theItemRef,
  953. UInt16 * numFlavors) TWOWORDINLINE(0x7010, 0xABED);
  954. /*
  955. * GetFlavorType()
  956. *
  957. * Availability:
  958. * Non-Carbon CFM: in DragLib 1.1 and later
  959. * CarbonLib: in CarbonLib 1.0 and later
  960. * Mac OS X: in version 10.0 and later
  961. */
  962. EXTERN_API( OSErr )
  963. GetFlavorType(
  964. DragRef theDrag,
  965. DragItemRef theItemRef,
  966. UInt16 index,
  967. FlavorType * theType) TWOWORDINLINE(0x7011, 0xABED);
  968. /*
  969. * GetFlavorFlags()
  970. *
  971. * Availability:
  972. * Non-Carbon CFM: in DragLib 1.1 and later
  973. * CarbonLib: in CarbonLib 1.0 and later
  974. * Mac OS X: in version 10.0 and later
  975. */
  976. EXTERN_API( OSErr )
  977. GetFlavorFlags(
  978. DragRef theDrag,
  979. DragItemRef theItemRef,
  980. FlavorType theType,
  981. FlavorFlags * theFlags) TWOWORDINLINE(0x7012, 0xABED);
  982. /*
  983. * GetFlavorDataSize()
  984. *
  985. * Availability:
  986. * Non-Carbon CFM: in DragLib 1.1 and later
  987. * CarbonLib: in CarbonLib 1.0 and later
  988. * Mac OS X: in version 10.0 and later
  989. */
  990. EXTERN_API( OSErr )
  991. GetFlavorDataSize(
  992. DragRef theDrag,
  993. DragItemRef theItemRef,
  994. FlavorType theType,
  995. Size * dataSize) TWOWORDINLINE(0x7013, 0xABED);
  996. /*
  997. * GetFlavorData()
  998. *
  999. * Availability:
  1000. * Non-Carbon CFM: in DragLib 1.1 and later
  1001. * CarbonLib: in CarbonLib 1.0 and later
  1002. * Mac OS X: in version 10.0 and later
  1003. */
  1004. EXTERN_API( OSErr )
  1005. GetFlavorData(
  1006. DragRef theDrag,
  1007. DragItemRef theItemRef,
  1008. FlavorType theType,
  1009. void * dataPtr,
  1010. Size * dataSize,
  1011. UInt32 dataOffset) TWOWORDINLINE(0x7014, 0xABED);
  1012. /*
  1013. _________________________________________________________________________________________________________
  1014. o DRAG ITEM BOUNDS
  1015. _________________________________________________________________________________________________________
  1016. */
  1017. /*
  1018. * GetDragItemBounds()
  1019. *
  1020. * Availability:
  1021. * Non-Carbon CFM: in DragLib 1.1 and later
  1022. * CarbonLib: in CarbonLib 1.0 and later
  1023. * Mac OS X: in version 10.0 and later
  1024. */
  1025. EXTERN_API( OSErr )
  1026. GetDragItemBounds(
  1027. DragRef theDrag,
  1028. DragItemRef theItemRef,
  1029. Rect * itemBounds) TWOWORDINLINE(0x7015, 0xABED);
  1030. /*
  1031. * SetDragItemBounds()
  1032. *
  1033. * Availability:
  1034. * Non-Carbon CFM: in DragLib 1.1 and later
  1035. * CarbonLib: in CarbonLib 1.0 and later
  1036. * Mac OS X: in version 10.0 and later
  1037. */
  1038. EXTERN_API( OSErr )
  1039. SetDragItemBounds(
  1040. DragRef theDrag,
  1041. DragItemRef theItemRef,
  1042. const Rect * itemBounds) TWOWORDINLINE(0x7016, 0xABED);
  1043. /*
  1044. _________________________________________________________________________________________________________
  1045. o DROP LOCATIONS
  1046. _________________________________________________________________________________________________________
  1047. */
  1048. /*
  1049. * GetDropLocation()
  1050. *
  1051. * Availability:
  1052. * Non-Carbon CFM: in DragLib 1.1 and later
  1053. * CarbonLib: in CarbonLib 1.0 and later
  1054. * Mac OS X: in version 10.0 and later
  1055. */
  1056. EXTERN_API( OSErr )
  1057. GetDropLocation(
  1058. DragRef theDrag,
  1059. AEDesc * dropLocation) TWOWORDINLINE(0x7017, 0xABED);
  1060. /*
  1061. * SetDropLocation()
  1062. *
  1063. * Availability:
  1064. * Non-Carbon CFM: in DragLib 1.1 and later
  1065. * CarbonLib: in CarbonLib 1.0 and later
  1066. * Mac OS X: in version 10.0 and later
  1067. */
  1068. EXTERN_API( OSErr )
  1069. SetDropLocation(
  1070. DragRef theDrag,
  1071. const AEDesc * dropLocation) TWOWORDINLINE(0x7018, 0xABED);
  1072. /*
  1073. _________________________________________________________________________________________________________
  1074. o STANDARD DROP LOCATIONS
  1075. _________________________________________________________________________________________________________
  1076. */
  1077. /*
  1078. * GetStandardDropLocation()
  1079. *
  1080. * Discussion:
  1081. * Gets the standard drop location that was set by the receiver of
  1082. * the drag.
  1083. *
  1084. * Parameters:
  1085. *
  1086. * theDrag:
  1087. * The drag reference from which to retrieve the allowable drag
  1088. * actions.
  1089. *
  1090. * outDropLocation:
  1091. * A pointer to the standard drop location, set by the receiver,
  1092. * representing the location where the drag was dropped.
  1093. *
  1094. * Result:
  1095. * An operating system result code.
  1096. *
  1097. * Availability:
  1098. * Non-Carbon CFM: not available
  1099. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1100. * Mac OS X: in version 10.2 and later
  1101. */
  1102. EXTERN_API_C( OSStatus )
  1103. GetStandardDropLocation(
  1104. DragRef theDrag,
  1105. StandardDropLocation * outDropLocation) TWOWORDINLINE(0x7017, 0xABED);
  1106. /*
  1107. * SetStandardDropLocation()
  1108. *
  1109. * Discussion:
  1110. * Used by the receiver of the drag to set the standard drop
  1111. * location.
  1112. *
  1113. * Parameters:
  1114. *
  1115. * theDrag:
  1116. * The drag reference from which to retrieve the allowable drag
  1117. * actions.
  1118. *
  1119. * dropLocation:
  1120. * The standard drop location representing the location where the
  1121. * drag was dropped.
  1122. *
  1123. * Result:
  1124. * An operating system result code.
  1125. *
  1126. * Availability:
  1127. * Non-Carbon CFM: not available
  1128. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  1129. * Mac OS X: in version 10.2 and later
  1130. */
  1131. EXTERN_API_C( OSStatus )
  1132. SetStandardDropLocation(
  1133. DragRef theDrag,
  1134. StandardDropLocation dropLocation) TWOWORDINLINE(0x7018, 0xABED);
  1135. /*
  1136. _________________________________________________________________________________________________________
  1137. o GETTING INFORMATION ABOUT A DRAG
  1138. _________________________________________________________________________________________________________
  1139. */
  1140. /*
  1141. * GetDragAttributes()
  1142. *
  1143. * Availability:
  1144. * Non-Carbon CFM: in DragLib 1.1 and later
  1145. * CarbonLib: in CarbonLib 1.0 and later
  1146. * Mac OS X: in version 10.0 and later
  1147. */
  1148. EXTERN_API( OSErr )
  1149. GetDragAttributes(
  1150. DragRef theDrag,
  1151. DragAttributes * flags) TWOWORDINLINE(0x7019, 0xABED);
  1152. /*
  1153. * GetDragMouse()
  1154. *
  1155. * Availability:
  1156. * Non-Carbon CFM: in DragLib 1.1 and later
  1157. * CarbonLib: in CarbonLib 1.0 and later
  1158. * Mac OS X: in version 10.0 and later
  1159. */
  1160. EXTERN_API( OSErr )
  1161. GetDragMouse(
  1162. DragRef theDrag,
  1163. Point * mouse,
  1164. Point * globalPinnedMouse) TWOWORDINLINE(0x701A, 0xABED);
  1165. /*
  1166. * SetDragMouse()
  1167. *
  1168. * Availability:
  1169. * Non-Carbon CFM: in DragLib 1.1 and later
  1170. * CarbonLib: in CarbonLib 1.0 and later
  1171. * Mac OS X: in version 10.0 and later
  1172. */
  1173. EXTERN_API( OSErr )
  1174. SetDragMouse(
  1175. DragRef theDrag,
  1176. Point globalPinnedMouse) TWOWORDINLINE(0x701B, 0xABED);
  1177. /*
  1178. * GetDragOrigin()
  1179. *
  1180. * Availability:
  1181. * Non-Carbon CFM: in DragLib 1.1 and later
  1182. * CarbonLib: in CarbonLib 1.0 and later
  1183. * Mac OS X: in version 10.0 and later
  1184. */
  1185. EXTERN_API( OSErr )
  1186. GetDragOrigin(
  1187. DragRef theDrag,
  1188. Point * globalInitialMouse) TWOWORDINLINE(0x701C, 0xABED);
  1189. /*
  1190. * GetDragModifiers()
  1191. *
  1192. * Availability:
  1193. * Non-Carbon CFM: in DragLib 1.1 and later
  1194. * CarbonLib: in CarbonLib 1.0 and later
  1195. * Mac OS X: in version 10.0 and later
  1196. */
  1197. EXTERN_API( OSErr )
  1198. GetDragModifiers(
  1199. DragRef theDrag,
  1200. SInt16 * modifiers,
  1201. SInt16 * mouseDownModifiers,
  1202. SInt16 * mouseUpModifiers) TWOWORDINLINE(0x701D, 0xABED);
  1203. /*
  1204. _________________________________________________________________________________________________________
  1205. o ACCESSING DRAG ACTIONS
  1206. _________________________________________________________________________________________________________
  1207. */
  1208. /*
  1209. * GetDragAllowableActions()
  1210. *
  1211. * Discussion:
  1212. * Gets the actions the drag sender has allowed the receiver to
  1213. * perform. These are not requirements, but they highly suggested
  1214. * actions which allows the drag receiver to improve harmony across
  1215. * the system. The allowable actions received are always those
  1216. * local to the caller's process.
  1217. *
  1218. * Parameters:
  1219. *
  1220. * theDrag:
  1221. * The drag reference from which to retreive the allowable drag
  1222. * actions.
  1223. *
  1224. * outActions:
  1225. * A pointer to receive the field of allowable drag actions.
  1226. *
  1227. * Result:
  1228. * An operating system result code.
  1229. *
  1230. * Availability:
  1231. * Non-Carbon CFM: not available
  1232. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  1233. * Mac OS X: in version 10.1 and later
  1234. */
  1235. EXTERN_API_C( OSStatus )
  1236. GetDragAllowableActions(
  1237. DragRef theDrag,
  1238. DragActions * outActions);
  1239. /*
  1240. * SetDragAllowableActions()
  1241. *
  1242. * Discussion:
  1243. * Sets the actions the receiver of the drag is allowed to perform.
  1244. * These are not requirements, but they highly suggested actions
  1245. * which allows the drag receiver to improve harmony across the
  1246. * system. The caller may select wether these drag actions apply to
  1247. * a local or remote process.
  1248. *
  1249. * Parameters:
  1250. *
  1251. * theDrag:
  1252. * The drag reference in which to set the allowable drag actions.
  1253. *
  1254. * inActions:
  1255. * A field of allowable drag actions to be set.
  1256. *
  1257. * isLocal:
  1258. * A boolean value allowing the drag sender to distinguish between
  1259. * those drag actions allowable by the local receiver versus a
  1260. * remote one.
  1261. *
  1262. * Result:
  1263. * An operating system result code.
  1264. *
  1265. * Availability:
  1266. * Non-Carbon CFM: not available
  1267. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  1268. * Mac OS X: in version 10.1 and later
  1269. */
  1270. EXTERN_API_C( OSStatus )
  1271. SetDragAllowableActions(
  1272. DragRef theDrag,
  1273. DragActions inActions,
  1274. Boolean isLocal);
  1275. /*
  1276. * GetDragDropAction()
  1277. *
  1278. * Discussion:
  1279. * Gets the action performed by the receiver of the drag. More than
  1280. * one action may have been performed.
  1281. *
  1282. * Parameters:
  1283. *
  1284. * theDrag:
  1285. * The drag reference from which to retreive the performed drop
  1286. * action.
  1287. *
  1288. * outAction:
  1289. * A pointer to receive the drag action performed.
  1290. *
  1291. * Result:
  1292. * An operating system result code.
  1293. *
  1294. * Availability:
  1295. * Non-Carbon CFM: not available
  1296. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  1297. * Mac OS X: in version 10.1 and later
  1298. */
  1299. EXTERN_API_C( OSStatus )
  1300. GetDragDropAction(
  1301. DragRef theDrag,
  1302. DragActions * outAction);
  1303. /*
  1304. * SetDragDropAction()
  1305. *
  1306. * Discussion:
  1307. * Sets the action performed by the receiver of the drag. More than
  1308. * one action may be performed.
  1309. *
  1310. * Parameters:
  1311. *
  1312. * theDrag:
  1313. * The drag reference in which to set the performed drop action.
  1314. *
  1315. * inAction:
  1316. * The drop action performed.
  1317. *
  1318. * Result:
  1319. * An operating system result code.
  1320. *
  1321. * Availability:
  1322. * Non-Carbon CFM: not available
  1323. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  1324. * Mac OS X: in version 10.1 and later
  1325. */
  1326. EXTERN_API_C( OSStatus )
  1327. SetDragDropAction(
  1328. DragRef theDrag,
  1329. DragActions inAction);
  1330. /*
  1331. _________________________________________________________________________________________________________
  1332. o DRAG HIGHLIGHTING
  1333. _________________________________________________________________________________________________________
  1334. */
  1335. /*
  1336. * ShowDragHilite()
  1337. *
  1338. * Availability:
  1339. * Non-Carbon CFM: in DragLib 1.1 and later
  1340. * CarbonLib: in CarbonLib 1.0 and later
  1341. * Mac OS X: in version 10.0 and later
  1342. */
  1343. EXTERN_API( OSErr )
  1344. ShowDragHilite(
  1345. DragRef theDrag,
  1346. RgnHandle hiliteFrame,
  1347. Boolean inside) TWOWORDINLINE(0x701E, 0xABED);
  1348. /*
  1349. * HideDragHilite()
  1350. *
  1351. * Availability:
  1352. * Non-Carbon CFM: in DragLib 1.1 and later
  1353. * CarbonLib: in CarbonLib 1.0 and later
  1354. * Mac OS X: in version 10.0 and later
  1355. */
  1356. EXTERN_API( OSErr )
  1357. HideDragHilite(DragRef theDrag) TWOWORDINLINE(0x701F, 0xABED);
  1358. /*
  1359. * DragPreScroll()
  1360. *
  1361. * Availability:
  1362. * Non-Carbon CFM: in DragLib 1.1 and later
  1363. * CarbonLib: in CarbonLib 1.0 and later
  1364. * Mac OS X: in version 10.0 and later
  1365. */
  1366. EXTERN_API( OSErr )
  1367. DragPreScroll(
  1368. DragRef theDrag,
  1369. SInt16 dH,
  1370. SInt16 dV) TWOWORDINLINE(0x7020, 0xABED);
  1371. /*
  1372. * DragPostScroll()
  1373. *
  1374. * Availability:
  1375. * Non-Carbon CFM: in DragLib 1.1 and later
  1376. * CarbonLib: in CarbonLib 1.0 and later
  1377. * Mac OS X: in version 10.0 and later
  1378. */
  1379. EXTERN_API( OSErr )
  1380. DragPostScroll(DragRef theDrag) TWOWORDINLINE(0x7021, 0xABED);
  1381. /*
  1382. * UpdateDragHilite()
  1383. *
  1384. * Availability:
  1385. * Non-Carbon CFM: in DragLib 1.1 and later
  1386. * CarbonLib: in CarbonLib 1.0 and later
  1387. * Mac OS X: in version 10.0 and later
  1388. */
  1389. EXTERN_API( OSErr )
  1390. UpdateDragHilite(
  1391. DragRef theDrag,
  1392. RgnHandle updateRgn) TWOWORDINLINE(0x7022, 0xABED);
  1393. /*
  1394. * GetDragHiliteColor()
  1395. *
  1396. * Availability:
  1397. * Non-Carbon CFM: in DragLib 7.5 and later
  1398. * CarbonLib: in CarbonLib 1.0 and later
  1399. * Mac OS X: in version 10.0 and later
  1400. */
  1401. EXTERN_API( OSErr )
  1402. GetDragHiliteColor(
  1403. WindowRef window,
  1404. RGBColor * color) TWOWORDINLINE(0x7026, 0xABED);
  1405. /*
  1406. _________________________________________________________________________________________________________
  1407. o UTILITIES
  1408. _________________________________________________________________________________________________________
  1409. */
  1410. /*
  1411. * WaitMouseMoved()
  1412. *
  1413. * Availability:
  1414. * Non-Carbon CFM: in DragLib 1.1 and later
  1415. * CarbonLib: in CarbonLib 1.0 and later
  1416. * Mac OS X: in version 10.0 and later
  1417. */
  1418. EXTERN_API( Boolean )
  1419. WaitMouseMoved(Point initialGlobalMouse) TWOWORDINLINE(0x7023, 0xABED);
  1420. /*
  1421. * ZoomRects()
  1422. *
  1423. * Availability:
  1424. * Non-Carbon CFM: in DragLib 1.1 and later
  1425. * CarbonLib: in CarbonLib 1.0 and later
  1426. * Mac OS X: in version 10.0 and later
  1427. */
  1428. EXTERN_API( OSErr )
  1429. ZoomRects(
  1430. const Rect * fromRect,
  1431. const Rect * toRect,
  1432. SInt16 zoomSteps,
  1433. ZoomAcceleration acceleration) TWOWORDINLINE(0x7024, 0xABED);
  1434. /*
  1435. * ZoomRegion()
  1436. *
  1437. * Availability:
  1438. * Non-Carbon CFM: in DragLib 1.1 and later
  1439. * CarbonLib: in CarbonLib 1.0 and later
  1440. * Mac OS X: in version 10.0 and later
  1441. */
  1442. EXTERN_API( OSErr )
  1443. ZoomRegion(
  1444. RgnHandle region,
  1445. Point zoomDistance,
  1446. SInt16 zoomSteps,
  1447. ZoomAcceleration acceleration) TWOWORDINLINE(0x7025, 0xABED);
  1448. /*
  1449. _________________________________________________________________________________________________________
  1450. o OLD NAMES
  1451. These are provided for compatiblity with older source bases. It is recommended to not use them since
  1452. they may removed from this interface file at any time.
  1453. _________________________________________________________________________________________________________
  1454. */
  1455. typedef DragRef DragReference;
  1456. typedef DragItemRef ItemReference;
  1457. #if OLDROUTINENAMES
  1458. enum {
  1459. dragHasLeftSenderWindow = kDragHasLeftSenderWindow, /* drag has left the source window since TrackDrag */
  1460. dragInsideSenderApplication = kDragInsideSenderApplication, /* drag is occurring within the sender application */
  1461. dragInsideSenderWindow = kDragInsideSenderWindow /* drag is occurring within the sender window */
  1462. };
  1463. enum {
  1464. dragTrackingEnterHandler = kDragTrackingEnterHandler, /* drag has entered handler */
  1465. dragTrackingEnterWindow = kDragTrackingEnterWindow, /* drag has entered window */
  1466. dragTrackingInWindow = kDragTrackingInWindow, /* drag is moving within window */
  1467. dragTrackingLeaveWindow = kDragTrackingLeaveWindow, /* drag has exited window */
  1468. dragTrackingLeaveHandler = kDragTrackingLeaveHandler /* drag has exited handler */
  1469. };
  1470. enum {
  1471. dragRegionBegin = kDragRegionBegin, /* initialize drawing */
  1472. dragRegionDraw = kDragRegionDraw, /* draw drag feedback */
  1473. dragRegionHide = kDragRegionHide, /* hide drag feedback */
  1474. dragRegionIdle = kDragRegionIdle, /* drag feedback idle time */
  1475. dragRegionEnd = kDragRegionEnd /* end of drawing */
  1476. };
  1477. enum {
  1478. zoomNoAcceleration = kZoomNoAcceleration, /* use linear interpolation */
  1479. zoomAccelerate = kZoomAccelerate, /* ramp up step size */
  1480. zoomDecelerate = kZoomDecelerate /* ramp down step size */
  1481. };
  1482. enum {
  1483. kDragStandardImage = kDragStandardTranslucency, /* 65% image translucency (standard)*/
  1484. kDragDarkImage = kDragDarkTranslucency, /* 50% image translucency*/
  1485. kDragDarkerImage = kDragDarkerTranslucency, /* 25% image translucency*/
  1486. kDragOpaqueImage = kDragOpaqueTranslucency /* 0% image translucency (opaque)*/
  1487. };
  1488. #endif /* OLDROUTINENAMES */
  1489. #if PRAGMA_STRUCT_ALIGN
  1490. #pragma options align=reset
  1491. #elif PRAGMA_STRUCT_PACKPUSH
  1492. #pragma pack(pop)
  1493. #elif PRAGMA_STRUCT_PACK
  1494. #pragma pack()
  1495. #endif
  1496. #ifdef PRAGMA_IMPORT_OFF
  1497. #pragma import off
  1498. #elif PRAGMA_IMPORT
  1499. #pragma import reset
  1500. #endif
  1501. #ifdef __cplusplus
  1502. }
  1503. #endif
  1504. #endif /* __DRAG__ */