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.

6103 lines
211 KiB

  1. /*
  2. File: ControlDefinitions.h
  3. Contains: Definitions of controls provided by the Control Manager
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1999-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 __CONTROLDEFINITIONS__
  11. #define __CONTROLDEFINITIONS__
  12. #ifndef __MACTYPES__
  13. #include <MacTypes.h>
  14. #endif
  15. #ifndef __CFSTRING__
  16. #include <CFString.h>
  17. #endif
  18. #ifndef __APPEARANCE__
  19. #include <Appearance.h>
  20. #endif
  21. #ifndef __CARBONEVENTS__
  22. #include <CarbonEvents.h>
  23. #endif
  24. #ifndef __CONTROLS__
  25. #include <Controls.h>
  26. #endif
  27. #ifndef __LISTS__
  28. #include <Lists.h>
  29. #endif
  30. #ifndef __MACHELP__
  31. #include <MacHelp.h>
  32. #endif
  33. #ifndef __MENUS__
  34. #include <Menus.h>
  35. #endif
  36. #if PRAGMA_ONCE
  37. #pragma once
  38. #endif
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42. #if PRAGMA_IMPORT
  43. #pragma import on
  44. #endif
  45. #if PRAGMA_STRUCT_ALIGN
  46. #pragma options align=mac68k
  47. #elif PRAGMA_STRUCT_PACKPUSH
  48. #pragma pack(push, 2)
  49. #elif PRAGMA_STRUCT_PACK
  50. #pragma pack(2)
  51. #endif
  52. /*
  53. * ControlDefinitions.h
  54. *
  55. * Discussion:
  56. * System software supplies a variety of controls for your
  57. * applications to use. They are described herein.
  58. */
  59. /*------------------------------------------------------------------------------------------------------*/
  60. /* o Resource Types */
  61. /*------------------------------------------------------------------------------------------------------*/
  62. enum {
  63. kControlTabListResType = FOUR_CHAR_CODE('tab#'), /* used for tab control (Appearance 1.0 and later)*/
  64. kControlListDescResType = FOUR_CHAR_CODE('ldes') /* used for list box control (Appearance 1.0 and later)*/
  65. };
  66. /*--------------------------------------------------------------------------------------*/
  67. /* o Check Box Values */
  68. /*--------------------------------------------------------------------------------------*/
  69. enum {
  70. kControlCheckBoxUncheckedValue = 0,
  71. kControlCheckBoxCheckedValue = 1,
  72. kControlCheckBoxMixedValue = 2
  73. };
  74. /*--------------------------------------------------------------------------------------*/
  75. /* o Radio Button Values */
  76. /*--------------------------------------------------------------------------------------*/
  77. enum {
  78. kControlRadioButtonUncheckedValue = 0,
  79. kControlRadioButtonCheckedValue = 1,
  80. kControlRadioButtonMixedValue = 2
  81. };
  82. /*--------------------------------------------------------------------------------------*/
  83. /* o Pop-Up Menu Control Constants */
  84. /*--------------------------------------------------------------------------------------*/
  85. /* Variant codes for the System 7 pop-up menu*/
  86. enum {
  87. popupFixedWidth = 1 << 0,
  88. popupVariableWidth = 1 << 1,
  89. popupUseAddResMenu = 1 << 2,
  90. popupUseWFont = 1 << 3
  91. };
  92. /* Menu label styles for the System 7 pop-up menu*/
  93. enum {
  94. popupTitleBold = 1 << 8,
  95. popupTitleItalic = 1 << 9,
  96. popupTitleUnderline = 1 << 10,
  97. popupTitleOutline = 1 << 11,
  98. popupTitleShadow = 1 << 12,
  99. popupTitleCondense = 1 << 13,
  100. popupTitleExtend = 1 << 14,
  101. popupTitleNoStyle = 1 << 15
  102. };
  103. /* Menu label justifications for the System 7 pop-up menu*/
  104. enum {
  105. popupTitleLeftJust = 0x00000000,
  106. popupTitleCenterJust = 0x00000001,
  107. popupTitleRightJust = 0x000000FF
  108. };
  109. /*------------------------------------------------------------------------------------------------------*/
  110. /* o PopUp Menu Private Data Structure */
  111. /*------------------------------------------------------------------------------------------------------*/
  112. #if !OPAQUE_TOOLBOX_STRUCTS
  113. struct PopupPrivateData {
  114. MenuRef mHandle;
  115. SInt16 mID;
  116. };
  117. typedef struct PopupPrivateData PopupPrivateData;
  118. typedef PopupPrivateData * PopupPrivateDataPtr;
  119. typedef PopupPrivateDataPtr * PopupPrivateDataHandle;
  120. #endif /* !OPAQUE_TOOLBOX_STRUCTS */
  121. /*------------------------------------------------------------------------------------------------------*/
  122. /* o Control Definition ID's */
  123. /*------------------------------------------------------------------------------------------------------*/
  124. /* Standard System 7 procIDs*/
  125. enum {
  126. pushButProc = 0,
  127. checkBoxProc = 1,
  128. radioButProc = 2,
  129. scrollBarProc = 16,
  130. popupMenuProc = 1008
  131. };
  132. /*--------------------------------------------------------------------------------------*/
  133. /* o Control Part Codes */
  134. /*--------------------------------------------------------------------------------------*/
  135. enum {
  136. kControlLabelPart = 1,
  137. kControlMenuPart = 2,
  138. kControlTrianglePart = 4,
  139. kControlEditTextPart = 5, /* Appearance 1.0 and later*/
  140. kControlPicturePart = 6, /* Appearance 1.0 and later*/
  141. kControlIconPart = 7, /* Appearance 1.0 and later*/
  142. kControlClockPart = 8, /* Appearance 1.0 and later*/
  143. kControlListBoxPart = 24, /* Appearance 1.0 and later*/
  144. kControlListBoxDoubleClickPart = 25, /* Appearance 1.0 and later*/
  145. kControlImageWellPart = 26, /* Appearance 1.0 and later*/
  146. kControlRadioGroupPart = 27, /* Appearance 1.0.2 and later*/
  147. kControlButtonPart = 10,
  148. kControlCheckBoxPart = 11,
  149. kControlRadioButtonPart = 11,
  150. kControlUpButtonPart = 20,
  151. kControlDownButtonPart = 21,
  152. kControlPageUpPart = 22,
  153. kControlPageDownPart = 23,
  154. kControlClockHourDayPart = 9, /* Appearance 1.1 and later*/
  155. kControlClockMinuteMonthPart = 10, /* Appearance 1.1 and later*/
  156. kControlClockSecondYearPart = 11, /* Appearance 1.1 and later*/
  157. kControlClockAMPMPart = 12, /* Appearance 1.1 and later*/
  158. kControlDataBrowserPart = 24, /* CarbonLib 1.0 and later*/
  159. kControlDataBrowserDraggedPart = 25 /* CarbonLib 1.0 and later*/
  160. };
  161. /*------------------------------------------------------------------------------------------------------*/
  162. /* o Control Types and ID's available only with Appearance 1.0 and later */
  163. /*------------------------------------------------------------------------------------------------------*/
  164. /*--------------------------------------------------------------------------------------*/
  165. /* o BEVEL BUTTON INTERFACE (CDEF 2) */
  166. /*--------------------------------------------------------------------------------------*/
  167. /* Bevel buttons allow you to control the content type (pict/icon/etc.), the behavior */
  168. /* (pushbutton/toggle/sticky), and the bevel size. You also have the option of */
  169. /* attaching a menu to it. When a menu is present, you can specify which way the */
  170. /* popup arrow is facing (down or right). */
  171. /* */
  172. /* This is all made possible by overloading the Min, Max, and Value parameters for the */
  173. /* control, as well as adjusting the variant. Here's the breakdown of what goes where: */
  174. /* */
  175. /* Parameter What Goes Here */
  176. /* ------------------- ---------------------------------------------------- */
  177. /* Min Hi Byte = Behavior, Lo Byte = content type. */
  178. /* Max ResID for resource-based content types. */
  179. /* Value MenuID to attach, 0 = no menu, please. */
  180. /* */
  181. /* The variant is broken down into two halfs. The low 2 bits control the bevel type. */
  182. /* Bit 2 controls the popup arrow direction (if a menu is present) and bit 3 controls */
  183. /* whether or not to use the control's owning window's font. */
  184. /* */
  185. /* Constants for all you need to put this together are below. The values for behaviors */
  186. /* are set up so that you can simply add them to the content type and pass them into */
  187. /* the Min parameter of NewControl. */
  188. /* */
  189. /* An example call: */
  190. /* */
  191. /* control = NewControl( window, &bounds, "\p", true, 0, kControlContentIconSuiteRes + */
  192. /* kBehaviorToggles, myIconSuiteID, bevelButtonSmallBevelProc, */
  193. /* 0L ); */
  194. /* */
  195. /* Attaching a menu: */
  196. /* */
  197. /* control = NewControl( window, &bounds, "\p", true, kMyMenuID, */
  198. /* kControlContentIconSuiteRes, myIconSuiteID, bevelButtonSmallBevelProc + */
  199. /* kBevelButtonMenuOnRight, 0L ); */
  200. /* */
  201. /* This will attach menu ID kMyMenuID to the button, with the popup arrow facing right.*/
  202. /* This also puts the menu up to the right of the button. You can also specify that a */
  203. /* menu can have multiple items checked at once by adding kBehaviorMultiValueMenus */
  204. /* into the Min parameter. If you do use multivalue menus, the GetBevelButtonMenuValue */
  205. /* helper function will return the last item chosen from the menu, whether or not it */
  206. /* was checked. */
  207. /* */
  208. /* NOTE: Bevel buttons with menus actually have *two* values. The value of the */
  209. /* button (on/off), and the value of the menu. The menu value can be gotten */
  210. /* with the GetBevelButtonMenuValue helper function. */
  211. /* */
  212. /* Handle-based Content */
  213. /* -------------------- */
  214. /* You can create your control and then set the content to an existing handle to an */
  215. /* icon suite, etc. using the macros below. Please keep in mind that resource-based */
  216. /* content is owned by the control, handle-based content is owned by you. The CDEF will*/
  217. /* not try to dispose of handle-based content. If you are changing the content type of */
  218. /* the button on the fly, you must make sure that if you are replacing a handle- */
  219. /* based content with a resource-based content to properly dispose of the handle, */
  220. /* else a memory leak will ensue. */
  221. /* */
  222. /* Bevel Button Proc IDs */
  223. enum {
  224. kControlBevelButtonSmallBevelProc = 32,
  225. kControlBevelButtonNormalBevelProc = 33,
  226. kControlBevelButtonLargeBevelProc = 34
  227. };
  228. /* Add these variant codes to kBevelButtonSmallBevelProc to change the type of button */
  229. enum {
  230. kControlBevelButtonSmallBevelVariant = 0,
  231. kControlBevelButtonNormalBevelVariant = (1 << 0),
  232. kControlBevelButtonLargeBevelVariant = (1 << 1),
  233. kControlBevelButtonMenuOnRightVariant = (1 << 2)
  234. };
  235. /* Bevel Thicknesses */
  236. typedef UInt16 ControlBevelThickness;
  237. enum {
  238. kControlBevelButtonSmallBevel = 0,
  239. kControlBevelButtonNormalBevel = 1,
  240. kControlBevelButtonLargeBevel = 2
  241. };
  242. /* Behaviors of bevel buttons. These are set up so you can add */
  243. /* them together with the content types. */
  244. enum {
  245. kControlBehaviorPushbutton = 0,
  246. kControlBehaviorToggles = 0x0100,
  247. kControlBehaviorSticky = 0x0200,
  248. kControlBehaviorSingleValueMenu = 0,
  249. kControlBehaviorMultiValueMenu = 0x4000, /* only makes sense when a menu is attached.*/
  250. kControlBehaviorOffsetContents = 0x8000
  251. };
  252. /* Behaviors for 1.0.1 or later */
  253. enum {
  254. kControlBehaviorCommandMenu = 0x2000 /* menu holds commands, not choices. Overrides multi-value bit.*/
  255. };
  256. typedef UInt16 ControlBevelButtonBehavior;
  257. typedef UInt16 ControlBevelButtonMenuBehavior;
  258. /* Bevel Button Menu Placements */
  259. typedef UInt16 ControlBevelButtonMenuPlacement;
  260. enum {
  261. kControlBevelButtonMenuOnBottom = 0,
  262. kControlBevelButtonMenuOnRight = (1 << 2)
  263. };
  264. /* Control Kind Tag */
  265. enum {
  266. kControlKindBevelButton = FOUR_CHAR_CODE('bevl')
  267. };
  268. /* Creation API: Carbon Only */
  269. /*
  270. * CreateBevelButtonControl()
  271. *
  272. * Availability:
  273. * Non-Carbon CFM: not available
  274. * CarbonLib: in CarbonLib 1.1 and later
  275. * Mac OS X: in version 10.0 and later
  276. */
  277. EXTERN_API( OSStatus )
  278. CreateBevelButtonControl(
  279. WindowRef window,
  280. const Rect * boundsRect,
  281. CFStringRef title,
  282. ControlBevelThickness thickness,
  283. ControlBevelButtonBehavior behavior,
  284. ControlButtonContentInfoPtr info,
  285. SInt16 menuID,
  286. ControlBevelButtonMenuBehavior menuBehavior,
  287. ControlBevelButtonMenuPlacement menuPlacement,
  288. ControlRef * outControl);
  289. /* Graphic Alignments */
  290. typedef SInt16 ControlButtonGraphicAlignment;
  291. enum {
  292. kControlBevelButtonAlignSysDirection = -1, /* only left or right*/
  293. kControlBevelButtonAlignCenter = 0,
  294. kControlBevelButtonAlignLeft = 1,
  295. kControlBevelButtonAlignRight = 2,
  296. kControlBevelButtonAlignTop = 3,
  297. kControlBevelButtonAlignBottom = 4,
  298. kControlBevelButtonAlignTopLeft = 5,
  299. kControlBevelButtonAlignBottomLeft = 6,
  300. kControlBevelButtonAlignTopRight = 7,
  301. kControlBevelButtonAlignBottomRight = 8
  302. };
  303. /* Text Alignments */
  304. typedef SInt16 ControlButtonTextAlignment;
  305. enum {
  306. kControlBevelButtonAlignTextSysDirection = teFlushDefault,
  307. kControlBevelButtonAlignTextCenter = teCenter,
  308. kControlBevelButtonAlignTextFlushRight = teFlushRight,
  309. kControlBevelButtonAlignTextFlushLeft = teFlushLeft
  310. };
  311. /* Text Placements */
  312. typedef SInt16 ControlButtonTextPlacement;
  313. enum {
  314. kControlBevelButtonPlaceSysDirection = -1, /* if graphic on right, then on left*/
  315. kControlBevelButtonPlaceNormally = 0,
  316. kControlBevelButtonPlaceToRightOfGraphic = 1,
  317. kControlBevelButtonPlaceToLeftOfGraphic = 2,
  318. kControlBevelButtonPlaceBelowGraphic = 3,
  319. kControlBevelButtonPlaceAboveGraphic = 4
  320. };
  321. /* Data tags supported by the bevel button controls */
  322. enum {
  323. kControlBevelButtonContentTag = FOUR_CHAR_CODE('cont'), /* ButtonContentInfo*/
  324. kControlBevelButtonTransformTag = FOUR_CHAR_CODE('tran'), /* IconTransformType*/
  325. kControlBevelButtonTextAlignTag = FOUR_CHAR_CODE('tali'), /* ButtonTextAlignment*/
  326. kControlBevelButtonTextOffsetTag = FOUR_CHAR_CODE('toff'), /* SInt16*/
  327. kControlBevelButtonGraphicAlignTag = FOUR_CHAR_CODE('gali'), /* ButtonGraphicAlignment*/
  328. kControlBevelButtonGraphicOffsetTag = FOUR_CHAR_CODE('goff'), /* Point*/
  329. kControlBevelButtonTextPlaceTag = FOUR_CHAR_CODE('tplc'), /* ButtonTextPlacement*/
  330. kControlBevelButtonMenuValueTag = FOUR_CHAR_CODE('mval'), /* SInt16*/
  331. kControlBevelButtonMenuHandleTag = FOUR_CHAR_CODE('mhnd'), /* MenuRef*/
  332. kControlBevelButtonMenuRefTag = FOUR_CHAR_CODE('mhnd'), /* MenuRef*/
  333. kControlBevelButtonCenterPopupGlyphTag = FOUR_CHAR_CODE('pglc') /* Boolean: true = center, false = bottom right*/
  334. };
  335. /* These are tags in 1.0.1 or later */
  336. enum {
  337. kControlBevelButtonLastMenuTag = FOUR_CHAR_CODE('lmnu'), /* SInt16: menuID of last menu item selected from*/
  338. kControlBevelButtonMenuDelayTag = FOUR_CHAR_CODE('mdly') /* SInt32: ticks to delay before menu appears*/
  339. };
  340. /* tags available with Appearance 1.1 or later */
  341. enum {
  342. /* Boolean: True = if an icon of the ideal size for*/
  343. /* the button isn't available, scale a larger or*/
  344. /* smaller icon to the ideal size. False = don't*/
  345. /* scale; draw a smaller icon or clip a larger icon.*/
  346. /* Default is false. Only applies to IconSuites and*/
  347. kControlBevelButtonScaleIconTag = FOUR_CHAR_CODE('scal') /* IconRefs.*/
  348. };
  349. /* tags available in Mac OS X and later */
  350. enum {
  351. kControlBevelButtonOwnedMenuRefTag = FOUR_CHAR_CODE('omrf'), /* MenuRef (control will dispose)*/
  352. kControlBevelButtonKindTag = FOUR_CHAR_CODE('bebk') /* ThemeButtonKind ( kTheme[Small,Medium,Large,Rounded]BevelButton )*/
  353. };
  354. /* Helper routines are available only thru the shared library/glue. */
  355. /*
  356. * GetBevelButtonMenuValue()
  357. *
  358. * Availability:
  359. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  360. * CarbonLib: in CarbonLib 1.0 and later
  361. * Mac OS X: in version 10.0 and later
  362. */
  363. EXTERN_API( OSErr )
  364. GetBevelButtonMenuValue(
  365. ControlRef inButton,
  366. SInt16 * outValue);
  367. /*
  368. * SetBevelButtonMenuValue()
  369. *
  370. * Availability:
  371. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  372. * CarbonLib: in CarbonLib 1.0 and later
  373. * Mac OS X: in version 10.0 and later
  374. */
  375. EXTERN_API( OSErr )
  376. SetBevelButtonMenuValue(
  377. ControlRef inButton,
  378. SInt16 inValue);
  379. /*
  380. * GetBevelButtonMenuHandle()
  381. *
  382. * Availability:
  383. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  384. * CarbonLib: in CarbonLib 1.0 and later
  385. * Mac OS X: in version 10.0 and later
  386. */
  387. EXTERN_API( OSErr )
  388. GetBevelButtonMenuHandle(
  389. ControlRef inButton,
  390. MenuHandle * outHandle);
  391. #define GetBevelButtonMenuRef GetBevelButtonMenuHandle
  392. /*
  393. * GetBevelButtonContentInfo()
  394. *
  395. * Availability:
  396. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  397. * CarbonLib: in CarbonLib 1.0 and later
  398. * Mac OS X: in version 10.0 and later
  399. */
  400. EXTERN_API( OSErr )
  401. GetBevelButtonContentInfo(
  402. ControlRef inButton,
  403. ControlButtonContentInfoPtr outContent);
  404. /*
  405. * SetBevelButtonContentInfo()
  406. *
  407. * Availability:
  408. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  409. * CarbonLib: in CarbonLib 1.0 and later
  410. * Mac OS X: in version 10.0 and later
  411. */
  412. EXTERN_API( OSErr )
  413. SetBevelButtonContentInfo(
  414. ControlRef inButton,
  415. ControlButtonContentInfoPtr inContent);
  416. /*
  417. * SetBevelButtonTransform()
  418. *
  419. * Availability:
  420. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  421. * CarbonLib: in CarbonLib 1.0 and later
  422. * Mac OS X: in version 10.0 and later
  423. */
  424. EXTERN_API( OSErr )
  425. SetBevelButtonTransform(
  426. ControlRef inButton,
  427. IconTransformType transform);
  428. /*
  429. * SetBevelButtonGraphicAlignment()
  430. *
  431. * Availability:
  432. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  433. * CarbonLib: in CarbonLib 1.0 and later
  434. * Mac OS X: in version 10.0 and later
  435. */
  436. EXTERN_API( OSErr )
  437. SetBevelButtonGraphicAlignment(
  438. ControlRef inButton,
  439. ControlButtonGraphicAlignment inAlign,
  440. SInt16 inHOffset,
  441. SInt16 inVOffset);
  442. /*
  443. * SetBevelButtonTextAlignment()
  444. *
  445. * Availability:
  446. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  447. * CarbonLib: in CarbonLib 1.0 and later
  448. * Mac OS X: in version 10.0 and later
  449. */
  450. EXTERN_API( OSErr )
  451. SetBevelButtonTextAlignment(
  452. ControlRef inButton,
  453. ControlButtonTextAlignment inAlign,
  454. SInt16 inHOffset);
  455. /*
  456. * SetBevelButtonTextPlacement()
  457. *
  458. * Availability:
  459. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  460. * CarbonLib: in CarbonLib 1.0 and later
  461. * Mac OS X: in version 10.0 and later
  462. */
  463. EXTERN_API( OSErr )
  464. SetBevelButtonTextPlacement(
  465. ControlRef inButton,
  466. ControlButtonTextPlacement inWhere);
  467. /*--------------------------------------------------------------------------------------*/
  468. /* o SLIDER (CDEF 3) */
  469. /*--------------------------------------------------------------------------------------*/
  470. /* There are several variants that control the behavior of the slider control. Any */
  471. /* combination of the following three constants can be added to the basic CDEF ID */
  472. /* (kSliderProc). */
  473. /* */
  474. /* Variants: */
  475. /* */
  476. /* kSliderLiveFeedback Slider does not use "ghosted" indicator when tracking. */
  477. /* ActionProc is called (set via SetControlAction) as the */
  478. /* indicator is dragged. The value is updated so that the */
  479. /* actionproc can adjust some other property based on the */
  480. /* value each time the action proc is called. If no action */
  481. /* proc is installed, it reverts to the ghost indicator. */
  482. /* */
  483. /* kSliderHasTickMarks Slider is drawn with 'tick marks'. The control */
  484. /* rectangle must be large enough to accomidate the tick */
  485. /* marks. */
  486. /* */
  487. /* kSliderReverseDirection Slider thumb points in opposite direction than normal. */
  488. /* If the slider is vertical, the thumb will point to the */
  489. /* left, if the slider is horizontal, the thumb will point */
  490. /* upwards. */
  491. /* */
  492. /* kSliderNonDirectional This option overrides the kSliderReverseDirection and */
  493. /* kSliderHasTickMarks variants. It creates an indicator */
  494. /* which is rectangular and doesn't point in any direction */
  495. /* like the normal indicator does. */
  496. /* Slider proc ID and variants */
  497. enum {
  498. kControlSliderProc = 48,
  499. kControlSliderLiveFeedback = (1 << 0),
  500. kControlSliderHasTickMarks = (1 << 1),
  501. kControlSliderReverseDirection = (1 << 2),
  502. kControlSliderNonDirectional = (1 << 3)
  503. };
  504. /* Slider Orientation */
  505. typedef UInt16 ControlSliderOrientation;
  506. enum {
  507. kControlSliderPointsDownOrRight = 0,
  508. kControlSliderPointsUpOrLeft = 1,
  509. kControlSliderDoesNotPoint = 2
  510. };
  511. /* Control Kind Tag */
  512. enum {
  513. kControlKindSlider = FOUR_CHAR_CODE('sldr')
  514. };
  515. /* Creation API: Carbon Only */
  516. /*
  517. * CreateSliderControl()
  518. *
  519. * Availability:
  520. * Non-Carbon CFM: not available
  521. * CarbonLib: in CarbonLib 1.1 and later
  522. * Mac OS X: in version 10.0 and later
  523. */
  524. EXTERN_API( OSStatus )
  525. CreateSliderControl(
  526. WindowRef window,
  527. const Rect * boundsRect,
  528. SInt32 value,
  529. SInt32 minimum,
  530. SInt32 maximum,
  531. ControlSliderOrientation orientation,
  532. UInt16 numTickMarks,
  533. Boolean liveTracking,
  534. ControlActionUPP liveTrackingProc,
  535. ControlRef * outControl);
  536. /*--------------------------------------------------------------------------------------*/
  537. /* o DISCLOSURE TRIANGLE (CDEF 4) */
  538. /*--------------------------------------------------------------------------------------*/
  539. /* This control can be used as either left or right facing. It can also handle its own */
  540. /* tracking if you wish. This means that when the 'autotoggle' variant is used, if the */
  541. /* user clicks the control, it's state will change automatically from open to closed */
  542. /* and vice-versa depending on its initial state. After a successful call to Track- */
  543. /* Control, you can just check the current value to see what state it was switched to. */
  544. /* Triangle proc IDs */
  545. enum {
  546. kControlTriangleProc = 64,
  547. kControlTriangleLeftFacingProc = 65,
  548. kControlTriangleAutoToggleProc = 66,
  549. kControlTriangleLeftFacingAutoToggleProc = 67
  550. };
  551. typedef UInt16 ControlDisclosureTriangleOrientation;
  552. enum {
  553. kControlDisclosureTrianglePointDefault = 0, /* points right on a left-to-right script system (Mac OS X and later or CarbonLib 1.5 and later only)*/
  554. kControlDisclosureTrianglePointRight = 1,
  555. kControlDisclosureTrianglePointLeft = 2
  556. };
  557. /* Control Kind Tag */
  558. enum {
  559. kControlKindDisclosureTriangle = FOUR_CHAR_CODE('dist')
  560. };
  561. /*
  562. * CreateDisclosureTriangleControl()
  563. *
  564. * Summary:
  565. * Creates a Disclosure Triangle control at a specific position in
  566. * the specified window.
  567. *
  568. * Discussion:
  569. * Disclosure Triangles are small controls that give the user a way
  570. * to toggle the visibility of information or other user interface.
  571. * When information is in a hidden state, a Disclosure Triangle is
  572. * considered "closed" and should point to the right (or sometimes
  573. * to the left). When the user clicks on it, the Disclosure Triangle
  574. * rotates downwards into the "open" state. The application should
  575. * repond by revealing the appropriate information or interface. On
  576. * Mac OS X, a root control will be created for the window if one
  577. * does not already exist. If a root control exists for the window,
  578. * the Disclosure Triangle control will be embedded into it.
  579. *
  580. * Parameters:
  581. *
  582. * inWindow:
  583. * The WindowRef into which the Disclosure Triangle will be
  584. * created.
  585. *
  586. * inBoundsRect:
  587. * The desired position (in coordinates local to the window's
  588. * port) for the Disclosure Triangle.
  589. *
  590. * inOrientation:
  591. * The direction the Disclosure Triangle should point when it is
  592. * "closed". Passing kControlDisclosureTrianglePointDefault is
  593. * only legal as of Mac OS X and CarbonLib 1.5.
  594. *
  595. * inTitle:
  596. * The title for the Disclosure Triangle. The title will only be
  597. * displayed if the inDrawTitle parameter is true. Title display
  598. * only works on Mac OS X.
  599. *
  600. * inInitialValue:
  601. * The starting value determines whether the Disclosure Triangle
  602. * is initially in its "open" or "closed" state. The value 0
  603. * represents the "closed" state and 1 represents the "open" state.
  604. *
  605. * inDrawTitle:
  606. * A Boolean indicating whether the Disclosure Triangle should
  607. * draw its title next to the widget. Title display only works on
  608. * Mac OS X.
  609. *
  610. * inAutoToggles:
  611. * A Boolean indicating whether the Disclosure Triangle should
  612. * change its own value (from "open" to "closed" and vice-versa)
  613. * automatically when it is clicked on.
  614. *
  615. * outControl:
  616. * On successful output, outControl will contain a reference to
  617. * the Disclosure Triangle control.
  618. *
  619. * Result:
  620. * An OSStatus code indicating success or failure.
  621. *
  622. * Availability:
  623. * Non-Carbon CFM: not available
  624. * CarbonLib: in CarbonLib 1.1 and later
  625. * Mac OS X: in version 10.0 and later
  626. */
  627. EXTERN_API( OSStatus )
  628. CreateDisclosureTriangleControl(
  629. WindowRef inWindow,
  630. const Rect * inBoundsRect,
  631. ControlDisclosureTriangleOrientation inOrientation,
  632. CFStringRef inTitle,
  633. SInt32 inInitialValue,
  634. Boolean inDrawTitle,
  635. Boolean inAutoToggles,
  636. ControlRef * outControl);
  637. /* Tagged data supported by disclosure triangles */
  638. enum {
  639. kControlTriangleLastValueTag = FOUR_CHAR_CODE('last') /* SInt16*/
  640. };
  641. /* Helper routines are available only thru the shared library/glue. */
  642. /*
  643. * SetDisclosureTriangleLastValue()
  644. *
  645. * Availability:
  646. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  647. * CarbonLib: in CarbonLib 1.0 and later
  648. * Mac OS X: in version 10.0 and later
  649. */
  650. EXTERN_API( OSErr )
  651. SetDisclosureTriangleLastValue(
  652. ControlRef inTabControl,
  653. SInt16 inValue);
  654. /*--------------------------------------------------------------------------------------*/
  655. /* o PROGRESS INDICATOR (CDEF 5) */
  656. /*--------------------------------------------------------------------------------------*/
  657. /* This CDEF implements both determinate and indeterminate progress bars. To switch, */
  658. /* just use SetControlData to set the indeterminate flag to make it indeterminate call */
  659. /* IdleControls to step thru the animation. IdleControls should be called at least */
  660. /* once during your event loop. */
  661. /* */
  662. /* We also use this same CDEF for Relevance bars. At this time this control does not */
  663. /* idle. */
  664. /* Progress Bar proc IDs */
  665. enum {
  666. kControlProgressBarProc = 80,
  667. kControlRelevanceBarProc = 81
  668. };
  669. /* Control Kind Tag */
  670. enum {
  671. kControlKindProgressBar = FOUR_CHAR_CODE('prgb'),
  672. kControlKindRelevanceBar = FOUR_CHAR_CODE('relb')
  673. };
  674. /* Creation API: Carbon only */
  675. /*
  676. * CreateProgressBarControl()
  677. *
  678. * Availability:
  679. * Non-Carbon CFM: not available
  680. * CarbonLib: in CarbonLib 1.1 and later
  681. * Mac OS X: in version 10.0 and later
  682. */
  683. EXTERN_API( OSStatus )
  684. CreateProgressBarControl(
  685. WindowRef window,
  686. const Rect * boundsRect,
  687. SInt32 value,
  688. SInt32 minimum,
  689. SInt32 maximum,
  690. Boolean indeterminate,
  691. ControlRef * outControl);
  692. /*
  693. * CreateRelevanceBarControl()
  694. *
  695. * Availability:
  696. * Non-Carbon CFM: not available
  697. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  698. * Mac OS X: in version 10.0 and later
  699. */
  700. EXTERN_API( OSStatus )
  701. CreateRelevanceBarControl(
  702. WindowRef window,
  703. const Rect * boundsRect,
  704. SInt32 value,
  705. SInt32 minimum,
  706. SInt32 maximum,
  707. ControlRef * outControl);
  708. /* Tagged data supported by progress bars */
  709. enum {
  710. kControlProgressBarIndeterminateTag = FOUR_CHAR_CODE('inde'), /* Boolean*/
  711. kControlProgressBarAnimatingTag = FOUR_CHAR_CODE('anim') /* Boolean*/
  712. };
  713. /*--------------------------------------------------------------------------------------*/
  714. /* o LITTLE ARROWS (CDEF 6) */
  715. /*--------------------------------------------------------------------------------------*/
  716. /* This control implements the little up and down arrows you'd see in the Memory */
  717. /* control panel for adjusting the cache size. */
  718. /* Little Arrows proc IDs */
  719. enum {
  720. kControlLittleArrowsProc = 96
  721. };
  722. /* Control Kind Tag */
  723. enum {
  724. kControlKindLittleArrows = FOUR_CHAR_CODE('larr')
  725. };
  726. /* Creation API: Carbon only */
  727. /*
  728. * CreateLittleArrowsControl()
  729. *
  730. * Availability:
  731. * Non-Carbon CFM: not available
  732. * CarbonLib: in CarbonLib 1.1 and later
  733. * Mac OS X: in version 10.0 and later
  734. */
  735. EXTERN_API( OSStatus )
  736. CreateLittleArrowsControl(
  737. WindowRef window,
  738. const Rect * boundsRect,
  739. SInt32 value,
  740. SInt32 minimum,
  741. SInt32 maximum,
  742. SInt32 increment,
  743. ControlRef * outControl);
  744. /*--------------------------------------------------------------------------------------*/
  745. /* o CHASING ARROWS (CDEF 7) */
  746. /*--------------------------------------------------------------------------------------*/
  747. /* To animate this control, make sure to call IdleControls repeatedly. */
  748. /* */
  749. /* Chasing Arrows proc IDs */
  750. enum {
  751. kControlChasingArrowsProc = 112
  752. };
  753. /* Control Kind Tag */
  754. enum {
  755. kControlKindChasingArrows = FOUR_CHAR_CODE('carr')
  756. };
  757. /* Creation API: Carbon only */
  758. /*
  759. * CreateChasingArrowsControl()
  760. *
  761. * Availability:
  762. * Non-Carbon CFM: not available
  763. * CarbonLib: in CarbonLib 1.1 and later
  764. * Mac OS X: in version 10.0 and later
  765. */
  766. EXTERN_API( OSStatus )
  767. CreateChasingArrowsControl(
  768. WindowRef window,
  769. const Rect * boundsRect,
  770. ControlRef * outControl);
  771. /* Tagged data supported by the Chasing Arrows control */
  772. enum {
  773. kControlChasingArrowsAnimatingTag = FOUR_CHAR_CODE('anim') /* Boolean*/
  774. };
  775. /*--------------------------------------------------------------------------------------*/
  776. /* o TABS (CDEF 8) */
  777. /*--------------------------------------------------------------------------------------*/
  778. /* Tabs use an auxiliary resource (tab#) to hold tab information such as the tab name */
  779. /* and an icon suite ID for each tab. */
  780. /* */
  781. /* The ID of the tab# resource that you wish to associate with a tab control should */
  782. /* be passed in as the Value parameter of the control. If you are using GetNewControl, */
  783. /* then the Value slot in the CNTL resource should have the ID of the 'tab#' resource */
  784. /* on creation. */
  785. /* */
  786. /* Passing zero in for the tab# resource tells the control not to read in a tab# res. */
  787. /* You can then use SetControlMaximum to add tabs, followed by a call to SetControlData*/
  788. /* with the kControlTabInfoTag, passing in a pointer to a ControlTabInfoRec. This sets */
  789. /* the name and optionally an icon for a tab. */
  790. /* Tabs proc IDs */
  791. enum {
  792. kControlTabLargeProc = 128, /* Large tab size, north facing */
  793. kControlTabSmallProc = 129, /* Small tab size, north facing */
  794. kControlTabLargeNorthProc = 128, /* Large tab size, north facing */
  795. kControlTabSmallNorthProc = 129, /* Small tab size, north facing */
  796. kControlTabLargeSouthProc = 130, /* Large tab size, south facing */
  797. kControlTabSmallSouthProc = 131, /* Small tab size, south facing */
  798. kControlTabLargeEastProc = 132, /* Large tab size, east facing */
  799. kControlTabSmallEastProc = 133, /* Small tab size, east facing */
  800. kControlTabLargeWestProc = 134, /* Large tab size, west facing */
  801. kControlTabSmallWestProc = 135 /* Small tab size, west facing */
  802. };
  803. /* Tab Directions */
  804. typedef UInt16 ControlTabDirection;
  805. enum {
  806. kControlTabDirectionNorth = 0,
  807. kControlTabDirectionSouth = 1,
  808. kControlTabDirectionEast = 2,
  809. kControlTabDirectionWest = 3
  810. };
  811. /* Tab Sizes */
  812. typedef UInt16 ControlTabSize;
  813. enum {
  814. kControlTabSizeLarge = kControlSizeNormal,
  815. kControlTabSizeSmall = kControlSizeSmall
  816. };
  817. /* Control Tab Entry - used during creation */
  818. /* Note that the client is responsible for allocating/providing */
  819. /* the ControlButtonContentInfo and string storage for this */
  820. /* structure. */
  821. struct ControlTabEntry {
  822. ControlButtonContentInfo * icon;
  823. CFStringRef name;
  824. Boolean enabled;
  825. };
  826. typedef struct ControlTabEntry ControlTabEntry;
  827. /* Control Kind Tag */
  828. enum {
  829. kControlKindTabs = FOUR_CHAR_CODE('tabs')
  830. };
  831. /* Creation API: Carbon only */
  832. /*
  833. * CreateTabsControl()
  834. *
  835. * Availability:
  836. * Non-Carbon CFM: not available
  837. * CarbonLib: in CarbonLib 1.1 and later
  838. * Mac OS X: in version 10.0 and later
  839. */
  840. EXTERN_API( OSStatus )
  841. CreateTabsControl(
  842. WindowRef window,
  843. const Rect * boundsRect,
  844. ControlTabSize size,
  845. ControlTabDirection direction,
  846. UInt16 numTabs,
  847. const ControlTabEntry * tabArray,
  848. ControlRef * outControl);
  849. /* Tagged data supported by tabs */
  850. enum {
  851. kControlTabContentRectTag = FOUR_CHAR_CODE('rect'), /* Rect*/
  852. kControlTabEnabledFlagTag = FOUR_CHAR_CODE('enab'), /* Boolean*/
  853. kControlTabFontStyleTag = kControlFontStyleTag /* ControlFontStyleRec*/
  854. };
  855. /* New tags in 1.0.1 or later */
  856. enum {
  857. kControlTabInfoTag = FOUR_CHAR_CODE('tabi') /* ControlTabInfoRec*/
  858. };
  859. /* New tags in X 10.1 or later */
  860. enum {
  861. kControlTabImageContentTag = FOUR_CHAR_CODE('cont') /* ControlButtonContentInfo*/
  862. };
  863. enum {
  864. kControlTabInfoVersionZero = 0, /* ControlTabInfoRec*/
  865. kControlTabInfoVersionOne = 1 /* ControlTabInfoRecV1*/
  866. };
  867. struct ControlTabInfoRec {
  868. SInt16 version; /* version of this structure.*/
  869. SInt16 iconSuiteID; /* icon suite to use. Zero indicates no icon*/
  870. Str255 name; /* name to be displayed on the tab*/
  871. };
  872. typedef struct ControlTabInfoRec ControlTabInfoRec;
  873. struct ControlTabInfoRecV1 {
  874. SInt16 version; /* version of this structure. == kControlTabInfoVersionOne*/
  875. SInt16 iconSuiteID; /* icon suite to use. Zero indicates no icon*/
  876. CFStringRef name; /* name to be displayed on the tab. Will be retained so caller*/
  877. /* should always release it.*/
  878. };
  879. typedef struct ControlTabInfoRecV1 ControlTabInfoRecV1;
  880. /* Helper routines are available only thru the shared library/glue. */
  881. /*
  882. * GetTabContentRect()
  883. *
  884. * Availability:
  885. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  886. * CarbonLib: in CarbonLib 1.0 and later
  887. * Mac OS X: in version 10.0 and later
  888. */
  889. EXTERN_API( OSErr )
  890. GetTabContentRect(
  891. ControlRef inTabControl,
  892. Rect * outContentRect);
  893. /*
  894. * SetTabEnabled()
  895. *
  896. * Availability:
  897. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  898. * CarbonLib: in CarbonLib 1.0 and later
  899. * Mac OS X: in version 10.0 and later
  900. */
  901. EXTERN_API( OSErr )
  902. SetTabEnabled(
  903. ControlRef inTabControl,
  904. SInt16 inTabToHilite,
  905. Boolean inEnabled);
  906. /*--------------------------------------------------------------------------------------*/
  907. /* o VISUAL SEPARATOR (CDEF 9) */
  908. /*--------------------------------------------------------------------------------------*/
  909. /* Separator lines determine their orientation (horizontal or vertical) automatically */
  910. /* based on the relative height and width of their contrlRect. */
  911. /* Visual separator proc IDs */
  912. enum {
  913. kControlSeparatorLineProc = 144
  914. };
  915. /* Control Kind Tag */
  916. enum {
  917. kControlKindSeparator = FOUR_CHAR_CODE('sepa')
  918. };
  919. /* Creation API: Carbon only */
  920. /*
  921. * CreateSeparatorControl()
  922. *
  923. * Availability:
  924. * Non-Carbon CFM: not available
  925. * CarbonLib: in CarbonLib 1.1 and later
  926. * Mac OS X: in version 10.0 and later
  927. */
  928. EXTERN_API( OSStatus )
  929. CreateSeparatorControl(
  930. WindowRef window,
  931. const Rect * boundsRect,
  932. ControlRef * outControl);
  933. /*--------------------------------------------------------------------------------------*/
  934. /* o GROUP BOX (CDEF 10) */
  935. /*--------------------------------------------------------------------------------------*/
  936. /* The group box CDEF can be use in several ways. It can have no title, a text title, */
  937. /* a check box as the title, or a popup button as a title. There are two versions of */
  938. /* group boxes, primary and secondary, which look slightly different. */
  939. /* Group Box proc IDs */
  940. enum {
  941. kControlGroupBoxTextTitleProc = 160,
  942. kControlGroupBoxCheckBoxProc = 161,
  943. kControlGroupBoxPopupButtonProc = 162,
  944. kControlGroupBoxSecondaryTextTitleProc = 164,
  945. kControlGroupBoxSecondaryCheckBoxProc = 165,
  946. kControlGroupBoxSecondaryPopupButtonProc = 166
  947. };
  948. /* Control Kind Tag */
  949. enum {
  950. kControlKindGroupBox = FOUR_CHAR_CODE('grpb'),
  951. kControlKindCheckGroupBox = FOUR_CHAR_CODE('cgrp'),
  952. kControlKindPopupGroupBox = FOUR_CHAR_CODE('pgrp')
  953. };
  954. /* Creation APIs: Carbon only */
  955. /*
  956. * CreateGroupBoxControl()
  957. *
  958. * Summary:
  959. * Creates a group box control.
  960. *
  961. * Parameters:
  962. *
  963. * window:
  964. * The window that should contain the control.
  965. *
  966. * boundsRect:
  967. * The bounding box of the control.
  968. *
  969. * title:
  970. * The title of the control.
  971. *
  972. * primary:
  973. * Whether to create a primary or secondary group box.
  974. *
  975. * outControl:
  976. * On exit, contains the new control.
  977. *
  978. * Availability:
  979. * Non-Carbon CFM: not available
  980. * CarbonLib: in CarbonLib 1.1 and later
  981. * Mac OS X: in version 10.0 and later
  982. */
  983. EXTERN_API( OSStatus )
  984. CreateGroupBoxControl(
  985. WindowRef window,
  986. const Rect * boundsRect,
  987. CFStringRef title,
  988. Boolean primary,
  989. ControlRef * outControl);
  990. /*
  991. * CreateCheckGroupBoxControl()
  992. *
  993. * Summary:
  994. * Creates a group box control that has a check box as its title.
  995. *
  996. * Parameters:
  997. *
  998. * window:
  999. * The window that should contain the control.
  1000. *
  1001. * boundsRect:
  1002. * The bounding box of the control.
  1003. *
  1004. * title:
  1005. * The title of the control (used as the title of the check box).
  1006. *
  1007. * initialValue:
  1008. * The initial value of the check box.
  1009. *
  1010. * primary:
  1011. * Whether to create a primary or secondary group box.
  1012. *
  1013. * autoToggle:
  1014. * Whether to create an auto-toggling check box. Auto-toggling
  1015. * check box titles are only supported on Mac OS X; this parameter
  1016. * must be false when used with CarbonLib.
  1017. *
  1018. * outControl:
  1019. * On exit, contains the new control.
  1020. *
  1021. * Availability:
  1022. * Non-Carbon CFM: not available
  1023. * CarbonLib: in CarbonLib 1.1 and later
  1024. * Mac OS X: in version 10.0 and later
  1025. */
  1026. EXTERN_API( OSStatus )
  1027. CreateCheckGroupBoxControl(
  1028. WindowRef window,
  1029. const Rect * boundsRect,
  1030. CFStringRef title,
  1031. SInt32 initialValue,
  1032. Boolean primary,
  1033. Boolean autoToggle,
  1034. ControlRef * outControl);
  1035. /*
  1036. * CreatePopupGroupBoxControl()
  1037. *
  1038. * Summary:
  1039. * Creates a group box control that has a popup button as its title.
  1040. *
  1041. * Parameters:
  1042. *
  1043. * window:
  1044. * The window that should contain the control.
  1045. *
  1046. * boundsRect:
  1047. * The bounding box of the control.
  1048. *
  1049. * title:
  1050. * The title of the control (used as the title of the popup
  1051. * button).
  1052. *
  1053. * primary:
  1054. * Whether to create a primary or secondary group box.
  1055. *
  1056. * menuID:
  1057. * The menu ID of the menu to be displayed by the popup button.
  1058. *
  1059. * variableWidth:
  1060. * Whether the popup button should have a variable-width title.
  1061. * Fixed-width titles are only supported by Mac OS X; this
  1062. * parameter must be true when used with CarbonLib.
  1063. *
  1064. * titleWidth:
  1065. * The width in pixels of the popup button title.
  1066. *
  1067. * titleJustification:
  1068. * The justification of the popup button title. Use one of the
  1069. * TextEdit justification constants here (teFlushDefault,
  1070. * teCenter, teFlushRight, or teFlushLeft).
  1071. *
  1072. * titleStyle:
  1073. * The QuickDraw text style of the popup button title.
  1074. *
  1075. * outControl:
  1076. * On exit, contains the new control.
  1077. *
  1078. * Availability:
  1079. * Non-Carbon CFM: not available
  1080. * CarbonLib: in CarbonLib 1.1 and later
  1081. * Mac OS X: in version 10.0 and later
  1082. */
  1083. EXTERN_API( OSStatus )
  1084. CreatePopupGroupBoxControl(
  1085. WindowRef window,
  1086. const Rect * boundsRect,
  1087. CFStringRef title,
  1088. Boolean primary,
  1089. SInt16 menuID,
  1090. Boolean variableWidth,
  1091. SInt16 titleWidth,
  1092. SInt16 titleJustification,
  1093. Style titleStyle,
  1094. ControlRef * outControl);
  1095. /* Tagged data supported by group box */
  1096. enum {
  1097. kControlGroupBoxMenuHandleTag = FOUR_CHAR_CODE('mhan'), /* MenuRef (popup title only)*/
  1098. kControlGroupBoxMenuRefTag = FOUR_CHAR_CODE('mhan'), /* MenuRef (popup title only)*/
  1099. kControlGroupBoxFontStyleTag = kControlFontStyleTag /* ControlFontStyleRec*/
  1100. };
  1101. /* tags available with Appearance 1.1 or later */
  1102. enum {
  1103. kControlGroupBoxTitleRectTag = FOUR_CHAR_CODE('trec') /* Rect. Rectangle that the title text/control is drawn in. (get only)*/
  1104. };
  1105. /*--------------------------------------------------------------------------------------*/
  1106. /* o IMAGE WELL (CDEF 11) */
  1107. /*--------------------------------------------------------------------------------------*/
  1108. /* Image Wells allow you to control the content type (pict/icon/etc.) shown in the */
  1109. /* well. */
  1110. /* */
  1111. /* This is made possible by overloading the Min and Value parameters for the control. */
  1112. /* */
  1113. /* Parameter What Goes Here */
  1114. /* ------------------- -------------------------------------------------- */
  1115. /* Min content type (see constants for bevel buttons) */
  1116. /* Value Resource ID of content type, if resource-based. */
  1117. /* */
  1118. /* */
  1119. /* Handle-based Content */
  1120. /* -------------------- */
  1121. /* You can create your control and then set the content to an existing handle to an */
  1122. /* icon suite, etc. using the macros below. Please keep in mind that resource-based */
  1123. /* content is owned by the control, handle-based content is owned by you. The CDEF will*/
  1124. /* not try to dispose of handle-based content. If you are changing the content type of */
  1125. /* the button on the fly, you must make sure that if you are replacing a handle- */
  1126. /* based content with a resource-based content to properly dispose of the handle, */
  1127. /* else a memory leak will ensue. */
  1128. /* */
  1129. /* Image Well proc IDs */
  1130. enum {
  1131. kControlImageWellProc = 176
  1132. };
  1133. /* Control Kind Tag */
  1134. enum {
  1135. kControlKindImageWell = FOUR_CHAR_CODE('well')
  1136. };
  1137. /* Creation API: Carbon only */
  1138. /*
  1139. * CreateImageWellControl()
  1140. *
  1141. * Availability:
  1142. * Non-Carbon CFM: not available
  1143. * CarbonLib: in CarbonLib 1.1 and later
  1144. * Mac OS X: in version 10.0 and later
  1145. */
  1146. EXTERN_API( OSStatus )
  1147. CreateImageWellControl(
  1148. WindowRef window,
  1149. const Rect * boundsRect,
  1150. const ControlButtonContentInfo * info,
  1151. ControlRef * outControl);
  1152. /* Tagged data supported by image wells */
  1153. enum {
  1154. kControlImageWellContentTag = FOUR_CHAR_CODE('cont'), /* ButtonContentInfo*/
  1155. kControlImageWellTransformTag = FOUR_CHAR_CODE('tran'), /* IconTransformType*/
  1156. kControlImageWellIsDragDestinationTag = FOUR_CHAR_CODE('drag') /* Boolean*/
  1157. };
  1158. /* Helper routines are available only thru the shared library/glue. */
  1159. /*
  1160. * GetImageWellContentInfo()
  1161. *
  1162. * Availability:
  1163. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  1164. * CarbonLib: in CarbonLib 1.0 and later
  1165. * Mac OS X: in version 10.0 and later
  1166. */
  1167. EXTERN_API( OSErr )
  1168. GetImageWellContentInfo(
  1169. ControlRef inButton,
  1170. ControlButtonContentInfoPtr outContent);
  1171. /*
  1172. * SetImageWellContentInfo()
  1173. *
  1174. * Availability:
  1175. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  1176. * CarbonLib: in CarbonLib 1.0 and later
  1177. * Mac OS X: in version 10.0 and later
  1178. */
  1179. EXTERN_API( OSErr )
  1180. SetImageWellContentInfo(
  1181. ControlRef inButton,
  1182. ControlButtonContentInfoPtr inContent);
  1183. /*
  1184. * SetImageWellTransform()
  1185. *
  1186. * Availability:
  1187. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  1188. * CarbonLib: in CarbonLib 1.0 and later
  1189. * Mac OS X: in version 10.0 and later
  1190. */
  1191. EXTERN_API( OSErr )
  1192. SetImageWellTransform(
  1193. ControlRef inButton,
  1194. IconTransformType inTransform);
  1195. /*--------------------------------------------------------------------------------------*/
  1196. /* o POPUP ARROW (CDEF 12) */
  1197. /*--------------------------------------------------------------------------------------*/
  1198. /* The popup arrow CDEF is used to draw the small arrow normally associated with a */
  1199. /* popup control. The arrow can point in four directions, and a small or large version */
  1200. /* can be used. This control is provided to allow clients to draw the arrow in a */
  1201. /* normalized fashion which will take advantage of themes automatically. */
  1202. /* */
  1203. /* Popup Arrow proc IDs */
  1204. enum {
  1205. kControlPopupArrowEastProc = 192,
  1206. kControlPopupArrowWestProc = 193,
  1207. kControlPopupArrowNorthProc = 194,
  1208. kControlPopupArrowSouthProc = 195,
  1209. kControlPopupArrowSmallEastProc = 196,
  1210. kControlPopupArrowSmallWestProc = 197,
  1211. kControlPopupArrowSmallNorthProc = 198,
  1212. kControlPopupArrowSmallSouthProc = 199
  1213. };
  1214. /* Popup Arrow Orientations */
  1215. enum {
  1216. kControlPopupArrowOrientationEast = 0,
  1217. kControlPopupArrowOrientationWest = 1,
  1218. kControlPopupArrowOrientationNorth = 2,
  1219. kControlPopupArrowOrientationSouth = 3
  1220. };
  1221. typedef UInt16 ControlPopupArrowOrientation;
  1222. /* Popup Arrow Size */
  1223. enum {
  1224. kControlPopupArrowSizeNormal = 0,
  1225. kControlPopupArrowSizeSmall = 1
  1226. };
  1227. typedef UInt16 ControlPopupArrowSize;
  1228. /* Control Kind Tag */
  1229. enum {
  1230. kControlKindPopupArrow = FOUR_CHAR_CODE('parr')
  1231. };
  1232. /* Creation API: Carbon only */
  1233. /*
  1234. * CreatePopupArrowControl()
  1235. *
  1236. * Availability:
  1237. * Non-Carbon CFM: not available
  1238. * CarbonLib: in CarbonLib 1.1 and later
  1239. * Mac OS X: in version 10.0 and later
  1240. */
  1241. EXTERN_API( OSStatus )
  1242. CreatePopupArrowControl(
  1243. WindowRef window,
  1244. const Rect * boundsRect,
  1245. ControlPopupArrowOrientation orientation,
  1246. ControlPopupArrowSize size,
  1247. ControlRef * outControl);
  1248. /*--------------------------------------------------------------------------------------*/
  1249. /* o PLACARD (CDEF 14) */
  1250. /*--------------------------------------------------------------------------------------*/
  1251. /* Placard proc IDs */
  1252. enum {
  1253. kControlPlacardProc = 224
  1254. };
  1255. /* Control Kind Tag */
  1256. enum {
  1257. kControlKindPlacard = FOUR_CHAR_CODE('plac')
  1258. };
  1259. /* Creation API: Carbon only */
  1260. /*
  1261. * CreatePlacardControl()
  1262. *
  1263. * Availability:
  1264. * Non-Carbon CFM: not available
  1265. * CarbonLib: in CarbonLib 1.1 and later
  1266. * Mac OS X: in version 10.0 and later
  1267. */
  1268. EXTERN_API( OSStatus )
  1269. CreatePlacardControl(
  1270. WindowRef window,
  1271. const Rect * boundsRect,
  1272. ControlRef * outControl);
  1273. /*--------------------------------------------------------------------------------------*/
  1274. /* o CLOCK (CDEF 15) */
  1275. /*--------------------------------------------------------------------------------------*/
  1276. /* NOTE: You can specify more options in the Value paramter when creating the clock. */
  1277. /* See below. */
  1278. /* */
  1279. /* NOTE: Under Appearance 1.1, the clock control knows and returns more part codes. */
  1280. /* The new clock-specific part codes are defined with the other control parts. */
  1281. /* Besides these clock-specific parts, we also return kControlUpButtonPart */
  1282. /* and kControlDownButtonPart when they hit the up and down arrows. */
  1283. /* The new part codes give you more flexibility for focusing and hit testing. */
  1284. /* */
  1285. /* The original kControlClockPart is still valid. When hit testing, it means */
  1286. /* that some non-editable area of the clock's whitespace has been clicked. */
  1287. /* When focusing a currently unfocused clock, it changes the focus to the */
  1288. /* first part; it is the same as passing kControlFocusNextPart. When */
  1289. /* re-focusing a focused clock, it will not change the focus at all. */
  1290. /* Clock proc IDs */
  1291. enum {
  1292. kControlClockTimeProc = 240,
  1293. kControlClockTimeSecondsProc = 241,
  1294. kControlClockDateProc = 242,
  1295. kControlClockMonthYearProc = 243
  1296. };
  1297. /* Clock Types */
  1298. typedef UInt16 ControlClockType;
  1299. enum {
  1300. kControlClockTypeHourMinute = 0,
  1301. kControlClockTypeHourMinuteSecond = 1,
  1302. kControlClockTypeMonthDayYear = 2,
  1303. kControlClockTypeMonthYear = 3
  1304. };
  1305. /* Clock Flags */
  1306. /* These flags can be passed into 'value' field on creation of the control. */
  1307. /* Value is set to 0 after control is created. */
  1308. typedef UInt32 ControlClockFlags;
  1309. enum {
  1310. kControlClockFlagStandard = 0, /* editable, non-live*/
  1311. kControlClockNoFlags = 0,
  1312. kControlClockFlagDisplayOnly = 1, /* add this to become non-editable*/
  1313. kControlClockIsDisplayOnly = 1,
  1314. kControlClockFlagLive = 2, /* automatically shows current time on idle. only valid with display only.*/
  1315. kControlClockIsLive = 2
  1316. };
  1317. /* Control Kind Tag */
  1318. enum {
  1319. kControlKindClock = FOUR_CHAR_CODE('clck')
  1320. };
  1321. /* Creation API: Carbon only */
  1322. /*
  1323. * CreateClockControl()
  1324. *
  1325. * Availability:
  1326. * Non-Carbon CFM: not available
  1327. * CarbonLib: in CarbonLib 1.1 and later
  1328. * Mac OS X: in version 10.0 and later
  1329. */
  1330. EXTERN_API( OSStatus )
  1331. CreateClockControl(
  1332. WindowRef window,
  1333. const Rect * boundsRect,
  1334. ControlClockType clockType,
  1335. ControlClockFlags clockFlags,
  1336. ControlRef * outControl);
  1337. /* Tagged data supported by clocks */
  1338. enum {
  1339. kControlClockLongDateTag = FOUR_CHAR_CODE('date'), /* LongDateRec*/
  1340. kControlClockFontStyleTag = kControlFontStyleTag, /* ControlFontStyleRec*/
  1341. kControlClockAnimatingTag = FOUR_CHAR_CODE('anim') /* Boolean*/
  1342. };
  1343. /*--------------------------------------------------------------------------------------*/
  1344. /* o USER PANE (CDEF 16) */
  1345. /*--------------------------------------------------------------------------------------*/
  1346. /* User panes have two primary purposes: to allow easy implementation of a custom */
  1347. /* control by the developer, and to provide a generic container for embedding other */
  1348. /* controls. */
  1349. /* */
  1350. /* In Carbon, with the advent of Carbon-event-based controls, you may find it easier */
  1351. /* to simply write a new control from scratch than to customize a user pane control. */
  1352. /* The set of callbacks provided by the user pane will not be extended to support */
  1353. /* new Control Manager features; instead, you should just write a real control. */
  1354. /* */
  1355. /* User panes do not, by default, support embedding. If you try to embed a control */
  1356. /* into a user pane, you will get back errControlIsNotEmbedder. You can make a user */
  1357. /* pane support embedding by passing the kControlSupportsEmbedding flag in the 'value' */
  1358. /* parameter when you create the control. */
  1359. /* */
  1360. /* User panes support the following overloaded control initialization options: */
  1361. /* */
  1362. /* Parameter What Goes Here */
  1363. /* ------------------- -------------------------------------------------- */
  1364. /* Value Control feature flags */
  1365. /* User Pane proc IDs */
  1366. enum {
  1367. kControlUserPaneProc = 256
  1368. };
  1369. /* Control Kind Tag */
  1370. enum {
  1371. kControlKindUserPane = FOUR_CHAR_CODE('upan')
  1372. };
  1373. /* Creation API: Carbon only */
  1374. /*
  1375. * CreateUserPaneControl()
  1376. *
  1377. * Availability:
  1378. * Non-Carbon CFM: not available
  1379. * CarbonLib: in CarbonLib 1.1 and later
  1380. * Mac OS X: in version 10.0 and later
  1381. */
  1382. EXTERN_API( OSStatus )
  1383. CreateUserPaneControl(
  1384. WindowRef window,
  1385. const Rect * boundsRect,
  1386. UInt32 features,
  1387. ControlRef * outControl);
  1388. /* Tagged data supported by user panes */
  1389. /* Currently, they are all proc ptrs for doing things like drawing and hit testing, etc. */
  1390. enum {
  1391. kControlUserItemDrawProcTag = FOUR_CHAR_CODE('uidp'), /* UserItemUPP*/
  1392. kControlUserPaneDrawProcTag = FOUR_CHAR_CODE('draw'), /* ControlUserPaneDrawingUPP*/
  1393. kControlUserPaneHitTestProcTag = FOUR_CHAR_CODE('hitt'), /* ControlUserPaneHitTestUPP*/
  1394. kControlUserPaneTrackingProcTag = FOUR_CHAR_CODE('trak'), /* ControlUserPaneTrackingUPP*/
  1395. kControlUserPaneIdleProcTag = FOUR_CHAR_CODE('idle'), /* ControlUserPaneIdleUPP*/
  1396. kControlUserPaneKeyDownProcTag = FOUR_CHAR_CODE('keyd'), /* ControlUserPaneKeyDownUPP*/
  1397. kControlUserPaneActivateProcTag = FOUR_CHAR_CODE('acti'), /* ControlUserPaneActivateUPP*/
  1398. kControlUserPaneFocusProcTag = FOUR_CHAR_CODE('foci'), /* ControlUserPaneFocusUPP*/
  1399. kControlUserPaneBackgroundProcTag = FOUR_CHAR_CODE('back') /* ControlUserPaneBackgroundUPP*/
  1400. };
  1401. typedef CALLBACK_API( void , ControlUserPaneDrawProcPtr )(ControlRef control, SInt16 part);
  1402. typedef CALLBACK_API( ControlPartCode , ControlUserPaneHitTestProcPtr )(ControlRef control, Point where);
  1403. typedef CALLBACK_API( ControlPartCode , ControlUserPaneTrackingProcPtr )(ControlRef control, Point startPt, ControlActionUPP actionProc);
  1404. typedef CALLBACK_API( void , ControlUserPaneIdleProcPtr )(ControlRef control);
  1405. typedef CALLBACK_API( ControlPartCode , ControlUserPaneKeyDownProcPtr )(ControlRef control, SInt16 keyCode, SInt16 charCode, SInt16 modifiers);
  1406. typedef CALLBACK_API( void , ControlUserPaneActivateProcPtr )(ControlRef control, Boolean activating);
  1407. typedef CALLBACK_API( ControlPartCode , ControlUserPaneFocusProcPtr )(ControlRef control, ControlFocusPart action);
  1408. typedef CALLBACK_API( void , ControlUserPaneBackgroundProcPtr )(ControlRef control, ControlBackgroundPtr info);
  1409. typedef STACK_UPP_TYPE(ControlUserPaneDrawProcPtr) ControlUserPaneDrawUPP;
  1410. typedef STACK_UPP_TYPE(ControlUserPaneHitTestProcPtr) ControlUserPaneHitTestUPP;
  1411. typedef STACK_UPP_TYPE(ControlUserPaneTrackingProcPtr) ControlUserPaneTrackingUPP;
  1412. typedef STACK_UPP_TYPE(ControlUserPaneIdleProcPtr) ControlUserPaneIdleUPP;
  1413. typedef STACK_UPP_TYPE(ControlUserPaneKeyDownProcPtr) ControlUserPaneKeyDownUPP;
  1414. typedef STACK_UPP_TYPE(ControlUserPaneActivateProcPtr) ControlUserPaneActivateUPP;
  1415. typedef STACK_UPP_TYPE(ControlUserPaneFocusProcPtr) ControlUserPaneFocusUPP;
  1416. typedef STACK_UPP_TYPE(ControlUserPaneBackgroundProcPtr) ControlUserPaneBackgroundUPP;
  1417. /*
  1418. * NewControlUserPaneDrawUPP()
  1419. *
  1420. * Availability:
  1421. * Non-Carbon CFM: available as macro/inline
  1422. * CarbonLib: in CarbonLib 1.0 and later
  1423. * Mac OS X: in version 10.0 and later
  1424. */
  1425. EXTERN_API_C( ControlUserPaneDrawUPP )
  1426. NewControlUserPaneDrawUPP(ControlUserPaneDrawProcPtr userRoutine);
  1427. #if !OPAQUE_UPP_TYPES
  1428. enum { uppControlUserPaneDrawProcInfo = 0x000002C0 }; /* pascal no_return_value Func(4_bytes, 2_bytes) */
  1429. #ifdef __cplusplus
  1430. inline DEFINE_API_C(ControlUserPaneDrawUPP) NewControlUserPaneDrawUPP(ControlUserPaneDrawProcPtr userRoutine) { return (ControlUserPaneDrawUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneDrawProcInfo, GetCurrentArchitecture()); }
  1431. #else
  1432. #define NewControlUserPaneDrawUPP(userRoutine) (ControlUserPaneDrawUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneDrawProcInfo, GetCurrentArchitecture())
  1433. #endif
  1434. #endif
  1435. /*
  1436. * NewControlUserPaneHitTestUPP()
  1437. *
  1438. * Availability:
  1439. * Non-Carbon CFM: available as macro/inline
  1440. * CarbonLib: in CarbonLib 1.0 and later
  1441. * Mac OS X: in version 10.0 and later
  1442. */
  1443. EXTERN_API_C( ControlUserPaneHitTestUPP )
  1444. NewControlUserPaneHitTestUPP(ControlUserPaneHitTestProcPtr userRoutine);
  1445. #if !OPAQUE_UPP_TYPES
  1446. enum { uppControlUserPaneHitTestProcInfo = 0x000003E0 }; /* pascal 2_bytes Func(4_bytes, 4_bytes) */
  1447. #ifdef __cplusplus
  1448. inline DEFINE_API_C(ControlUserPaneHitTestUPP) NewControlUserPaneHitTestUPP(ControlUserPaneHitTestProcPtr userRoutine) { return (ControlUserPaneHitTestUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneHitTestProcInfo, GetCurrentArchitecture()); }
  1449. #else
  1450. #define NewControlUserPaneHitTestUPP(userRoutine) (ControlUserPaneHitTestUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneHitTestProcInfo, GetCurrentArchitecture())
  1451. #endif
  1452. #endif
  1453. /*
  1454. * NewControlUserPaneTrackingUPP()
  1455. *
  1456. * Availability:
  1457. * Non-Carbon CFM: available as macro/inline
  1458. * CarbonLib: in CarbonLib 1.0 and later
  1459. * Mac OS X: in version 10.0 and later
  1460. */
  1461. EXTERN_API_C( ControlUserPaneTrackingUPP )
  1462. NewControlUserPaneTrackingUPP(ControlUserPaneTrackingProcPtr userRoutine);
  1463. #if !OPAQUE_UPP_TYPES
  1464. enum { uppControlUserPaneTrackingProcInfo = 0x00000FE0 }; /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes) */
  1465. #ifdef __cplusplus
  1466. inline DEFINE_API_C(ControlUserPaneTrackingUPP) NewControlUserPaneTrackingUPP(ControlUserPaneTrackingProcPtr userRoutine) { return (ControlUserPaneTrackingUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneTrackingProcInfo, GetCurrentArchitecture()); }
  1467. #else
  1468. #define NewControlUserPaneTrackingUPP(userRoutine) (ControlUserPaneTrackingUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneTrackingProcInfo, GetCurrentArchitecture())
  1469. #endif
  1470. #endif
  1471. /*
  1472. * NewControlUserPaneIdleUPP()
  1473. *
  1474. * Availability:
  1475. * Non-Carbon CFM: available as macro/inline
  1476. * CarbonLib: in CarbonLib 1.0 and later
  1477. * Mac OS X: in version 10.0 and later
  1478. */
  1479. EXTERN_API_C( ControlUserPaneIdleUPP )
  1480. NewControlUserPaneIdleUPP(ControlUserPaneIdleProcPtr userRoutine);
  1481. #if !OPAQUE_UPP_TYPES
  1482. enum { uppControlUserPaneIdleProcInfo = 0x000000C0 }; /* pascal no_return_value Func(4_bytes) */
  1483. #ifdef __cplusplus
  1484. inline DEFINE_API_C(ControlUserPaneIdleUPP) NewControlUserPaneIdleUPP(ControlUserPaneIdleProcPtr userRoutine) { return (ControlUserPaneIdleUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneIdleProcInfo, GetCurrentArchitecture()); }
  1485. #else
  1486. #define NewControlUserPaneIdleUPP(userRoutine) (ControlUserPaneIdleUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneIdleProcInfo, GetCurrentArchitecture())
  1487. #endif
  1488. #endif
  1489. /*
  1490. * NewControlUserPaneKeyDownUPP()
  1491. *
  1492. * Availability:
  1493. * Non-Carbon CFM: available as macro/inline
  1494. * CarbonLib: in CarbonLib 1.0 and later
  1495. * Mac OS X: in version 10.0 and later
  1496. */
  1497. EXTERN_API_C( ControlUserPaneKeyDownUPP )
  1498. NewControlUserPaneKeyDownUPP(ControlUserPaneKeyDownProcPtr userRoutine);
  1499. #if !OPAQUE_UPP_TYPES
  1500. enum { uppControlUserPaneKeyDownProcInfo = 0x00002AE0 }; /* pascal 2_bytes Func(4_bytes, 2_bytes, 2_bytes, 2_bytes) */
  1501. #ifdef __cplusplus
  1502. inline DEFINE_API_C(ControlUserPaneKeyDownUPP) NewControlUserPaneKeyDownUPP(ControlUserPaneKeyDownProcPtr userRoutine) { return (ControlUserPaneKeyDownUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneKeyDownProcInfo, GetCurrentArchitecture()); }
  1503. #else
  1504. #define NewControlUserPaneKeyDownUPP(userRoutine) (ControlUserPaneKeyDownUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneKeyDownProcInfo, GetCurrentArchitecture())
  1505. #endif
  1506. #endif
  1507. /*
  1508. * NewControlUserPaneActivateUPP()
  1509. *
  1510. * Availability:
  1511. * Non-Carbon CFM: available as macro/inline
  1512. * CarbonLib: in CarbonLib 1.0 and later
  1513. * Mac OS X: in version 10.0 and later
  1514. */
  1515. EXTERN_API_C( ControlUserPaneActivateUPP )
  1516. NewControlUserPaneActivateUPP(ControlUserPaneActivateProcPtr userRoutine);
  1517. #if !OPAQUE_UPP_TYPES
  1518. enum { uppControlUserPaneActivateProcInfo = 0x000001C0 }; /* pascal no_return_value Func(4_bytes, 1_byte) */
  1519. #ifdef __cplusplus
  1520. inline DEFINE_API_C(ControlUserPaneActivateUPP) NewControlUserPaneActivateUPP(ControlUserPaneActivateProcPtr userRoutine) { return (ControlUserPaneActivateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneActivateProcInfo, GetCurrentArchitecture()); }
  1521. #else
  1522. #define NewControlUserPaneActivateUPP(userRoutine) (ControlUserPaneActivateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneActivateProcInfo, GetCurrentArchitecture())
  1523. #endif
  1524. #endif
  1525. /*
  1526. * NewControlUserPaneFocusUPP()
  1527. *
  1528. * Availability:
  1529. * Non-Carbon CFM: available as macro/inline
  1530. * CarbonLib: in CarbonLib 1.0 and later
  1531. * Mac OS X: in version 10.0 and later
  1532. */
  1533. EXTERN_API_C( ControlUserPaneFocusUPP )
  1534. NewControlUserPaneFocusUPP(ControlUserPaneFocusProcPtr userRoutine);
  1535. #if !OPAQUE_UPP_TYPES
  1536. enum { uppControlUserPaneFocusProcInfo = 0x000002E0 }; /* pascal 2_bytes Func(4_bytes, 2_bytes) */
  1537. #ifdef __cplusplus
  1538. inline DEFINE_API_C(ControlUserPaneFocusUPP) NewControlUserPaneFocusUPP(ControlUserPaneFocusProcPtr userRoutine) { return (ControlUserPaneFocusUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneFocusProcInfo, GetCurrentArchitecture()); }
  1539. #else
  1540. #define NewControlUserPaneFocusUPP(userRoutine) (ControlUserPaneFocusUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneFocusProcInfo, GetCurrentArchitecture())
  1541. #endif
  1542. #endif
  1543. /*
  1544. * NewControlUserPaneBackgroundUPP()
  1545. *
  1546. * Availability:
  1547. * Non-Carbon CFM: available as macro/inline
  1548. * CarbonLib: in CarbonLib 1.0 and later
  1549. * Mac OS X: in version 10.0 and later
  1550. */
  1551. EXTERN_API_C( ControlUserPaneBackgroundUPP )
  1552. NewControlUserPaneBackgroundUPP(ControlUserPaneBackgroundProcPtr userRoutine);
  1553. #if !OPAQUE_UPP_TYPES
  1554. enum { uppControlUserPaneBackgroundProcInfo = 0x000003C0 }; /* pascal no_return_value Func(4_bytes, 4_bytes) */
  1555. #ifdef __cplusplus
  1556. inline DEFINE_API_C(ControlUserPaneBackgroundUPP) NewControlUserPaneBackgroundUPP(ControlUserPaneBackgroundProcPtr userRoutine) { return (ControlUserPaneBackgroundUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneBackgroundProcInfo, GetCurrentArchitecture()); }
  1557. #else
  1558. #define NewControlUserPaneBackgroundUPP(userRoutine) (ControlUserPaneBackgroundUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneBackgroundProcInfo, GetCurrentArchitecture())
  1559. #endif
  1560. #endif
  1561. /*
  1562. * DisposeControlUserPaneDrawUPP()
  1563. *
  1564. * Availability:
  1565. * Non-Carbon CFM: available as macro/inline
  1566. * CarbonLib: in CarbonLib 1.0 and later
  1567. * Mac OS X: in version 10.0 and later
  1568. */
  1569. EXTERN_API_C( void )
  1570. DisposeControlUserPaneDrawUPP(ControlUserPaneDrawUPP userUPP);
  1571. #if !OPAQUE_UPP_TYPES
  1572. #ifdef __cplusplus
  1573. inline DEFINE_API_C(void) DisposeControlUserPaneDrawUPP(ControlUserPaneDrawUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  1574. #else
  1575. #define DisposeControlUserPaneDrawUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  1576. #endif
  1577. #endif
  1578. /*
  1579. * DisposeControlUserPaneHitTestUPP()
  1580. *
  1581. * Availability:
  1582. * Non-Carbon CFM: available as macro/inline
  1583. * CarbonLib: in CarbonLib 1.0 and later
  1584. * Mac OS X: in version 10.0 and later
  1585. */
  1586. EXTERN_API_C( void )
  1587. DisposeControlUserPaneHitTestUPP(ControlUserPaneHitTestUPP userUPP);
  1588. #if !OPAQUE_UPP_TYPES
  1589. #ifdef __cplusplus
  1590. inline DEFINE_API_C(void) DisposeControlUserPaneHitTestUPP(ControlUserPaneHitTestUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  1591. #else
  1592. #define DisposeControlUserPaneHitTestUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  1593. #endif
  1594. #endif
  1595. /*
  1596. * DisposeControlUserPaneTrackingUPP()
  1597. *
  1598. * Availability:
  1599. * Non-Carbon CFM: available as macro/inline
  1600. * CarbonLib: in CarbonLib 1.0 and later
  1601. * Mac OS X: in version 10.0 and later
  1602. */
  1603. EXTERN_API_C( void )
  1604. DisposeControlUserPaneTrackingUPP(ControlUserPaneTrackingUPP userUPP);
  1605. #if !OPAQUE_UPP_TYPES
  1606. #ifdef __cplusplus
  1607. inline DEFINE_API_C(void) DisposeControlUserPaneTrackingUPP(ControlUserPaneTrackingUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  1608. #else
  1609. #define DisposeControlUserPaneTrackingUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  1610. #endif
  1611. #endif
  1612. /*
  1613. * DisposeControlUserPaneIdleUPP()
  1614. *
  1615. * Availability:
  1616. * Non-Carbon CFM: available as macro/inline
  1617. * CarbonLib: in CarbonLib 1.0 and later
  1618. * Mac OS X: in version 10.0 and later
  1619. */
  1620. EXTERN_API_C( void )
  1621. DisposeControlUserPaneIdleUPP(ControlUserPaneIdleUPP userUPP);
  1622. #if !OPAQUE_UPP_TYPES
  1623. #ifdef __cplusplus
  1624. inline DEFINE_API_C(void) DisposeControlUserPaneIdleUPP(ControlUserPaneIdleUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  1625. #else
  1626. #define DisposeControlUserPaneIdleUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  1627. #endif
  1628. #endif
  1629. /*
  1630. * DisposeControlUserPaneKeyDownUPP()
  1631. *
  1632. * Availability:
  1633. * Non-Carbon CFM: available as macro/inline
  1634. * CarbonLib: in CarbonLib 1.0 and later
  1635. * Mac OS X: in version 10.0 and later
  1636. */
  1637. EXTERN_API_C( void )
  1638. DisposeControlUserPaneKeyDownUPP(ControlUserPaneKeyDownUPP userUPP);
  1639. #if !OPAQUE_UPP_TYPES
  1640. #ifdef __cplusplus
  1641. inline DEFINE_API_C(void) DisposeControlUserPaneKeyDownUPP(ControlUserPaneKeyDownUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  1642. #else
  1643. #define DisposeControlUserPaneKeyDownUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  1644. #endif
  1645. #endif
  1646. /*
  1647. * DisposeControlUserPaneActivateUPP()
  1648. *
  1649. * Availability:
  1650. * Non-Carbon CFM: available as macro/inline
  1651. * CarbonLib: in CarbonLib 1.0 and later
  1652. * Mac OS X: in version 10.0 and later
  1653. */
  1654. EXTERN_API_C( void )
  1655. DisposeControlUserPaneActivateUPP(ControlUserPaneActivateUPP userUPP);
  1656. #if !OPAQUE_UPP_TYPES
  1657. #ifdef __cplusplus
  1658. inline DEFINE_API_C(void) DisposeControlUserPaneActivateUPP(ControlUserPaneActivateUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  1659. #else
  1660. #define DisposeControlUserPaneActivateUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  1661. #endif
  1662. #endif
  1663. /*
  1664. * DisposeControlUserPaneFocusUPP()
  1665. *
  1666. * Availability:
  1667. * Non-Carbon CFM: available as macro/inline
  1668. * CarbonLib: in CarbonLib 1.0 and later
  1669. * Mac OS X: in version 10.0 and later
  1670. */
  1671. EXTERN_API_C( void )
  1672. DisposeControlUserPaneFocusUPP(ControlUserPaneFocusUPP userUPP);
  1673. #if !OPAQUE_UPP_TYPES
  1674. #ifdef __cplusplus
  1675. inline DEFINE_API_C(void) DisposeControlUserPaneFocusUPP(ControlUserPaneFocusUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  1676. #else
  1677. #define DisposeControlUserPaneFocusUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  1678. #endif
  1679. #endif
  1680. /*
  1681. * DisposeControlUserPaneBackgroundUPP()
  1682. *
  1683. * Availability:
  1684. * Non-Carbon CFM: available as macro/inline
  1685. * CarbonLib: in CarbonLib 1.0 and later
  1686. * Mac OS X: in version 10.0 and later
  1687. */
  1688. EXTERN_API_C( void )
  1689. DisposeControlUserPaneBackgroundUPP(ControlUserPaneBackgroundUPP userUPP);
  1690. #if !OPAQUE_UPP_TYPES
  1691. #ifdef __cplusplus
  1692. inline DEFINE_API_C(void) DisposeControlUserPaneBackgroundUPP(ControlUserPaneBackgroundUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  1693. #else
  1694. #define DisposeControlUserPaneBackgroundUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  1695. #endif
  1696. #endif
  1697. /*
  1698. * InvokeControlUserPaneDrawUPP()
  1699. *
  1700. * Availability:
  1701. * Non-Carbon CFM: available as macro/inline
  1702. * CarbonLib: in CarbonLib 1.0 and later
  1703. * Mac OS X: in version 10.0 and later
  1704. */
  1705. EXTERN_API_C( void )
  1706. InvokeControlUserPaneDrawUPP(
  1707. ControlRef control,
  1708. SInt16 part,
  1709. ControlUserPaneDrawUPP userUPP);
  1710. #if !OPAQUE_UPP_TYPES
  1711. #ifdef __cplusplus
  1712. inline DEFINE_API_C(void) InvokeControlUserPaneDrawUPP(ControlRef control, SInt16 part, ControlUserPaneDrawUPP userUPP) { CALL_TWO_PARAMETER_UPP(userUPP, uppControlUserPaneDrawProcInfo, control, part); }
  1713. #else
  1714. #define InvokeControlUserPaneDrawUPP(control, part, userUPP) CALL_TWO_PARAMETER_UPP((userUPP), uppControlUserPaneDrawProcInfo, (control), (part))
  1715. #endif
  1716. #endif
  1717. /*
  1718. * InvokeControlUserPaneHitTestUPP()
  1719. *
  1720. * Availability:
  1721. * Non-Carbon CFM: available as macro/inline
  1722. * CarbonLib: in CarbonLib 1.0 and later
  1723. * Mac OS X: in version 10.0 and later
  1724. */
  1725. EXTERN_API_C( ControlPartCode )
  1726. InvokeControlUserPaneHitTestUPP(
  1727. ControlRef control,
  1728. Point where,
  1729. ControlUserPaneHitTestUPP userUPP);
  1730. #if !OPAQUE_UPP_TYPES
  1731. #ifdef __cplusplus
  1732. inline DEFINE_API_C(ControlPartCode) InvokeControlUserPaneHitTestUPP(ControlRef control, Point where, ControlUserPaneHitTestUPP userUPP) { return (ControlPartCode)CALL_TWO_PARAMETER_UPP(userUPP, uppControlUserPaneHitTestProcInfo, control, where); }
  1733. #else
  1734. #define InvokeControlUserPaneHitTestUPP(control, where, userUPP) (ControlPartCode)CALL_TWO_PARAMETER_UPP((userUPP), uppControlUserPaneHitTestProcInfo, (control), (where))
  1735. #endif
  1736. #endif
  1737. /*
  1738. * InvokeControlUserPaneTrackingUPP()
  1739. *
  1740. * Availability:
  1741. * Non-Carbon CFM: available as macro/inline
  1742. * CarbonLib: in CarbonLib 1.0 and later
  1743. * Mac OS X: in version 10.0 and later
  1744. */
  1745. EXTERN_API_C( ControlPartCode )
  1746. InvokeControlUserPaneTrackingUPP(
  1747. ControlRef control,
  1748. Point startPt,
  1749. ControlActionUPP actionProc,
  1750. ControlUserPaneTrackingUPP userUPP);
  1751. #if !OPAQUE_UPP_TYPES
  1752. #ifdef __cplusplus
  1753. inline DEFINE_API_C(ControlPartCode) InvokeControlUserPaneTrackingUPP(ControlRef control, Point startPt, ControlActionUPP actionProc, ControlUserPaneTrackingUPP userUPP) { return (ControlPartCode)CALL_THREE_PARAMETER_UPP(userUPP, uppControlUserPaneTrackingProcInfo, control, startPt, actionProc); }
  1754. #else
  1755. #define InvokeControlUserPaneTrackingUPP(control, startPt, actionProc, userUPP) (ControlPartCode)CALL_THREE_PARAMETER_UPP((userUPP), uppControlUserPaneTrackingProcInfo, (control), (startPt), (actionProc))
  1756. #endif
  1757. #endif
  1758. /*
  1759. * InvokeControlUserPaneIdleUPP()
  1760. *
  1761. * Availability:
  1762. * Non-Carbon CFM: available as macro/inline
  1763. * CarbonLib: in CarbonLib 1.0 and later
  1764. * Mac OS X: in version 10.0 and later
  1765. */
  1766. EXTERN_API_C( void )
  1767. InvokeControlUserPaneIdleUPP(
  1768. ControlRef control,
  1769. ControlUserPaneIdleUPP userUPP);
  1770. #if !OPAQUE_UPP_TYPES
  1771. #ifdef __cplusplus
  1772. inline DEFINE_API_C(void) InvokeControlUserPaneIdleUPP(ControlRef control, ControlUserPaneIdleUPP userUPP) { CALL_ONE_PARAMETER_UPP(userUPP, uppControlUserPaneIdleProcInfo, control); }
  1773. #else
  1774. #define InvokeControlUserPaneIdleUPP(control, userUPP) CALL_ONE_PARAMETER_UPP((userUPP), uppControlUserPaneIdleProcInfo, (control))
  1775. #endif
  1776. #endif
  1777. /*
  1778. * InvokeControlUserPaneKeyDownUPP()
  1779. *
  1780. * Availability:
  1781. * Non-Carbon CFM: available as macro/inline
  1782. * CarbonLib: in CarbonLib 1.0 and later
  1783. * Mac OS X: in version 10.0 and later
  1784. */
  1785. EXTERN_API_C( ControlPartCode )
  1786. InvokeControlUserPaneKeyDownUPP(
  1787. ControlRef control,
  1788. SInt16 keyCode,
  1789. SInt16 charCode,
  1790. SInt16 modifiers,
  1791. ControlUserPaneKeyDownUPP userUPP);
  1792. #if !OPAQUE_UPP_TYPES
  1793. #ifdef __cplusplus
  1794. inline DEFINE_API_C(ControlPartCode) InvokeControlUserPaneKeyDownUPP(ControlRef control, SInt16 keyCode, SInt16 charCode, SInt16 modifiers, ControlUserPaneKeyDownUPP userUPP) { return (ControlPartCode)CALL_FOUR_PARAMETER_UPP(userUPP, uppControlUserPaneKeyDownProcInfo, control, keyCode, charCode, modifiers); }
  1795. #else
  1796. #define InvokeControlUserPaneKeyDownUPP(control, keyCode, charCode, modifiers, userUPP) (ControlPartCode)CALL_FOUR_PARAMETER_UPP((userUPP), uppControlUserPaneKeyDownProcInfo, (control), (keyCode), (charCode), (modifiers))
  1797. #endif
  1798. #endif
  1799. /*
  1800. * InvokeControlUserPaneActivateUPP()
  1801. *
  1802. * Availability:
  1803. * Non-Carbon CFM: available as macro/inline
  1804. * CarbonLib: in CarbonLib 1.0 and later
  1805. * Mac OS X: in version 10.0 and later
  1806. */
  1807. EXTERN_API_C( void )
  1808. InvokeControlUserPaneActivateUPP(
  1809. ControlRef control,
  1810. Boolean activating,
  1811. ControlUserPaneActivateUPP userUPP);
  1812. #if !OPAQUE_UPP_TYPES
  1813. #ifdef __cplusplus
  1814. inline DEFINE_API_C(void) InvokeControlUserPaneActivateUPP(ControlRef control, Boolean activating, ControlUserPaneActivateUPP userUPP) { CALL_TWO_PARAMETER_UPP(userUPP, uppControlUserPaneActivateProcInfo, control, activating); }
  1815. #else
  1816. #define InvokeControlUserPaneActivateUPP(control, activating, userUPP) CALL_TWO_PARAMETER_UPP((userUPP), uppControlUserPaneActivateProcInfo, (control), (activating))
  1817. #endif
  1818. #endif
  1819. /*
  1820. * InvokeControlUserPaneFocusUPP()
  1821. *
  1822. * Availability:
  1823. * Non-Carbon CFM: available as macro/inline
  1824. * CarbonLib: in CarbonLib 1.0 and later
  1825. * Mac OS X: in version 10.0 and later
  1826. */
  1827. EXTERN_API_C( ControlPartCode )
  1828. InvokeControlUserPaneFocusUPP(
  1829. ControlRef control,
  1830. ControlFocusPart action,
  1831. ControlUserPaneFocusUPP userUPP);
  1832. #if !OPAQUE_UPP_TYPES
  1833. #ifdef __cplusplus
  1834. inline DEFINE_API_C(ControlPartCode) InvokeControlUserPaneFocusUPP(ControlRef control, ControlFocusPart action, ControlUserPaneFocusUPP userUPP) { return (ControlPartCode)CALL_TWO_PARAMETER_UPP(userUPP, uppControlUserPaneFocusProcInfo, control, action); }
  1835. #else
  1836. #define InvokeControlUserPaneFocusUPP(control, action, userUPP) (ControlPartCode)CALL_TWO_PARAMETER_UPP((userUPP), uppControlUserPaneFocusProcInfo, (control), (action))
  1837. #endif
  1838. #endif
  1839. /*
  1840. * InvokeControlUserPaneBackgroundUPP()
  1841. *
  1842. * Availability:
  1843. * Non-Carbon CFM: available as macro/inline
  1844. * CarbonLib: in CarbonLib 1.0 and later
  1845. * Mac OS X: in version 10.0 and later
  1846. */
  1847. EXTERN_API_C( void )
  1848. InvokeControlUserPaneBackgroundUPP(
  1849. ControlRef control,
  1850. ControlBackgroundPtr info,
  1851. ControlUserPaneBackgroundUPP userUPP);
  1852. #if !OPAQUE_UPP_TYPES
  1853. #ifdef __cplusplus
  1854. inline DEFINE_API_C(void) InvokeControlUserPaneBackgroundUPP(ControlRef control, ControlBackgroundPtr info, ControlUserPaneBackgroundUPP userUPP) { CALL_TWO_PARAMETER_UPP(userUPP, uppControlUserPaneBackgroundProcInfo, control, info); }
  1855. #else
  1856. #define InvokeControlUserPaneBackgroundUPP(control, info, userUPP) CALL_TWO_PARAMETER_UPP((userUPP), uppControlUserPaneBackgroundProcInfo, (control), (info))
  1857. #endif
  1858. #endif
  1859. #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
  1860. /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
  1861. #define NewControlUserPaneDrawProc(userRoutine) NewControlUserPaneDrawUPP(userRoutine)
  1862. #define NewControlUserPaneHitTestProc(userRoutine) NewControlUserPaneHitTestUPP(userRoutine)
  1863. #define NewControlUserPaneTrackingProc(userRoutine) NewControlUserPaneTrackingUPP(userRoutine)
  1864. #define NewControlUserPaneIdleProc(userRoutine) NewControlUserPaneIdleUPP(userRoutine)
  1865. #define NewControlUserPaneKeyDownProc(userRoutine) NewControlUserPaneKeyDownUPP(userRoutine)
  1866. #define NewControlUserPaneActivateProc(userRoutine) NewControlUserPaneActivateUPP(userRoutine)
  1867. #define NewControlUserPaneFocusProc(userRoutine) NewControlUserPaneFocusUPP(userRoutine)
  1868. #define NewControlUserPaneBackgroundProc(userRoutine) NewControlUserPaneBackgroundUPP(userRoutine)
  1869. #define CallControlUserPaneDrawProc(userRoutine, control, part) InvokeControlUserPaneDrawUPP(control, part, userRoutine)
  1870. #define CallControlUserPaneHitTestProc(userRoutine, control, where) InvokeControlUserPaneHitTestUPP(control, where, userRoutine)
  1871. #define CallControlUserPaneTrackingProc(userRoutine, control, startPt, actionProc) InvokeControlUserPaneTrackingUPP(control, startPt, actionProc, userRoutine)
  1872. #define CallControlUserPaneIdleProc(userRoutine, control) InvokeControlUserPaneIdleUPP(control, userRoutine)
  1873. #define CallControlUserPaneKeyDownProc(userRoutine, control, keyCode, charCode, modifiers) InvokeControlUserPaneKeyDownUPP(control, keyCode, charCode, modifiers, userRoutine)
  1874. #define CallControlUserPaneActivateProc(userRoutine, control, activating) InvokeControlUserPaneActivateUPP(control, activating, userRoutine)
  1875. #define CallControlUserPaneFocusProc(userRoutine, control, action) InvokeControlUserPaneFocusUPP(control, action, userRoutine)
  1876. #define CallControlUserPaneBackgroundProc(userRoutine, control, info) InvokeControlUserPaneBackgroundUPP(control, info, userRoutine)
  1877. #endif /* CALL_NOT_IN_CARBON */
  1878. /*
  1879. ------------------------------------------------------------------------------------------
  1880. o EDIT TEXT (CDEF 17)
  1881. ------------------------------------------------------------------------------------------
  1882. */
  1883. /* Edit Text proc IDs */
  1884. enum {
  1885. kControlEditTextProc = 272,
  1886. kControlEditTextPasswordProc = 274
  1887. };
  1888. /* proc IDs available with Appearance 1.1 or later */
  1889. enum {
  1890. kControlEditTextInlineInputProc = 276 /* Can't combine with the other variants*/
  1891. };
  1892. /* Control Kind Tag */
  1893. enum {
  1894. kControlKindEditText = FOUR_CHAR_CODE('etxt')
  1895. };
  1896. /* Creation API: Carbon only */
  1897. /*
  1898. * CreateEditTextControl()
  1899. *
  1900. * Availability:
  1901. * Non-Carbon CFM: not available
  1902. * CarbonLib: in CarbonLib 1.1 and later
  1903. * Mac OS X: in version 10.0 and later
  1904. */
  1905. EXTERN_API( OSStatus )
  1906. CreateEditTextControl(
  1907. WindowRef window,
  1908. const Rect * boundsRect,
  1909. CFStringRef text,
  1910. Boolean isPassword,
  1911. Boolean useInlineInput,
  1912. const ControlFontStyleRec * style, /* can be NULL */
  1913. ControlRef * outControl);
  1914. /* Tagged data supported by edit text */
  1915. enum {
  1916. kControlEditTextStyleTag = kControlFontStyleTag, /* ControlFontStyleRec*/
  1917. kControlEditTextTextTag = FOUR_CHAR_CODE('text'), /* Buffer of chars - you supply the buffer*/
  1918. kControlEditTextTEHandleTag = FOUR_CHAR_CODE('than'), /* The TEHandle of the text edit record*/
  1919. kControlEditTextKeyFilterTag = kControlKeyFilterTag,
  1920. kControlEditTextSelectionTag = FOUR_CHAR_CODE('sele'), /* ControlEditTextSelectionRec*/
  1921. kControlEditTextPasswordTag = FOUR_CHAR_CODE('pass') /* The clear text password text*/
  1922. };
  1923. /* tags available with Appearance 1.1 or later */
  1924. enum {
  1925. kControlEditTextKeyScriptBehaviorTag = FOUR_CHAR_CODE('kscr'), /* ControlKeyScriptBehavior. Defaults to "PrefersRoman" for password fields,*/
  1926. /* or "AllowAnyScript" for non-password fields.*/
  1927. kControlEditTextLockedTag = FOUR_CHAR_CODE('lock'), /* Boolean. Locking disables editability.*/
  1928. kControlEditTextFixedTextTag = FOUR_CHAR_CODE('ftxt'), /* Like the normal text tag, but fixes inline input first*/
  1929. kControlEditTextValidationProcTag = FOUR_CHAR_CODE('vali'), /* ControlEditTextValidationUPP. Called when a key filter can't be: after cut, paste, etc.*/
  1930. kControlEditTextInlinePreUpdateProcTag = FOUR_CHAR_CODE('prup'), /* TSMTEPreUpdateUPP and TSMTEPostUpdateUpp. For use with inline input variant...*/
  1931. kControlEditTextInlinePostUpdateProcTag = FOUR_CHAR_CODE('poup') /* ...The refCon parameter will contain the ControlRef.*/
  1932. };
  1933. /*
  1934. * Discussion:
  1935. * EditText ControlData tags available with MacOSX and later.
  1936. */
  1937. enum {
  1938. /*
  1939. * Extract the content of the edit text field as a CFString. Don't
  1940. * forget that you own the returned CFStringRef and are responsible
  1941. * for CFReleasing it.
  1942. */
  1943. kControlEditTextCFStringTag = FOUR_CHAR_CODE('cfst'), /* CFStringRef (Also available on CarbonLib 1.5)*/
  1944. /*
  1945. * Extract the content of the edit text field as a CFString, if it is
  1946. * a password field. Don't forget that you own the returned
  1947. * CFStringRef and are responsible for CFReleasing it.
  1948. */
  1949. kControlEditTextPasswordCFStringTag = FOUR_CHAR_CODE('pwcf') /* CFStringRef*/
  1950. };
  1951. /* Structure for getting the edit text selection */
  1952. struct ControlEditTextSelectionRec {
  1953. SInt16 selStart;
  1954. SInt16 selEnd;
  1955. };
  1956. typedef struct ControlEditTextSelectionRec ControlEditTextSelectionRec;
  1957. typedef ControlEditTextSelectionRec * ControlEditTextSelectionPtr;
  1958. typedef CALLBACK_API( void , ControlEditTextValidationProcPtr )(ControlRef control);
  1959. typedef STACK_UPP_TYPE(ControlEditTextValidationProcPtr) ControlEditTextValidationUPP;
  1960. /*
  1961. * NewControlEditTextValidationUPP()
  1962. *
  1963. * Availability:
  1964. * Non-Carbon CFM: available as macro/inline
  1965. * CarbonLib: in CarbonLib 1.0 and later
  1966. * Mac OS X: in version 10.0 and later
  1967. */
  1968. EXTERN_API_C( ControlEditTextValidationUPP )
  1969. NewControlEditTextValidationUPP(ControlEditTextValidationProcPtr userRoutine);
  1970. #if !OPAQUE_UPP_TYPES
  1971. enum { uppControlEditTextValidationProcInfo = 0x000000C0 }; /* pascal no_return_value Func(4_bytes) */
  1972. #ifdef __cplusplus
  1973. inline DEFINE_API_C(ControlEditTextValidationUPP) NewControlEditTextValidationUPP(ControlEditTextValidationProcPtr userRoutine) { return (ControlEditTextValidationUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlEditTextValidationProcInfo, GetCurrentArchitecture()); }
  1974. #else
  1975. #define NewControlEditTextValidationUPP(userRoutine) (ControlEditTextValidationUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlEditTextValidationProcInfo, GetCurrentArchitecture())
  1976. #endif
  1977. #endif
  1978. /*
  1979. * DisposeControlEditTextValidationUPP()
  1980. *
  1981. * Availability:
  1982. * Non-Carbon CFM: available as macro/inline
  1983. * CarbonLib: in CarbonLib 1.0 and later
  1984. * Mac OS X: in version 10.0 and later
  1985. */
  1986. EXTERN_API_C( void )
  1987. DisposeControlEditTextValidationUPP(ControlEditTextValidationUPP userUPP);
  1988. #if !OPAQUE_UPP_TYPES
  1989. #ifdef __cplusplus
  1990. inline DEFINE_API_C(void) DisposeControlEditTextValidationUPP(ControlEditTextValidationUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  1991. #else
  1992. #define DisposeControlEditTextValidationUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  1993. #endif
  1994. #endif
  1995. /*
  1996. * InvokeControlEditTextValidationUPP()
  1997. *
  1998. * Availability:
  1999. * Non-Carbon CFM: available as macro/inline
  2000. * CarbonLib: in CarbonLib 1.0 and later
  2001. * Mac OS X: in version 10.0 and later
  2002. */
  2003. EXTERN_API_C( void )
  2004. InvokeControlEditTextValidationUPP(
  2005. ControlRef control,
  2006. ControlEditTextValidationUPP userUPP);
  2007. #if !OPAQUE_UPP_TYPES
  2008. #ifdef __cplusplus
  2009. inline DEFINE_API_C(void) InvokeControlEditTextValidationUPP(ControlRef control, ControlEditTextValidationUPP userUPP) { CALL_ONE_PARAMETER_UPP(userUPP, uppControlEditTextValidationProcInfo, control); }
  2010. #else
  2011. #define InvokeControlEditTextValidationUPP(control, userUPP) CALL_ONE_PARAMETER_UPP((userUPP), uppControlEditTextValidationProcInfo, (control))
  2012. #endif
  2013. #endif
  2014. #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
  2015. /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
  2016. #define NewControlEditTextValidationProc(userRoutine) NewControlEditTextValidationUPP(userRoutine)
  2017. #define CallControlEditTextValidationProc(userRoutine, control) InvokeControlEditTextValidationUPP(control, userRoutine)
  2018. #endif /* CALL_NOT_IN_CARBON */
  2019. /*--------------------------------------------------------------------------------------*/
  2020. /* o STATIC TEXT (CDEF 18) */
  2021. /*--------------------------------------------------------------------------------------*/
  2022. /* Static Text proc IDs */
  2023. enum {
  2024. kControlStaticTextProc = 288
  2025. };
  2026. /* Control Kind Tag */
  2027. enum {
  2028. kControlKindStaticText = FOUR_CHAR_CODE('stxt')
  2029. };
  2030. /* Creation API: Carbon only */
  2031. /*
  2032. * CreateStaticTextControl()
  2033. *
  2034. * Availability:
  2035. * Non-Carbon CFM: not available
  2036. * CarbonLib: in CarbonLib 1.1 and later
  2037. * Mac OS X: in version 10.0 and later
  2038. */
  2039. EXTERN_API( OSStatus )
  2040. CreateStaticTextControl(
  2041. WindowRef window,
  2042. const Rect * boundsRect,
  2043. CFStringRef text,
  2044. const ControlFontStyleRec * style,
  2045. ControlRef * outControl);
  2046. /* Tagged data supported by static text */
  2047. enum {
  2048. kControlStaticTextStyleTag = kControlFontStyleTag, /* ControlFontStyleRec*/
  2049. kControlStaticTextTextTag = FOUR_CHAR_CODE('text'), /* Copy of text*/
  2050. kControlStaticTextTextHeightTag = FOUR_CHAR_CODE('thei') /* SInt16*/
  2051. };
  2052. /* Tags available with appearance 1.1 or later */
  2053. enum {
  2054. kControlStaticTextTruncTag = FOUR_CHAR_CODE('trun') /* TruncCode (-1 means no truncation)*/
  2055. };
  2056. /* Tags available with Mac OS X or later */
  2057. enum {
  2058. kControlStaticTextCFStringTag = FOUR_CHAR_CODE('cfst') /* CFStringRef (Also available on CarbonLib 1.5)*/
  2059. };
  2060. /*--------------------------------------------------------------------------------------*/
  2061. /* o PICTURE CONTROL (CDEF 19) */
  2062. /*--------------------------------------------------------------------------------------*/
  2063. /* Value parameter should contain the ID of the picture you wish to display when */
  2064. /* creating controls of this type. If you don't want the control tracked at all, use */
  2065. /* the 'no track' variant. */
  2066. /* Picture control proc IDs */
  2067. enum {
  2068. kControlPictureProc = 304,
  2069. kControlPictureNoTrackProc = 305 /* immediately returns kControlPicturePart*/
  2070. };
  2071. /* Control Kind Tag */
  2072. enum {
  2073. kControlKindPicture = FOUR_CHAR_CODE('pict')
  2074. };
  2075. /* Creation API: Carbon only */
  2076. /*
  2077. * CreatePictureControl()
  2078. *
  2079. * Availability:
  2080. * Non-Carbon CFM: not available
  2081. * CarbonLib: in CarbonLib 1.1 and later
  2082. * Mac OS X: in version 10.0 and later
  2083. */
  2084. EXTERN_API( OSStatus )
  2085. CreatePictureControl(
  2086. WindowRef window,
  2087. const Rect * boundsRect,
  2088. const ControlButtonContentInfo * content,
  2089. Boolean dontTrack,
  2090. ControlRef * outControl);
  2091. /* Tagged data supported by picture controls */
  2092. enum {
  2093. kControlPictureHandleTag = FOUR_CHAR_CODE('pich') /* PicHandle*/
  2094. };
  2095. /*--------------------------------------------------------------------------------------*/
  2096. /* o ICON CONTROL (CDEF 20) */
  2097. /*--------------------------------------------------------------------------------------*/
  2098. /* Value parameter should contain the ID of the ICON or cicn you wish to display when */
  2099. /* creating controls of this type. If you don't want the control tracked at all, use */
  2100. /* the 'no track' variant. */
  2101. /* Icon control proc IDs */
  2102. enum {
  2103. kControlIconProc = 320,
  2104. kControlIconNoTrackProc = 321, /* immediately returns kControlIconPart*/
  2105. kControlIconSuiteProc = 322,
  2106. kControlIconSuiteNoTrackProc = 323 /* immediately returns kControlIconPart*/
  2107. };
  2108. enum {
  2109. /* icon ref controls may have either an icon, color icon, icon suite, or icon ref.*/
  2110. /* for data other than icon, you must set the data by passing a*/
  2111. /* ControlButtonContentInfo to SetControlData*/
  2112. kControlIconRefProc = 324,
  2113. kControlIconRefNoTrackProc = 325 /* immediately returns kControlIconPart*/
  2114. };
  2115. /* Control Kind Tag */
  2116. enum {
  2117. kControlKindIcon = FOUR_CHAR_CODE('icon')
  2118. };
  2119. /*
  2120. * CreateIconControl()
  2121. *
  2122. * Summary:
  2123. * Creates an Icon control at a specific position in the specified
  2124. * window.
  2125. *
  2126. * Discussion:
  2127. * Icon controls display an icon that (optionally) hilites when
  2128. * clicked on. On Mac OS X, a root control will be created for the
  2129. * window if one does not already exist. If a root control exists
  2130. * for the window, the Icon control will be embedded into it.
  2131. *
  2132. * Parameters:
  2133. *
  2134. * inWindow:
  2135. * The WindowRef into which the Icon control will be created.
  2136. *
  2137. * inBoundsRect:
  2138. * The desired position (in coordinates local to the window's
  2139. * port) for the Icon control.
  2140. *
  2141. * inIconContent:
  2142. * The descriptor for the icon you want the control to display.
  2143. * Mac OS X and CarbonLib 1.5 (and beyond) support all of the icon
  2144. * content types. Prior to CarbonLib 1.5, the only content types
  2145. * that are properly respected are kControlContentIconSuiteRes,
  2146. * kControlContentCIconRes, and kControlContentICONRes.
  2147. *
  2148. * inDontTrack:
  2149. * A Boolean value indicating whether the control should hilite
  2150. * when it is clicked on. False means hilite and track the mouse.
  2151. *
  2152. * outControl:
  2153. * On successful output, outControl will contain a reference to
  2154. * the Icon control.
  2155. *
  2156. * Result:
  2157. * An OSStatus code indicating success or failure.
  2158. *
  2159. * Availability:
  2160. * Non-Carbon CFM: not available
  2161. * CarbonLib: in CarbonLib 1.1 and later
  2162. * Mac OS X: in version 10.0 and later
  2163. */
  2164. EXTERN_API( OSStatus )
  2165. CreateIconControl(
  2166. WindowRef inWindow,
  2167. const Rect * inBoundsRect,
  2168. const ControlButtonContentInfo * inIconContent,
  2169. Boolean inDontTrack,
  2170. ControlRef * outControl);
  2171. /* Tagged data supported by icon controls */
  2172. enum {
  2173. kControlIconTransformTag = FOUR_CHAR_CODE('trfm'), /* IconTransformType*/
  2174. kControlIconAlignmentTag = FOUR_CHAR_CODE('algn') /* IconAlignmentType*/
  2175. };
  2176. /* Tags available with appearance 1.1 or later */
  2177. enum {
  2178. kControlIconResourceIDTag = FOUR_CHAR_CODE('ires'), /* SInt16 resource ID of icon to use*/
  2179. kControlIconContentTag = FOUR_CHAR_CODE('cont') /* accepts a ControlButtonContentInfo*/
  2180. };
  2181. /*--------------------------------------------------------------------------------------*/
  2182. /* o WINDOW HEADER (CDEF 21) */
  2183. /*--------------------------------------------------------------------------------------*/
  2184. /* Window Header proc IDs */
  2185. enum {
  2186. kControlWindowHeaderProc = 336, /* normal header*/
  2187. kControlWindowListViewHeaderProc = 337 /* variant for list views - no bottom line*/
  2188. };
  2189. /* Control Kind Tag */
  2190. enum {
  2191. kControlKindWindowHeader = FOUR_CHAR_CODE('whed')
  2192. };
  2193. /* Creation API: Carbon Only */
  2194. /*
  2195. * CreateWindowHeaderControl()
  2196. *
  2197. * Availability:
  2198. * Non-Carbon CFM: not available
  2199. * CarbonLib: in CarbonLib 1.1 and later
  2200. * Mac OS X: in version 10.0 and later
  2201. */
  2202. EXTERN_API( OSStatus )
  2203. CreateWindowHeaderControl(
  2204. WindowRef window,
  2205. const Rect * boundsRect,
  2206. Boolean isListHeader,
  2207. ControlRef * outControl);
  2208. /*--------------------------------------------------------------------------------------*/
  2209. /* o LIST BOX (CDEF 22) */
  2210. /*--------------------------------------------------------------------------------------*/
  2211. /* Lists use an auxiliary resource to define their format. The resource type used is */
  2212. /* 'ldes' and a definition for it can be found in Appearance.r. The resource ID for */
  2213. /* the ldes is passed in the 'value' parameter when creating the control. You may pass */
  2214. /* zero in value. This tells the List Box control to not use a resource. The list will */
  2215. /* be created with default values, and will use the standard LDEF (0). You can change */
  2216. /* the list by getting the list handle. You can set the LDEF to use by using the tag */
  2217. /* below (kControlListBoxLDEFTag) */
  2218. /* List Box proc IDs */
  2219. enum {
  2220. kControlListBoxProc = 352,
  2221. kControlListBoxAutoSizeProc = 353
  2222. };
  2223. /* Control Kind Tag */
  2224. enum {
  2225. kControlKindListBox = FOUR_CHAR_CODE('lbox')
  2226. };
  2227. /* Creation API: Carbon Only */
  2228. /*
  2229. * CreateListBoxControl()
  2230. *
  2231. * Availability:
  2232. * Non-Carbon CFM: not available
  2233. * CarbonLib: in CarbonLib 1.1 and later
  2234. * Mac OS X: in version 10.0 and later
  2235. */
  2236. EXTERN_API( OSStatus )
  2237. CreateListBoxControl(
  2238. WindowRef window,
  2239. const Rect * boundsRect,
  2240. Boolean autoSize,
  2241. SInt16 numRows,
  2242. SInt16 numColumns,
  2243. Boolean horizScroll,
  2244. Boolean vertScroll,
  2245. SInt16 cellHeight,
  2246. SInt16 cellWidth,
  2247. Boolean hasGrowSpace,
  2248. const ListDefSpec * listDef,
  2249. ControlRef * outControl);
  2250. /* Tagged data supported by list box */
  2251. enum {
  2252. kControlListBoxListHandleTag = FOUR_CHAR_CODE('lhan'), /* ListHandle*/
  2253. kControlListBoxKeyFilterTag = kControlKeyFilterTag, /* ControlKeyFilterUPP*/
  2254. kControlListBoxFontStyleTag = kControlFontStyleTag /* ControlFontStyleRec*/
  2255. };
  2256. /* New tags in 1.0.1 or later */
  2257. enum {
  2258. kControlListBoxDoubleClickTag = FOUR_CHAR_CODE('dblc'), /* Boolean. Was last click a double-click?*/
  2259. kControlListBoxLDEFTag = FOUR_CHAR_CODE('ldef') /* SInt16. ID of LDEF to use.*/
  2260. };
  2261. /*--------------------------------------------------------------------------------------*/
  2262. /* o PUSH BUTTON (CDEF 23) */
  2263. /*--------------------------------------------------------------------------------------*/
  2264. /* The new standard checkbox and radio button controls support a "mixed" value that */
  2265. /* indicates that the current setting contains a mixed set of on and off values. The */
  2266. /* control value used to display this indication is defined in Controls.h: */
  2267. /* */
  2268. /* kControlCheckBoxMixedValue = 2 */
  2269. /* */
  2270. /* Two new variants of the standard pushbutton have been added to the standard control */
  2271. /* suite that draw a color icon next to the control title. One variant draws the icon */
  2272. /* on the left side, the other draws it on the right side (when the system justifica- */
  2273. /* tion is right to left, these are reversed). */
  2274. /* */
  2275. /* When either of the icon pushbuttons are created, the contrlMax field of the control */
  2276. /* record is used to determine the ID of the 'cicn' resource drawn in the pushbutton. */
  2277. /* */
  2278. /* In addition, a push button can now be told to draw with a default outline using the */
  2279. /* SetControlData routine with the kControlPushButtonDefaultTag below. */
  2280. /* */
  2281. /* A push button may also be marked using the kControlPushButtonCancelTag. This has */
  2282. /* no visible representation, but does cause the button to play the CancelButton theme */
  2283. /* sound instead of the regular pushbutton theme sound when pressed. */
  2284. /* */
  2285. /* Theme Push Button/Check Box/Radio Button proc IDs */
  2286. enum {
  2287. kControlPushButtonProc = 368,
  2288. kControlCheckBoxProc = 369,
  2289. kControlRadioButtonProc = 370,
  2290. kControlPushButLeftIconProc = 374, /* Standard pushbutton with left-side icon*/
  2291. kControlPushButRightIconProc = 375 /* Standard pushbutton with right-side icon*/
  2292. };
  2293. /* Variants with Appearance 1.1 or later */
  2294. enum {
  2295. kControlCheckBoxAutoToggleProc = 371,
  2296. kControlRadioButtonAutoToggleProc = 372
  2297. };
  2298. /* Push Button Icon Alignments */
  2299. typedef UInt16 ControlPushButtonIconAlignment;
  2300. enum {
  2301. kControlPushButtonIconOnLeft = 6,
  2302. kControlPushButtonIconOnRight = 7
  2303. };
  2304. /* Control Kind Tag */
  2305. enum {
  2306. kControlKindPushButton = FOUR_CHAR_CODE('push'),
  2307. kControlKindPushIconButton = FOUR_CHAR_CODE('picn'),
  2308. kControlKindRadioButton = FOUR_CHAR_CODE('rdio'),
  2309. kControlKindCheckBox = FOUR_CHAR_CODE('cbox')
  2310. };
  2311. /* Creation APIs: Carbon Only */
  2312. /*
  2313. * CreatePushButtonControl()
  2314. *
  2315. * Availability:
  2316. * Non-Carbon CFM: not available
  2317. * CarbonLib: in CarbonLib 1.1 and later
  2318. * Mac OS X: in version 10.0 and later
  2319. */
  2320. EXTERN_API( OSStatus )
  2321. CreatePushButtonControl(
  2322. WindowRef window,
  2323. const Rect * boundsRect,
  2324. CFStringRef title,
  2325. ControlRef * outControl);
  2326. /*
  2327. * CreatePushButtonWithIconControl()
  2328. *
  2329. * Availability:
  2330. * Non-Carbon CFM: not available
  2331. * CarbonLib: in CarbonLib 1.1 and later
  2332. * Mac OS X: in version 10.0 and later
  2333. */
  2334. EXTERN_API( OSStatus )
  2335. CreatePushButtonWithIconControl(
  2336. WindowRef window,
  2337. const Rect * boundsRect,
  2338. CFStringRef title,
  2339. ControlButtonContentInfo * icon,
  2340. ControlPushButtonIconAlignment iconAlignment,
  2341. ControlRef * outControl);
  2342. /*
  2343. * CreateRadioButtonControl()
  2344. *
  2345. * Availability:
  2346. * Non-Carbon CFM: not available
  2347. * CarbonLib: in CarbonLib 1.1 and later
  2348. * Mac OS X: in version 10.0 and later
  2349. */
  2350. EXTERN_API( OSStatus )
  2351. CreateRadioButtonControl(
  2352. WindowRef window,
  2353. const Rect * boundsRect,
  2354. CFStringRef title,
  2355. SInt32 initialValue,
  2356. Boolean autoToggle,
  2357. ControlRef * outControl);
  2358. /*
  2359. * CreateCheckBoxControl()
  2360. *
  2361. * Availability:
  2362. * Non-Carbon CFM: not available
  2363. * CarbonLib: in CarbonLib 1.1 and later
  2364. * Mac OS X: in version 10.0 and later
  2365. */
  2366. EXTERN_API( OSStatus )
  2367. CreateCheckBoxControl(
  2368. WindowRef window,
  2369. const Rect * boundsRect,
  2370. CFStringRef title,
  2371. SInt32 initialValue,
  2372. Boolean autoToggle,
  2373. ControlRef * outControl);
  2374. /* Tagged data supported by standard buttons */
  2375. enum {
  2376. kControlPushButtonDefaultTag = FOUR_CHAR_CODE('dflt'), /* default ring flag*/
  2377. kControlPushButtonCancelTag = FOUR_CHAR_CODE('cncl') /* cancel button flag (1.1 and later)*/
  2378. };
  2379. /*--------------------------------------------------------------------------------------*/
  2380. /* o SCROLL BAR (CDEF 24) */
  2381. /*--------------------------------------------------------------------------------------*/
  2382. /* This is the new Appearance scroll bar. */
  2383. /* */
  2384. /* Theme Scroll Bar proc IDs */
  2385. enum {
  2386. kControlScrollBarProc = 384, /* normal scroll bar*/
  2387. kControlScrollBarLiveProc = 386 /* live scrolling variant*/
  2388. };
  2389. /* Control Kind Tag */
  2390. enum {
  2391. kControlKindScrollBar = FOUR_CHAR_CODE('sbar')
  2392. };
  2393. /* Creation API: Carbon Only */
  2394. /*
  2395. * CreateScrollBarControl()
  2396. *
  2397. * Availability:
  2398. * Non-Carbon CFM: not available
  2399. * CarbonLib: in CarbonLib 1.1 and later
  2400. * Mac OS X: in version 10.0 and later
  2401. */
  2402. EXTERN_API( OSStatus )
  2403. CreateScrollBarControl(
  2404. WindowRef window,
  2405. const Rect * boundsRect,
  2406. SInt32 value,
  2407. SInt32 minimum,
  2408. SInt32 maximum,
  2409. SInt32 viewSize,
  2410. Boolean liveTracking,
  2411. ControlActionUPP liveTrackingProc,
  2412. ControlRef * outControl);
  2413. /* These tags are available in Mac OS X or later */
  2414. enum {
  2415. kControlScrollBarShowsArrowsTag = FOUR_CHAR_CODE('arro') /* Boolean whether or not to draw the scroll arrows*/
  2416. };
  2417. /*--------------------------------------------------------------------------------------*/
  2418. /* o POPUP BUTTON (CDEF 25) */
  2419. /*--------------------------------------------------------------------------------------*/
  2420. /* This is the new Appearance Popup Button. It takes the same variants and does the */
  2421. /* same overloading as the previous popup menu control. There are some differences: */
  2422. /* */
  2423. /* Passing in a menu ID of -12345 causes the popup not to try and get the menu from a */
  2424. /* resource. Instead, you can build the menu and later stuff the MenuRef field in */
  2425. /* the popup data information. */
  2426. /* */
  2427. /* You can pass -1 in the Max parameter to have the control calculate the width of the */
  2428. /* title on its own instead of guessing and then tweaking to get it right. It adds the */
  2429. /* appropriate amount of space between the title and the popup. */
  2430. /* */
  2431. /* Theme Popup Button proc IDs */
  2432. enum {
  2433. kControlPopupButtonProc = 400,
  2434. kControlPopupFixedWidthVariant = 1 << 0,
  2435. kControlPopupVariableWidthVariant = 1 << 1,
  2436. kControlPopupUseAddResMenuVariant = 1 << 2,
  2437. kControlPopupUseWFontVariant = kControlUsesOwningWindowsFontVariant
  2438. };
  2439. /* Control Kind Tag */
  2440. enum {
  2441. kControlKindPopupButton = FOUR_CHAR_CODE('popb')
  2442. };
  2443. /* Creation API: Carbon Only */
  2444. /*
  2445. * CreatePopupButtonControl()
  2446. *
  2447. * Availability:
  2448. * Non-Carbon CFM: not available
  2449. * CarbonLib: in CarbonLib 1.1 and later
  2450. * Mac OS X: in version 10.0 and later
  2451. */
  2452. EXTERN_API( OSStatus )
  2453. CreatePopupButtonControl(
  2454. WindowRef window,
  2455. const Rect * boundsRect,
  2456. CFStringRef title,
  2457. SInt16 menuID,
  2458. Boolean variableWidth,
  2459. SInt16 titleWidth,
  2460. SInt16 titleJustification,
  2461. Style titleStyle,
  2462. ControlRef * outControl);
  2463. /* These tags are available in 1.0.1 or later of Appearance */
  2464. enum {
  2465. kControlPopupButtonMenuHandleTag = FOUR_CHAR_CODE('mhan'), /* MenuRef*/
  2466. kControlPopupButtonMenuRefTag = FOUR_CHAR_CODE('mhan'), /* MenuRef*/
  2467. kControlPopupButtonMenuIDTag = FOUR_CHAR_CODE('mnid') /* SInt16*/
  2468. };
  2469. /* These tags are available in 1.1 or later of Appearance */
  2470. enum {
  2471. kControlPopupButtonExtraHeightTag = FOUR_CHAR_CODE('exht'), /* SInt16 - extra vertical whitespace within the button*/
  2472. kControlPopupButtonOwnedMenuRefTag = FOUR_CHAR_CODE('omrf') /* MenuRef*/
  2473. };
  2474. /* These tags are available in Mac OS X */
  2475. enum {
  2476. kControlPopupButtonCheckCurrentTag = FOUR_CHAR_CODE('chck') /* Boolean - whether the popup puts a checkmark next to the current item (defaults to true)*/
  2477. };
  2478. /*--------------------------------------------------------------------------------------*/
  2479. /* o RADIO GROUP (CDEF 26) */
  2480. /*--------------------------------------------------------------------------------------*/
  2481. /* This control implements a radio group. It is an embedding control and can therefore */
  2482. /* only be used when a control hierarchy is established for its owning window. You */
  2483. /* should only embed radio buttons within it. As radio buttons are embedded into it, */
  2484. /* the group sets up its value, min, and max to represent the number of embedded items.*/
  2485. /* The current value of the control is the index of the sub-control that is the current*/
  2486. /* 'on' radio button. To get the current radio button control handle, you can use the */
  2487. /* control manager call GetIndSubControl, passing in the value of the radio group. */
  2488. /* */
  2489. /* NOTE: This control is only available with Appearance 1.0.1. */
  2490. /* Radio Group Proc ID */
  2491. enum {
  2492. kControlRadioGroupProc = 416
  2493. };
  2494. /* Control Kind Tag */
  2495. enum {
  2496. kControlKindRadioGroup = FOUR_CHAR_CODE('rgrp')
  2497. };
  2498. /* Creation API: Carbon Only */
  2499. /*
  2500. * CreateRadioGroupControl()
  2501. *
  2502. * Availability:
  2503. * Non-Carbon CFM: not available
  2504. * CarbonLib: in CarbonLib 1.1 and later
  2505. * Mac OS X: in version 10.0 and later
  2506. */
  2507. EXTERN_API( OSStatus )
  2508. CreateRadioGroupControl(
  2509. WindowRef window,
  2510. const Rect * boundsRect,
  2511. ControlRef * outControl);
  2512. /*--------------------------------------------------------------------------------------*/
  2513. /* o SCROLL TEXT BOX (CDEF 27) */
  2514. /*--------------------------------------------------------------------------------------*/
  2515. /* This control implements a scrolling box of (non-editable) text. This is useful for */
  2516. /* credits in about boxes, etc. */
  2517. /* The standard version of this control has a scroll bar, but the autoscrolling */
  2518. /* variant does not. The autoscrolling variant needs two pieces of information to */
  2519. /* work: delay (in ticks) before the scrolling starts, and time (in ticks) between */
  2520. /* scrolls. It will scroll one pixel at a time, unless changed via SetControlData. */
  2521. /* */
  2522. /* Parameter What Goes Here */
  2523. /* ------------------- ---------------------------------------------------- */
  2524. /* Value Resource ID of 'TEXT'/'styl' content. */
  2525. /* Min Scroll start delay (in ticks) . */
  2526. /* Max Delay (in ticks) between scrolls. */
  2527. /* */
  2528. /* NOTE: This control is only available with Appearance 1.1. */
  2529. /* Scroll Text Box Proc IDs */
  2530. enum {
  2531. kControlScrollTextBoxProc = 432,
  2532. kControlScrollTextBoxAutoScrollProc = 433
  2533. };
  2534. /* Control Kind Tag */
  2535. enum {
  2536. kControlKindScrollingTextBox = FOUR_CHAR_CODE('stbx')
  2537. };
  2538. /* Creation API: Carbon Only */
  2539. /*
  2540. * CreateScrollingTextBoxControl()
  2541. *
  2542. * Availability:
  2543. * Non-Carbon CFM: not available
  2544. * CarbonLib: in CarbonLib 1.1 and later
  2545. * Mac OS X: in version 10.0 and later
  2546. */
  2547. EXTERN_API( OSStatus )
  2548. CreateScrollingTextBoxControl(
  2549. WindowRef window,
  2550. const Rect * boundsRect,
  2551. SInt16 contentResID,
  2552. Boolean autoScroll,
  2553. UInt32 delayBeforeAutoScroll,
  2554. UInt32 delayBetweenAutoScroll,
  2555. UInt16 autoScrollAmount,
  2556. ControlRef * outControl);
  2557. /* Tagged data supported by Scroll Text Box */
  2558. enum {
  2559. kControlScrollTextBoxDelayBeforeAutoScrollTag = FOUR_CHAR_CODE('stdl'), /* UInt32 (ticks until autoscrolling starts)*/
  2560. kControlScrollTextBoxDelayBetweenAutoScrollTag = FOUR_CHAR_CODE('scdl'), /* UInt32 (ticks between scrolls)*/
  2561. kControlScrollTextBoxAutoScrollAmountTag = FOUR_CHAR_CODE('samt'), /* UInt16 (pixels per scroll) -- defaults to 1*/
  2562. kControlScrollTextBoxContentsTag = FOUR_CHAR_CODE('tres'), /* SInt16 (resource ID of 'TEXT'/'styl') -- write only!*/
  2563. kControlScrollTextBoxAnimatingTag = FOUR_CHAR_CODE('anim') /* Boolean (whether the text box should auto-scroll)*/
  2564. };
  2565. /*--------------------------------------------------------------------------------------*/
  2566. /* o DISCLOSURE BUTTON */
  2567. /*--------------------------------------------------------------------------------------*/
  2568. /*
  2569. * CreateDisclosureButtonControl()
  2570. *
  2571. * Summary:
  2572. * Creates a new instance of the Disclosure Button Control.
  2573. *
  2574. * Discussion:
  2575. * CreateDisclosureButtonControl is preferred over NewControl
  2576. * because it allows you to specify the exact set of parameters
  2577. * required to create the control without overloading parameter
  2578. * semantics. The initial minimum of the Disclosure Button will be
  2579. * kControlDisclosureButtonClosed, and the maximum will be
  2580. * kControlDisclosureButtonDisclosed.
  2581. *
  2582. * Parameters:
  2583. *
  2584. * inWindow:
  2585. * The WindowRef in which to create the control.
  2586. *
  2587. * inBoundsRect:
  2588. * The bounding rectangle for the control. The height of the
  2589. * control is fixed and the control will be centered vertically
  2590. * within the rectangle you specify.
  2591. *
  2592. * inValue:
  2593. * The initial value; either kControlDisclosureButtonClosed or
  2594. * kControlDisclosureButtonDisclosed.
  2595. *
  2596. * inAutoToggles:
  2597. * A boolean value indicating whether its value should change
  2598. * automatically after tracking the mouse.
  2599. *
  2600. * outControl:
  2601. * On successful exit, this will contain the new control.
  2602. *
  2603. * Availability:
  2604. * Non-Carbon CFM: not available
  2605. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  2606. * Mac OS X: in version 10.0 and later
  2607. */
  2608. EXTERN_API( OSStatus )
  2609. CreateDisclosureButtonControl(
  2610. WindowRef inWindow,
  2611. const Rect * inBoundsRect,
  2612. SInt32 inValue,
  2613. Boolean inAutoToggles,
  2614. ControlRef * outControl);
  2615. /* Control Kind Tag */
  2616. enum {
  2617. kControlKindDisclosureButton = FOUR_CHAR_CODE('disb')
  2618. };
  2619. /*
  2620. * Discussion:
  2621. * Disclosure Button Values
  2622. */
  2623. enum {
  2624. /*
  2625. * The control be drawn suggesting a closed state.
  2626. */
  2627. kControlDisclosureButtonClosed = 0,
  2628. /*
  2629. * The control will be drawn suggesting an open state.
  2630. */
  2631. kControlDisclosureButtonDisclosed = 1
  2632. };
  2633. /*--------------------------------------------------------------------------------------*/
  2634. /* o ROUND BUTTON */
  2635. /*--------------------------------------------------------------------------------------*/
  2636. /*
  2637. * ControlRoundButtonSize
  2638. *
  2639. * Discussion:
  2640. * Button Sizes
  2641. */
  2642. typedef SInt16 ControlRoundButtonSize;
  2643. enum {
  2644. /*
  2645. * A 20 pixel diameter button.
  2646. */
  2647. kControlRoundButtonNormalSize = kControlSizeNormal,
  2648. /*
  2649. * A 25 pixel diameter button.
  2650. */
  2651. kControlRoundButtonLargeSize = kControlSizeLarge
  2652. };
  2653. /* Data tags supported by the round button controls */
  2654. enum {
  2655. kControlRoundButtonContentTag = FOUR_CHAR_CODE('cont'), /* ControlButtonContentInfo*/
  2656. kControlRoundButtonSizeTag = kControlSizeTag /* ControlRoundButtonSize*/
  2657. };
  2658. /* Control Kind Tag */
  2659. enum {
  2660. kControlKindRoundButton = FOUR_CHAR_CODE('rndb')
  2661. };
  2662. /*
  2663. * CreateRoundButtonControl()
  2664. *
  2665. * Summary:
  2666. * Creates a new instance of the Round Button Control.
  2667. *
  2668. * Discussion:
  2669. * CreateRoundButtonControl is preferred over NewControl because it
  2670. * allows you to specify the exact set of parameters required to
  2671. * create the control without overloading parameter semantics.
  2672. *
  2673. * Parameters:
  2674. *
  2675. * inWindow:
  2676. * The WindowRef in which to create the control.
  2677. *
  2678. * inBoundsRect:
  2679. * The bounding rectangle for the control. The height and width of
  2680. * the control is fixed (specified by the ControlRoundButtonSize
  2681. * parameter) and the control will be centered within the
  2682. * rectangle you specify.
  2683. *
  2684. * inSize:
  2685. * The button size; either kControlRoundButtonNormalSize or
  2686. * kControlRoundButtonLargeSize.
  2687. *
  2688. * inContent:
  2689. * Any optional content displayed in the button. Currently only
  2690. * kControlContentIconRef is supported.
  2691. *
  2692. * outControl:
  2693. * On successful exit, this will contain the new control.
  2694. *
  2695. * Availability:
  2696. * Non-Carbon CFM: not available
  2697. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  2698. * Mac OS X: in version 10.0 and later
  2699. */
  2700. EXTERN_API( OSStatus )
  2701. CreateRoundButtonControl(
  2702. WindowRef inWindow,
  2703. const Rect * inBoundsRect,
  2704. ControlRoundButtonSize inSize,
  2705. ControlButtonContentInfo * inContent,
  2706. ControlRef * outControl);
  2707. /*--------------------------------------------------------------------------------------*/
  2708. /* o DATA BROWSER */
  2709. /* (CDEF 29) */
  2710. /*--------------------------------------------------------------------------------------*/
  2711. /* This control implements a user interface component for browsing (optionally) */
  2712. /* hiearchical data structures. The browser supports multiple presentation styles */
  2713. /* including, but not limited to: */
  2714. /* */
  2715. /* kDataBrowserListView - items and item properties in */
  2716. /* multi-column (optionally outline) format */
  2717. /* kDataBrowserColumnView - in-place browsing using fixed navigation columns */
  2718. /* */
  2719. /* The browser manages all view styles through a single high-level interface. */
  2720. /* The high-level interface makes the following assumptions: */
  2721. /* */
  2722. /* - Items have unique 32-bit identifiers (0 is reserved) */
  2723. /* */
  2724. /* - Items have two kinds of named and typed properties: */
  2725. /* - Predefined attribute properties ( < 1024 ) */
  2726. /* (including some display properties) */
  2727. /* - Client-defined display properties ( >= 1024 ) */
  2728. /* */
  2729. /* - Some items are containers of other items */
  2730. /* - Items may be sorted by any property */
  2731. /* */
  2732. /* Because a browser doesn't know all details about the type of objects it manages, */
  2733. /* some implementation responsibility is best handled by its client. The client must */
  2734. /* provide a set of callback routines which define the item hierarchy and help to */
  2735. /* populate the browser with items. The client may also provide callbacks for handling */
  2736. /* custom data types and doing low-level event management. */
  2737. /* */
  2738. /* The API is subdivided into a "universal" set of routines that applies to all view */
  2739. /* styles, and a set of routines unique to each view style. kDataBrowserListView and */
  2740. /* kDataBrowserColumnView share an (internal) TableView abstract base class. The */
  2741. /* TableView formatting options and API applies to both of these view styles. */
  2742. /* */
  2743. /* NOTE: This control is only available with CarbonLib 1.1. */
  2744. /* */
  2745. /* NOTE: This control must be created with the CreateDataBrowserControl API in */
  2746. /* CarbonLib 1.1 through 1.4. In Mac OS X and CarbonLib 1.5 and later, you */
  2747. /* may use the control's procID (29) to create the control with NewControl */
  2748. /* or with a 'CNTL' resource. */
  2749. /* Control Kind Tag */
  2750. enum {
  2751. kControlKindDataBrowser = FOUR_CHAR_CODE('datb')
  2752. };
  2753. /* Error Codes */
  2754. enum {
  2755. errDataBrowserNotConfigured = -4970,
  2756. errDataBrowserItemNotFound = -4971,
  2757. errDataBrowserItemNotAdded = -4975,
  2758. errDataBrowserPropertyNotFound = -4972,
  2759. errDataBrowserInvalidPropertyPart = -4973,
  2760. errDataBrowserInvalidPropertyData = -4974,
  2761. errDataBrowserPropertyNotSupported = -4979 /* Return from DataBrowserGetSetItemDataProc */
  2762. };
  2763. enum {
  2764. /* Generic Control Tags */
  2765. kControlDataBrowserIncludesFrameAndFocusTag = FOUR_CHAR_CODE('brdr'), /* Boolean */
  2766. kControlDataBrowserKeyFilterTag = kControlEditTextKeyFilterTag,
  2767. kControlDataBrowserEditTextKeyFilterTag = kControlDataBrowserKeyFilterTag,
  2768. kControlDataBrowserEditTextValidationProcTag = kControlEditTextValidationProcTag
  2769. };
  2770. /* Data Browser View Styles */
  2771. typedef OSType DataBrowserViewStyle;
  2772. enum {
  2773. kDataBrowserNoView = 0x3F3F3F3F, /* Error State */
  2774. kDataBrowserListView = FOUR_CHAR_CODE('lstv'),
  2775. kDataBrowserColumnView = FOUR_CHAR_CODE('clmv')
  2776. };
  2777. /* Selection Flags */
  2778. typedef UInt32 DataBrowserSelectionFlags;
  2779. enum {
  2780. kDataBrowserDragSelect = 1 << 0, /* * ListMgr lNoRect */
  2781. kDataBrowserSelectOnlyOne = 1 << 1, /* * ListMgr lOnlyOne */
  2782. kDataBrowserResetSelection = 1 << 2, /* * ListMgr lNoExtend */
  2783. kDataBrowserCmdTogglesSelection = 1 << 3, /* * ListMgr lUseSense */
  2784. kDataBrowserNoDisjointSelection = 1 << 4, /* * ListMgr lNoDisjoint */
  2785. kDataBrowserAlwaysExtendSelection = 1 << 5, /* * ListMgr lExtendDrag */
  2786. kDataBrowserNeverEmptySelectionSet = 1 << 6 /* * ListMgr lNoNilHilite */
  2787. };
  2788. /* Data Browser Sorting */
  2789. typedef UInt16 DataBrowserSortOrder;
  2790. enum {
  2791. kDataBrowserOrderUndefined = 0, /* Not currently supported */
  2792. kDataBrowserOrderIncreasing = 1,
  2793. kDataBrowserOrderDecreasing = 2
  2794. };
  2795. /* Data Browser Item Management */
  2796. typedef UInt32 DataBrowserItemID;
  2797. enum {
  2798. kDataBrowserNoItem = 0L /* Reserved DataBrowserItemID */
  2799. };
  2800. typedef UInt32 DataBrowserItemState;
  2801. enum {
  2802. kDataBrowserItemNoState = 0,
  2803. kDataBrowserItemAnyState = (unsigned long)(-1),
  2804. kDataBrowserItemIsSelected = 1 << 0,
  2805. kDataBrowserContainerIsOpen = 1 << 1,
  2806. kDataBrowserItemIsDragTarget = 1 << 2 /* During a drag operation */
  2807. };
  2808. /* Options for use with RevealDataBrowserItem */
  2809. typedef UInt8 DataBrowserRevealOptions;
  2810. enum {
  2811. kDataBrowserRevealOnly = 0,
  2812. kDataBrowserRevealAndCenterInView = 1 << 0,
  2813. kDataBrowserRevealWithoutSelecting = 1 << 1
  2814. };
  2815. /* Set operations for use with SetDataBrowserSelectedItems */
  2816. typedef UInt32 DataBrowserSetOption;
  2817. enum {
  2818. kDataBrowserItemsAdd = 0, /* add specified items to existing set */
  2819. kDataBrowserItemsAssign = 1, /* assign destination set to specified items */
  2820. kDataBrowserItemsToggle = 2, /* toggle membership state of specified items */
  2821. kDataBrowserItemsRemove = 3 /* remove specified items from existing set */
  2822. };
  2823. /* Commands for use with MoveDataBrowserSelectionAnchor */
  2824. typedef UInt32 DataBrowserSelectionAnchorDirection;
  2825. enum {
  2826. kDataBrowserSelectionAnchorUp = 0,
  2827. kDataBrowserSelectionAnchorDown = 1,
  2828. kDataBrowserSelectionAnchorLeft = 2,
  2829. kDataBrowserSelectionAnchorRight = 3
  2830. };
  2831. /* Edit menu command IDs for use with Enable/ExecuteDataBrowserEditCommand */
  2832. typedef UInt32 DataBrowserEditCommand;
  2833. enum {
  2834. kDataBrowserEditMsgUndo = kHICommandUndo,
  2835. kDataBrowserEditMsgRedo = kHICommandRedo,
  2836. kDataBrowserEditMsgCut = kHICommandCut,
  2837. kDataBrowserEditMsgCopy = kHICommandCopy,
  2838. kDataBrowserEditMsgPaste = kHICommandPaste,
  2839. kDataBrowserEditMsgClear = kHICommandClear,
  2840. kDataBrowserEditMsgSelectAll = kHICommandSelectAll
  2841. };
  2842. /* Notifications used in DataBrowserItemNotificationProcPtr */
  2843. typedef UInt32 DataBrowserItemNotification;
  2844. enum {
  2845. kDataBrowserItemAdded = 1, /* The specified item has been added to the browser */
  2846. kDataBrowserItemRemoved = 2, /* The specified item has been removed from the browser */
  2847. kDataBrowserEditStarted = 3, /* Starting an EditText session for specified item */
  2848. kDataBrowserEditStopped = 4, /* Stopping an EditText session for specified item */
  2849. kDataBrowserItemSelected = 5, /* Item has just been added to the selection set */
  2850. kDataBrowserItemDeselected = 6, /* Item has just been removed from the selection set */
  2851. kDataBrowserItemDoubleClicked = 7,
  2852. kDataBrowserContainerOpened = 8, /* Container is open */
  2853. kDataBrowserContainerClosing = 9, /* Container is about to close (and will real soon now, y'all) */
  2854. kDataBrowserContainerClosed = 10, /* Container is closed (y'all come back now!) */
  2855. kDataBrowserContainerSorting = 11, /* Container is about to be sorted (lock any volatile properties) */
  2856. kDataBrowserContainerSorted = 12, /* Container has been sorted (you may release any property locks) */
  2857. kDataBrowserUserToggledContainer = 16, /* _User_ requested container open/close state to be toggled */
  2858. kDataBrowserTargetChanged = 15, /* The target has changed to the specified item */
  2859. kDataBrowserUserStateChanged = 13, /* The user has reformatted the view for the target */
  2860. kDataBrowserSelectionSetChanged = 14 /* The selection set has been modified (net result may be the same) */
  2861. };
  2862. /* DataBrowser Property Management */
  2863. /* 0-1023 reserved; >= 1024 for client use */
  2864. typedef UInt32 DataBrowserPropertyID;
  2865. enum {
  2866. /* Predefined attribute properties, optional & non-display unless otherwise stated */
  2867. kDataBrowserItemNoProperty = 0L, /* The anti-property (no associated data) */
  2868. kDataBrowserItemIsActiveProperty = 1L, /* Boolean typed data (defaults to true) */
  2869. kDataBrowserItemIsSelectableProperty = 2L, /* Boolean typed data (defaults to true) */
  2870. kDataBrowserItemIsEditableProperty = 3L, /* Boolean typed data (defaults to false, used for editable properties) */
  2871. kDataBrowserItemIsContainerProperty = 4L, /* Boolean typed data (defaults to false) */
  2872. kDataBrowserContainerIsOpenableProperty = 5L, /* Boolean typed data (defaults to true) */
  2873. kDataBrowserContainerIsClosableProperty = 6L, /* Boolean typed data (defaults to true) */
  2874. kDataBrowserContainerIsSortableProperty = 7L, /* Boolean typed data (defaults to true) */
  2875. kDataBrowserItemSelfIdentityProperty = 8L, /* kDataBrowserIconAndTextType (display property; ColumnView only) */
  2876. kDataBrowserContainerAliasIDProperty = 9L, /* DataBrowserItemID (alias/symlink an item to a container item) */
  2877. kDataBrowserColumnViewPreviewProperty = 10L, /* kDataBrowserCustomType (display property; ColumnView only) */
  2878. kDataBrowserItemParentContainerProperty = 11L /* DataBrowserItemID (the parent of the specified item, used by ColumnView) */
  2879. };
  2880. /* DataBrowser Property Types (for display properties; i.e. ListView columns) */
  2881. /* These are primarily presentation types (or styles) although */
  2882. /* they also imply a particular set of primitive types or structures. */
  2883. typedef OSType DataBrowserPropertyType;
  2884. enum {
  2885. /* == Corresponding data type or structure == */
  2886. kDataBrowserCustomType = 0x3F3F3F3F, /* No associated data, custom callbacks used */
  2887. kDataBrowserIconType = FOUR_CHAR_CODE('icnr'), /* IconRef, IconTransformType, RGBColor */
  2888. kDataBrowserTextType = FOUR_CHAR_CODE('text'), /* CFStringRef */
  2889. kDataBrowserDateTimeType = FOUR_CHAR_CODE('date'), /* DateTime or LongDateTime */
  2890. kDataBrowserSliderType = FOUR_CHAR_CODE('sldr'), /* Min, Max, Value */
  2891. kDataBrowserCheckboxType = FOUR_CHAR_CODE('chbx'), /* ThemeButtonValue */
  2892. kDataBrowserProgressBarType = FOUR_CHAR_CODE('prog'), /* Min, Max, Value */
  2893. kDataBrowserRelevanceRankType = FOUR_CHAR_CODE('rank'), /* Min, Max, Value */
  2894. kDataBrowserPopupMenuType = FOUR_CHAR_CODE('menu'), /* MenuRef, Value */
  2895. kDataBrowserIconAndTextType = FOUR_CHAR_CODE('ticn') /* IconRef, CFStringRef, etc */
  2896. };
  2897. /* DataBrowser Property Parts */
  2898. /* Visual components of a property type. */
  2899. /* For use with GetDataBrowserItemPartBounds. */
  2900. typedef OSType DataBrowserPropertyPart;
  2901. enum {
  2902. kDataBrowserPropertyEnclosingPart = 0L,
  2903. kDataBrowserPropertyContentPart = FOUR_CHAR_CODE('----'),
  2904. kDataBrowserPropertyDisclosurePart = FOUR_CHAR_CODE('disc'),
  2905. kDataBrowserPropertyTextPart = kDataBrowserTextType,
  2906. kDataBrowserPropertyIconPart = kDataBrowserIconType,
  2907. kDataBrowserPropertySliderPart = kDataBrowserSliderType,
  2908. kDataBrowserPropertyCheckboxPart = kDataBrowserCheckboxType,
  2909. kDataBrowserPropertyProgressBarPart = kDataBrowserProgressBarType,
  2910. kDataBrowserPropertyRelevanceRankPart = kDataBrowserRelevanceRankType
  2911. };
  2912. /* Modify appearance/behavior of display properties */
  2913. typedef unsigned long DataBrowserPropertyFlags;
  2914. /* Low 8 bits apply to all property types */
  2915. enum {
  2916. kDataBrowserUniversalPropertyFlagsMask = 0xFF,
  2917. kDataBrowserPropertyIsMutable = 1 << 0,
  2918. kDataBrowserDefaultPropertyFlags = 0 << 0,
  2919. kDataBrowserUniversalPropertyFlags = kDataBrowserUniversalPropertyFlagsMask, /* support for an old name*/
  2920. kDataBrowserPropertyIsEditable = kDataBrowserPropertyIsMutable /* support for an old name*/
  2921. };
  2922. /* Next 8 bits contain property-specific modifiers */
  2923. enum {
  2924. kDataBrowserPropertyFlagsOffset = 8,
  2925. kDataBrowserPropertyFlagsMask = 0xFF << kDataBrowserPropertyFlagsOffset,
  2926. kDataBrowserCheckboxTriState = 1 << kDataBrowserPropertyFlagsOffset, /* kDataBrowserCheckboxType*/
  2927. kDataBrowserDateTimeRelative = 1 << (kDataBrowserPropertyFlagsOffset), /* kDataBrowserDateTimeType */
  2928. kDataBrowserDateTimeDateOnly = 1 << (kDataBrowserPropertyFlagsOffset + 1), /* kDataBrowserDateTimeType */
  2929. kDataBrowserDateTimeTimeOnly = 1 << (kDataBrowserPropertyFlagsOffset + 2), /* kDataBrowserDateTimeType */
  2930. kDataBrowserDateTimeSecondsToo = 1 << (kDataBrowserPropertyFlagsOffset + 3), /* kDataBrowserDateTimeType */
  2931. kDataBrowserSliderPlainThumb = kThemeThumbPlain << kDataBrowserPropertyFlagsOffset, /* kDataBrowserSliderType */
  2932. kDataBrowserSliderUpwardThumb = kThemeThumbUpward << kDataBrowserPropertyFlagsOffset, /* kDataBrowserSliderType */
  2933. kDataBrowserSliderDownwardThumb = kThemeThumbDownward << kDataBrowserPropertyFlagsOffset, /* kDataBrowserSliderType */
  2934. kDataBrowserDoNotTruncateText = 3 << kDataBrowserPropertyFlagsOffset, /* kDataBrowserTextType && kDataBrowserIconAndTextType */
  2935. kDataBrowserTruncateTextAtEnd = 2 << kDataBrowserPropertyFlagsOffset, /* kDataBrowserTextType && kDataBrowserIconAndTextType */
  2936. kDataBrowserTruncateTextMiddle = 0 << kDataBrowserPropertyFlagsOffset, /* kDataBrowserTextType && kDataBrowserIconAndTextType */
  2937. kDataBrowserTruncateTextAtStart = 1 << kDataBrowserPropertyFlagsOffset, /* kDataBrowserTextType && kDataBrowserIconAndTextType */
  2938. kDataBrowserPropertyModificationFlags = kDataBrowserPropertyFlagsMask, /* support for an old name*/
  2939. kDataBrowserRelativeDateTime = kDataBrowserDateTimeRelative /* support for an old name*/
  2940. };
  2941. /*
  2942. Next 8 bits contain viewStyle-specific modifiers
  2943. See individual ViewStyle sections below for flag definitions
  2944. */
  2945. enum {
  2946. kDataBrowserViewSpecificFlagsOffset = 16,
  2947. kDataBrowserViewSpecificFlagsMask = 0xFF << kDataBrowserViewSpecificFlagsOffset,
  2948. kDataBrowserViewSpecificPropertyFlags = kDataBrowserViewSpecificFlagsMask /* support for an old name*/
  2949. };
  2950. /* High 8 bits are reserved for client application use */
  2951. enum {
  2952. kDataBrowserClientPropertyFlagsOffset = 24,
  2953. kDataBrowserClientPropertyFlagsMask = (unsigned long)(0xFF << kDataBrowserClientPropertyFlagsOffset)
  2954. };
  2955. /* Client defined property description */
  2956. struct DataBrowserPropertyDesc {
  2957. DataBrowserPropertyID propertyID;
  2958. DataBrowserPropertyType propertyType;
  2959. DataBrowserPropertyFlags propertyFlags;
  2960. };
  2961. typedef struct DataBrowserPropertyDesc DataBrowserPropertyDesc;
  2962. /* Callback definition for use with ForEachDataBrowserItem */
  2963. typedef CALLBACK_API( void , DataBrowserItemProcPtr )(DataBrowserItemID item, DataBrowserItemState state, void *clientData);
  2964. typedef STACK_UPP_TYPE(DataBrowserItemProcPtr) DataBrowserItemUPP;
  2965. /*
  2966. * NewDataBrowserItemUPP()
  2967. *
  2968. * Availability:
  2969. * Non-Carbon CFM: not available
  2970. * CarbonLib: in CarbonLib 1.1 and later
  2971. * Mac OS X: in version 10.0 and later
  2972. */
  2973. EXTERN_API_C( DataBrowserItemUPP )
  2974. NewDataBrowserItemUPP(DataBrowserItemProcPtr userRoutine);
  2975. /*
  2976. * DisposeDataBrowserItemUPP()
  2977. *
  2978. * Availability:
  2979. * Non-Carbon CFM: not available
  2980. * CarbonLib: in CarbonLib 1.1 and later
  2981. * Mac OS X: in version 10.0 and later
  2982. */
  2983. EXTERN_API_C( void )
  2984. DisposeDataBrowserItemUPP(DataBrowserItemUPP userUPP);
  2985. /*
  2986. * InvokeDataBrowserItemUPP()
  2987. *
  2988. * Availability:
  2989. * Non-Carbon CFM: not available
  2990. * CarbonLib: in CarbonLib 1.1 and later
  2991. * Mac OS X: in version 10.0 and later
  2992. */
  2993. EXTERN_API_C( void )
  2994. InvokeDataBrowserItemUPP(
  2995. DataBrowserItemID item,
  2996. DataBrowserItemState state,
  2997. void * clientData,
  2998. DataBrowserItemUPP userUPP);
  2999. /* Creation/Configuration */
  3000. /*
  3001. * CreateDataBrowserControl()
  3002. *
  3003. * Availability:
  3004. * Non-Carbon CFM: not available
  3005. * CarbonLib: in CarbonLib 1.1 and later
  3006. * Mac OS X: in version 10.0 and later
  3007. */
  3008. EXTERN_API( OSStatus )
  3009. CreateDataBrowserControl(
  3010. WindowRef window,
  3011. const Rect * boundsRect,
  3012. DataBrowserViewStyle style,
  3013. ControlRef * outControl);
  3014. /*
  3015. * GetDataBrowserViewStyle()
  3016. *
  3017. * Availability:
  3018. * Non-Carbon CFM: not available
  3019. * CarbonLib: in CarbonLib 1.1 and later
  3020. * Mac OS X: in version 10.0 and later
  3021. */
  3022. EXTERN_API( OSStatus )
  3023. GetDataBrowserViewStyle(
  3024. ControlRef browser,
  3025. DataBrowserViewStyle * style);
  3026. /*
  3027. * SetDataBrowserViewStyle()
  3028. *
  3029. * Availability:
  3030. * Non-Carbon CFM: not available
  3031. * CarbonLib: in CarbonLib 1.1 and later
  3032. * Mac OS X: in version 10.0 and later
  3033. */
  3034. EXTERN_API( OSStatus )
  3035. SetDataBrowserViewStyle(
  3036. ControlRef browser,
  3037. DataBrowserViewStyle style);
  3038. /* Item Manipulation */
  3039. /* Passing NULL for "items" argument to RemoveDataBrowserItems and */
  3040. /* UpdateDataBrowserItems refers to all items in the specified container. */
  3041. /* Passing NULL for "items" argument to AddDataBrowserItems means */
  3042. /* "generate IDs starting from 1." */
  3043. /*
  3044. * AddDataBrowserItems()
  3045. *
  3046. * Availability:
  3047. * Non-Carbon CFM: not available
  3048. * CarbonLib: in CarbonLib 1.1 and later
  3049. * Mac OS X: in version 10.0 and later
  3050. */
  3051. EXTERN_API( OSStatus )
  3052. AddDataBrowserItems(
  3053. ControlRef browser,
  3054. DataBrowserItemID container,
  3055. UInt32 numItems,
  3056. const DataBrowserItemID * items, /* can be NULL */
  3057. DataBrowserPropertyID preSortProperty);
  3058. /*
  3059. * RemoveDataBrowserItems()
  3060. *
  3061. * Availability:
  3062. * Non-Carbon CFM: not available
  3063. * CarbonLib: in CarbonLib 1.1 and later
  3064. * Mac OS X: in version 10.0 and later
  3065. */
  3066. EXTERN_API( OSStatus )
  3067. RemoveDataBrowserItems(
  3068. ControlRef browser,
  3069. DataBrowserItemID container,
  3070. UInt32 numItems,
  3071. const DataBrowserItemID * items, /* can be NULL */
  3072. DataBrowserPropertyID preSortProperty);
  3073. /*
  3074. * UpdateDataBrowserItems()
  3075. *
  3076. * Availability:
  3077. * Non-Carbon CFM: not available
  3078. * CarbonLib: in CarbonLib 1.1 and later
  3079. * Mac OS X: in version 10.0 and later
  3080. */
  3081. EXTERN_API( OSStatus )
  3082. UpdateDataBrowserItems(
  3083. ControlRef browser,
  3084. DataBrowserItemID container,
  3085. UInt32 numItems,
  3086. const DataBrowserItemID * items, /* can be NULL */
  3087. DataBrowserPropertyID preSortProperty,
  3088. DataBrowserPropertyID propertyID);
  3089. /* Edit Menu Enabling and Handling */
  3090. /*
  3091. * EnableDataBrowserEditCommand()
  3092. *
  3093. * Availability:
  3094. * Non-Carbon CFM: not available
  3095. * CarbonLib: in CarbonLib 1.1 and later
  3096. * Mac OS X: in version 10.0 and later
  3097. */
  3098. EXTERN_API( Boolean )
  3099. EnableDataBrowserEditCommand(
  3100. ControlRef browser,
  3101. DataBrowserEditCommand command);
  3102. /*
  3103. * ExecuteDataBrowserEditCommand()
  3104. *
  3105. * Availability:
  3106. * Non-Carbon CFM: not available
  3107. * CarbonLib: in CarbonLib 1.1 and later
  3108. * Mac OS X: in version 10.0 and later
  3109. */
  3110. EXTERN_API( OSStatus )
  3111. ExecuteDataBrowserEditCommand(
  3112. ControlRef browser,
  3113. DataBrowserEditCommand command);
  3114. /*
  3115. * GetDataBrowserSelectionAnchor()
  3116. *
  3117. * Availability:
  3118. * Non-Carbon CFM: not available
  3119. * CarbonLib: in CarbonLib 1.1 and later
  3120. * Mac OS X: in version 10.0 and later
  3121. */
  3122. EXTERN_API( OSStatus )
  3123. GetDataBrowserSelectionAnchor(
  3124. ControlRef browser,
  3125. DataBrowserItemID * first,
  3126. DataBrowserItemID * last);
  3127. /*
  3128. * MoveDataBrowserSelectionAnchor()
  3129. *
  3130. * Availability:
  3131. * Non-Carbon CFM: not available
  3132. * CarbonLib: in CarbonLib 1.1 and later
  3133. * Mac OS X: in version 10.0 and later
  3134. */
  3135. EXTERN_API( OSStatus )
  3136. MoveDataBrowserSelectionAnchor(
  3137. ControlRef browser,
  3138. DataBrowserSelectionAnchorDirection direction,
  3139. Boolean extendSelection);
  3140. /* Container Manipulation */
  3141. /*
  3142. * OpenDataBrowserContainer()
  3143. *
  3144. * Availability:
  3145. * Non-Carbon CFM: not available
  3146. * CarbonLib: in CarbonLib 1.1 and later
  3147. * Mac OS X: in version 10.0 and later
  3148. */
  3149. EXTERN_API( OSStatus )
  3150. OpenDataBrowserContainer(
  3151. ControlRef browser,
  3152. DataBrowserItemID container);
  3153. /*
  3154. * CloseDataBrowserContainer()
  3155. *
  3156. * Availability:
  3157. * Non-Carbon CFM: not available
  3158. * CarbonLib: in CarbonLib 1.1 and later
  3159. * Mac OS X: in version 10.0 and later
  3160. */
  3161. EXTERN_API( OSStatus )
  3162. CloseDataBrowserContainer(
  3163. ControlRef browser,
  3164. DataBrowserItemID container);
  3165. /*
  3166. * SortDataBrowserContainer()
  3167. *
  3168. * Availability:
  3169. * Non-Carbon CFM: not available
  3170. * CarbonLib: in CarbonLib 1.1 and later
  3171. * Mac OS X: in version 10.0 and later
  3172. */
  3173. EXTERN_API( OSStatus )
  3174. SortDataBrowserContainer(
  3175. ControlRef browser,
  3176. DataBrowserItemID container,
  3177. Boolean sortChildren);
  3178. /* Aggregate Item Access and Iteration */
  3179. /*
  3180. * GetDataBrowserItems()
  3181. *
  3182. * Availability:
  3183. * Non-Carbon CFM: not available
  3184. * CarbonLib: in CarbonLib 1.1 and later
  3185. * Mac OS X: in version 10.0 and later
  3186. */
  3187. EXTERN_API( OSStatus )
  3188. GetDataBrowserItems(
  3189. ControlRef browser,
  3190. DataBrowserItemID container,
  3191. Boolean recurse,
  3192. DataBrowserItemState state,
  3193. Handle items);
  3194. /*
  3195. * GetDataBrowserItemCount()
  3196. *
  3197. * Availability:
  3198. * Non-Carbon CFM: not available
  3199. * CarbonLib: in CarbonLib 1.1 and later
  3200. * Mac OS X: in version 10.0 and later
  3201. */
  3202. EXTERN_API( OSStatus )
  3203. GetDataBrowserItemCount(
  3204. ControlRef browser,
  3205. DataBrowserItemID container,
  3206. Boolean recurse,
  3207. DataBrowserItemState state,
  3208. UInt32 * numItems);
  3209. /*
  3210. * ForEachDataBrowserItem()
  3211. *
  3212. * Availability:
  3213. * Non-Carbon CFM: not available
  3214. * CarbonLib: in CarbonLib 1.1 and later
  3215. * Mac OS X: in version 10.0 and later
  3216. */
  3217. EXTERN_API( OSStatus )
  3218. ForEachDataBrowserItem(
  3219. ControlRef browser,
  3220. DataBrowserItemID container,
  3221. Boolean recurse,
  3222. DataBrowserItemState state,
  3223. DataBrowserItemUPP callback,
  3224. void * clientData);
  3225. /* Individual Item Access and Display */
  3226. /*
  3227. * IsDataBrowserItemSelected()
  3228. *
  3229. * Availability:
  3230. * Non-Carbon CFM: not available
  3231. * CarbonLib: in CarbonLib 1.1 and later
  3232. * Mac OS X: in version 10.0 and later
  3233. */
  3234. EXTERN_API( Boolean )
  3235. IsDataBrowserItemSelected(
  3236. ControlRef browser,
  3237. DataBrowserItemID item);
  3238. /*
  3239. * GetDataBrowserItemState()
  3240. *
  3241. * Availability:
  3242. * Non-Carbon CFM: not available
  3243. * CarbonLib: in CarbonLib 1.1 and later
  3244. * Mac OS X: in version 10.0 and later
  3245. */
  3246. EXTERN_API( OSStatus )
  3247. GetDataBrowserItemState(
  3248. ControlRef browser,
  3249. DataBrowserItemID item,
  3250. DataBrowserItemState * state);
  3251. /*
  3252. * RevealDataBrowserItem()
  3253. *
  3254. * Availability:
  3255. * Non-Carbon CFM: not available
  3256. * CarbonLib: in CarbonLib 1.1 and later
  3257. * Mac OS X: in version 10.0 and later
  3258. */
  3259. EXTERN_API( OSStatus )
  3260. RevealDataBrowserItem(
  3261. ControlRef browser,
  3262. DataBrowserItemID item,
  3263. DataBrowserPropertyID propertyID,
  3264. DataBrowserRevealOptions options);
  3265. /* Selection Set Manipulation */
  3266. /*
  3267. * SetDataBrowserSelectedItems()
  3268. *
  3269. * Availability:
  3270. * Non-Carbon CFM: not available
  3271. * CarbonLib: in CarbonLib 1.1 and later
  3272. * Mac OS X: in version 10.0 and later
  3273. */
  3274. EXTERN_API( OSStatus )
  3275. SetDataBrowserSelectedItems(
  3276. ControlRef browser,
  3277. UInt32 numItems,
  3278. const DataBrowserItemID * items,
  3279. DataBrowserSetOption operation);
  3280. /* DataBrowser Attribute Manipulation */
  3281. /* The user customizable portion of the current view style settings */
  3282. /*
  3283. * SetDataBrowserUserState()
  3284. *
  3285. * Availability:
  3286. * Non-Carbon CFM: not available
  3287. * CarbonLib: in CarbonLib 1.1 and later
  3288. * Mac OS X: in version 10.0 and later
  3289. */
  3290. EXTERN_API( OSStatus )
  3291. SetDataBrowserUserState(
  3292. ControlRef browser,
  3293. CFDataRef stateInfo);
  3294. /*
  3295. * GetDataBrowserUserState()
  3296. *
  3297. * Availability:
  3298. * Non-Carbon CFM: not available
  3299. * CarbonLib: in CarbonLib 1.1 and later
  3300. * Mac OS X: in version 10.0 and later
  3301. */
  3302. EXTERN_API( OSStatus )
  3303. GetDataBrowserUserState(
  3304. ControlRef browser,
  3305. CFDataRef * stateInfo);
  3306. /* All items are active/enabled or not */
  3307. /*
  3308. * SetDataBrowserActiveItems()
  3309. *
  3310. * Availability:
  3311. * Non-Carbon CFM: not available
  3312. * CarbonLib: in CarbonLib 1.1 and later
  3313. * Mac OS X: in version 10.0 and later
  3314. */
  3315. EXTERN_API( OSStatus )
  3316. SetDataBrowserActiveItems(
  3317. ControlRef browser,
  3318. Boolean active);
  3319. /*
  3320. * GetDataBrowserActiveItems()
  3321. *
  3322. * Availability:
  3323. * Non-Carbon CFM: not available
  3324. * CarbonLib: in CarbonLib 1.1 and later
  3325. * Mac OS X: in version 10.0 and later
  3326. */
  3327. EXTERN_API( OSStatus )
  3328. GetDataBrowserActiveItems(
  3329. ControlRef browser,
  3330. Boolean * active);
  3331. /* Inset the scrollbars within the DataBrowser bounds */
  3332. /*
  3333. * SetDataBrowserScrollBarInset()
  3334. *
  3335. * Availability:
  3336. * Non-Carbon CFM: not available
  3337. * CarbonLib: in CarbonLib 1.1 and later
  3338. * Mac OS X: in version 10.0 and later
  3339. */
  3340. EXTERN_API( OSStatus )
  3341. SetDataBrowserScrollBarInset(
  3342. ControlRef browser,
  3343. Rect * insetRect);
  3344. /*
  3345. * GetDataBrowserScrollBarInset()
  3346. *
  3347. * Availability:
  3348. * Non-Carbon CFM: not available
  3349. * CarbonLib: in CarbonLib 1.1 and later
  3350. * Mac OS X: in version 10.0 and later
  3351. */
  3352. EXTERN_API( OSStatus )
  3353. GetDataBrowserScrollBarInset(
  3354. ControlRef browser,
  3355. Rect * insetRect);
  3356. /* The "user focused" item */
  3357. /* For the ListView, this means the root container */
  3358. /* For the ColumnView, this means the rightmost container column */
  3359. /*
  3360. * SetDataBrowserTarget()
  3361. *
  3362. * Availability:
  3363. * Non-Carbon CFM: not available
  3364. * CarbonLib: in CarbonLib 1.1 and later
  3365. * Mac OS X: in version 10.0 and later
  3366. */
  3367. EXTERN_API( OSStatus )
  3368. SetDataBrowserTarget(
  3369. ControlRef browser,
  3370. DataBrowserItemID target);
  3371. /*
  3372. * GetDataBrowserTarget()
  3373. *
  3374. * Availability:
  3375. * Non-Carbon CFM: not available
  3376. * CarbonLib: in CarbonLib 1.1 and later
  3377. * Mac OS X: in version 10.0 and later
  3378. */
  3379. EXTERN_API( OSStatus )
  3380. GetDataBrowserTarget(
  3381. ControlRef browser,
  3382. DataBrowserItemID * target);
  3383. /* Current sort ordering */
  3384. /* ListView tracks this per-column */
  3385. /*
  3386. * SetDataBrowserSortOrder()
  3387. *
  3388. * Availability:
  3389. * Non-Carbon CFM: not available
  3390. * CarbonLib: in CarbonLib 1.1 and later
  3391. * Mac OS X: in version 10.0 and later
  3392. */
  3393. EXTERN_API( OSStatus )
  3394. SetDataBrowserSortOrder(
  3395. ControlRef browser,
  3396. DataBrowserSortOrder order);
  3397. /*
  3398. * GetDataBrowserSortOrder()
  3399. *
  3400. * Availability:
  3401. * Non-Carbon CFM: not available
  3402. * CarbonLib: in CarbonLib 1.1 and later
  3403. * Mac OS X: in version 10.0 and later
  3404. */
  3405. EXTERN_API( OSStatus )
  3406. GetDataBrowserSortOrder(
  3407. ControlRef browser,
  3408. DataBrowserSortOrder * order);
  3409. /* Scrollbar values */
  3410. /*
  3411. * SetDataBrowserScrollPosition()
  3412. *
  3413. * Availability:
  3414. * Non-Carbon CFM: not available
  3415. * CarbonLib: in CarbonLib 1.1 and later
  3416. * Mac OS X: in version 10.0 and later
  3417. */
  3418. EXTERN_API( OSStatus )
  3419. SetDataBrowserScrollPosition(
  3420. ControlRef browser,
  3421. UInt32 top,
  3422. UInt32 left);
  3423. /*
  3424. * GetDataBrowserScrollPosition()
  3425. *
  3426. * Availability:
  3427. * Non-Carbon CFM: not available
  3428. * CarbonLib: in CarbonLib 1.1 and later
  3429. * Mac OS X: in version 10.0 and later
  3430. */
  3431. EXTERN_API( OSStatus )
  3432. GetDataBrowserScrollPosition(
  3433. ControlRef browser,
  3434. UInt32 * top,
  3435. UInt32 * left);
  3436. /* Show/Hide each scrollbar */
  3437. /*
  3438. * SetDataBrowserHasScrollBars()
  3439. *
  3440. * Availability:
  3441. * Non-Carbon CFM: not available
  3442. * CarbonLib: in CarbonLib 1.1 and later
  3443. * Mac OS X: in version 10.0 and later
  3444. */
  3445. EXTERN_API( OSStatus )
  3446. SetDataBrowserHasScrollBars(
  3447. ControlRef browser,
  3448. Boolean horiz,
  3449. Boolean vert);
  3450. /*
  3451. * GetDataBrowserHasScrollBars()
  3452. *
  3453. * Availability:
  3454. * Non-Carbon CFM: not available
  3455. * CarbonLib: in CarbonLib 1.1 and later
  3456. * Mac OS X: in version 10.0 and later
  3457. */
  3458. EXTERN_API( OSStatus )
  3459. GetDataBrowserHasScrollBars(
  3460. ControlRef browser,
  3461. Boolean * horiz,
  3462. Boolean * vert);
  3463. /* Property passed to sort callback (ListView sort column) */
  3464. /*
  3465. * SetDataBrowserSortProperty()
  3466. *
  3467. * Availability:
  3468. * Non-Carbon CFM: not available
  3469. * CarbonLib: in CarbonLib 1.1 and later
  3470. * Mac OS X: in version 10.0 and later
  3471. */
  3472. EXTERN_API( OSStatus )
  3473. SetDataBrowserSortProperty(
  3474. ControlRef browser,
  3475. DataBrowserPropertyID property);
  3476. /*
  3477. * GetDataBrowserSortProperty()
  3478. *
  3479. * Availability:
  3480. * Non-Carbon CFM: not available
  3481. * CarbonLib: in CarbonLib 1.1 and later
  3482. * Mac OS X: in version 10.0 and later
  3483. */
  3484. EXTERN_API( OSStatus )
  3485. GetDataBrowserSortProperty(
  3486. ControlRef browser,
  3487. DataBrowserPropertyID * property);
  3488. /* Modify selection behavior */
  3489. /*
  3490. * SetDataBrowserSelectionFlags()
  3491. *
  3492. * Availability:
  3493. * Non-Carbon CFM: not available
  3494. * CarbonLib: in CarbonLib 1.1 and later
  3495. * Mac OS X: in version 10.0 and later
  3496. */
  3497. EXTERN_API( OSStatus )
  3498. SetDataBrowserSelectionFlags(
  3499. ControlRef browser,
  3500. DataBrowserSelectionFlags selectionFlags);
  3501. /*
  3502. * GetDataBrowserSelectionFlags()
  3503. *
  3504. * Availability:
  3505. * Non-Carbon CFM: not available
  3506. * CarbonLib: in CarbonLib 1.1 and later
  3507. * Mac OS X: in version 10.0 and later
  3508. */
  3509. EXTERN_API( OSStatus )
  3510. GetDataBrowserSelectionFlags(
  3511. ControlRef browser,
  3512. DataBrowserSelectionFlags * selectionFlags);
  3513. /* Dynamically modify property appearance/behavior */
  3514. /*
  3515. * SetDataBrowserPropertyFlags()
  3516. *
  3517. * Availability:
  3518. * Non-Carbon CFM: not available
  3519. * CarbonLib: in CarbonLib 1.1 and later
  3520. * Mac OS X: in version 10.0 and later
  3521. */
  3522. EXTERN_API( OSStatus )
  3523. SetDataBrowserPropertyFlags(
  3524. ControlRef browser,
  3525. DataBrowserPropertyID property,
  3526. DataBrowserPropertyFlags flags);
  3527. /*
  3528. * GetDataBrowserPropertyFlags()
  3529. *
  3530. * Availability:
  3531. * Non-Carbon CFM: not available
  3532. * CarbonLib: in CarbonLib 1.1 and later
  3533. * Mac OS X: in version 10.0 and later
  3534. */
  3535. EXTERN_API( OSStatus )
  3536. GetDataBrowserPropertyFlags(
  3537. ControlRef browser,
  3538. DataBrowserPropertyID property,
  3539. DataBrowserPropertyFlags * flags);
  3540. /* Text of current in-place edit session */
  3541. /*
  3542. * SetDataBrowserEditText()
  3543. *
  3544. * Availability:
  3545. * Non-Carbon CFM: not available
  3546. * CarbonLib: in CarbonLib 1.1 and later
  3547. * Mac OS X: in version 10.0 and later
  3548. */
  3549. EXTERN_API( OSStatus )
  3550. SetDataBrowserEditText(
  3551. ControlRef browser,
  3552. CFStringRef text);
  3553. /*
  3554. * CopyDataBrowserEditText()
  3555. *
  3556. * Availability:
  3557. * Non-Carbon CFM: not available
  3558. * CarbonLib: in CarbonLib 1.5 and later
  3559. * Mac OS X: in version 10.0 and later
  3560. */
  3561. EXTERN_API( OSStatus )
  3562. CopyDataBrowserEditText(
  3563. ControlRef browser,
  3564. CFStringRef * text);
  3565. /*
  3566. * GetDataBrowserEditText()
  3567. *
  3568. * Availability:
  3569. * Non-Carbon CFM: not available
  3570. * CarbonLib: in CarbonLib 1.1 and later
  3571. * Mac OS X: in version 10.0 and later
  3572. */
  3573. EXTERN_API( OSStatus )
  3574. GetDataBrowserEditText(
  3575. ControlRef browser,
  3576. CFMutableStringRef text);
  3577. /* Item/property currently being edited */
  3578. /*
  3579. * SetDataBrowserEditItem()
  3580. *
  3581. * Availability:
  3582. * Non-Carbon CFM: not available
  3583. * CarbonLib: in CarbonLib 1.1 and later
  3584. * Mac OS X: in version 10.0 and later
  3585. */
  3586. EXTERN_API( OSStatus )
  3587. SetDataBrowserEditItem(
  3588. ControlRef browser,
  3589. DataBrowserItemID item,
  3590. DataBrowserPropertyID property);
  3591. /*
  3592. * GetDataBrowserEditItem()
  3593. *
  3594. * Availability:
  3595. * Non-Carbon CFM: not available
  3596. * CarbonLib: in CarbonLib 1.1 and later
  3597. * Mac OS X: in version 10.0 and later
  3598. */
  3599. EXTERN_API( OSStatus )
  3600. GetDataBrowserEditItem(
  3601. ControlRef browser,
  3602. DataBrowserItemID * item,
  3603. DataBrowserPropertyID * property);
  3604. /* Get the current bounds of a visual part of an item's property */
  3605. /*
  3606. * GetDataBrowserItemPartBounds()
  3607. *
  3608. * Availability:
  3609. * Non-Carbon CFM: not available
  3610. * CarbonLib: in CarbonLib 1.1 and later
  3611. * Mac OS X: in version 10.0 and later
  3612. */
  3613. EXTERN_API( OSStatus )
  3614. GetDataBrowserItemPartBounds(
  3615. ControlRef browser,
  3616. DataBrowserItemID item,
  3617. DataBrowserPropertyID property,
  3618. DataBrowserPropertyPart part,
  3619. Rect * bounds);
  3620. /* DataBrowser ItemData Accessors (used within DataBrowserItemData callback) */
  3621. typedef void * DataBrowserItemDataRef;
  3622. /*
  3623. * SetDataBrowserItemDataIcon()
  3624. *
  3625. * Availability:
  3626. * Non-Carbon CFM: not available
  3627. * CarbonLib: in CarbonLib 1.1 and later
  3628. * Mac OS X: in version 10.0 and later
  3629. */
  3630. EXTERN_API( OSStatus )
  3631. SetDataBrowserItemDataIcon(
  3632. DataBrowserItemDataRef itemData,
  3633. IconRef theData);
  3634. /*
  3635. * GetDataBrowserItemDataIcon()
  3636. *
  3637. * Availability:
  3638. * Non-Carbon CFM: not available
  3639. * CarbonLib: in CarbonLib 1.5 and later
  3640. * Mac OS X: in version 10.0 and later
  3641. */
  3642. EXTERN_API( OSStatus )
  3643. GetDataBrowserItemDataIcon(
  3644. DataBrowserItemDataRef itemData,
  3645. IconRef * theData);
  3646. /*
  3647. * SetDataBrowserItemDataText()
  3648. *
  3649. * Availability:
  3650. * Non-Carbon CFM: not available
  3651. * CarbonLib: in CarbonLib 1.1 and later
  3652. * Mac OS X: in version 10.0 and later
  3653. */
  3654. EXTERN_API( OSStatus )
  3655. SetDataBrowserItemDataText(
  3656. DataBrowserItemDataRef itemData,
  3657. CFStringRef theData);
  3658. /*
  3659. * GetDataBrowserItemDataText()
  3660. *
  3661. * Availability:
  3662. * Non-Carbon CFM: not available
  3663. * CarbonLib: in CarbonLib 1.1 and later
  3664. * Mac OS X: in version 10.0 and later
  3665. */
  3666. EXTERN_API( OSStatus )
  3667. GetDataBrowserItemDataText(
  3668. DataBrowserItemDataRef itemData,
  3669. CFStringRef * theData);
  3670. /*
  3671. * SetDataBrowserItemDataValue()
  3672. *
  3673. * Availability:
  3674. * Non-Carbon CFM: not available
  3675. * CarbonLib: in CarbonLib 1.1 and later
  3676. * Mac OS X: in version 10.0 and later
  3677. */
  3678. EXTERN_API( OSStatus )
  3679. SetDataBrowserItemDataValue(
  3680. DataBrowserItemDataRef itemData,
  3681. SInt32 theData);
  3682. /*
  3683. * GetDataBrowserItemDataValue()
  3684. *
  3685. * Availability:
  3686. * Non-Carbon CFM: not available
  3687. * CarbonLib: in CarbonLib 1.1 and later
  3688. * Mac OS X: in version 10.0 and later
  3689. */
  3690. EXTERN_API( OSStatus )
  3691. GetDataBrowserItemDataValue(
  3692. DataBrowserItemDataRef itemData,
  3693. SInt32 * theData);
  3694. /*
  3695. * SetDataBrowserItemDataMinimum()
  3696. *
  3697. * Availability:
  3698. * Non-Carbon CFM: not available
  3699. * CarbonLib: in CarbonLib 1.1 and later
  3700. * Mac OS X: in version 10.0 and later
  3701. */
  3702. EXTERN_API( OSStatus )
  3703. SetDataBrowserItemDataMinimum(
  3704. DataBrowserItemDataRef itemData,
  3705. SInt32 theData);
  3706. /*
  3707. * GetDataBrowserItemDataMinimum()
  3708. *
  3709. * Availability:
  3710. * Non-Carbon CFM: not available
  3711. * CarbonLib: in CarbonLib 1.1 and later
  3712. * Mac OS X: in version 10.0 and later
  3713. */
  3714. EXTERN_API( OSStatus )
  3715. GetDataBrowserItemDataMinimum(
  3716. DataBrowserItemDataRef itemData,
  3717. SInt32 * theData);
  3718. /*
  3719. * SetDataBrowserItemDataMaximum()
  3720. *
  3721. * Availability:
  3722. * Non-Carbon CFM: not available
  3723. * CarbonLib: in CarbonLib 1.1 and later
  3724. * Mac OS X: in version 10.0 and later
  3725. */
  3726. EXTERN_API( OSStatus )
  3727. SetDataBrowserItemDataMaximum(
  3728. DataBrowserItemDataRef itemData,
  3729. SInt32 theData);
  3730. /*
  3731. * GetDataBrowserItemDataMaximum()
  3732. *
  3733. * Availability:
  3734. * Non-Carbon CFM: not available
  3735. * CarbonLib: in CarbonLib 1.1 and later
  3736. * Mac OS X: in version 10.0 and later
  3737. */
  3738. EXTERN_API( OSStatus )
  3739. GetDataBrowserItemDataMaximum(
  3740. DataBrowserItemDataRef itemData,
  3741. SInt32 * theData);
  3742. /*
  3743. * SetDataBrowserItemDataBooleanValue()
  3744. *
  3745. * Availability:
  3746. * Non-Carbon CFM: not available
  3747. * CarbonLib: in CarbonLib 1.1 and later
  3748. * Mac OS X: in version 10.0 and later
  3749. */
  3750. EXTERN_API( OSStatus )
  3751. SetDataBrowserItemDataBooleanValue(
  3752. DataBrowserItemDataRef itemData,
  3753. Boolean theData);
  3754. /*
  3755. * GetDataBrowserItemDataBooleanValue()
  3756. *
  3757. * Availability:
  3758. * Non-Carbon CFM: not available
  3759. * CarbonLib: in CarbonLib 1.1 and later
  3760. * Mac OS X: in version 10.0 and later
  3761. */
  3762. EXTERN_API( OSStatus )
  3763. GetDataBrowserItemDataBooleanValue(
  3764. DataBrowserItemDataRef itemData,
  3765. Boolean * theData);
  3766. /*
  3767. * SetDataBrowserItemDataMenuRef()
  3768. *
  3769. * Availability:
  3770. * Non-Carbon CFM: not available
  3771. * CarbonLib: in CarbonLib 1.1 and later
  3772. * Mac OS X: in version 10.0 and later
  3773. */
  3774. EXTERN_API( OSStatus )
  3775. SetDataBrowserItemDataMenuRef(
  3776. DataBrowserItemDataRef itemData,
  3777. MenuRef theData);
  3778. /*
  3779. * GetDataBrowserItemDataMenuRef()
  3780. *
  3781. * Availability:
  3782. * Non-Carbon CFM: not available
  3783. * CarbonLib: in CarbonLib 1.1 and later
  3784. * Mac OS X: in version 10.0 and later
  3785. */
  3786. EXTERN_API( OSStatus )
  3787. GetDataBrowserItemDataMenuRef(
  3788. DataBrowserItemDataRef itemData,
  3789. MenuRef * theData);
  3790. /*
  3791. * SetDataBrowserItemDataRGBColor()
  3792. *
  3793. * Availability:
  3794. * Non-Carbon CFM: not available
  3795. * CarbonLib: in CarbonLib 1.1 and later
  3796. * Mac OS X: in version 10.0 and later
  3797. */
  3798. EXTERN_API( OSStatus )
  3799. SetDataBrowserItemDataRGBColor(
  3800. DataBrowserItemDataRef itemData,
  3801. const RGBColor * theData);
  3802. /*
  3803. * GetDataBrowserItemDataRGBColor()
  3804. *
  3805. * Availability:
  3806. * Non-Carbon CFM: not available
  3807. * CarbonLib: in CarbonLib 1.1 and later
  3808. * Mac OS X: in version 10.0 and later
  3809. */
  3810. EXTERN_API( OSStatus )
  3811. GetDataBrowserItemDataRGBColor(
  3812. DataBrowserItemDataRef itemData,
  3813. RGBColor * theData);
  3814. /*
  3815. * SetDataBrowserItemDataDrawState()
  3816. *
  3817. * Availability:
  3818. * Non-Carbon CFM: not available
  3819. * CarbonLib: in CarbonLib 1.1 and later
  3820. * Mac OS X: in version 10.0 and later
  3821. */
  3822. EXTERN_API( OSStatus )
  3823. SetDataBrowserItemDataDrawState(
  3824. DataBrowserItemDataRef itemData,
  3825. ThemeDrawState theData);
  3826. /*
  3827. * GetDataBrowserItemDataDrawState()
  3828. *
  3829. * Availability:
  3830. * Non-Carbon CFM: not available
  3831. * CarbonLib: in CarbonLib 1.1 and later
  3832. * Mac OS X: in version 10.0 and later
  3833. */
  3834. EXTERN_API( OSStatus )
  3835. GetDataBrowserItemDataDrawState(
  3836. DataBrowserItemDataRef itemData,
  3837. ThemeDrawState * theData);
  3838. /*
  3839. * SetDataBrowserItemDataButtonValue()
  3840. *
  3841. * Availability:
  3842. * Non-Carbon CFM: not available
  3843. * CarbonLib: in CarbonLib 1.1 and later
  3844. * Mac OS X: in version 10.0 and later
  3845. */
  3846. EXTERN_API( OSStatus )
  3847. SetDataBrowserItemDataButtonValue(
  3848. DataBrowserItemDataRef itemData,
  3849. ThemeButtonValue theData);
  3850. /*
  3851. * GetDataBrowserItemDataButtonValue()
  3852. *
  3853. * Availability:
  3854. * Non-Carbon CFM: not available
  3855. * CarbonLib: in CarbonLib 1.1 and later
  3856. * Mac OS X: in version 10.0 and later
  3857. */
  3858. EXTERN_API( OSStatus )
  3859. GetDataBrowserItemDataButtonValue(
  3860. DataBrowserItemDataRef itemData,
  3861. ThemeButtonValue * theData);
  3862. /*
  3863. * SetDataBrowserItemDataIconTransform()
  3864. *
  3865. * Availability:
  3866. * Non-Carbon CFM: not available
  3867. * CarbonLib: in CarbonLib 1.1 and later
  3868. * Mac OS X: in version 10.0 and later
  3869. */
  3870. EXTERN_API( OSStatus )
  3871. SetDataBrowserItemDataIconTransform(
  3872. DataBrowserItemDataRef itemData,
  3873. IconTransformType theData);
  3874. /*
  3875. * GetDataBrowserItemDataIconTransform()
  3876. *
  3877. * Availability:
  3878. * Non-Carbon CFM: not available
  3879. * CarbonLib: in CarbonLib 1.1 and later
  3880. * Mac OS X: in version 10.0 and later
  3881. */
  3882. EXTERN_API( OSStatus )
  3883. GetDataBrowserItemDataIconTransform(
  3884. DataBrowserItemDataRef itemData,
  3885. IconTransformType * theData);
  3886. /*
  3887. * SetDataBrowserItemDataDateTime()
  3888. *
  3889. * Availability:
  3890. * Non-Carbon CFM: not available
  3891. * CarbonLib: in CarbonLib 1.1 and later
  3892. * Mac OS X: in version 10.0 and later
  3893. */
  3894. EXTERN_API( OSStatus )
  3895. SetDataBrowserItemDataDateTime(
  3896. DataBrowserItemDataRef itemData,
  3897. long theData);
  3898. /*
  3899. * GetDataBrowserItemDataDateTime()
  3900. *
  3901. * Availability:
  3902. * Non-Carbon CFM: not available
  3903. * CarbonLib: in CarbonLib 1.1 and later
  3904. * Mac OS X: in version 10.0 and later
  3905. */
  3906. EXTERN_API( OSStatus )
  3907. GetDataBrowserItemDataDateTime(
  3908. DataBrowserItemDataRef itemData,
  3909. long * theData);
  3910. /*
  3911. * SetDataBrowserItemDataLongDateTime()
  3912. *
  3913. * Availability:
  3914. * Non-Carbon CFM: not available
  3915. * CarbonLib: in CarbonLib 1.1 and later
  3916. * Mac OS X: in version 10.0 and later
  3917. */
  3918. EXTERN_API( OSStatus )
  3919. SetDataBrowserItemDataLongDateTime(
  3920. DataBrowserItemDataRef itemData,
  3921. const LongDateTime * theData);
  3922. /*
  3923. * GetDataBrowserItemDataLongDateTime()
  3924. *
  3925. * Availability:
  3926. * Non-Carbon CFM: not available
  3927. * CarbonLib: in CarbonLib 1.1 and later
  3928. * Mac OS X: in version 10.0 and later
  3929. */
  3930. EXTERN_API( OSStatus )
  3931. GetDataBrowserItemDataLongDateTime(
  3932. DataBrowserItemDataRef itemData,
  3933. LongDateTime * theData);
  3934. /*
  3935. * SetDataBrowserItemDataItemID()
  3936. *
  3937. * Availability:
  3938. * Non-Carbon CFM: not available
  3939. * CarbonLib: in CarbonLib 1.1 and later
  3940. * Mac OS X: in version 10.0 and later
  3941. */
  3942. EXTERN_API( OSStatus )
  3943. SetDataBrowserItemDataItemID(
  3944. DataBrowserItemDataRef itemData,
  3945. DataBrowserItemID theData);
  3946. /*
  3947. * GetDataBrowserItemDataItemID()
  3948. *
  3949. * Availability:
  3950. * Non-Carbon CFM: not available
  3951. * CarbonLib: in CarbonLib 1.5 and later
  3952. * Mac OS X: in version 10.0 and later
  3953. */
  3954. EXTERN_API( OSStatus )
  3955. GetDataBrowserItemDataItemID(
  3956. DataBrowserItemDataRef itemData,
  3957. DataBrowserItemID * theData);
  3958. /*
  3959. * GetDataBrowserItemDataProperty()
  3960. *
  3961. * Availability:
  3962. * Non-Carbon CFM: not available
  3963. * CarbonLib: in CarbonLib 1.1 and later
  3964. * Mac OS X: in version 10.0 and later
  3965. */
  3966. EXTERN_API( OSStatus )
  3967. GetDataBrowserItemDataProperty(
  3968. DataBrowserItemDataRef itemData,
  3969. DataBrowserPropertyID * theData);
  3970. /* Standard DataBrowser Callbacks */
  3971. /* Basic Item Management & Manipulation */
  3972. typedef CALLBACK_API( OSStatus , DataBrowserItemDataProcPtr )(ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, DataBrowserItemDataRef itemData, Boolean setValue);
  3973. typedef STACK_UPP_TYPE(DataBrowserItemDataProcPtr) DataBrowserItemDataUPP;
  3974. /* Item Comparison */
  3975. typedef CALLBACK_API( Boolean , DataBrowserItemCompareProcPtr )(ControlRef browser, DataBrowserItemID itemOne, DataBrowserItemID itemTwo, DataBrowserPropertyID sortProperty);
  3976. typedef STACK_UPP_TYPE(DataBrowserItemCompareProcPtr) DataBrowserItemCompareUPP;
  3977. /* ItemEvent Notification */
  3978. /* A Very Important Note about DataBrowserItemNotificationProcPtr: */
  3979. /* */
  3980. /* Under all currently shipping versions of CarbonLib (eg. up through 1.3), your callback is called */
  3981. /* just as the prototype appears in this header. It should only be expecting three parameters because */
  3982. /* DataBrowser will only pass three parameters. */
  3983. /* */
  3984. /* Under Mac OS X, your callback is called with an additional parameter. If you wish to interpret */
  3985. /* the additional parameter, your callback should have the same prototype as the */
  3986. /* DataBrowserItemNotificationWithItemProcPtr (below). You may freely take a callback with this */
  3987. /* prototype and pass it to NewDataBrowserItemNotificationUPP in order to generate a */
  3988. /* DataBrowserItemNotificationUPP that you can use just like any other DataBrowserItemNotificationUPP. */
  3989. /* */
  3990. /* If you use this technique under CarbonLib, you will *not* receive valid data in the fourth */
  3991. /* parameter, and any attempt to use the invalid data will probably result in a crash. */
  3992. typedef CALLBACK_API( void , DataBrowserItemNotificationWithItemProcPtr )(ControlRef browser, DataBrowserItemID item, DataBrowserItemNotification message, DataBrowserItemDataRef itemData);
  3993. typedef CALLBACK_API( void , DataBrowserItemNotificationProcPtr )(ControlRef browser, DataBrowserItemID item, DataBrowserItemNotification message);
  3994. typedef STACK_UPP_TYPE(DataBrowserItemNotificationWithItemProcPtr) DataBrowserItemNotificationWithItemUPP;
  3995. typedef STACK_UPP_TYPE(DataBrowserItemNotificationProcPtr) DataBrowserItemNotificationUPP;
  3996. /* Drag & Drop Processing */
  3997. typedef CALLBACK_API( Boolean , DataBrowserAddDragItemProcPtr )(ControlRef browser, DragReference theDrag, DataBrowserItemID item, ItemReference *itemRef);
  3998. typedef CALLBACK_API( Boolean , DataBrowserAcceptDragProcPtr )(ControlRef browser, DragReference theDrag, DataBrowserItemID item);
  3999. typedef CALLBACK_API( Boolean , DataBrowserReceiveDragProcPtr )(ControlRef browser, DragReference theDrag, DataBrowserItemID item);
  4000. typedef CALLBACK_API( void , DataBrowserPostProcessDragProcPtr )(ControlRef browser, DragReference theDrag, OSStatus trackDragResult);
  4001. typedef STACK_UPP_TYPE(DataBrowserAddDragItemProcPtr) DataBrowserAddDragItemUPP;
  4002. typedef STACK_UPP_TYPE(DataBrowserAcceptDragProcPtr) DataBrowserAcceptDragUPP;
  4003. typedef STACK_UPP_TYPE(DataBrowserReceiveDragProcPtr) DataBrowserReceiveDragUPP;
  4004. typedef STACK_UPP_TYPE(DataBrowserPostProcessDragProcPtr) DataBrowserPostProcessDragUPP;
  4005. /* Contextual Menu Support */
  4006. typedef CALLBACK_API( void , DataBrowserGetContextualMenuProcPtr )(ControlRef browser, MenuRef *menu, UInt32 *helpType, CFStringRef *helpItemString, AEDesc *selection);
  4007. typedef CALLBACK_API( void , DataBrowserSelectContextualMenuProcPtr )(ControlRef browser, MenuRef menu, UInt32 selectionType, SInt16 menuID, MenuItemIndex menuItem);
  4008. typedef STACK_UPP_TYPE(DataBrowserGetContextualMenuProcPtr) DataBrowserGetContextualMenuUPP;
  4009. typedef STACK_UPP_TYPE(DataBrowserSelectContextualMenuProcPtr) DataBrowserSelectContextualMenuUPP;
  4010. /* Help Manager Support */
  4011. typedef CALLBACK_API( void , DataBrowserItemHelpContentProcPtr )(ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, HMContentRequest inRequest, HMContentProvidedType *outContentProvided, HMHelpContentPtr ioHelpContent);
  4012. typedef STACK_UPP_TYPE(DataBrowserItemHelpContentProcPtr) DataBrowserItemHelpContentUPP;
  4013. /*
  4014. * NewDataBrowserItemDataUPP()
  4015. *
  4016. * Availability:
  4017. * Non-Carbon CFM: not available
  4018. * CarbonLib: in CarbonLib 1.1 and later
  4019. * Mac OS X: in version 10.0 and later
  4020. */
  4021. EXTERN_API_C( DataBrowserItemDataUPP )
  4022. NewDataBrowserItemDataUPP(DataBrowserItemDataProcPtr userRoutine);
  4023. /*
  4024. * NewDataBrowserItemCompareUPP()
  4025. *
  4026. * Availability:
  4027. * Non-Carbon CFM: not available
  4028. * CarbonLib: in CarbonLib 1.1 and later
  4029. * Mac OS X: in version 10.0 and later
  4030. */
  4031. EXTERN_API_C( DataBrowserItemCompareUPP )
  4032. NewDataBrowserItemCompareUPP(DataBrowserItemCompareProcPtr userRoutine);
  4033. /*
  4034. * NewDataBrowserItemNotificationWithItemUPP()
  4035. *
  4036. * Availability:
  4037. * Non-Carbon CFM: not available
  4038. * CarbonLib: in CarbonLib 1.5 and later
  4039. * Mac OS X: in version 10.1 and later
  4040. */
  4041. EXTERN_API_C( DataBrowserItemNotificationWithItemUPP )
  4042. NewDataBrowserItemNotificationWithItemUPP(DataBrowserItemNotificationWithItemProcPtr userRoutine);
  4043. /*
  4044. * NewDataBrowserItemNotificationUPP()
  4045. *
  4046. * Availability:
  4047. * Non-Carbon CFM: not available
  4048. * CarbonLib: in CarbonLib 1.1 and later
  4049. * Mac OS X: in version 10.0 and later
  4050. */
  4051. EXTERN_API_C( DataBrowserItemNotificationUPP )
  4052. NewDataBrowserItemNotificationUPP(DataBrowserItemNotificationProcPtr userRoutine);
  4053. /*
  4054. * NewDataBrowserAddDragItemUPP()
  4055. *
  4056. * Availability:
  4057. * Non-Carbon CFM: not available
  4058. * CarbonLib: in CarbonLib 1.1 and later
  4059. * Mac OS X: in version 10.0 and later
  4060. */
  4061. EXTERN_API_C( DataBrowserAddDragItemUPP )
  4062. NewDataBrowserAddDragItemUPP(DataBrowserAddDragItemProcPtr userRoutine);
  4063. /*
  4064. * NewDataBrowserAcceptDragUPP()
  4065. *
  4066. * Availability:
  4067. * Non-Carbon CFM: not available
  4068. * CarbonLib: in CarbonLib 1.1 and later
  4069. * Mac OS X: in version 10.0 and later
  4070. */
  4071. EXTERN_API_C( DataBrowserAcceptDragUPP )
  4072. NewDataBrowserAcceptDragUPP(DataBrowserAcceptDragProcPtr userRoutine);
  4073. /*
  4074. * NewDataBrowserReceiveDragUPP()
  4075. *
  4076. * Availability:
  4077. * Non-Carbon CFM: not available
  4078. * CarbonLib: in CarbonLib 1.1 and later
  4079. * Mac OS X: in version 10.0 and later
  4080. */
  4081. EXTERN_API_C( DataBrowserReceiveDragUPP )
  4082. NewDataBrowserReceiveDragUPP(DataBrowserReceiveDragProcPtr userRoutine);
  4083. /*
  4084. * NewDataBrowserPostProcessDragUPP()
  4085. *
  4086. * Availability:
  4087. * Non-Carbon CFM: not available
  4088. * CarbonLib: in CarbonLib 1.1 and later
  4089. * Mac OS X: in version 10.0 and later
  4090. */
  4091. EXTERN_API_C( DataBrowserPostProcessDragUPP )
  4092. NewDataBrowserPostProcessDragUPP(DataBrowserPostProcessDragProcPtr userRoutine);
  4093. /*
  4094. * NewDataBrowserGetContextualMenuUPP()
  4095. *
  4096. * Availability:
  4097. * Non-Carbon CFM: not available
  4098. * CarbonLib: in CarbonLib 1.1 and later
  4099. * Mac OS X: in version 10.0 and later
  4100. */
  4101. EXTERN_API_C( DataBrowserGetContextualMenuUPP )
  4102. NewDataBrowserGetContextualMenuUPP(DataBrowserGetContextualMenuProcPtr userRoutine);
  4103. /*
  4104. * NewDataBrowserSelectContextualMenuUPP()
  4105. *
  4106. * Availability:
  4107. * Non-Carbon CFM: not available
  4108. * CarbonLib: in CarbonLib 1.1 and later
  4109. * Mac OS X: in version 10.0 and later
  4110. */
  4111. EXTERN_API_C( DataBrowserSelectContextualMenuUPP )
  4112. NewDataBrowserSelectContextualMenuUPP(DataBrowserSelectContextualMenuProcPtr userRoutine);
  4113. /*
  4114. * NewDataBrowserItemHelpContentUPP()
  4115. *
  4116. * Availability:
  4117. * Non-Carbon CFM: not available
  4118. * CarbonLib: in CarbonLib 1.1 and later
  4119. * Mac OS X: in version 10.0 and later
  4120. */
  4121. EXTERN_API_C( DataBrowserItemHelpContentUPP )
  4122. NewDataBrowserItemHelpContentUPP(DataBrowserItemHelpContentProcPtr userRoutine);
  4123. /*
  4124. * DisposeDataBrowserItemDataUPP()
  4125. *
  4126. * Availability:
  4127. * Non-Carbon CFM: not available
  4128. * CarbonLib: in CarbonLib 1.1 and later
  4129. * Mac OS X: in version 10.0 and later
  4130. */
  4131. EXTERN_API_C( void )
  4132. DisposeDataBrowserItemDataUPP(DataBrowserItemDataUPP userUPP);
  4133. /*
  4134. * DisposeDataBrowserItemCompareUPP()
  4135. *
  4136. * Availability:
  4137. * Non-Carbon CFM: not available
  4138. * CarbonLib: in CarbonLib 1.1 and later
  4139. * Mac OS X: in version 10.0 and later
  4140. */
  4141. EXTERN_API_C( void )
  4142. DisposeDataBrowserItemCompareUPP(DataBrowserItemCompareUPP userUPP);
  4143. /*
  4144. * DisposeDataBrowserItemNotificationWithItemUPP()
  4145. *
  4146. * Availability:
  4147. * Non-Carbon CFM: not available
  4148. * CarbonLib: in CarbonLib 1.5 and later
  4149. * Mac OS X: in version 10.1 and later
  4150. */
  4151. EXTERN_API_C( void )
  4152. DisposeDataBrowserItemNotificationWithItemUPP(DataBrowserItemNotificationWithItemUPP userUPP);
  4153. /*
  4154. * DisposeDataBrowserItemNotificationUPP()
  4155. *
  4156. * Availability:
  4157. * Non-Carbon CFM: not available
  4158. * CarbonLib: in CarbonLib 1.1 and later
  4159. * Mac OS X: in version 10.0 and later
  4160. */
  4161. EXTERN_API_C( void )
  4162. DisposeDataBrowserItemNotificationUPP(DataBrowserItemNotificationUPP userUPP);
  4163. /*
  4164. * DisposeDataBrowserAddDragItemUPP()
  4165. *
  4166. * Availability:
  4167. * Non-Carbon CFM: not available
  4168. * CarbonLib: in CarbonLib 1.1 and later
  4169. * Mac OS X: in version 10.0 and later
  4170. */
  4171. EXTERN_API_C( void )
  4172. DisposeDataBrowserAddDragItemUPP(DataBrowserAddDragItemUPP userUPP);
  4173. /*
  4174. * DisposeDataBrowserAcceptDragUPP()
  4175. *
  4176. * Availability:
  4177. * Non-Carbon CFM: not available
  4178. * CarbonLib: in CarbonLib 1.1 and later
  4179. * Mac OS X: in version 10.0 and later
  4180. */
  4181. EXTERN_API_C( void )
  4182. DisposeDataBrowserAcceptDragUPP(DataBrowserAcceptDragUPP userUPP);
  4183. /*
  4184. * DisposeDataBrowserReceiveDragUPP()
  4185. *
  4186. * Availability:
  4187. * Non-Carbon CFM: not available
  4188. * CarbonLib: in CarbonLib 1.1 and later
  4189. * Mac OS X: in version 10.0 and later
  4190. */
  4191. EXTERN_API_C( void )
  4192. DisposeDataBrowserReceiveDragUPP(DataBrowserReceiveDragUPP userUPP);
  4193. /*
  4194. * DisposeDataBrowserPostProcessDragUPP()
  4195. *
  4196. * Availability:
  4197. * Non-Carbon CFM: not available
  4198. * CarbonLib: in CarbonLib 1.1 and later
  4199. * Mac OS X: in version 10.0 and later
  4200. */
  4201. EXTERN_API_C( void )
  4202. DisposeDataBrowserPostProcessDragUPP(DataBrowserPostProcessDragUPP userUPP);
  4203. /*
  4204. * DisposeDataBrowserGetContextualMenuUPP()
  4205. *
  4206. * Availability:
  4207. * Non-Carbon CFM: not available
  4208. * CarbonLib: in CarbonLib 1.1 and later
  4209. * Mac OS X: in version 10.0 and later
  4210. */
  4211. EXTERN_API_C( void )
  4212. DisposeDataBrowserGetContextualMenuUPP(DataBrowserGetContextualMenuUPP userUPP);
  4213. /*
  4214. * DisposeDataBrowserSelectContextualMenuUPP()
  4215. *
  4216. * Availability:
  4217. * Non-Carbon CFM: not available
  4218. * CarbonLib: in CarbonLib 1.1 and later
  4219. * Mac OS X: in version 10.0 and later
  4220. */
  4221. EXTERN_API_C( void )
  4222. DisposeDataBrowserSelectContextualMenuUPP(DataBrowserSelectContextualMenuUPP userUPP);
  4223. /*
  4224. * DisposeDataBrowserItemHelpContentUPP()
  4225. *
  4226. * Availability:
  4227. * Non-Carbon CFM: not available
  4228. * CarbonLib: in CarbonLib 1.1 and later
  4229. * Mac OS X: in version 10.0 and later
  4230. */
  4231. EXTERN_API_C( void )
  4232. DisposeDataBrowserItemHelpContentUPP(DataBrowserItemHelpContentUPP userUPP);
  4233. /*
  4234. * InvokeDataBrowserItemDataUPP()
  4235. *
  4236. * Availability:
  4237. * Non-Carbon CFM: not available
  4238. * CarbonLib: in CarbonLib 1.1 and later
  4239. * Mac OS X: in version 10.0 and later
  4240. */
  4241. EXTERN_API_C( OSStatus )
  4242. InvokeDataBrowserItemDataUPP(
  4243. ControlRef browser,
  4244. DataBrowserItemID item,
  4245. DataBrowserPropertyID property,
  4246. DataBrowserItemDataRef itemData,
  4247. Boolean setValue,
  4248. DataBrowserItemDataUPP userUPP);
  4249. /*
  4250. * InvokeDataBrowserItemCompareUPP()
  4251. *
  4252. * Availability:
  4253. * Non-Carbon CFM: not available
  4254. * CarbonLib: in CarbonLib 1.1 and later
  4255. * Mac OS X: in version 10.0 and later
  4256. */
  4257. EXTERN_API_C( Boolean )
  4258. InvokeDataBrowserItemCompareUPP(
  4259. ControlRef browser,
  4260. DataBrowserItemID itemOne,
  4261. DataBrowserItemID itemTwo,
  4262. DataBrowserPropertyID sortProperty,
  4263. DataBrowserItemCompareUPP userUPP);
  4264. /*
  4265. * InvokeDataBrowserItemNotificationWithItemUPP()
  4266. *
  4267. * Availability:
  4268. * Non-Carbon CFM: not available
  4269. * CarbonLib: in CarbonLib 1.5 and later
  4270. * Mac OS X: in version 10.1 and later
  4271. */
  4272. EXTERN_API_C( void )
  4273. InvokeDataBrowserItemNotificationWithItemUPP(
  4274. ControlRef browser,
  4275. DataBrowserItemID item,
  4276. DataBrowserItemNotification message,
  4277. DataBrowserItemDataRef itemData,
  4278. DataBrowserItemNotificationWithItemUPP userUPP);
  4279. /*
  4280. * InvokeDataBrowserItemNotificationUPP()
  4281. *
  4282. * Availability:
  4283. * Non-Carbon CFM: not available
  4284. * CarbonLib: in CarbonLib 1.1 and later
  4285. * Mac OS X: in version 10.0 and later
  4286. */
  4287. EXTERN_API_C( void )
  4288. InvokeDataBrowserItemNotificationUPP(
  4289. ControlRef browser,
  4290. DataBrowserItemID item,
  4291. DataBrowserItemNotification message,
  4292. DataBrowserItemNotificationUPP userUPP);
  4293. /*
  4294. * InvokeDataBrowserAddDragItemUPP()
  4295. *
  4296. * Availability:
  4297. * Non-Carbon CFM: not available
  4298. * CarbonLib: in CarbonLib 1.1 and later
  4299. * Mac OS X: in version 10.0 and later
  4300. */
  4301. EXTERN_API_C( Boolean )
  4302. InvokeDataBrowserAddDragItemUPP(
  4303. ControlRef browser,
  4304. DragReference theDrag,
  4305. DataBrowserItemID item,
  4306. ItemReference * itemRef,
  4307. DataBrowserAddDragItemUPP userUPP);
  4308. /*
  4309. * InvokeDataBrowserAcceptDragUPP()
  4310. *
  4311. * Availability:
  4312. * Non-Carbon CFM: not available
  4313. * CarbonLib: in CarbonLib 1.1 and later
  4314. * Mac OS X: in version 10.0 and later
  4315. */
  4316. EXTERN_API_C( Boolean )
  4317. InvokeDataBrowserAcceptDragUPP(
  4318. ControlRef browser,
  4319. DragReference theDrag,
  4320. DataBrowserItemID item,
  4321. DataBrowserAcceptDragUPP userUPP);
  4322. /*
  4323. * InvokeDataBrowserReceiveDragUPP()
  4324. *
  4325. * Availability:
  4326. * Non-Carbon CFM: not available
  4327. * CarbonLib: in CarbonLib 1.1 and later
  4328. * Mac OS X: in version 10.0 and later
  4329. */
  4330. EXTERN_API_C( Boolean )
  4331. InvokeDataBrowserReceiveDragUPP(
  4332. ControlRef browser,
  4333. DragReference theDrag,
  4334. DataBrowserItemID item,
  4335. DataBrowserReceiveDragUPP userUPP);
  4336. /*
  4337. * InvokeDataBrowserPostProcessDragUPP()
  4338. *
  4339. * Availability:
  4340. * Non-Carbon CFM: not available
  4341. * CarbonLib: in CarbonLib 1.1 and later
  4342. * Mac OS X: in version 10.0 and later
  4343. */
  4344. EXTERN_API_C( void )
  4345. InvokeDataBrowserPostProcessDragUPP(
  4346. ControlRef browser,
  4347. DragReference theDrag,
  4348. OSStatus trackDragResult,
  4349. DataBrowserPostProcessDragUPP userUPP);
  4350. /*
  4351. * InvokeDataBrowserGetContextualMenuUPP()
  4352. *
  4353. * Availability:
  4354. * Non-Carbon CFM: not available
  4355. * CarbonLib: in CarbonLib 1.1 and later
  4356. * Mac OS X: in version 10.0 and later
  4357. */
  4358. EXTERN_API_C( void )
  4359. InvokeDataBrowserGetContextualMenuUPP(
  4360. ControlRef browser,
  4361. MenuRef * menu,
  4362. UInt32 * helpType,
  4363. CFStringRef * helpItemString,
  4364. AEDesc * selection,
  4365. DataBrowserGetContextualMenuUPP userUPP);
  4366. /*
  4367. * InvokeDataBrowserSelectContextualMenuUPP()
  4368. *
  4369. * Availability:
  4370. * Non-Carbon CFM: not available
  4371. * CarbonLib: in CarbonLib 1.1 and later
  4372. * Mac OS X: in version 10.0 and later
  4373. */
  4374. EXTERN_API_C( void )
  4375. InvokeDataBrowserSelectContextualMenuUPP(
  4376. ControlRef browser,
  4377. MenuRef menu,
  4378. UInt32 selectionType,
  4379. SInt16 menuID,
  4380. MenuItemIndex menuItem,
  4381. DataBrowserSelectContextualMenuUPP userUPP);
  4382. /*
  4383. * InvokeDataBrowserItemHelpContentUPP()
  4384. *
  4385. * Availability:
  4386. * Non-Carbon CFM: not available
  4387. * CarbonLib: in CarbonLib 1.1 and later
  4388. * Mac OS X: in version 10.0 and later
  4389. */
  4390. EXTERN_API_C( void )
  4391. InvokeDataBrowserItemHelpContentUPP(
  4392. ControlRef browser,
  4393. DataBrowserItemID item,
  4394. DataBrowserPropertyID property,
  4395. HMContentRequest inRequest,
  4396. HMContentProvidedType * outContentProvided,
  4397. HMHelpContentPtr ioHelpContent,
  4398. DataBrowserItemHelpContentUPP userUPP);
  4399. /* Standard Callback (vtable) Structure */
  4400. enum {
  4401. kDataBrowserLatestCallbacks = 0
  4402. };
  4403. struct DataBrowserCallbacks {
  4404. UInt32 version; /* Use kDataBrowserLatestCallbacks */
  4405. union {
  4406. struct {
  4407. DataBrowserItemDataUPP itemDataCallback;
  4408. DataBrowserItemCompareUPP itemCompareCallback;
  4409. DataBrowserItemNotificationUPP itemNotificationCallback;
  4410. DataBrowserAddDragItemUPP addDragItemCallback;
  4411. DataBrowserAcceptDragUPP acceptDragCallback;
  4412. DataBrowserReceiveDragUPP receiveDragCallback;
  4413. DataBrowserPostProcessDragUPP postProcessDragCallback;
  4414. DataBrowserItemHelpContentUPP itemHelpContentCallback;
  4415. DataBrowserGetContextualMenuUPP getContextualMenuCallback;
  4416. DataBrowserSelectContextualMenuUPP selectContextualMenuCallback;
  4417. } v1;
  4418. } u;
  4419. };
  4420. typedef struct DataBrowserCallbacks DataBrowserCallbacks;
  4421. /*
  4422. * InitDataBrowserCallbacks()
  4423. *
  4424. * Availability:
  4425. * Non-Carbon CFM: not available
  4426. * CarbonLib: in CarbonLib 1.1 and later
  4427. * Mac OS X: in version 10.0 and later
  4428. */
  4429. EXTERN_API( OSStatus )
  4430. InitDataBrowserCallbacks(DataBrowserCallbacks * callbacks);
  4431. /* Macro for initializing callback structure */
  4432. #define InitializeDataBrowserCallbacks(callbacks, vers) \
  4433. { (callbacks)->version = (vers); InitDataBrowserCallbacks(callbacks); }
  4434. /*
  4435. * GetDataBrowserCallbacks()
  4436. *
  4437. * Availability:
  4438. * Non-Carbon CFM: not available
  4439. * CarbonLib: in CarbonLib 1.1 and later
  4440. * Mac OS X: in version 10.0 and later
  4441. */
  4442. EXTERN_API( OSStatus )
  4443. GetDataBrowserCallbacks(
  4444. ControlRef browser,
  4445. DataBrowserCallbacks * callbacks);
  4446. /*
  4447. * SetDataBrowserCallbacks()
  4448. *
  4449. * Availability:
  4450. * Non-Carbon CFM: not available
  4451. * CarbonLib: in CarbonLib 1.1 and later
  4452. * Mac OS X: in version 10.0 and later
  4453. */
  4454. EXTERN_API( OSStatus )
  4455. SetDataBrowserCallbacks(
  4456. ControlRef browser,
  4457. const DataBrowserCallbacks * callbacks);
  4458. /* Custom Format Callbacks (kDataBrowserCustomType display properties) */
  4459. typedef unsigned long DataBrowserDragFlags;
  4460. typedef SInt16 DataBrowserTrackingResult;
  4461. enum {
  4462. kDataBrowserContentHit = 1,
  4463. kDataBrowserNothingHit = 0,
  4464. kDataBrowserStopTracking = -1
  4465. };
  4466. typedef CALLBACK_API( void , DataBrowserDrawItemProcPtr )(ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, DataBrowserItemState itemState, const Rect *theRect, SInt16 gdDepth, Boolean colorDevice);
  4467. typedef CALLBACK_API( Boolean , DataBrowserEditItemProcPtr )(ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, CFStringRef theString, Rect *maxEditTextRect, Boolean *shrinkToFit);
  4468. typedef CALLBACK_API( Boolean , DataBrowserHitTestProcPtr )(ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, const Rect *mouseRect);
  4469. typedef CALLBACK_API( DataBrowserTrackingResult , DataBrowserTrackingProcPtr )(ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, Point startPt, EventModifiers modifiers);
  4470. typedef CALLBACK_API( void , DataBrowserItemDragRgnProcPtr )(ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, RgnHandle dragRgn);
  4471. typedef CALLBACK_API( DataBrowserDragFlags , DataBrowserItemAcceptDragProcPtr )(ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, DragReference theDrag);
  4472. typedef CALLBACK_API( Boolean , DataBrowserItemReceiveDragProcPtr )(ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, DataBrowserDragFlags dragFlags, DragReference theDrag);
  4473. typedef STACK_UPP_TYPE(DataBrowserDrawItemProcPtr) DataBrowserDrawItemUPP;
  4474. typedef STACK_UPP_TYPE(DataBrowserEditItemProcPtr) DataBrowserEditItemUPP;
  4475. typedef STACK_UPP_TYPE(DataBrowserHitTestProcPtr) DataBrowserHitTestUPP;
  4476. typedef STACK_UPP_TYPE(DataBrowserTrackingProcPtr) DataBrowserTrackingUPP;
  4477. typedef STACK_UPP_TYPE(DataBrowserItemDragRgnProcPtr) DataBrowserItemDragRgnUPP;
  4478. typedef STACK_UPP_TYPE(DataBrowserItemAcceptDragProcPtr) DataBrowserItemAcceptDragUPP;
  4479. typedef STACK_UPP_TYPE(DataBrowserItemReceiveDragProcPtr) DataBrowserItemReceiveDragUPP;
  4480. /*
  4481. * NewDataBrowserDrawItemUPP()
  4482. *
  4483. * Availability:
  4484. * Non-Carbon CFM: not available
  4485. * CarbonLib: in CarbonLib 1.1 and later
  4486. * Mac OS X: in version 10.1 and later
  4487. */
  4488. EXTERN_API_C( DataBrowserDrawItemUPP )
  4489. NewDataBrowserDrawItemUPP(DataBrowserDrawItemProcPtr userRoutine);
  4490. /*
  4491. * NewDataBrowserEditItemUPP()
  4492. *
  4493. * Availability:
  4494. * Non-Carbon CFM: not available
  4495. * CarbonLib: in CarbonLib 1.1 and later
  4496. * Mac OS X: in version 10.1 and later
  4497. */
  4498. EXTERN_API_C( DataBrowserEditItemUPP )
  4499. NewDataBrowserEditItemUPP(DataBrowserEditItemProcPtr userRoutine);
  4500. /*
  4501. * NewDataBrowserHitTestUPP()
  4502. *
  4503. * Availability:
  4504. * Non-Carbon CFM: not available
  4505. * CarbonLib: in CarbonLib 1.1 and later
  4506. * Mac OS X: in version 10.1 and later
  4507. */
  4508. EXTERN_API_C( DataBrowserHitTestUPP )
  4509. NewDataBrowserHitTestUPP(DataBrowserHitTestProcPtr userRoutine);
  4510. /*
  4511. * NewDataBrowserTrackingUPP()
  4512. *
  4513. * Availability:
  4514. * Non-Carbon CFM: not available
  4515. * CarbonLib: in CarbonLib 1.1 and later
  4516. * Mac OS X: in version 10.1 and later
  4517. */
  4518. EXTERN_API_C( DataBrowserTrackingUPP )
  4519. NewDataBrowserTrackingUPP(DataBrowserTrackingProcPtr userRoutine);
  4520. /*
  4521. * NewDataBrowserItemDragRgnUPP()
  4522. *
  4523. * Availability:
  4524. * Non-Carbon CFM: not available
  4525. * CarbonLib: in CarbonLib 1.1 and later
  4526. * Mac OS X: in version 10.1 and later
  4527. */
  4528. EXTERN_API_C( DataBrowserItemDragRgnUPP )
  4529. NewDataBrowserItemDragRgnUPP(DataBrowserItemDragRgnProcPtr userRoutine);
  4530. /*
  4531. * NewDataBrowserItemAcceptDragUPP()
  4532. *
  4533. * Availability:
  4534. * Non-Carbon CFM: not available
  4535. * CarbonLib: in CarbonLib 1.1 and later
  4536. * Mac OS X: in version 10.1 and later
  4537. */
  4538. EXTERN_API_C( DataBrowserItemAcceptDragUPP )
  4539. NewDataBrowserItemAcceptDragUPP(DataBrowserItemAcceptDragProcPtr userRoutine);
  4540. /*
  4541. * NewDataBrowserItemReceiveDragUPP()
  4542. *
  4543. * Availability:
  4544. * Non-Carbon CFM: not available
  4545. * CarbonLib: in CarbonLib 1.1 and later
  4546. * Mac OS X: in version 10.1 and later
  4547. */
  4548. EXTERN_API_C( DataBrowserItemReceiveDragUPP )
  4549. NewDataBrowserItemReceiveDragUPP(DataBrowserItemReceiveDragProcPtr userRoutine);
  4550. /*
  4551. * DisposeDataBrowserDrawItemUPP()
  4552. *
  4553. * Availability:
  4554. * Non-Carbon CFM: not available
  4555. * CarbonLib: in CarbonLib 1.1 and later
  4556. * Mac OS X: in version 10.1 and later
  4557. */
  4558. EXTERN_API_C( void )
  4559. DisposeDataBrowserDrawItemUPP(DataBrowserDrawItemUPP userUPP);
  4560. /*
  4561. * DisposeDataBrowserEditItemUPP()
  4562. *
  4563. * Availability:
  4564. * Non-Carbon CFM: not available
  4565. * CarbonLib: in CarbonLib 1.1 and later
  4566. * Mac OS X: in version 10.1 and later
  4567. */
  4568. EXTERN_API_C( void )
  4569. DisposeDataBrowserEditItemUPP(DataBrowserEditItemUPP userUPP);
  4570. /*
  4571. * DisposeDataBrowserHitTestUPP()
  4572. *
  4573. * Availability:
  4574. * Non-Carbon CFM: not available
  4575. * CarbonLib: in CarbonLib 1.1 and later
  4576. * Mac OS X: in version 10.1 and later
  4577. */
  4578. EXTERN_API_C( void )
  4579. DisposeDataBrowserHitTestUPP(DataBrowserHitTestUPP userUPP);
  4580. /*
  4581. * DisposeDataBrowserTrackingUPP()
  4582. *
  4583. * Availability:
  4584. * Non-Carbon CFM: not available
  4585. * CarbonLib: in CarbonLib 1.1 and later
  4586. * Mac OS X: in version 10.1 and later
  4587. */
  4588. EXTERN_API_C( void )
  4589. DisposeDataBrowserTrackingUPP(DataBrowserTrackingUPP userUPP);
  4590. /*
  4591. * DisposeDataBrowserItemDragRgnUPP()
  4592. *
  4593. * Availability:
  4594. * Non-Carbon CFM: not available
  4595. * CarbonLib: in CarbonLib 1.1 and later
  4596. * Mac OS X: in version 10.1 and later
  4597. */
  4598. EXTERN_API_C( void )
  4599. DisposeDataBrowserItemDragRgnUPP(DataBrowserItemDragRgnUPP userUPP);
  4600. /*
  4601. * DisposeDataBrowserItemAcceptDragUPP()
  4602. *
  4603. * Availability:
  4604. * Non-Carbon CFM: not available
  4605. * CarbonLib: in CarbonLib 1.1 and later
  4606. * Mac OS X: in version 10.1 and later
  4607. */
  4608. EXTERN_API_C( void )
  4609. DisposeDataBrowserItemAcceptDragUPP(DataBrowserItemAcceptDragUPP userUPP);
  4610. /*
  4611. * DisposeDataBrowserItemReceiveDragUPP()
  4612. *
  4613. * Availability:
  4614. * Non-Carbon CFM: not available
  4615. * CarbonLib: in CarbonLib 1.1 and later
  4616. * Mac OS X: in version 10.1 and later
  4617. */
  4618. EXTERN_API_C( void )
  4619. DisposeDataBrowserItemReceiveDragUPP(DataBrowserItemReceiveDragUPP userUPP);
  4620. /*
  4621. * InvokeDataBrowserDrawItemUPP()
  4622. *
  4623. * Availability:
  4624. * Non-Carbon CFM: not available
  4625. * CarbonLib: in CarbonLib 1.1 and later
  4626. * Mac OS X: in version 10.1 and later
  4627. */
  4628. EXTERN_API_C( void )
  4629. InvokeDataBrowserDrawItemUPP(
  4630. ControlRef browser,
  4631. DataBrowserItemID item,
  4632. DataBrowserPropertyID property,
  4633. DataBrowserItemState itemState,
  4634. const Rect * theRect,
  4635. SInt16 gdDepth,
  4636. Boolean colorDevice,
  4637. DataBrowserDrawItemUPP userUPP);
  4638. /*
  4639. * InvokeDataBrowserEditItemUPP()
  4640. *
  4641. * Availability:
  4642. * Non-Carbon CFM: not available
  4643. * CarbonLib: in CarbonLib 1.1 and later
  4644. * Mac OS X: in version 10.1 and later
  4645. */
  4646. EXTERN_API_C( Boolean )
  4647. InvokeDataBrowserEditItemUPP(
  4648. ControlRef browser,
  4649. DataBrowserItemID item,
  4650. DataBrowserPropertyID property,
  4651. CFStringRef theString,
  4652. Rect * maxEditTextRect,
  4653. Boolean * shrinkToFit,
  4654. DataBrowserEditItemUPP userUPP);
  4655. /*
  4656. * InvokeDataBrowserHitTestUPP()
  4657. *
  4658. * Availability:
  4659. * Non-Carbon CFM: not available
  4660. * CarbonLib: in CarbonLib 1.1 and later
  4661. * Mac OS X: in version 10.1 and later
  4662. */
  4663. EXTERN_API_C( Boolean )
  4664. InvokeDataBrowserHitTestUPP(
  4665. ControlRef browser,
  4666. DataBrowserItemID itemID,
  4667. DataBrowserPropertyID property,
  4668. const Rect * theRect,
  4669. const Rect * mouseRect,
  4670. DataBrowserHitTestUPP userUPP);
  4671. /*
  4672. * InvokeDataBrowserTrackingUPP()
  4673. *
  4674. * Availability:
  4675. * Non-Carbon CFM: not available
  4676. * CarbonLib: in CarbonLib 1.1 and later
  4677. * Mac OS X: in version 10.1 and later
  4678. */
  4679. EXTERN_API_C( DataBrowserTrackingResult )
  4680. InvokeDataBrowserTrackingUPP(
  4681. ControlRef browser,
  4682. DataBrowserItemID itemID,
  4683. DataBrowserPropertyID property,
  4684. const Rect * theRect,
  4685. Point startPt,
  4686. EventModifiers modifiers,
  4687. DataBrowserTrackingUPP userUPP);
  4688. /*
  4689. * InvokeDataBrowserItemDragRgnUPP()
  4690. *
  4691. * Availability:
  4692. * Non-Carbon CFM: not available
  4693. * CarbonLib: in CarbonLib 1.1 and later
  4694. * Mac OS X: in version 10.1 and later
  4695. */
  4696. EXTERN_API_C( void )
  4697. InvokeDataBrowserItemDragRgnUPP(
  4698. ControlRef browser,
  4699. DataBrowserItemID itemID,
  4700. DataBrowserPropertyID property,
  4701. const Rect * theRect,
  4702. RgnHandle dragRgn,
  4703. DataBrowserItemDragRgnUPP userUPP);
  4704. /*
  4705. * InvokeDataBrowserItemAcceptDragUPP()
  4706. *
  4707. * Availability:
  4708. * Non-Carbon CFM: not available
  4709. * CarbonLib: in CarbonLib 1.1 and later
  4710. * Mac OS X: in version 10.1 and later
  4711. */
  4712. EXTERN_API_C( DataBrowserDragFlags )
  4713. InvokeDataBrowserItemAcceptDragUPP(
  4714. ControlRef browser,
  4715. DataBrowserItemID itemID,
  4716. DataBrowserPropertyID property,
  4717. const Rect * theRect,
  4718. DragReference theDrag,
  4719. DataBrowserItemAcceptDragUPP userUPP);
  4720. /*
  4721. * InvokeDataBrowserItemReceiveDragUPP()
  4722. *
  4723. * Availability:
  4724. * Non-Carbon CFM: not available
  4725. * CarbonLib: in CarbonLib 1.1 and later
  4726. * Mac OS X: in version 10.1 and later
  4727. */
  4728. EXTERN_API_C( Boolean )
  4729. InvokeDataBrowserItemReceiveDragUPP(
  4730. ControlRef browser,
  4731. DataBrowserItemID itemID,
  4732. DataBrowserPropertyID property,
  4733. DataBrowserDragFlags dragFlags,
  4734. DragReference theDrag,
  4735. DataBrowserItemReceiveDragUPP userUPP);
  4736. /* Custom Callback (vtable) Structure */
  4737. enum {
  4738. kDataBrowserLatestCustomCallbacks = 0
  4739. };
  4740. struct DataBrowserCustomCallbacks {
  4741. UInt32 version; /* Use kDataBrowserLatestCustomCallbacks */
  4742. union {
  4743. struct {
  4744. DataBrowserDrawItemUPP drawItemCallback;
  4745. DataBrowserEditItemUPP editTextCallback;
  4746. DataBrowserHitTestUPP hitTestCallback;
  4747. DataBrowserTrackingUPP trackingCallback;
  4748. DataBrowserItemDragRgnUPP dragRegionCallback;
  4749. DataBrowserItemAcceptDragUPP acceptDragCallback;
  4750. DataBrowserItemReceiveDragUPP receiveDragCallback;
  4751. } v1;
  4752. } u;
  4753. };
  4754. typedef struct DataBrowserCustomCallbacks DataBrowserCustomCallbacks;
  4755. /*
  4756. * InitDataBrowserCustomCallbacks()
  4757. *
  4758. * Availability:
  4759. * Non-Carbon CFM: not available
  4760. * CarbonLib: in CarbonLib 1.1 and later
  4761. * Mac OS X: in version 10.0 and later
  4762. */
  4763. EXTERN_API( OSStatus )
  4764. InitDataBrowserCustomCallbacks(DataBrowserCustomCallbacks * callbacks);
  4765. /* Macro for initializing custom callback structure */
  4766. #define InitializeDataBrowserCustomCallbacks(callbacks, vers) \
  4767. { (callbacks)->version = (vers); InitDataBrowserCustomCallbacks(callbacks); }
  4768. /*
  4769. * GetDataBrowserCustomCallbacks()
  4770. *
  4771. * Availability:
  4772. * Non-Carbon CFM: not available
  4773. * CarbonLib: in CarbonLib 1.1 and later
  4774. * Mac OS X: in version 10.0 and later
  4775. */
  4776. EXTERN_API( OSStatus )
  4777. GetDataBrowserCustomCallbacks(
  4778. ControlRef browser,
  4779. DataBrowserCustomCallbacks * callbacks);
  4780. /*
  4781. * SetDataBrowserCustomCallbacks()
  4782. *
  4783. * Availability:
  4784. * Non-Carbon CFM: not available
  4785. * CarbonLib: in CarbonLib 1.1 and later
  4786. * Mac OS X: in version 10.0 and later
  4787. */
  4788. EXTERN_API( OSStatus )
  4789. SetDataBrowserCustomCallbacks(
  4790. ControlRef browser,
  4791. const DataBrowserCustomCallbacks * callbacks);
  4792. /* TableView Formatting */
  4793. typedef UInt32 DataBrowserTableViewHiliteStyle;
  4794. enum {
  4795. kDataBrowserTableViewMinimalHilite = 0,
  4796. kDataBrowserTableViewFillHilite = 1
  4797. };
  4798. typedef UInt32 DataBrowserTableViewPropertyFlags;
  4799. enum {
  4800. /* kDataBrowserTableView DataBrowserPropertyFlags */
  4801. kDataBrowserTableViewSelectionColumn = 1 << kDataBrowserViewSpecificFlagsOffset
  4802. };
  4803. /* The row and column indicies are zero-based */
  4804. typedef UInt32 DataBrowserTableViewRowIndex;
  4805. typedef UInt32 DataBrowserTableViewColumnIndex;
  4806. typedef DataBrowserPropertyID DataBrowserTableViewColumnID;
  4807. typedef DataBrowserPropertyDesc DataBrowserTableViewColumnDesc;
  4808. /* TableView API */
  4809. /* Use when setting column position */
  4810. enum {
  4811. kDataBrowserTableViewLastColumn = -1
  4812. };
  4813. /*
  4814. * RemoveDataBrowserTableViewColumn()
  4815. *
  4816. * Availability:
  4817. * Non-Carbon CFM: not available
  4818. * CarbonLib: in CarbonLib 1.1 and later
  4819. * Mac OS X: in version 10.0 and later
  4820. */
  4821. EXTERN_API( OSStatus )
  4822. RemoveDataBrowserTableViewColumn(
  4823. ControlRef browser,
  4824. DataBrowserTableViewColumnID column);
  4825. /*
  4826. * GetDataBrowserTableViewColumnCount()
  4827. *
  4828. * Availability:
  4829. * Non-Carbon CFM: not available
  4830. * CarbonLib: in CarbonLib 1.1 and later
  4831. * Mac OS X: in version 10.0 and later
  4832. */
  4833. EXTERN_API( OSStatus )
  4834. GetDataBrowserTableViewColumnCount(
  4835. ControlRef browser,
  4836. UInt32 * numColumns);
  4837. /*
  4838. * SetDataBrowserTableViewHiliteStyle()
  4839. *
  4840. * Availability:
  4841. * Non-Carbon CFM: not available
  4842. * CarbonLib: in CarbonLib 1.1 and later
  4843. * Mac OS X: in version 10.0 and later
  4844. */
  4845. EXTERN_API( OSStatus )
  4846. SetDataBrowserTableViewHiliteStyle(
  4847. ControlRef browser,
  4848. DataBrowserTableViewHiliteStyle hiliteStyle);
  4849. /*
  4850. * GetDataBrowserTableViewHiliteStyle()
  4851. *
  4852. * Availability:
  4853. * Non-Carbon CFM: not available
  4854. * CarbonLib: in CarbonLib 1.1 and later
  4855. * Mac OS X: in version 10.0 and later
  4856. */
  4857. EXTERN_API( OSStatus )
  4858. GetDataBrowserTableViewHiliteStyle(
  4859. ControlRef browser,
  4860. DataBrowserTableViewHiliteStyle * hiliteStyle);
  4861. /*
  4862. * SetDataBrowserTableViewRowHeight()
  4863. *
  4864. * Availability:
  4865. * Non-Carbon CFM: not available
  4866. * CarbonLib: in CarbonLib 1.1 and later
  4867. * Mac OS X: in version 10.0 and later
  4868. */
  4869. EXTERN_API( OSStatus )
  4870. SetDataBrowserTableViewRowHeight(
  4871. ControlRef browser,
  4872. UInt16 height);
  4873. /*
  4874. * GetDataBrowserTableViewRowHeight()
  4875. *
  4876. * Availability:
  4877. * Non-Carbon CFM: not available
  4878. * CarbonLib: in CarbonLib 1.1 and later
  4879. * Mac OS X: in version 10.0 and later
  4880. */
  4881. EXTERN_API( OSStatus )
  4882. GetDataBrowserTableViewRowHeight(
  4883. ControlRef browser,
  4884. UInt16 * height);
  4885. /*
  4886. * SetDataBrowserTableViewColumnWidth()
  4887. *
  4888. * Availability:
  4889. * Non-Carbon CFM: not available
  4890. * CarbonLib: in CarbonLib 1.1 and later
  4891. * Mac OS X: in version 10.0 and later
  4892. */
  4893. EXTERN_API( OSStatus )
  4894. SetDataBrowserTableViewColumnWidth(
  4895. ControlRef browser,
  4896. UInt16 width);
  4897. /*
  4898. * GetDataBrowserTableViewColumnWidth()
  4899. *
  4900. * Availability:
  4901. * Non-Carbon CFM: not available
  4902. * CarbonLib: in CarbonLib 1.1 and later
  4903. * Mac OS X: in version 10.0 and later
  4904. */
  4905. EXTERN_API( OSStatus )
  4906. GetDataBrowserTableViewColumnWidth(
  4907. ControlRef browser,
  4908. UInt16 * width);
  4909. /*
  4910. * SetDataBrowserTableViewItemRowHeight()
  4911. *
  4912. * Availability:
  4913. * Non-Carbon CFM: not available
  4914. * CarbonLib: in CarbonLib 1.1 and later
  4915. * Mac OS X: in version 10.0 and later
  4916. */
  4917. EXTERN_API( OSStatus )
  4918. SetDataBrowserTableViewItemRowHeight(
  4919. ControlRef browser,
  4920. DataBrowserItemID item,
  4921. UInt16 height);
  4922. /*
  4923. * GetDataBrowserTableViewItemRowHeight()
  4924. *
  4925. * Availability:
  4926. * Non-Carbon CFM: not available
  4927. * CarbonLib: in CarbonLib 1.1 and later
  4928. * Mac OS X: in version 10.0 and later
  4929. */
  4930. EXTERN_API( OSStatus )
  4931. GetDataBrowserTableViewItemRowHeight(
  4932. ControlRef browser,
  4933. DataBrowserItemID item,
  4934. UInt16 * height);
  4935. /*
  4936. * SetDataBrowserTableViewNamedColumnWidth()
  4937. *
  4938. * Availability:
  4939. * Non-Carbon CFM: not available
  4940. * CarbonLib: in CarbonLib 1.1 and later
  4941. * Mac OS X: in version 10.0 and later
  4942. */
  4943. EXTERN_API( OSStatus )
  4944. SetDataBrowserTableViewNamedColumnWidth(
  4945. ControlRef browser,
  4946. DataBrowserTableViewColumnID column,
  4947. UInt16 width);
  4948. /*
  4949. * GetDataBrowserTableViewNamedColumnWidth()
  4950. *
  4951. * Availability:
  4952. * Non-Carbon CFM: not available
  4953. * CarbonLib: in CarbonLib 1.1 and later
  4954. * Mac OS X: in version 10.0 and later
  4955. */
  4956. EXTERN_API( OSStatus )
  4957. GetDataBrowserTableViewNamedColumnWidth(
  4958. ControlRef browser,
  4959. DataBrowserTableViewColumnID column,
  4960. UInt16 * width);
  4961. /*
  4962. * SetDataBrowserTableViewGeometry()
  4963. *
  4964. * Availability:
  4965. * Non-Carbon CFM: not available
  4966. * CarbonLib: in CarbonLib 1.1 and later
  4967. * Mac OS X: in version 10.0 and later
  4968. */
  4969. EXTERN_API( OSStatus )
  4970. SetDataBrowserTableViewGeometry(
  4971. ControlRef browser,
  4972. Boolean variableWidthColumns,
  4973. Boolean variableHeightRows);
  4974. /*
  4975. * GetDataBrowserTableViewGeometry()
  4976. *
  4977. * Availability:
  4978. * Non-Carbon CFM: not available
  4979. * CarbonLib: in CarbonLib 1.1 and later
  4980. * Mac OS X: in version 10.0 and later
  4981. */
  4982. EXTERN_API( OSStatus )
  4983. GetDataBrowserTableViewGeometry(
  4984. ControlRef browser,
  4985. Boolean * variableWidthColumns,
  4986. Boolean * variableHeightRows);
  4987. /*
  4988. * GetDataBrowserTableViewItemID()
  4989. *
  4990. * Availability:
  4991. * Non-Carbon CFM: not available
  4992. * CarbonLib: in CarbonLib 1.1 and later
  4993. * Mac OS X: in version 10.0 and later
  4994. */
  4995. EXTERN_API( OSStatus )
  4996. GetDataBrowserTableViewItemID(
  4997. ControlRef browser,
  4998. DataBrowserTableViewRowIndex row,
  4999. DataBrowserItemID * item);
  5000. /*
  5001. * SetDataBrowserTableViewItemRow()
  5002. *
  5003. * Availability:
  5004. * Non-Carbon CFM: not available
  5005. * CarbonLib: in CarbonLib 1.1 and later
  5006. * Mac OS X: in version 10.0 and later
  5007. */
  5008. EXTERN_API( OSStatus )
  5009. SetDataBrowserTableViewItemRow(
  5010. ControlRef browser,
  5011. DataBrowserItemID item,
  5012. DataBrowserTableViewRowIndex row);
  5013. /*
  5014. * GetDataBrowserTableViewItemRow()
  5015. *
  5016. * Availability:
  5017. * Non-Carbon CFM: not available
  5018. * CarbonLib: in CarbonLib 1.1 and later
  5019. * Mac OS X: in version 10.0 and later
  5020. */
  5021. EXTERN_API( OSStatus )
  5022. GetDataBrowserTableViewItemRow(
  5023. ControlRef browser,
  5024. DataBrowserItemID item,
  5025. DataBrowserTableViewRowIndex * row);
  5026. /*
  5027. * SetDataBrowserTableViewColumnPosition()
  5028. *
  5029. * Availability:
  5030. * Non-Carbon CFM: not available
  5031. * CarbonLib: in CarbonLib 1.1 and later
  5032. * Mac OS X: in version 10.0 and later
  5033. */
  5034. EXTERN_API( OSStatus )
  5035. SetDataBrowserTableViewColumnPosition(
  5036. ControlRef browser,
  5037. DataBrowserTableViewColumnID column,
  5038. DataBrowserTableViewColumnIndex position);
  5039. /*
  5040. * GetDataBrowserTableViewColumnPosition()
  5041. *
  5042. * Availability:
  5043. * Non-Carbon CFM: not available
  5044. * CarbonLib: in CarbonLib 1.1 and later
  5045. * Mac OS X: in version 10.0 and later
  5046. */
  5047. EXTERN_API( OSStatus )
  5048. GetDataBrowserTableViewColumnPosition(
  5049. ControlRef browser,
  5050. DataBrowserTableViewColumnID column,
  5051. DataBrowserTableViewColumnIndex * position);
  5052. /*
  5053. * GetDataBrowserTableViewColumnProperty()
  5054. *
  5055. * Availability:
  5056. * Non-Carbon CFM: not available
  5057. * CarbonLib: in CarbonLib 1.1 and later
  5058. * Mac OS X: in version 10.0 and later
  5059. */
  5060. EXTERN_API( OSStatus )
  5061. GetDataBrowserTableViewColumnProperty(
  5062. ControlRef browser,
  5063. DataBrowserTableViewColumnIndex column,
  5064. DataBrowserTableViewColumnID * property);
  5065. /* kDataBrowserListView Formatting */
  5066. typedef UInt32 DataBrowserListViewPropertyFlags;
  5067. enum {
  5068. /* kDataBrowserListView DataBrowserPropertyFlags */
  5069. kDataBrowserListViewMovableColumn = 1 << (kDataBrowserViewSpecificFlagsOffset + 1),
  5070. kDataBrowserListViewSortableColumn = 1 << (kDataBrowserViewSpecificFlagsOffset + 2),
  5071. kDataBrowserListViewSelectionColumn = kDataBrowserTableViewSelectionColumn,
  5072. kDataBrowserListViewDefaultColumnFlags = kDataBrowserListViewMovableColumn + kDataBrowserListViewSortableColumn
  5073. };
  5074. enum {
  5075. kDataBrowserListViewLatestHeaderDesc = 0
  5076. };
  5077. struct DataBrowserListViewHeaderDesc {
  5078. UInt32 version; /* Use kDataBrowserListViewLatestHeaderDesc */
  5079. UInt16 minimumWidth;
  5080. UInt16 maximumWidth;
  5081. SInt16 titleOffset;
  5082. CFStringRef titleString;
  5083. DataBrowserSortOrder initialOrder;
  5084. ControlFontStyleRec btnFontStyle;
  5085. ControlButtonContentInfo btnContentInfo;
  5086. };
  5087. typedef struct DataBrowserListViewHeaderDesc DataBrowserListViewHeaderDesc;
  5088. struct DataBrowserListViewColumnDesc {
  5089. DataBrowserTableViewColumnDesc propertyDesc;
  5090. DataBrowserListViewHeaderDesc headerBtnDesc;
  5091. };
  5092. typedef struct DataBrowserListViewColumnDesc DataBrowserListViewColumnDesc;
  5093. /* kDataBrowserListView API */
  5094. enum {
  5095. kDataBrowserListViewAppendColumn = kDataBrowserTableViewLastColumn
  5096. };
  5097. /*
  5098. * AutoSizeDataBrowserListViewColumns()
  5099. *
  5100. * Availability:
  5101. * Non-Carbon CFM: not available
  5102. * CarbonLib: in CarbonLib 1.1 and later
  5103. * Mac OS X: in version 10.0 and later
  5104. */
  5105. EXTERN_API( OSStatus )
  5106. AutoSizeDataBrowserListViewColumns(ControlRef browser);
  5107. /*
  5108. * AddDataBrowserListViewColumn()
  5109. *
  5110. * Availability:
  5111. * Non-Carbon CFM: not available
  5112. * CarbonLib: in CarbonLib 1.1 and later
  5113. * Mac OS X: in version 10.0 and later
  5114. */
  5115. EXTERN_API( OSStatus )
  5116. AddDataBrowserListViewColumn(
  5117. ControlRef browser,
  5118. DataBrowserListViewColumnDesc * columnDesc,
  5119. DataBrowserTableViewColumnIndex position);
  5120. /*
  5121. * GetDataBrowserListViewHeaderDesc()
  5122. *
  5123. * Availability:
  5124. * Non-Carbon CFM: not available
  5125. * CarbonLib: in CarbonLib 1.5 and later
  5126. * Mac OS X: in version 10.2 and later
  5127. */
  5128. EXTERN_API( OSStatus )
  5129. GetDataBrowserListViewHeaderDesc(
  5130. ControlRef browser,
  5131. DataBrowserTableViewColumnID column,
  5132. DataBrowserListViewHeaderDesc * desc);
  5133. /*
  5134. * SetDataBrowserListViewHeaderDesc()
  5135. *
  5136. * Availability:
  5137. * Non-Carbon CFM: not available
  5138. * CarbonLib: in CarbonLib 1.5 and later
  5139. * Mac OS X: in version 10.2 and later
  5140. */
  5141. EXTERN_API( OSStatus )
  5142. SetDataBrowserListViewHeaderDesc(
  5143. ControlRef browser,
  5144. DataBrowserTableViewColumnID column,
  5145. DataBrowserListViewHeaderDesc * desc);
  5146. /*
  5147. * SetDataBrowserListViewHeaderBtnHeight()
  5148. *
  5149. * Availability:
  5150. * Non-Carbon CFM: not available
  5151. * CarbonLib: in CarbonLib 1.1 and later
  5152. * Mac OS X: in version 10.0 and later
  5153. */
  5154. EXTERN_API( OSStatus )
  5155. SetDataBrowserListViewHeaderBtnHeight(
  5156. ControlRef browser,
  5157. UInt16 height);
  5158. /*
  5159. * GetDataBrowserListViewHeaderBtnHeight()
  5160. *
  5161. * Availability:
  5162. * Non-Carbon CFM: not available
  5163. * CarbonLib: in CarbonLib 1.1 and later
  5164. * Mac OS X: in version 10.0 and later
  5165. */
  5166. EXTERN_API( OSStatus )
  5167. GetDataBrowserListViewHeaderBtnHeight(
  5168. ControlRef browser,
  5169. UInt16 * height);
  5170. /*
  5171. * SetDataBrowserListViewUsePlainBackground()
  5172. *
  5173. * Availability:
  5174. * Non-Carbon CFM: not available
  5175. * CarbonLib: in CarbonLib 1.1 and later
  5176. * Mac OS X: in version 10.0 and later
  5177. */
  5178. EXTERN_API( OSStatus )
  5179. SetDataBrowserListViewUsePlainBackground(
  5180. ControlRef browser,
  5181. Boolean usePlainBackground);
  5182. /*
  5183. * GetDataBrowserListViewUsePlainBackground()
  5184. *
  5185. * Availability:
  5186. * Non-Carbon CFM: not available
  5187. * CarbonLib: in CarbonLib 1.1 and later
  5188. * Mac OS X: in version 10.0 and later
  5189. */
  5190. EXTERN_API( OSStatus )
  5191. GetDataBrowserListViewUsePlainBackground(
  5192. ControlRef browser,
  5193. Boolean * usePlainBackground);
  5194. /*
  5195. * SetDataBrowserListViewDisclosureColumn()
  5196. *
  5197. * Availability:
  5198. * Non-Carbon CFM: not available
  5199. * CarbonLib: in CarbonLib 1.1 and later
  5200. * Mac OS X: in version 10.0 and later
  5201. */
  5202. EXTERN_API( OSStatus )
  5203. SetDataBrowserListViewDisclosureColumn(
  5204. ControlRef browser,
  5205. DataBrowserTableViewColumnID column,
  5206. Boolean expandableRows);
  5207. /*
  5208. * GetDataBrowserListViewDisclosureColumn()
  5209. *
  5210. * Availability:
  5211. * Non-Carbon CFM: not available
  5212. * CarbonLib: in CarbonLib 1.1 and later
  5213. * Mac OS X: in version 10.0 and later
  5214. */
  5215. EXTERN_API( OSStatus )
  5216. GetDataBrowserListViewDisclosureColumn(
  5217. ControlRef browser,
  5218. DataBrowserTableViewColumnID * column,
  5219. Boolean * expandableRows);
  5220. /* kDataBrowserColumnView API */
  5221. /*
  5222. * GetDataBrowserColumnViewPath()
  5223. *
  5224. * Availability:
  5225. * Non-Carbon CFM: not available
  5226. * CarbonLib: in CarbonLib 1.1 and later
  5227. * Mac OS X: in version 10.0 and later
  5228. */
  5229. EXTERN_API( OSStatus )
  5230. GetDataBrowserColumnViewPath(
  5231. ControlRef browser,
  5232. Handle path);
  5233. /*
  5234. * GetDataBrowserColumnViewPathLength()
  5235. *
  5236. * Availability:
  5237. * Non-Carbon CFM: not available
  5238. * CarbonLib: in CarbonLib 1.1 and later
  5239. * Mac OS X: in version 10.0 and later
  5240. */
  5241. EXTERN_API( OSStatus )
  5242. GetDataBrowserColumnViewPathLength(
  5243. ControlRef browser,
  5244. UInt32 * pathLength);
  5245. /*
  5246. * SetDataBrowserColumnViewPath()
  5247. *
  5248. * Availability:
  5249. * Non-Carbon CFM: not available
  5250. * CarbonLib: in CarbonLib 1.1 and later
  5251. * Mac OS X: in version 10.0 and later
  5252. */
  5253. EXTERN_API( OSStatus )
  5254. SetDataBrowserColumnViewPath(
  5255. ControlRef browser,
  5256. UInt32 length,
  5257. const DataBrowserItemID * path);
  5258. /*
  5259. * SetDataBrowserColumnViewDisplayType()
  5260. *
  5261. * Availability:
  5262. * Non-Carbon CFM: not available
  5263. * CarbonLib: in CarbonLib 1.1 and later
  5264. * Mac OS X: in version 10.0 and later
  5265. */
  5266. EXTERN_API( OSStatus )
  5267. SetDataBrowserColumnViewDisplayType(
  5268. ControlRef browser,
  5269. DataBrowserPropertyType propertyType);
  5270. /*
  5271. * GetDataBrowserColumnViewDisplayType()
  5272. *
  5273. * Availability:
  5274. * Non-Carbon CFM: not available
  5275. * CarbonLib: in CarbonLib 1.1 and later
  5276. * Mac OS X: in version 10.0 and later
  5277. */
  5278. EXTERN_API( OSStatus )
  5279. GetDataBrowserColumnViewDisplayType(
  5280. ControlRef browser,
  5281. DataBrowserPropertyType * propertyType);
  5282. /* DataBrowser UPP macros */
  5283. /*---------------------------------------------------------------------------------------*/
  5284. /* EditUnicodeText Control */
  5285. /*---------------------------------------------------------------------------------------*/
  5286. /* This control is only available in Mac OS X. It is super similar to Edit Text control */
  5287. /* Use all the same Get/Set tags. But don't ask for the TEHandle. */
  5288. /*---------------------------------------------------------------------------------------*/
  5289. /* This callback supplies the functionality of the TSMTEPostUpdateProcPtr that is used */
  5290. /* in the EditText control. A client should supply this call if they want to look at */
  5291. /* inline text that has been fixed before it is included in the actual body text */
  5292. /* if the new text (i.e. the text in the handle) should be included in the body text */
  5293. /* the client should return true. If the client wants to block the inclusion of the */
  5294. /* text they should return false. */
  5295. typedef CALLBACK_API( Boolean , EditUnicodePostUpdateProcPtr )(UniCharArrayHandle uniText, UniCharCount uniTextLength, UniCharArrayOffset iStartOffset, UniCharArrayOffset iEndOffset, void *refcon);
  5296. typedef STACK_UPP_TYPE(EditUnicodePostUpdateProcPtr) EditUnicodePostUpdateUPP;
  5297. /*
  5298. * NewEditUnicodePostUpdateUPP()
  5299. *
  5300. * Availability:
  5301. * Non-Carbon CFM: not available
  5302. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  5303. * Mac OS X: in version 10.0 and later
  5304. */
  5305. EXTERN_API_C( EditUnicodePostUpdateUPP )
  5306. NewEditUnicodePostUpdateUPP(EditUnicodePostUpdateProcPtr userRoutine);
  5307. /*
  5308. * DisposeEditUnicodePostUpdateUPP()
  5309. *
  5310. * Availability:
  5311. * Non-Carbon CFM: not available
  5312. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  5313. * Mac OS X: in version 10.0 and later
  5314. */
  5315. EXTERN_API_C( void )
  5316. DisposeEditUnicodePostUpdateUPP(EditUnicodePostUpdateUPP userUPP);
  5317. /*
  5318. * InvokeEditUnicodePostUpdateUPP()
  5319. *
  5320. * Availability:
  5321. * Non-Carbon CFM: not available
  5322. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  5323. * Mac OS X: in version 10.0 and later
  5324. */
  5325. EXTERN_API_C( Boolean )
  5326. InvokeEditUnicodePostUpdateUPP(
  5327. UniCharArrayHandle uniText,
  5328. UniCharCount uniTextLength,
  5329. UniCharArrayOffset iStartOffset,
  5330. UniCharArrayOffset iEndOffset,
  5331. void * refcon,
  5332. EditUnicodePostUpdateUPP userUPP);
  5333. /* Use this tag when calling ControlSet/GetData to specify the UnicodePostUpdateProcPtr */
  5334. /* tags available with Appearance 1.1 or later */
  5335. enum {
  5336. kControlEditUnicodeTextPostUpdateProcTag = FOUR_CHAR_CODE('upup')
  5337. };
  5338. enum {
  5339. kControlEditUnicodeTextProc = 912,
  5340. kControlEditUnicodeTextPasswordProc = 914
  5341. };
  5342. /* Control Kind Tag */
  5343. enum {
  5344. kControlKindEditUnicodeText = FOUR_CHAR_CODE('eutx')
  5345. };
  5346. /* Creation API for X */
  5347. /*
  5348. * CreateEditUnicodeTextControl()
  5349. *
  5350. * Availability:
  5351. * Non-Carbon CFM: not available
  5352. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  5353. * Mac OS X: in version 10.0 and later
  5354. */
  5355. EXTERN_API( OSStatus )
  5356. CreateEditUnicodeTextControl(
  5357. WindowRef window,
  5358. const Rect * boundsRect,
  5359. CFStringRef text,
  5360. Boolean isPassword,
  5361. const ControlFontStyleRec * style, /* can be NULL */
  5362. ControlRef * outControl);
  5363. /* Tagged data supported by Unicode text Control only*/
  5364. enum {
  5365. kControlEditTextSingleLineTag = FOUR_CHAR_CODE('sglc')
  5366. };
  5367. #if OLDROUTINENAMES
  5368. /*--------------------------------------------------------------------------------------*/
  5369. /* o OLDROUTINENAMES */
  5370. /*--------------------------------------------------------------------------------------*/
  5371. enum {
  5372. kControlCheckboxUncheckedValue = kControlCheckBoxUncheckedValue,
  5373. kControlCheckboxCheckedValue = kControlCheckBoxCheckedValue,
  5374. kControlCheckboxMixedValue = kControlCheckBoxMixedValue
  5375. };
  5376. enum {
  5377. inLabel = kControlLabelPart,
  5378. inMenu = kControlMenuPart,
  5379. inTriangle = kControlTrianglePart,
  5380. inButton = kControlButtonPart,
  5381. inCheckBox = kControlCheckBoxPart,
  5382. inUpButton = kControlUpButtonPart,
  5383. inDownButton = kControlDownButtonPart,
  5384. inPageUp = kControlPageUpPart,
  5385. inPageDown = kControlPageDownPart
  5386. };
  5387. enum {
  5388. kInLabelControlPart = kControlLabelPart,
  5389. kInMenuControlPart = kControlMenuPart,
  5390. kInTriangleControlPart = kControlTrianglePart,
  5391. kInButtonControlPart = kControlButtonPart,
  5392. kInCheckBoxControlPart = kControlCheckBoxPart,
  5393. kInUpButtonControlPart = kControlUpButtonPart,
  5394. kInDownButtonControlPart = kControlDownButtonPart,
  5395. kInPageUpControlPart = kControlPageUpPart,
  5396. kInPageDownControlPart = kControlPageDownPart
  5397. };
  5398. #endif /* OLDROUTINENAMES */
  5399. #if PRAGMA_STRUCT_ALIGN
  5400. #pragma options align=reset
  5401. #elif PRAGMA_STRUCT_PACKPUSH
  5402. #pragma pack(pop)
  5403. #elif PRAGMA_STRUCT_PACK
  5404. #pragma pack()
  5405. #endif
  5406. #ifdef PRAGMA_IMPORT_OFF
  5407. #pragma import off
  5408. #elif PRAGMA_IMPORT
  5409. #pragma import reset
  5410. #endif
  5411. #ifdef __cplusplus
  5412. }
  5413. #endif
  5414. #endif /* __CONTROLDEFINITIONS__ */