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

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       Controls.h
  3.  
  4.      Contains:   Control Manager interfaces
  5.  
  6.      Version:    Technology: Mac OS 9
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1985-2001 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __CONTROLS__
  18. #define __CONTROLS__
  19. #ifndef __MACTYPES__
  20. #include "MacTypes.h"
  21. #endif
  22. #ifndef __QUICKDRAW__
  23. #include "Quickdraw.h"
  24. #endif
  25. #ifndef __MENUS__
  26. #include "Menus.h"
  27. #endif
  28. #ifndef __TEXTEDIT__
  29. #include "TextEdit.h"
  30. #endif
  31. #ifndef __DRAG__
  32. #include "Drag.h"
  33. #endif
  34. #ifndef __ICONS__
  35. #include "Icons.h"
  36. #endif
  37. #ifndef __COLLECTIONS__
  38. #include "Collections.h"
  39. #endif
  40. #ifndef __MACERRORS__
  41. #include "MacErrors.h"
  42. #endif
  43. #if PRAGMA_ONCE
  44. #pragma once
  45. #endif
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49. #if PRAGMA_IMPORT
  50. #pragma import on
  51. #endif
  52. #if PRAGMA_STRUCT_ALIGN
  53.     #pragma options align=mac68k
  54. #elif PRAGMA_STRUCT_PACKPUSH
  55.     #pragma pack(push, 2)
  56. #elif PRAGMA_STRUCT_PACK
  57.     #pragma pack(2)
  58. #endif
  59. /*------------------------------------------------------------------------------------------------------*/
  60. /*  o Resource Types                                                                                    */
  61. /*------------------------------------------------------------------------------------------------------*/
  62. enum {
  63.     kControlDefProcType         = FOUR_CHAR_CODE('CDEF'),
  64.     kControlTemplateResourceType = FOUR_CHAR_CODE('CNTL'),
  65.     kControlColorTableResourceType = FOUR_CHAR_CODE('cctb'),
  66.     kControlDefProcResourceType = FOUR_CHAR_CODE('CDEF')
  67. };
  68. /*------------------------------------------------------------------------------------------------------*/
  69. /*  o Format of a 'CNTL' resource                                                                       */
  70. /*------------------------------------------------------------------------------------------------------*/
  71. struct ControlTemplate {
  72.     Rect                            controlRect;
  73.     SInt16                          controlValue;
  74.     Boolean                         controlVisible;
  75.     UInt8                           fill;
  76.     SInt16                          controlMaximum;
  77.     SInt16                          controlMinimum;
  78.     SInt16                          controlDefProcID;
  79.     SInt32                          controlReference;
  80.     Str255                          controlTitle;
  81. };
  82. typedef struct ControlTemplate          ControlTemplate;
  83. typedef ControlTemplate *               ControlTemplatePtr;
  84. typedef ControlTemplatePtr *            ControlTemplateHandle;
  85. #if !TARGET_OS_MAC
  86. /*
  87.   ---------------------------------------------------------------------------------------------------------
  88.    o NON-MAC COMPATIBILITY CODES (QuickTime 3.0)
  89.   ---------------------------------------------------------------------------------------------------------
  90. */
  91. typedef UInt32                          ControlNotification;
  92. enum {
  93.     controlNotifyNothing        = FOUR_CHAR_CODE('nada'),       /* No (null) notification*/
  94.     controlNotifyClick          = FOUR_CHAR_CODE('clik'),       /* Control was clicked*/
  95.     controlNotifyFocus          = FOUR_CHAR_CODE('focu'),       /* Control got keyboard focus*/
  96.     controlNotifyKey            = FOUR_CHAR_CODE('key ')        /* Control got a keypress*/
  97. };
  98. typedef UInt32                          ControlCapabilities;
  99. enum {
  100.     kControlCanAutoInvalidate   = 1L << 0                       /* Control component automatically invalidates areas left behind after hide/move operation.*/
  101. };
  102. /* procID's for our added "controls"*/
  103. enum {
  104.     staticTextProc              = 256,                          /* static text*/
  105.     editTextProc                = 272,                          /* editable text*/
  106.     iconProc                    = 288,                          /* icon*/
  107.     userItemProc                = 304,                          /* user drawn item*/
  108.     pictItemProc                = 320                           /* pict*/
  109. };
  110. #endif  /* !TARGET_OS_MAC */
  111. /*------------------------------------------------------------------------------------------------------*/
  112. /*  o ControlRef                                                                                        */
  113. /*------------------------------------------------------------------------------------------------------*/
  114. #if !OPAQUE_TOOLBOX_STRUCTS
  115. typedef struct ControlRecord            ControlRecord;
  116. typedef ControlRecord *                 ControlPtr;
  117. typedef ControlPtr *                    ControlRef;
  118. #else
  119. typedef struct OpaqueControlRef*        ControlRef;
  120. #endif  /* !OPAQUE_TOOLBOX_STRUCTS */
  121. /* ControlHandle is obsolete. Use ControlRef.*/
  122. typedef ControlRef                      ControlHandle;
  123. typedef SInt16                          ControlPartCode;
  124. /*------------------------------------------------------------------------------------------------------*/
  125. /* o Control ActionProcPtr                                                                              */
  126. /*------------------------------------------------------------------------------------------------------*/
  127. typedef CALLBACK_API( void , ControlActionProcPtr )(ControlRef theControl, ControlPartCode partCode);
  128. typedef STACK_UPP_TYPE(ControlActionProcPtr)                    ControlActionUPP;
  129. /*------------------------------------------------------------------------------------------------------*/
  130. /*  o ControlRecord                                                                                     */
  131. /*------------------------------------------------------------------------------------------------------*/
  132. #if !OPAQUE_TOOLBOX_STRUCTS
  133. struct ControlRecord {
  134.     ControlRef                      nextControl;
  135.     WindowPtr                       contrlOwner;
  136.     Rect                            contrlRect;
  137.     UInt8                           contrlVis;
  138.     UInt8                           contrlHilite;
  139.     SInt16                          contrlValue;
  140.     SInt16                          contrlMin;
  141.     SInt16                          contrlMax;
  142.     Handle                          contrlDefProc;
  143.     Handle                          contrlData;
  144.     ControlActionUPP                contrlAction;
  145.     SInt32                          contrlRfCon;
  146.     Str255                          contrlTitle;
  147. };
  148. #endif  /* !OPAQUE_TOOLBOX_STRUCTS */
  149. /*------------------------------------------------------------------------------------------------------*/
  150. /* o Control ActionProcPtr : Epilogue                                                                   */
  151. /*------------------------------------------------------------------------------------------------------*/
  152. #if OPAQUE_UPP_TYPES
  153.     EXTERN_API(ControlActionUPP)
  154.     NewControlActionUPP            (ControlActionProcPtr    userRoutine);
  155.     EXTERN_API(void)
  156.     DisposeControlActionUPP        (ControlActionUPP        userUPP);
  157.     EXTERN_API(void)
  158.     InvokeControlActionUPP         (ControlRef              theControl,
  159.                                     ControlPartCode         partCode,
  160.                                     ControlActionUPP        userUPP);
  161. #else
  162.     enum { uppControlActionProcInfo = 0x000002C0 };                 /* pascal no_return_value Func(4_bytes, 2_bytes) */
  163.     #define NewControlActionUPP(userRoutine)                        (ControlActionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlActionProcInfo, GetCurrentArchitecture())
  164.     #define DisposeControlActionUPP(userUPP)                        DisposeRoutineDescriptor(userUPP)
  165.     #define InvokeControlActionUPP(theControl, partCode, userUPP)   CALL_TWO_PARAMETER_UPP((userUPP), uppControlActionProcInfo, (theControl), (partCode))
  166. #endif
  167. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  168. #define NewControlActionProc(userRoutine)                       NewControlActionUPP(userRoutine)
  169. #define CallControlActionProc(userRoutine, theControl, partCode) InvokeControlActionUPP(theControl, partCode, userRoutine)
  170. /*------------------------------------------------------------------------------------------------------*/
  171. /*  o Control Color Table                                                                               */
  172. /*------------------------------------------------------------------------------------------------------*/
  173. enum {
  174.     cFrameColor                 = 0,
  175.     cBodyColor                  = 1,
  176.     cTextColor                  = 2,
  177.     cThumbColor                 = 3,
  178.     kNumberCtlCTabEntries       = 4
  179. };
  180. struct CtlCTab {
  181.     SInt32                          ccSeed;
  182.     SInt16                          ccRider;
  183.     SInt16                          ctSize;
  184.     ColorSpec                       ctTable[4];
  185. };
  186. typedef struct CtlCTab                  CtlCTab;
  187. typedef CtlCTab *                       CCTabPtr;
  188. typedef CCTabPtr *                      CCTabHandle;
  189. /*------------------------------------------------------------------------------------------------------*/
  190. /*  o Auxiliary Control Record                                                                          */
  191. /*------------------------------------------------------------------------------------------------------*/
  192. #if !OPAQUE_TOOLBOX_STRUCTS
  193. struct AuxCtlRec {
  194.     Handle                          acNext;
  195.     ControlRef                      acOwner;
  196.     CCTabHandle                     acCTable;
  197.     SInt16                          acFlags;
  198.     SInt32                          acReserved;
  199.     SInt32                          acRefCon;
  200. };
  201. typedef struct AuxCtlRec                AuxCtlRec;
  202. typedef AuxCtlRec *                     AuxCtlPtr;
  203. typedef AuxCtlPtr *                     AuxCtlHandle;
  204. #endif  /* !OPAQUE_TOOLBOX_STRUCTS */
  205. /*--------------------------------------------------------------------------------------*/
  206. /*  o Control Variants                                                                  */
  207. /*--------------------------------------------------------------------------------------*/
  208. typedef SInt16                          ControlVariant;
  209. enum {
  210.     kControlNoVariant           = 0,                            /* No variant*/
  211.     kControlUsesOwningWindowsFontVariant = 1 << 3               /* Control uses owning windows font to display text*/
  212. };
  213. /*--------------------------------------------------------------------------------------*/
  214. /*  o Control Part Codes                                                                */
  215. /*--------------------------------------------------------------------------------------*/
  216. /* Basic part codes */
  217. enum {
  218.     kControlNoPart              = 0,
  219.     kControlIndicatorPart       = 129,
  220.     kControlDisabledPart        = 254,
  221.     kControlInactivePart        = 255
  222. };
  223. /* Use this constant in Get/SetControlData when the data referred to is not         */
  224. /* specific to a part, but rather the entire control, e.g. the list handle of a     */
  225. /* list box control.                                                                */
  226. enum {
  227.     kControlEntireControl       = 0
  228. };
  229. /*  Meta-Parts                                                                          */
  230. /*                                                                                      */
  231. /*  If you haven't guessed from looking at other toolbox headers. We like the word      */
  232. /*  'meta'. It's cool. So here's one more for you. A meta-part is a part used in a call */
  233. /*  to the GetControlRegion API. These parts are parts that might be defined by a       */
  234. /*  control, but should not be returned from calls like TestControl, et al. They define */
  235. /*  a region of a control, presently the structure and the content region. The content  */
  236. /*  region is only defined by controls that can embed other controls. It is the area    */
  237. /*  that embedded content can live.                                                     */
  238. /*                                                                                      */
  239. /*  Along with these parts, you can also pass in normal part codes to get the regions   */
  240. /*  of the parts. Not all controls fully support this at the time this was written.     */
  241. enum {
  242.     kControlStructureMetaPart   = -1,
  243.     kControlContentMetaPart     = -2
  244. };
  245. /* focusing part codes */
  246. enum {
  247.     kControlFocusNoPart         = 0,                            /* tells control to clear its focus*/
  248.     kControlFocusNextPart       = -1,                           /* tells control to focus on the next part*/
  249.     kControlFocusPrevPart       = -2                            /* tells control to focus on the previous part*/
  250. };
  251. typedef SInt16                          ControlFocusPart;
  252. /*------------------------------------------------------------------------------------------------------*/
  253. /*  o Control Collection Tags                                                                           */
  254. /*------------------------------------------------------------------------------------------------------*/
  255. /*  These are standard tags that you will find in a flattened Control's Collection.                     */
  256. /*                                                                                                      */
  257. /*  All tags at ID zero in a flattened Control's Collection is reserved for Control Manager use.        */
  258. /*  Custom control definitions should use other IDs.                                                    */
  259. /*                                                                                                      */
  260. /*  Most of these tags are interpreted when you call CreateCustomControl; the Control Manager will      */
  261. /*  put value in the right place before calling the Control Definition with the initialization message. */
  262. /*  Other tags are only interpreted when calling UnflattenControl.                                      */
  263. enum {
  264.     kControlCollectionTagBounds = FOUR_CHAR_CODE('boun'),       /* Rect - the bounding rectangle*/
  265.     kControlCollectionTagValue  = FOUR_CHAR_CODE('valu'),       /* SInt32 - the value*/
  266.     kControlCollectionTagMinimum = FOUR_CHAR_CODE('min '),      /* SInt32 - the minimum*/
  267.     kControlCollectionTagMaximum = FOUR_CHAR_CODE('max '),      /* SInt32 - the maximum*/
  268.     kControlCollectionTagViewSize = FOUR_CHAR_CODE('view'),     /* SInt32 - the view size*/
  269.     kControlCollectionTagVisibility = FOUR_CHAR_CODE('visi'),   /* Boolean - the visible state*/
  270.     kControlCollectionTagRefCon = FOUR_CHAR_CODE('refc'),       /* SInt32 - the refCon*/
  271.     kControlCollectionTagTitle  = FOUR_CHAR_CODE('titl')        /* arbitrarily sized character array - the title*/
  272. };
  273. /*  The following are additional tags which are only interpreted by UnflattenControl. */
  274. enum {
  275.     kControlCollectionTagSubControls = FOUR_CHAR_CODE('subc')   /* data for all of a control's subcontrols*/
  276. };
  277. /*------------------------------------------------------------------------------------------------------*/
  278. /*  o Control Image Content                                                                             */
  279. /*------------------------------------------------------------------------------------------------------*/
  280. enum {
  281.     kControlContentTextOnly     = 0,
  282.     kControlNoContent           = 0,
  283.     kControlContentIconSuiteRes = 1,
  284.     kControlContentCIconRes     = 2,
  285.     kControlContentPictRes      = 3,
  286.     kControlContentICONRes      = 4,
  287.     kControlContentIconSuiteHandle = 129,
  288.     kControlContentCIconHandle  = 130,
  289.     kControlContentPictHandle   = 131,
  290.     kControlContentIconRef      = 132,
  291.     kControlContentICON         = 133
  292. };
  293. typedef SInt16                          ControlContentType;
  294. struct ControlButtonContentInfo {
  295.     ControlContentType              contentType;
  296.     union {
  297.         SInt16                          resID;
  298.         CIconHandle                     cIconHandle;
  299.         Handle                          iconSuite;
  300.         IconRef                         iconRef;
  301.         PicHandle                       picture;
  302.         Handle                          ICONHandle;
  303.     }                                 u;
  304. };
  305. typedef struct ControlButtonContentInfo ControlButtonContentInfo;
  306. typedef ControlButtonContentInfo *      ControlButtonContentInfoPtr;
  307. typedef ControlButtonContentInfo        ControlImageContentInfo;
  308. typedef ControlButtonContentInfo *      ControlImageContentInfoPtr;
  309. /*------------------------------------------------------------------------------------------------------*/
  310. /*  o Control Key Script Behavior                                                                       */
  311. /*------------------------------------------------------------------------------------------------------*/
  312. enum {
  313.     kControlKeyScriptBehaviorAllowAnyScript = FOUR_CHAR_CODE('any '), /* leaves the current keyboard alone and allows user to change the keyboard.*/
  314.     kControlKeyScriptBehaviorPrefersRoman = FOUR_CHAR_CODE('prmn'), /* switches the keyboard to roman, but allows them to change it as desired.*/
  315.     kControlKeyScriptBehaviorRequiresRoman = FOUR_CHAR_CODE('rrmn') /* switches the keyboard to roman and prevents the user from changing it.*/
  316. };
  317. typedef UInt32                          ControlKeyScriptBehavior;
  318. /*------------------------------------------------------------------------------------------------------*/
  319. /*  o Control Font Style                                                                                */
  320. /*------------------------------------------------------------------------------------------------------*/
  321. /*    SPECIAL FONT USAGE NOTES: You can specify the font to use for many control types.
  322.     The constants below are meta-font numbers which you can use to set a particular
  323.     control's font usage. There are essentially two modes you can use: 1) default,
  324.     which is essentially the same as it always has been, i.e. it uses the system font, unless
  325.     directed to use the window font via a control variant. 2) you can specify to use
  326.     the big or small system font in a generic manner. The Big system font is the font
  327.     used in menus, etc. Chicago has filled that role for some time now. Small system
  328.     font is currently Geneva 10. The meta-font number implies the size and style.
  329.     NOTE:       Not all font attributes are used by all controls. Most, in fact, ignore
  330.                 the fore and back color (Static Text is the only one that does, for
  331.                 backwards compatibility). Also size, face, and addFontSize are ignored
  332.                 when using the meta-font numbering.
  333. */
  334. /* Meta-font numbering - see note above */
  335. enum {
  336.     kControlFontBigSystemFont   = -1,                           /* force to big system font*/
  337.     kControlFontSmallSystemFont = -2,                           /* force to small system font*/
  338.     kControlFontSmallBoldSystemFont = -3,                       /* force to small bold system font*/
  339.     kControlFontViewSystemFont  = -4                            /* force to views system font (DataBrowser control only)*/
  340. };
  341. /* Add these masks together to set the flags field of a ControlFontStyleRec */
  342. /* They specify which fields to apply to the text. It is important to make  */
  343. /* sure that you specify only the fields that you wish to set.              */
  344. enum {
  345.     kControlUseFontMask         = 0x0001,
  346.     kControlUseFaceMask         = 0x0002,
  347.     kControlUseSizeMask         = 0x0004,
  348.     kControlUseForeColorMask    = 0x0008,
  349.     kControlUseBackColorMask    = 0x0010,
  350.     kControlUseModeMask         = 0x0020,
  351.     kControlUseJustMask         = 0x0040,
  352.     kControlUseAllMask          = 0x00FF,
  353.     kControlAddFontSizeMask     = 0x0100
  354. };
  355. /* AddToMetaFont indicates that we want to start with a standard system     */
  356. /* font, but then we'd like to add the other attributes. Normally, the meta */
  357. /* font ignores all other flags                                             */
  358. enum {
  359.     kControlAddToMetaFontMask   = 0x0200                        /* Available in Appearance 1.1 or later*/
  360. };
  361. struct ControlFontStyleRec {
  362.     SInt16                          flags;
  363.     SInt16                          font;
  364.     SInt16                          size;
  365.     SInt16                          style;
  366.     SInt16                          mode;
  367.     SInt16                          just;
  368.     RGBColor                        foreColor;
  369.     RGBColor                        backColor;
  370. };
  371. typedef struct ControlFontStyleRec      ControlFontStyleRec;
  372. typedef ControlFontStyleRec *           ControlFontStylePtr;
  373. /*------------------------------------------------------------------------------------------------------*/
  374. /*  o Click Activation Results                                                                          */
  375. /*------------------------------------------------------------------------------------------------------*/
  376. /*  These are for use with GetControlClickActivation. The enumerated values should be pretty            */
  377. /*  self-explanatory, but just in case:                                                                 */
  378. /*  o Activate/DoNotActivate indicates whether or not to change the owning window's z-ordering before   */
  379. /*      processing the click. If activation is requested, you may also want to immediately redraw the   */
  380. /*      newly exposed portion of the window.                                                            */
  381. /*  o Ignore/Handle Click indicates whether or not to call an appropriate click handling API (like      */
  382. /*      HandleControlClick) in respose to the event.                                                    */
  383. enum {
  384.     kDoNotActivateAndIgnoreClick = 0,                           /* probably never used. here for completeness.*/
  385.     kDoNotActivateAndHandleClick = 1,                           /* let the control handle the click while the window is still in the background.*/
  386.     kActivateAndIgnoreClick     = 2,                            /* control doesn't want to respond directly to the click, but window should still be brought forward.*/
  387.     kActivateAndHandleClick     = 3                             /* control wants to respond to the click, but only after the window has been activated.*/
  388. };
  389. typedef UInt32                          ClickActivationResult;
  390. /*------------------------------------------------------------------------------------------------------*/
  391. /*  o Common data tags for Get/SetControlData                                                           */
  392. /*------------------------------------------------------------------------------------------------------*/
  393. enum {
  394.     kControlFontStyleTag        = FOUR_CHAR_CODE('font'),
  395.     kControlKeyFilterTag        = FOUR_CHAR_CODE('fltr')
  396. };
  397. /*------------------------------------------------------------------------------------------------------*/
  398. /*  o Control Feature Bits                                                                              */
  399. /*------------------------------------------------------------------------------------------------------*/
  400. enum {
  401.                                                                 /* Control feature bits - returned by GetControlFeatures */
  402.     kControlSupportsGhosting    = 1 << 0,
  403.     kControlSupportsEmbedding   = 1 << 1,
  404.     kControlSupportsFocus       = 1 << 2,
  405.     kControlWantsIdle           = 1 << 3,
  406.     kControlWantsActivate       = 1 << 4,
  407.     kControlHandlesTracking     = 1 << 5,
  408.     kControlSupportsDataAccess  = 1 << 6,
  409.     kControlHasSpecialBackground = 1 << 7,
  410.     kControlGetsFocusOnClick    = 1 << 8,
  411.     kControlSupportsCalcBestRect = 1 << 9,
  412.     kControlSupportsLiveFeedback = 1 << 10,
  413.     kControlHasRadioBehavior    = 1 << 11,                      /* Available in Appearance 1.0.1 or later*/
  414.     kControlSupportsDragAndDrop = 1 << 12,                      /* Available in Carbon*/
  415.     kControlAutoToggles         = 1 << 14,                      /* Available in Appearance 1.1 or later*/
  416.     kControlSupportsGetRegion   = 1 << 17,                      /* Available in Appearance 1.1 or later*/
  417.     kControlSupportsFlattening  = 1 << 19,                      /* Available in Carbon*/
  418.     kControlSupportsSetCursor   = 1 << 20,                      /* Available in Carbon*/
  419.     kControlSupportsContextualMenus = 1 << 21,                  /* Available in Carbon*/
  420.     kControlSupportsClickActivation = 1 << 22                   /* Available in Carbon*/
  421. };
  422. /*------------------------------------------------------------------------------------------------------*/
  423. /*  o Control Messages                                                                                  */
  424. /*------------------------------------------------------------------------------------------------------*/
  425. enum {
  426.     drawCntl                    = 0,
  427.     testCntl                    = 1,
  428.     calcCRgns                   = 2,
  429.     initCntl                    = 3,
  430.     dispCntl                    = 4,
  431.     posCntl                     = 5,
  432.     thumbCntl                   = 6,
  433.     dragCntl                    = 7,
  434.     autoTrack                   = 8,
  435.     calcCntlRgn                 = 10,
  436.     calcThumbRgn                = 11,
  437.     drawThumbOutline            = 12,
  438.     kControlMsgDrawGhost        = 13,
  439.     kControlMsgCalcBestRect     = 14,                           /* Calculate best fitting rectangle for control*/
  440.     kControlMsgHandleTracking   = 15,
  441.     kControlMsgFocus            = 16,                           /* param indicates action.*/
  442.     kControlMsgKeyDown          = 17,
  443.     kControlMsgIdle             = 18,
  444.     kControlMsgGetFeatures      = 19,
  445.     kControlMsgSetData          = 20,
  446.     kControlMsgGetData          = 21,
  447.     kControlMsgActivate         = 22,
  448.     kControlMsgSetUpBackground  = 23,
  449.     kControlMsgCalcValueFromPos = 26,
  450.     kControlMsgTestNewMsgSupport = 27,                          /* See if this control supports new messaging*/
  451.     kControlMsgSubValueChanged  = 25,                           /* Available in Appearance 1.0.1 or later*/
  452.     kControlMsgSubControlAdded  = 28,                           /* Available in Appearance 1.0.1 or later*/
  453.     kControlMsgSubControlRemoved = 29,                          /* Available in Appearance 1.0.1 or later*/
  454.     kControlMsgApplyTextColor   = 30,                           /* Available in Appearance 1.1 or later*/
  455.     kControlMsgGetRegion        = 31,                           /* Available in Appearance 1.1 or later*/
  456.     kControlMsgFlatten          = 32,                           /* Available in Carbon. Param is Collection.*/
  457.     kControlMsgSetCursor        = 33,                           /* Available in Carbon. Param is ControlSetCursorRec*/
  458.     kControlMsgDragEnter        = 38,                           /* Available in Carbon. Param is DragRef, result is boolean indicating acceptibility of drag.*/
  459.     kControlMsgDragLeave        = 39,                           /* Available in Carbon. As above.*/
  460.     kControlMsgDragWithin       = 40,                           /* Available in Carbon. As above.*/
  461.     kControlMsgDragReceive      = 41,                           /* Available in Carbon. Param is DragRef, result is OSStatus indicating success/failure.*/
  462.     kControlMsgDisplayDebugInfo = 46,                           /* Available in Carbon on X.*/
  463.     kControlMsgContextualMenuClick = 47,                        /* Available in Carbon. Param is ControlContextualMenuClickRec*/
  464.     kControlMsgGetClickActivation = 48                          /* Available in Carbon. Param is ControlClickActivationRec*/
  465. };
  466. typedef SInt16                          ControlDefProcMessage;
  467. /*--------------------------------------------------------------------------------------*/
  468. /*  o Constants for drawCntl message (passed in param)                                  */
  469. /*--------------------------------------------------------------------------------------*/
  470. enum {
  471.     kDrawControlEntireControl   = 0,
  472.     kDrawControlIndicatorOnly   = 129
  473. };
  474. /*--------------------------------------------------------------------------------------*/
  475. /*  o Constants for dragCntl message (passed in param)                                  */
  476. /*--------------------------------------------------------------------------------------*/
  477. enum {
  478.     kDragControlEntireControl   = 0,
  479.     kDragControlIndicator       = 1
  480. };
  481. /*--------------------------------------------------------------------------------------*/
  482. /*  o Drag Constraint Structure for thumbCntl message (passed in param)                 */
  483. /*--------------------------------------------------------------------------------------*/
  484. struct IndicatorDragConstraint {
  485.     Rect                            limitRect;
  486.     Rect                            slopRect;
  487.     DragConstraint                  axis;
  488. };
  489. typedef struct IndicatorDragConstraint  IndicatorDragConstraint;
  490. typedef IndicatorDragConstraint *       IndicatorDragConstraintPtr;
  491. /*--------------------------------------------------------------------------------------*/
  492. /*  CDEF should return as result of kControlMsgTestNewMsgSupport                        */
  493. /*--------------------------------------------------------------------------------------*/
  494. enum {
  495.     kControlSupportsNewMessages = FOUR_CHAR_CODE(' ok ')
  496. };
  497. /*--------------------------------------------------------------------------------------*/
  498. /*  This structure is passed into a CDEF when called with the kControlMsgHandleTracking */
  499. /*  message                                                                             */
  500. /*--------------------------------------------------------------------------------------*/
  501. struct ControlTrackingRec {
  502.     Point                           startPt;
  503.     EventModifiers                  modifiers;
  504.     ControlActionUPP                action;
  505. };
  506. typedef struct ControlTrackingRec       ControlTrackingRec;
  507. typedef ControlTrackingRec *            ControlTrackingPtr;
  508. /*--------------------------------------------------------------------------------------*/
  509. /* This structure is passed into a CDEF when called with the kControlMsgKeyDown message */
  510. /*--------------------------------------------------------------------------------------*/
  511. struct ControlKeyDownRec {
  512.     EventModifiers                  modifiers;
  513.     SInt16                          keyCode;
  514.     SInt16                          charCode;
  515. };
  516. typedef struct ControlKeyDownRec        ControlKeyDownRec;
  517. typedef ControlKeyDownRec *             ControlKeyDownPtr;
  518. /*--------------------------------------------------------------------------------------*/
  519. /* This structure is passed into a CDEF when called with the kControlMsgGetData or      */
  520. /* kControlMsgSetData message                                                           */
  521. /*--------------------------------------------------------------------------------------*/
  522. struct ControlDataAccessRec {
  523.     ResType                         tag;
  524.     ResType                         part;
  525.     Size                            size;
  526.     Ptr                             dataPtr;
  527. };
  528. typedef struct ControlDataAccessRec     ControlDataAccessRec;
  529. typedef ControlDataAccessRec *          ControlDataAccessPtr;
  530. /*--------------------------------------------------------------------------------------*/
  531. /* This structure is passed into a CDEF when called with the kControlCalcBestRect msg   */
  532. /*--------------------------------------------------------------------------------------*/
  533. struct ControlCalcSizeRec {
  534.     SInt16                          height;
  535.     SInt16                          width;
  536.     SInt16                          baseLine;
  537. };
  538. typedef struct ControlCalcSizeRec       ControlCalcSizeRec;
  539. typedef ControlCalcSizeRec *            ControlCalcSizePtr;
  540. /*--------------------------------------------------------------------------------------*/
  541. /* This structure is passed into a CDEF when called with the kControlMsgSetUpBackground */
  542. /* message is sent                                                                      */
  543. /*--------------------------------------------------------------------------------------*/
  544. struct ControlBackgroundRec {
  545.     SInt16                          depth;
  546.     Boolean                         colorDevice;
  547. };
  548. typedef struct ControlBackgroundRec     ControlBackgroundRec;
  549. typedef ControlBackgroundRec *          ControlBackgroundPtr;
  550. /*--------------------------------------------------------------------------------------*/
  551. /* This structure is passed into a CDEF when called with the kControlMsgApplyTextColor  */
  552. /* message is sent                                                                      */
  553. /*--------------------------------------------------------------------------------------*/
  554. struct ControlApplyTextColorRec {
  555.     SInt16                          depth;
  556.     Boolean                         colorDevice;
  557.     Boolean                         active;
  558. };
  559. typedef struct ControlApplyTextColorRec ControlApplyTextColorRec;
  560. typedef ControlApplyTextColorRec *      ControlApplyTextColorPtr;
  561. /*--------------------------------------------------------------------------------------*/
  562. /* This structure is passed into a CDEF when called with the kControlMsgGetRegion       */
  563. /* message is sent                                                                      */
  564. /*--------------------------------------------------------------------------------------*/
  565. struct ControlGetRegionRec {
  566.     RgnHandle                       region;
  567.     ControlPartCode                 part;
  568. };
  569. typedef struct ControlGetRegionRec      ControlGetRegionRec;
  570. typedef ControlGetRegionRec *           ControlGetRegionPtr;
  571. /*--------------------------------------------------------------------------------------*/
  572. /* This structure is passed into a CDEF when the kControlMsgSetCursor message is sent   */
  573. /* Only sent on Carbon                                                                  */
  574. /*--------------------------------------------------------------------------------------*/
  575. struct ControlSetCursorRec {
  576.     Point                           localPoint;
  577.     EventModifiers                  modifiers;
  578.     Boolean                         cursorWasSet;               /* your CDEF must set this to true if you set the cursor, or false otherwise*/
  579. };
  580. typedef struct ControlSetCursorRec      ControlSetCursorRec;
  581. typedef ControlSetCursorRec *           ControlSetCursorPtr;
  582. /*--------------------------------------------------------------------------------------*/
  583. /* This structure is passed into a CDEF when the kControlMsgContextualMenuClick message */
  584. /* is sent                                                                              */
  585. /* Only sent on Carbon                                                                  */
  586. /*--------------------------------------------------------------------------------------*/
  587. struct ControlContextualMenuClickRec {
  588.     Point                           localPoint;
  589.     Boolean                         menuDisplayed;              /* your CDEF must set this to true if you displayed a menu, or false otherwise*/
  590. };
  591. typedef struct ControlContextualMenuClickRec ControlContextualMenuClickRec;
  592. typedef ControlContextualMenuClickRec * ControlContextualMenuClickPtr;
  593. /*--------------------------------------------------------------------------------------*/
  594. /* This structure is passed into a CDEF when the kControlMsgGetClickActivation message  */
  595. /* is sent                                                                              */
  596. /* Only sent on Carbon                                                                  */
  597. /*--------------------------------------------------------------------------------------*/
  598. struct ControlClickActivationRec {
  599.     Point                           localPoint;
  600.     EventModifiers                  modifiers;
  601.     ClickActivationResult           result;                     /* your CDEF must pass the desired result back*/
  602. };
  603. typedef struct ControlClickActivationRec ControlClickActivationRec;
  604. typedef ControlClickActivationRec *     ControlClickActivationPtr;
  605. /*--------------------------------------------------------------------------------------*/
  606. /*  o 'CDEF' entrypoint                                                                 */
  607. /*--------------------------------------------------------------------------------------*/
  608. typedef CALLBACK_API( SInt32 , ControlDefProcPtr )(SInt16 varCode, ControlRef theControl, ControlDefProcMessage message, SInt32 param);
  609. typedef STACK_UPP_TYPE(ControlDefProcPtr)                       ControlDefUPP;
  610. #if OPAQUE_UPP_TYPES
  611.     EXTERN_API(ControlDefUPP)
  612.     NewControlDefUPP               (ControlDefProcPtr       userRoutine);
  613.     EXTERN_API(void)
  614.     DisposeControlDefUPP           (ControlDefUPP           userUPP);
  615.     EXTERN_API(SInt32)
  616.     InvokeControlDefUPP            (SInt16                  varCode,
  617.                                     ControlRef              theControl,
  618.                                     ControlDefProcMessage   message,
  619.                                     SInt32                  param,
  620.                                     ControlDefUPP           userUPP);
  621. #else
  622.     enum { uppControlDefProcInfo = 0x00003BB0 };                    /* pascal 4_bytes Func(2_bytes, 4_bytes, 2_bytes, 4_bytes) */
  623.     #define NewControlDefUPP(userRoutine)                           (ControlDefUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlDefProcInfo, GetCurrentArchitecture())
  624.     #define DisposeControlDefUPP(userUPP)                           DisposeRoutineDescriptor(userUPP)
  625.     #define InvokeControlDefUPP(varCode, theControl, message, param, userUPP)  (SInt32)CALL_FOUR_PARAMETER_UPP((userUPP), uppControlDefProcInfo, (varCode), (theControl), (message), (param))
  626. #endif
  627. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  628. #define NewControlDefProc(userRoutine)                          NewControlDefUPP(userRoutine)
  629. #define CallControlDefProc(userRoutine, varCode, theControl, message, param) InvokeControlDefUPP(varCode, theControl, message, param, userRoutine)
  630. /*--------------------------------------------------------------------------------------*/
  631. /*  Control Key Filter                                                                  */
  632. /*--------------------------------------------------------------------------------------*/
  633. /* Certain controls can have a keyfilter attached to them.                              */
  634. /* Definition of a key filter for intercepting and possibly changing keystrokes         */
  635. /* which are destined for a control.                                                    */
  636. /* Key Filter Result Codes                                                          */
  637. /* The filter proc should return one of the two constants below. If                 */
  638. /* kKeyFilterBlockKey is returned, the key is blocked and never makes it to the     */
  639. /* control. If kKeyFilterPassKey is returned, the control receives the keystroke.   */
  640. enum {
  641.     kControlKeyFilterBlockKey   = 0,
  642.     kControlKeyFilterPassKey    = 1
  643. };
  644. typedef SInt16                          ControlKeyFilterResult;
  645. typedef CALLBACK_API( ControlKeyFilterResult , ControlKeyFilterProcPtr )(ControlRef theControl, SInt16 *keyCode, SInt16 *charCode, EventModifiers *modifiers);
  646. typedef STACK_UPP_TYPE(ControlKeyFilterProcPtr)                 ControlKeyFilterUPP;
  647. #if OPAQUE_UPP_TYPES
  648.     EXTERN_API(ControlKeyFilterUPP)
  649.     NewControlKeyFilterUPP         (ControlKeyFilterProcPtr userRoutine);
  650.     EXTERN_API(void)
  651.     DisposeControlKeyFilterUPP     (ControlKeyFilterUPP     userUPP);
  652.     EXTERN_API(ControlKeyFilterResult)
  653.     InvokeControlKeyFilterUPP      (ControlRef              theControl,
  654.                                     SInt16 *                keyCode,
  655.                                     SInt16 *                charCode,
  656.                                     EventModifiers *        modifiers,
  657.                                     ControlKeyFilterUPP     userUPP);
  658. #else
  659.     enum { uppControlKeyFilterProcInfo = 0x00003FE0 };              /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  660.     #define NewControlKeyFilterUPP(userRoutine)                     (ControlKeyFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlKeyFilterProcInfo, GetCurrentArchitecture())
  661.     #define DisposeControlKeyFilterUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  662.     #define InvokeControlKeyFilterUPP(theControl, keyCode, charCode, modifiers, userUPP)  (ControlKeyFilterResult)CALL_FOUR_PARAMETER_UPP((userUPP), uppControlKeyFilterProcInfo, (theControl), (keyCode), (charCode), (modifiers))
  663. #endif
  664. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  665. #define NewControlKeyFilterProc(userRoutine)                    NewControlKeyFilterUPP(userRoutine)
  666. #define CallControlKeyFilterProc(userRoutine, theControl, keyCode, charCode, modifiers) InvokeControlKeyFilterUPP(theControl, keyCode, charCode, modifiers, userRoutine)
  667. /*--------------------------------------------------------------------------------------*/
  668. /*  o DragGrayRgn Constatns                                                             */
  669. /*                                                                                      */
  670. /*   For DragGrayRgnUPP used in TrackControl()                                          */
  671. /*--------------------------------------------------------------------------------------*/
  672. enum {
  673.     noConstraint                = kNoConstraint,
  674.     hAxisOnly                   = 1,
  675.     vAxisOnly                   = 2
  676. };
  677. /*--------------------------------------------------------------------------------------*/
  678. /*  o Control Creation/Deletion/Persistence                                             */
  679. /*--------------------------------------------------------------------------------------*/
  680. /*  CreateCustomControl is only available as part of Carbon                             */
  681. enum {
  682.     kControlDefProcPtr          = 0                             /* raw proc-ptr based access*/
  683. };
  684. typedef UInt32                          ControlDefType;
  685. struct ControlDefSpec {
  686.     ControlDefType                  defType;
  687.     union {
  688.         ControlDefUPP                   defProc;
  689.     }                                 u;
  690. };
  691. typedef struct ControlDefSpec           ControlDefSpec;
  692. EXTERN_API( OSStatus )
  693. CreateCustomControl             (WindowRef              owningWindow,
  694.                                  const Rect *           contBounds,
  695.                                  const ControlDefSpec * def,
  696.                                  Collection             initData,
  697.                                  ControlRef *           outControl);
  698. EXTERN_API( ControlRef )
  699. NewControl                      (WindowPtr              owningWindow,
  700.                                  const Rect *           boundsRect,
  701.                                  ConstStr255Param       controlTitle,
  702.                                  Boolean                initiallyVisible,
  703.                                  SInt16                 initialValue,
  704.                                  SInt16                 minimumValue,
  705.                                  SInt16                 maximumValue,
  706.                                  SInt16                 procID,
  707.                                  SInt32                 controlReference)                   ONEWORDINLINE(0xA954);
  708. EXTERN_API( ControlRef )
  709. GetNewControl                   (SInt16                 resourceID,
  710.                                  WindowPtr              owningWindow)                       ONEWORDINLINE(0xA9BE);
  711. EXTERN_API( void )
  712. DisposeControl                  (ControlRef             theControl)                         ONEWORDINLINE(0xA955);
  713. EXTERN_API( void )
  714. KillControls                    (WindowPtr              theWindow)                          ONEWORDINLINE(0xA956);
  715. #if CALL_NOT_IN_CARBON
  716. EXTERN_API( OSStatus )
  717. FlattenControl                  (ControlRef             control,
  718.                                  Boolean                flattenSubControls,
  719.                                  Collection             collection);
  720. EXTERN_API( OSStatus )
  721. UnflattenControl                (WindowRef              window,
  722.                                  Collection             collection,
  723.                                  ControlRef *           outControl);
  724. #endif  /* CALL_NOT_IN_CARBON */
  725. /*--------------------------------------------------------------------------------------*/
  726. /*  o Control Definition Registration                                                   */
  727. /*--------------------------------------------------------------------------------------*/
  728. /*  In GetNewControl on Carbon, the Control Manager needs to know how to map the procID */
  729. /*  to a ControlDefSpec. With RegisterControlDefinition, your application can inform    */
  730. /*  the Control Manager which ControlDefSpec to call when it sees a request to use a    */
  731. /*  'CDEF' of a particular resource ID.                                                 */
  732. /*                                                                                      */
  733. /*  Since custom control definitions receive their initialization data in a Collection, */
  734. /*  you must also provide a procedure to convert the bounds, min, max, and other fields */
  735. /*  from the 'CNTL' resource into a Collection. If you don't provide a conversion proc, */
  736. /*  your control will receive an empty collection when it is sent the initialization    */
  737. /*  message.                                                                                */
  738. /*  If you want the value, min, visibility, etc. to be given to the control, you must   */
  739. /*  add the appropriate tagged data to the collection. See the Control Collection Tags  */
  740. /*  above.                                                                              */
  741. /*  RegisterControlDefinition is only available as part of Carbon                       */
  742. typedef CALLBACK_API( OSStatus , ControlCNTLToCollectionProcPtr )(const Rect *bounds, SInt16 value, Boolean visible, SInt16 max, SInt16 min, SInt16 procID, SInt32 refCon, ConstStr255Param title, Collection collection);
  743. typedef STACK_UPP_TYPE(ControlCNTLToCollectionProcPtr)          ControlCNTLToCollectionUPP;
  744. #if OPAQUE_UPP_TYPES
  745.     EXTERN_API(ControlCNTLToCollectionUPP)
  746.     NewControlCNTLToCollectionUPP    (ControlCNTLToCollectionProcPtr userRoutine);
  747.     EXTERN_API(void)
  748.     DisposeControlCNTLToCollectionUPP    (ControlCNTLToCollectionUPP userUPP);
  749.     EXTERN_API(OSStatus)
  750.     InvokeControlCNTLToCollectionUPP    (const Rect *       bounds,
  751.                                     SInt16                  value,
  752.                                     Boolean                 visible,
  753.                                     SInt16                  max,
  754.                                     SInt16                  min,
  755.                                     SInt16                  procID,
  756.                                     SInt32                  refCon,
  757.                                     ConstStr255Param        title,
  758.                                     Collection              collection,
  759.                                     ControlCNTLToCollectionUPP userUPP);
  760. #else
  761.     enum { uppControlCNTLToCollectionProcInfo = 0x00FEA6F0 };       /* pascal 4_bytes Func(4_bytes, 2_bytes, 1_byte, 2_bytes, 2_bytes, 2_bytes, 4_bytes, 4_bytes, 4_bytes) */
  762.     #define NewControlCNTLToCollectionUPP(userRoutine)              (ControlCNTLToCollectionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlCNTLToCollectionProcInfo, GetCurrentArchitecture())
  763.     #define DisposeControlCNTLToCollectionUPP(userUPP)              DisposeRoutineDescriptor(userUPP)
  764.     #define InvokeControlCNTLToCollectionUPP(bounds, value, visible, max, min, procID, refCon, title, collection, userUPP)  (OSStatus)CALL_NINE_PARAMETER_UPP((userUPP), uppControlCNTLToCollectionProcInfo, (bounds), (value), (visible), (max), (min), (procID), (refCon), (title), (collection))
  765. #endif
  766. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  767. #define NewControlCNTLToCollectionProc(userRoutine)             NewControlCNTLToCollectionUPP(userRoutine)
  768. #define CallControlCNTLToCollectionProc(userRoutine, bounds, value, visible, max, min, procID, refCon, title, collection) InvokeControlCNTLToCollectionUPP(bounds, value, visible, max, min, procID, refCon, title, collection, userRoutine)
  769. EXTERN_API( OSStatus )
  770. RegisterControlDefinition       (SInt16                 CDEFResID,
  771.                                  const ControlDefSpec * def,
  772.                                  ControlCNTLToCollectionUPP  conversionProc);
  773. /*--------------------------------------------------------------------------------------*/
  774. /*  o Control Visible State                                                             */
  775. /*--------------------------------------------------------------------------------------*/
  776. EXTERN_API( void )
  777. HiliteControl                   (ControlRef             theControl,
  778.                                  ControlPartCode        hiliteState)                        ONEWORDINLINE(0xA95D);
  779. EXTERN_API( void )
  780. ShowControl                     (ControlRef             theControl)                         ONEWORDINLINE(0xA957);
  781. EXTERN_API( void )
  782. HideControl                     (ControlRef             theControl)                         ONEWORDINLINE(0xA958);
  783. /* following state routines available only with Appearance 1.0 and later*/
  784. EXTERN_API( Boolean )
  785. IsControlActive                 (ControlRef             inControl)                          THREEWORDINLINE(0x303C, 0x0005, 0xAA73);
  786. EXTERN_API( Boolean )
  787. IsControlVisible                (ControlRef             inControl)                          THREEWORDINLINE(0x303C, 0x0006, 0xAA73);
  788. EXTERN_API( OSErr )
  789. ActivateControl                 (ControlRef             inControl)                          THREEWORDINLINE(0x303C, 0x0007, 0xAA73);
  790. EXTERN_API( OSErr )
  791. DeactivateControl               (ControlRef             inControl)                          THREEWORDINLINE(0x303C, 0x0008, 0xAA73);
  792. EXTERN_API( OSErr )
  793. SetControlVisibility            (ControlRef             inControl,
  794.                                  Boolean                inIsVisible,
  795.                                  Boolean                inDoDraw)                           THREEWORDINLINE(0x303C, 0x001E, 0xAA73);
  796. /*--------------------------------------------------------------------------------------*/
  797. /*  o Control Imaging                                                                   */
  798. /*--------------------------------------------------------------------------------------*/
  799. EXTERN_API( void )
  800. DrawControls                    (WindowPtr              theWindow)                          ONEWORDINLINE(0xA969);
  801. EXTERN_API( void )
  802. Draw1Control                    (ControlRef             theControl)                         ONEWORDINLINE(0xA96D);
  803. #define DrawOneControl(theControl) Draw1Control(theControl)
  804. EXTERN_API( void )
  805. UpdateControls                  (WindowPtr              theWindow,
  806.                                  RgnHandle              updateRegion)                       ONEWORDINLINE(0xA953);
  807. /* following imaging routines available only with Appearance 1.0 and later*/
  808. EXTERN_API( OSErr )
  809. GetBestControlRect              (ControlRef             inControl,
  810.                                  Rect *                 outRect,
  811.                                  SInt16 *               outBaseLineOffset)                  THREEWORDINLINE(0x303C, 0x001B, 0xAA73);
  812. EXTERN_API( OSErr )
  813. SetControlFontStyle             (ControlRef             inControl,
  814.                                  const ControlFontStyleRec * inStyle)                       THREEWORDINLINE(0x303C, 0x001C, 0xAA73);
  815. EXTERN_API( void )
  816. DrawControlInCurrentPort        (ControlRef             inControl)                          THREEWORDINLINE(0x303C, 0x0018, 0xAA73);
  817. EXTERN_API( OSErr )
  818. SetUpControlBackground          (ControlRef             inControl,
  819.                                  SInt16                 inDepth,
  820.                                  Boolean                inIsColorDevice)                    THREEWORDINLINE(0x303C, 0x001D, 0xAA73);
  821. /* SetUpControlTextColor is available in Appearance 1.1 or later.*/
  822. EXTERN_API( OSErr )
  823. SetUpControlTextColor           (ControlRef             inControl,
  824.                                  SInt16                 inDepth,
  825.                                  Boolean                inIsColorDevice);
  826. /*--------------------------------------------------------------------------------------*/
  827. /*  o Control Mousing                                                                   */
  828. /*--------------------------------------------------------------------------------------*/
  829. /*
  830.     NOTE ON CONTROL ACTION PROCS
  831.     When using the TrackControl() call when tracking an indicator, the actionProc parameter
  832.     (type ControlActionUPP) should be replaced by a parameter of type DragGrayRgnUPP
  833.     (see Quickdraw.h).
  834.     If, however, you are using the live feedback variants of scroll bars or sliders, you
  835.     can pass a ControlActionUPP in when tracking the indicator as well. This functionality
  836.     is available in Appearance 1.0 or later.
  837. */
  838. EXTERN_API( ControlPartCode )
  839. TrackControl                    (ControlRef             theControl,
  840.                                  Point                  startPoint,
  841.                                  ControlActionUPP       actionProc) /* can be NULL */       ONEWORDINLINE(0xA968);
  842. EXTERN_API( void )
  843. DragControl                     (ControlRef             theControl,
  844.                                  Point                  startPoint,
  845.                                  const Rect *           limitRect,
  846.                                  const Rect *           slopRect,
  847.                                  DragConstraint         axis)                               ONEWORDINLINE(0xA967);
  848. EXTERN_API( ControlPartCode )
  849. TestControl                     (ControlRef             theControl,
  850.                                  Point                  testPoint)                          ONEWORDINLINE(0xA966);
  851. EXTERN_API( ControlPartCode )
  852. FindControl                     (Point                  testPoint,
  853.                                  WindowPtr              theWindow,
  854.                                  ControlRef *           theControl)                         ONEWORDINLINE(0xA96C);
  855. /* The following mousing routines available only with Appearance 1.0 and later  */
  856. /*                                                                              */
  857. /* HandleControlClick is preferable to TrackControl when running under          */
  858. /* Appearance 1.0 as you can pass in modifiers, which some of the new controls  */
  859. /* use, such as edit text and list boxes.                                       */
  860. EXTERN_API( ControlRef )
  861. FindControlUnderMouse           (Point                  inWhere,
  862.                                  WindowPtr              inWindow,
  863.                                  SInt16 *               outPart)                            THREEWORDINLINE(0x303C, 0x0009, 0xAA73);
  864. EXTERN_API( ControlPartCode )
  865. HandleControlClick              (ControlRef             inControl,
  866.                                  Point                  inWhere,
  867.                                  EventModifiers         inModifiers,
  868.                                  ControlActionUPP       inAction) /* can be NULL */         THREEWORDINLINE(0x303C, 0x000A, 0xAA73);
  869. /* Contextual Menu support in the Control Manager is only available on Carbon.  */
  870. /* If the control didn't display a contextual menu (possibly because the point  */
  871. /* was in a non-interesting part), the menuDisplayed output parameter will be   */
  872. /* false. If the control did display a menu, menuDisplayed will be true.        */
  873. /* This in on Carbon only                                                       */
  874. EXTERN_API( OSStatus )
  875. HandleControlContextualMenuClick (ControlRef            inControl,
  876.                                  Point                  inWhere,
  877.                                  Boolean *              menuDisplayed);
  878. /* Some complex controls (like Data Browser) require proper sequencing of       */
  879. /* window activation and click processing. In some cases, the control might     */
  880. /* want the window to be left inactive yet still handle the click, or vice-     */
  881. /* versa. The GetControlClickActivation routine lets a control client ask the   */
  882. /* control how it wishes to behave for a particular click.                      */
  883. /* This in on Carbon only.                                                      */
  884. EXTERN_API( OSStatus )
  885. GetControlClickActivation       (ControlRef             inControl,
  886.                                  Point                  inWhere,
  887.                                  EventModifiers         inModifiers,
  888.                                  ClickActivationResult * outResult);
  889. /*--------------------------------------------------------------------------------------*/
  890. /*  o Control Events (available only with Appearance 1.0 and later)                     */
  891. /*--------------------------------------------------------------------------------------*/
  892. EXTERN_API( SInt16 )
  893. HandleControlKey                (ControlRef             inControl,
  894.                                  SInt16                 inKeyCode,
  895.                                  SInt16                 inCharCode,
  896.                                  EventModifiers         inModifiers)                        THREEWORDINLINE(0x303C, 0x000B, 0xAA73);
  897. EXTERN_API( void )
  898. IdleControls                    (WindowPtr              inWindow)                           THREEWORDINLINE(0x303C, 0x000C, 0xAA73);
  899. /*--------------------------------------------------------------------------------------*/
  900. /* o Control Mouse Tracking (available with Carbon)                                     */
  901. /*--------------------------------------------------------------------------------------*/
  902. /* The HandleControlSetCursor routine requests that a given control set the cursor to   */
  903. /* something appropriate based on the mouse location.                                   */
  904. /* If the control didn't want to set the cursor (because the point was in a             */
  905. /* non-interesting part), the cursorWasSet output parameter will be false. If the       */
  906. /* control did set the cursor, cursorWasSet will be true.                               */
  907. /* Carbon only.                                                                         */
  908. EXTERN_API( OSStatus )
  909. HandleControlSetCursor          (ControlRef             control,
  910.                                  Point                  localPoint,
  911.                                  EventModifiers         modifiers,
  912.                                  Boolean *              cursorWasSet);
  913. /*--------------------------------------------------------------------------------------*/
  914. /*  o Control Positioning                                                               */
  915. /*--------------------------------------------------------------------------------------*/
  916. EXTERN_API( void )
  917. MoveControl                     (ControlRef             theControl,
  918.                                  SInt16                 h,
  919.                                  SInt16                 v)                                  ONEWORDINLINE(0xA959);
  920. EXTERN_API( void )
  921. SizeControl                     (ControlRef             theControl,
  922.                                  SInt16                 w,
  923.                                  SInt16                 h)                                  ONEWORDINLINE(0xA95C);
  924. /*--------------------------------------------------------------------------------------*/
  925. /*  o Control Title                                                                     */
  926. /*--------------------------------------------------------------------------------------*/
  927. EXTERN_API( void )
  928. SetControlTitle                 (ControlRef             theControl,
  929.                                  ConstStr255Param       title)                              ONEWORDINLINE(0xA95F);
  930. EXTERN_API( void )
  931. GetControlTitle                 (ControlRef             theControl,
  932.                                  Str255                 title)                              ONEWORDINLINE(0xA95E);
  933. /*--------------------------------------------------------------------------------------*/
  934. /*  o Control Value                                                                     */
  935. /*--------------------------------------------------------------------------------------*/
  936. EXTERN_API( SInt16 )
  937. GetControlValue                 (ControlRef             theControl)                         ONEWORDINLINE(0xA960);
  938. EXTERN_API( void )
  939. SetControlValue                 (ControlRef             theControl,
  940.                                  SInt16                 newValue)                           ONEWORDINLINE(0xA963);
  941. EXTERN_API( SInt16 )
  942. GetControlMinimum               (ControlRef             theControl)                         ONEWORDINLINE(0xA961);
  943. EXTERN_API( void )
  944. SetControlMinimum               (ControlRef             theControl,
  945.                                  SInt16                 newMinimum)                         ONEWORDINLINE(0xA964);
  946. EXTERN_API( SInt16 )
  947. GetControlMaximum               (ControlRef             theControl)                         ONEWORDINLINE(0xA962);
  948. EXTERN_API( void )
  949. SetControlMaximum               (ControlRef             theControl,
  950.                                  SInt16                 newMaximum)                         ONEWORDINLINE(0xA965);
  951. /* proportional scrolling/32-bit value support is new with Appearance 1.1*/
  952. EXTERN_API( SInt32 )
  953. GetControlViewSize              (ControlRef             theControl);
  954. EXTERN_API( void )
  955. SetControlViewSize              (ControlRef             theControl,
  956.                                  SInt32                 newViewSize);
  957. EXTERN_API( SInt32 )
  958. GetControl32BitValue            (ControlRef             theControl);
  959. EXTERN_API( void )
  960. SetControl32BitValue            (ControlRef             theControl,
  961.                                  SInt32                 newValue);
  962. EXTERN_API( SInt32 )
  963. GetControl32BitMaximum          (ControlRef             theControl);
  964. EXTERN_API( void )
  965. SetControl32BitMaximum          (ControlRef             theControl,
  966.                                  SInt32                 newMaximum);
  967. EXTERN_API( SInt32 )
  968. GetControl32BitMinimum          (ControlRef             theControl);
  969. EXTERN_API( void )
  970. SetControl32BitMinimum          (ControlRef             theControl,
  971.                                  SInt32                 newMinimum);
  972. /*
  973.     IsValidControlHandle will tell you if the handle you pass in belongs to a control
  974.     the Control Manager knows about. It does not sanity check the data in the control.
  975. */
  976. EXTERN_API( Boolean )
  977. IsValidControlHandle            (ControlRef             theControl);
  978. /*--------------------------------------------------------------------------------------*/
  979. /* o Control IDs                                                                        */
  980. /* Carbon only.                                                                         */
  981. /*--------------------------------------------------------------------------------------*/
  982. struct ControlID {
  983.     OSType                          signature;
  984.     SInt32                          id;
  985. };
  986. typedef struct ControlID                ControlID;
  987. EXTERN_API( OSStatus )
  988. SetControlID                    (ControlRef             inControl,
  989.                                  const ControlID *      inID);
  990. EXTERN_API( OSStatus )
  991. GetControlID                    (ControlRef             inControl,
  992.                                  ControlID *            outID);
  993. EXTERN_API( OSStatus )
  994. GetControlByID                  (WindowRef              inWindow,
  995.                                  const ControlID *      inID,
  996.                                  ControlRef *           outControl);
  997. /*--------------------------------------------------------------------------------------*/
  998. /* o Properties                                                                         */
  999. /*--------------------------------------------------------------------------------------*/
  1000. enum {
  1001.     kControlPropertyPersistent  = 0x00000001                    /* whether this property gets saved when flattening the control*/
  1002. };
  1003. EXTERN_API( OSStatus )
  1004. GetControlProperty              (ControlRef             control,
  1005.                                  OSType                 propertyCreator,
  1006.                                  OSType                 propertyTag,
  1007.                                  UInt32                 bufferSize,
  1008.                                  UInt32 *               actualSize,
  1009.                                  void *                 propertyBuffer);
  1010. EXTERN_API( OSStatus )
  1011. GetControlPropertySize          (ControlRef             control,
  1012.                                  OSType                 propertyCreator,
  1013.                                  OSType                 propertyTag,
  1014.                                  UInt32 *               size);
  1015. EXTERN_API( OSStatus )
  1016. SetControlProperty              (ControlRef             control,
  1017.                                  OSType                 propertyCreator,
  1018.                                  OSType                 propertyTag,
  1019.                                  UInt32                 propertySize,
  1020.                                  void *                 propertyData);
  1021. EXTERN_API( OSStatus )
  1022. RemoveControlProperty           (ControlRef             control,
  1023.                                  OSType                 propertyCreator,
  1024.                                  OSType                 propertyTag);
  1025. EXTERN_API( OSStatus )
  1026. GetControlPropertyAttributes    (ControlRef             control,
  1027.                                  OSType                 propertyCreator,
  1028.                                  OSType                 propertyTag,
  1029.                                  UInt32 *               attributes);
  1030. EXTERN_API( OSStatus )
  1031. ChangeControlPropertyAttributes (ControlRef             control,
  1032.                                  OSType                 propertyCreator,
  1033.                                  OSType                 propertyTag,
  1034.                                  UInt32                 attributesToSet,
  1035.                                  UInt32                 attributesToClear);
  1036. /*--------------------------------------------------------------------------------------*/
  1037. /*  o Control Regions (Appearance 1.1 or later)                                         */
  1038. /*                                                                                      */
  1039. /*  See the discussion on meta-parts in this header for more information                */
  1040. /*--------------------------------------------------------------------------------------*/
  1041. EXTERN_API( OSStatus )
  1042. GetControlRegion                (ControlRef             inControl,
  1043.                                  ControlPartCode        inPart,
  1044.                                  RgnHandle              outRegion);
  1045. /*--------------------------------------------------------------------------------------*/
  1046. /*  o Control Variant                                                                   */
  1047. /*--------------------------------------------------------------------------------------*/
  1048. EXTERN_API( ControlVariant )
  1049. GetControlVariant               (ControlRef             theControl)                         ONEWORDINLINE(0xA809);
  1050. /*--------------------------------------------------------------------------------------*/
  1051. /*  o Control Action                                                                    */
  1052. /*--------------------------------------------------------------------------------------*/
  1053. EXTERN_API( void )
  1054. SetControlAction                (ControlRef             theControl,
  1055.                                  ControlActionUPP       actionProc)                         ONEWORDINLINE(0xA96B);
  1056. EXTERN_API( ControlActionUPP )
  1057. GetControlAction                (ControlRef             theControl)                         ONEWORDINLINE(0xA96A);
  1058. /*--------------------------------------------------------------------------------------*/
  1059. /* o Control Accessors                                                                  */
  1060. /*--------------------------------------------------------------------------------------*/
  1061. EXTERN_API( void )
  1062. SetControlReference             (ControlRef             theControl,
  1063.                                  SInt32                 data)                               ONEWORDINLINE(0xA95B);
  1064. EXTERN_API( SInt32 )
  1065. GetControlReference             (ControlRef             theControl)                         ONEWORDINLINE(0xA95A);
  1066. #if !OPAQUE_TOOLBOX_STRUCTS
  1067. EXTERN_API( Boolean )
  1068. GetAuxiliaryControlRecord       (ControlRef             theControl,
  1069.                                  AuxCtlHandle *         acHndl)                             ONEWORDINLINE(0xAA44);
  1070. #endif  /* !OPAQUE_TOOLBOX_STRUCTS */
  1071. #if CALL_NOT_IN_CARBON
  1072. EXTERN_API( void )
  1073. SetControlColor                 (ControlRef             theControl,
  1074.                                  CCTabHandle            newColorTable)                      ONEWORDINLINE(0xAA43);
  1075. /*--------------------------------------------------------------------------------------*/
  1076. /*  o Control Hierarchy (Appearance 1.0 and later only)                                 */
  1077. /*--------------------------------------------------------------------------------------*/
  1078. #endif  /* CALL_NOT_IN_CARBON */
  1079. EXTERN_API( SInt32 )
  1080. SendControlMessage              (ControlRef             inControl,
  1081.                                  SInt16                 inMessage,
  1082.                                  SInt32                 inParam)                            THREEWORDINLINE(0x303C, 0xFFFE, 0xAA73);
  1083. EXTERN_API( OSErr )
  1084. DumpControlHierarchy            (WindowPtr              inWindow,
  1085.                                  const FSSpec *         inDumpFile)                         THREEWORDINLINE(0x303C, 0xFFFF, 0xAA73);
  1086. EXTERN_API( OSErr )
  1087. CreateRootControl               (WindowPtr              inWindow,
  1088.                                  ControlRef *           outControl)                         THREEWORDINLINE(0x303C, 0x0001, 0xAA73);
  1089. EXTERN_API( OSErr )
  1090. GetRootControl                  (WindowPtr              inWindow,
  1091.                                  ControlRef *           outControl)                         THREEWORDINLINE(0x303C, 0x0002, 0xAA73);
  1092. EXTERN_API( OSErr )
  1093. EmbedControl                    (ControlRef             inControl,
  1094.                                  ControlRef             inContainer)                        THREEWORDINLINE(0x303C, 0x0003, 0xAA73);
  1095. EXTERN_API( OSErr )
  1096. AutoEmbedControl                (ControlRef             inControl,
  1097.                                  WindowPtr              inWindow)                           THREEWORDINLINE(0x303C, 0x0004, 0xAA73);
  1098. EXTERN_API( OSErr )
  1099. GetSuperControl                 (ControlRef             inControl,
  1100.                                  ControlRef *           outParent)                          THREEWORDINLINE(0x303C, 0x0015, 0xAA73);
  1101. EXTERN_API( OSErr )
  1102. CountSubControls                (ControlRef             inControl,
  1103.                                  UInt16 *               outNumChildren)                     THREEWORDINLINE(0x303C, 0x0016, 0xAA73);
  1104. EXTERN_API( OSErr )
  1105. GetIndexedSubControl            (ControlRef             inControl,
  1106.                                  UInt16                 inIndex,
  1107.                                  ControlRef *           outSubControl)                      THREEWORDINLINE(0x303C, 0x0017, 0xAA73);
  1108. EXTERN_API( OSErr )
  1109. SetControlSupervisor            (ControlRef             inControl,
  1110.                                  ControlRef             inBoss)                             THREEWORDINLINE(0x303C, 0x001A, 0xAA73);
  1111. /*--------------------------------------------------------------------------------------*/
  1112. /*  o Keyboard Focus (available only with Appearance 1.0 and later)                     */
  1113. /*--------------------------------------------------------------------------------------*/
  1114. EXTERN_API( OSErr )
  1115. GetKeyboardFocus                (WindowPtr              inWindow,
  1116.                                  ControlRef *           outControl)                         THREEWORDINLINE(0x303C, 0x000D, 0xAA73);
  1117. EXTERN_API( OSErr )
  1118. SetKeyboardFocus                (WindowPtr              inWindow,
  1119.                                  ControlRef             inControl,
  1120.                                  ControlFocusPart       inPart)                             THREEWORDINLINE(0x303C, 0x000E, 0xAA73);
  1121. EXTERN_API( OSErr )
  1122. AdvanceKeyboardFocus            (WindowPtr              inWindow)                           THREEWORDINLINE(0x303C, 0x000F, 0xAA73);
  1123. EXTERN_API( OSErr )
  1124. ReverseKeyboardFocus            (WindowPtr              inWindow)                           THREEWORDINLINE(0x303C, 0x0010, 0xAA73);
  1125. EXTERN_API( OSErr )
  1126. ClearKeyboardFocus              (WindowPtr              inWindow)                           THREEWORDINLINE(0x303C, 0x0019, 0xAA73);
  1127. /*--------------------------------------------------------------------------------------*/
  1128. /*  o Control Data (available only with Appearance 1.0 and later)                       */
  1129. /*--------------------------------------------------------------------------------------*/
  1130. EXTERN_API( OSErr )
  1131. GetControlFeatures              (ControlRef             inControl,
  1132.                                  UInt32 *               outFeatures)                        THREEWORDINLINE(0x303C, 0x0011, 0xAA73);
  1133. EXTERN_API( OSErr )
  1134. SetControlData                  (ControlRef             inControl,
  1135.                                  ControlPartCode        inPart,
  1136.                                  ResType                inTagName,
  1137.                                  Size                   inSize,
  1138.                                  void *                 inData)                             THREEWORDINLINE(0x303C, 0x0012, 0xAA73);
  1139. EXTERN_API( OSErr )
  1140. GetControlData                  (ControlRef             inControl,
  1141.                                  ControlPartCode        inPart,
  1142.                                  ResType                inTagName,
  1143.                                  Size                   inBufferSize,
  1144.                                  void *                 inBuffer,
  1145.                                  Size *                 outActualSize)                      THREEWORDINLINE(0x303C, 0x0013, 0xAA73);
  1146. EXTERN_API( OSErr )
  1147. GetControlDataSize              (ControlRef             inControl,
  1148.                                  ControlPartCode        inPart,
  1149.                                  ResType                inTagName,
  1150.                                  Size *                 outMaxSize)                         THREEWORDINLINE(0x303C, 0x0014, 0xAA73);
  1151. /*--------------------------------------------------------------------------------------*/
  1152. /*  o Control Drag & Drop                                                               */
  1153. /*      Carbon only.                                                                    */
  1154. /*--------------------------------------------------------------------------------------*/
  1155. /* some simple redefinitions of the messages found in the Drag header*/
  1156. enum {
  1157.     kDragTrackingEnterControl   = kDragTrackingEnterWindow,
  1158.     kDragTrackingInControl      = kDragTrackingInWindow,
  1159.     kDragTrackingLeaveControl   = kDragTrackingLeaveWindow
  1160. };
  1161. EXTERN_API( OSStatus )
  1162. HandleControlDragTracking       (ControlRef             inControl,
  1163.                                  DragTrackingMessage    inMessage,
  1164.                                  DragReference          inDrag,
  1165.                                  Boolean *              outLikesDrag);
  1166. EXTERN_API( OSStatus )
  1167. HandleControlDragReceive        (ControlRef             inControl,
  1168.                                  DragReference          inDrag);
  1169. EXTERN_API( OSStatus )
  1170. SetControlDragTrackingEnabled   (ControlRef             theControl,
  1171.                                  Boolean                tracks);
  1172. EXTERN_API( OSStatus )
  1173. IsControlDragTrackingEnabled    (ControlRef             theControl,
  1174.                                  Boolean *              tracks);
  1175. EXTERN_API( OSStatus )
  1176. SetAutomaticControlDragTrackingEnabledForWindow (WindowPtr  theWindow,
  1177.                                  Boolean                tracks);
  1178. EXTERN_API( OSStatus )
  1179. IsAutomaticControlDragTrackingEnabledForWindow (WindowPtr  theWindow,
  1180.                                  Boolean *              tracks);
  1181. #if !TARGET_OS_MAC
  1182. /*--------------------------------------------------------------------------------------*/
  1183. /*  o QuickTime 3.0 Win32/unix notification mechanism                                   */
  1184. /*--------------------------------------------------------------------------------------*/
  1185. /* Proc used to notify window that something happened to the control*/
  1186. typedef CALLBACK_API_C( void , ControlNotificationProcPtr )(WindowPtr theWindow, ControlRef theControl, ControlNotification notification, long param1, long param2);
  1187. /*
  1188.    Proc used to prefilter events before handled by control.  A client of a control calls
  1189.    CTRLSetPreFilterProc() to have the control call this proc before handling the event.
  1190.    If the proc returns TRUE, the control can go ahead and handle the event.
  1191. */
  1192. typedef CALLBACK_API_C( Boolean , PreFilterEventProc )(ControlRef theControl, EventRecord *theEvent);
  1193. #if CALL_NOT_IN_CARBON
  1194. EXTERN_API_C( long )
  1195. GetControlComponentInstance     (ControlRef             theControl);
  1196. EXTERN_API_C( ControlRef )
  1197. GetControlHandleFromCookie      (long                   cookie);
  1198. EXTERN_API_C( void )
  1199. SetControlDefProc               (short                  resID,
  1200.                                  ControlDefProcPtr      proc);
  1201. #endif  /* CALL_NOT_IN_CARBON */
  1202. typedef ControlNotificationProcPtr      ControlNotificationUPP;
  1203. #endif  /* !TARGET_OS_MAC */
  1204. /*--------------------------------------------------------------------------------------*/
  1205. /*  o C Glue                                                                            */
  1206. /*--------------------------------------------------------------------------------------*/
  1207. #if CALL_NOT_IN_CARBON
  1208. #if CALL_NOT_IN_CARBON
  1209. EXTERN_API_C( void )
  1210. dragcontrol                     (ControlRef             theControl,
  1211.                                  Point *                startPt,
  1212.                                  const Rect *           limitRect,
  1213.                                  const Rect *           slopRect,
  1214.                                  short                  axis);
  1215. EXTERN_API_C( ControlRef )
  1216. newcontrol                      (WindowPtr              theWindow,
  1217.                                  const Rect *           boundsRect,
  1218.                                  const char *           title,
  1219.                                  Boolean                visible,
  1220.                                  short                  value,
  1221.                                  short                  min,
  1222.                                  short                  max,
  1223.                                  short                  procID,
  1224.                                  long                   refCon);
  1225. EXTERN_API_C( short )
  1226. findcontrol                     (Point *                thePoint,
  1227.                                  WindowPtr              theWindow,
  1228.                                  ControlRef *           theControl);
  1229. EXTERN_API_C( void )
  1230. getcontroltitle                 (ControlRef             theControl,
  1231.                                  char *                 title);
  1232. EXTERN_API_C( void )
  1233. setcontroltitle                 (ControlRef             theControl,
  1234.                                  const char *           title);
  1235. EXTERN_API_C( short )
  1236. trackcontrol                    (ControlRef             theControl,
  1237.                                  Point *                thePoint,
  1238.                                  ControlActionUPP       actionProc);
  1239. EXTERN_API_C( short )
  1240. testcontrol                     (ControlRef             theControl,
  1241.                                  Point *                thePt);
  1242. #endif  /* CALL_NOT_IN_CARBON */
  1243. #endif  /* CALL_NOT_IN_CARBON */
  1244. #if OLDROUTINENAMES
  1245. /*--------------------------------------------------------------------------------------*/
  1246. /*  o OLDROUTINENAMES                                                                   */
  1247. /*--------------------------------------------------------------------------------------*/
  1248. enum {
  1249.     useWFont                    = kControlUsesOwningWindowsFontVariant
  1250. };
  1251. enum {
  1252.     inThumb                     = kControlIndicatorPart,
  1253.     kNoHiliteControlPart        = kControlNoPart,
  1254.     kInIndicatorControlPart     = kControlIndicatorPart,
  1255.     kReservedControlPart        = kControlDisabledPart,
  1256.     kControlInactiveControlPart = kControlInactivePart
  1257. };
  1258. #define SetCTitle(theControl, title) SetControlTitle(theControl, title)
  1259. #define GetCTitle(theControl, title) GetControlTitle(theControl, title)
  1260. #define UpdtControl(theWindow, updateRgn) UpdateControls(theWindow, updateRgn)
  1261. #define SetCtlValue(theControl, theValue) SetControlValue(theControl, theValue)
  1262. #define GetCtlValue(theControl) GetControlValue(theControl)
  1263. #define SetCtlMin(theControl, minValue) SetControlMinimum(theControl, minValue)
  1264. #define GetCtlMin(theControl) GetControlMinimum(theControl)
  1265. #define SetCtlMax(theControl, maxValue) SetControlMaximum(theControl, maxValue)
  1266. #define GetCtlMax(theControl) GetControlMaximum(theControl)
  1267. #define GetAuxCtl(theControl, acHndl) GetAuxiliaryControlRecord(theControl, acHndl)
  1268. #define SetCRefCon(theControl, data) SetControlReference(theControl, data)
  1269. #define GetCRefCon(theControl) GetControlReference(theControl)
  1270. #define SetCtlAction(theControl, actionProc) SetControlAction(theControl, actionProc)
  1271. #define GetCtlAction(theControl) GetControlAction(theControl)
  1272. #define SetCtlColor(theControl, newColorTable) SetControlColor(theControl, newColorTable)
  1273. #define GetCVariant(theControl) GetControlVariant(theControl)
  1274. #define getctitle(theControl, title) getcontroltitle(theControl, title)
  1275. #define setctitle(theControl, title) setcontroltitle(theControl, title)
  1276. #endif  /* OLDROUTINENAMES */
  1277. #if ACCESSOR_CALLS_ARE_FUNCTIONS
  1278. /* Getters */
  1279. EXTERN_API( Rect *)
  1280. GetControlBounds                (ControlRef             control,
  1281.                                  Rect *                 bounds);
  1282. EXTERN_API( Boolean )
  1283. IsControlHilited                (ControlRef             control);
  1284. EXTERN_API( UInt16 )
  1285. GetControlHilite                (ControlRef             control);
  1286. EXTERN_API( WindowPtr )
  1287. GetControlOwner                 (ControlRef             control);
  1288. EXTERN_API( Handle )
  1289. GetControlDataHandle            (ControlRef             control);
  1290. EXTERN_API( MenuHandle )
  1291. GetControlPopupMenuHandle       (ControlRef             control);
  1292. EXTERN_API( short )
  1293. GetControlPopupMenuID           (ControlRef             control);
  1294. /* Setters */
  1295. EXTERN_API( void )
  1296. SetControlDataHandle            (ControlRef             control,
  1297.                                  Handle                 dataHandle);
  1298. EXTERN_API( void )
  1299. SetControlBounds                (ControlRef             control,
  1300.                                  const Rect *           bounds);
  1301. EXTERN_API( void )
  1302. SetControlPopupMenuHandle       (ControlRef             control,
  1303.                                  MenuHandle             popupMenu);
  1304. EXTERN_API( void )
  1305. SetControlPopupMenuID           (ControlRef             control,
  1306.                                  short                  menuID);
  1307. #endif  /* ACCESSOR_CALLS_ARE_FUNCTIONS */
  1308. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  1309. #define GetControlListFromWindow(theWindow)     ( *(ControlRef *) (((UInt8 *) theWindow) + sizeof(GrafPort) + 0x20))
  1310. #define GetControlOwningWindowControlList(theWindow)        ( *(ControlRef *) (((UInt8 *) theWindow) + sizeof(GrafPort) + 0x20))
  1311. #endif  /* !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS */
  1312. #if PRAGMA_STRUCT_ALIGN
  1313.     #pragma options align=reset
  1314. #elif PRAGMA_STRUCT_PACKPUSH
  1315.     #pragma pack(pop)
  1316. #elif PRAGMA_STRUCT_PACK
  1317.     #pragma pack()
  1318. #endif
  1319. #ifdef PRAGMA_IMPORT_OFF
  1320. #pragma import off
  1321. #elif PRAGMA_IMPORT
  1322. #pragma import reset
  1323. #endif
  1324. #ifdef __cplusplus
  1325. }
  1326. #endif
  1327. #endif /* __CONTROLS__ */