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

2161 lines
64 KiB

  1. /*
  2. File: Dialogs.h
  3. Contains: Dialog Manager interfaces.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1985-2001 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __DIALOGS__
  11. #define __DIALOGS__
  12. #ifndef __MACTYPES__
  13. #include <MacTypes.h>
  14. #endif
  15. #ifndef __MIXEDMODE__
  16. #include <MixedMode.h>
  17. #endif
  18. #ifndef __MACERRORS__
  19. #include <MacErrors.h>
  20. #endif
  21. #ifndef __EVENTS__
  22. #include <Events.h>
  23. #endif
  24. #ifndef __MACWINDOWS__
  25. #include <MacWindows.h>
  26. #endif
  27. #ifndef __TEXTEDIT__
  28. #include <TextEdit.h>
  29. #endif
  30. #ifndef __CONTROLS__
  31. #include <Controls.h>
  32. #endif
  33. #ifndef __CARBONEVENTS__
  34. #include <CarbonEvents.h>
  35. #endif
  36. #if PRAGMA_ONCE
  37. #pragma once
  38. #endif
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42. #if PRAGMA_IMPORT
  43. #pragma import on
  44. #endif
  45. #if PRAGMA_STRUCT_ALIGN
  46. #pragma options align=mac68k
  47. #elif PRAGMA_STRUCT_PACKPUSH
  48. #pragma pack(push, 2)
  49. #elif PRAGMA_STRUCT_PACK
  50. #pragma pack(2)
  51. #endif
  52. enum {
  53. /* new, more standard names for dialog item types*/
  54. kControlDialogItem = 4,
  55. kButtonDialogItem = kControlDialogItem | 0,
  56. kCheckBoxDialogItem = kControlDialogItem | 1,
  57. kRadioButtonDialogItem = kControlDialogItem | 2,
  58. kResourceControlDialogItem = kControlDialogItem | 3,
  59. kStaticTextDialogItem = 8,
  60. kEditTextDialogItem = 16,
  61. kIconDialogItem = 32,
  62. kPictureDialogItem = 64,
  63. kUserDialogItem = 0,
  64. kHelpDialogItem = 1,
  65. kItemDisableBit = 128
  66. };
  67. enum {
  68. /* old names for dialog item types*/
  69. ctrlItem = 4,
  70. btnCtrl = 0,
  71. chkCtrl = 1,
  72. radCtrl = 2,
  73. resCtrl = 3,
  74. statText = 8,
  75. editText = 16,
  76. iconItem = 32,
  77. picItem = 64,
  78. userItem = 0,
  79. itemDisable = 128
  80. };
  81. enum {
  82. /* standard dialog item numbers*/
  83. kStdOkItemIndex = 1,
  84. kStdCancelItemIndex = 2, /* old names*/
  85. ok = kStdOkItemIndex,
  86. cancel = kStdCancelItemIndex
  87. };
  88. enum {
  89. /* standard icon resource id's */
  90. kStopIcon = 0,
  91. kNoteIcon = 1,
  92. kCautionIcon = 2, /* old names*/
  93. stopIcon = kStopIcon,
  94. noteIcon = kNoteIcon,
  95. cautionIcon = kCautionIcon
  96. };
  97. #if OLDROUTINENAMES
  98. /*
  99. These constants lived briefly on ETO 16. They suggest
  100. that there is only one index you can use for the OK
  101. item, which is not true. You can put the ok item
  102. anywhere you want in the DITL.
  103. */
  104. enum {
  105. kOkItemIndex = 1,
  106. kCancelItemIndex = 2
  107. };
  108. #endif /* OLDROUTINENAMES */
  109. /* Dialog Item List Manipulation Constants */
  110. typedef SInt16 DITLMethod;
  111. enum {
  112. overlayDITL = 0,
  113. appendDITLRight = 1,
  114. appendDITLBottom = 2
  115. };
  116. typedef SInt16 StageList;
  117. /* DialogPtr is obsolete. Use DialogRef instead.*/
  118. typedef DialogPtr DialogRef;
  119. #if !OPAQUE_TOOLBOX_STRUCTS
  120. struct DialogRecord {
  121. WindowRecord window; /* in Carbon use GetDialogWindow or GetDialogPort*/
  122. Handle items; /* in Carbon use Get/SetDialogItem*/
  123. TEHandle textH; /* in Carbon use GetDialogTextEditHandle*/
  124. SInt16 editField; /* in Carbon use SelectDialogItemText/GetDialogKeyboardFocusItem*/
  125. SInt16 editOpen; /* not available in Carbon */
  126. SInt16 aDefItem; /* in Carbon use Get/SetDialogDefaultItem*/
  127. };
  128. typedef struct DialogRecord DialogRecord;
  129. typedef DialogRecord * DialogPeek;
  130. #endif /* !OPAQUE_TOOLBOX_STRUCTS */
  131. struct DialogTemplate {
  132. Rect boundsRect;
  133. SInt16 procID;
  134. Boolean visible;
  135. Boolean filler1;
  136. Boolean goAwayFlag;
  137. Boolean filler2;
  138. SInt32 refCon;
  139. SInt16 itemsID;
  140. Str255 title;
  141. };
  142. typedef struct DialogTemplate DialogTemplate;
  143. typedef DialogTemplate * DialogTPtr;
  144. typedef DialogTPtr * DialogTHndl;
  145. struct AlertTemplate {
  146. Rect boundsRect;
  147. SInt16 itemsID;
  148. StageList stages;
  149. };
  150. typedef struct AlertTemplate AlertTemplate;
  151. typedef AlertTemplate * AlertTPtr;
  152. typedef AlertTPtr * AlertTHndl;
  153. /* new type abstractions for the dialog manager */
  154. typedef SInt16 DialogItemIndexZeroBased;
  155. typedef SInt16 DialogItemIndex;
  156. typedef SInt16 DialogItemType;
  157. /* dialog manager callbacks */
  158. typedef CALLBACK_API( void , SoundProcPtr )(SInt16 soundNumber);
  159. typedef CALLBACK_API( Boolean , ModalFilterProcPtr )(DialogRef theDialog, EventRecord *theEvent, DialogItemIndex *itemHit);
  160. /* ModalFilterYDProcPtr was previously in StandardFile.h */
  161. typedef CALLBACK_API( Boolean , ModalFilterYDProcPtr )(DialogRef theDialog, EventRecord *theEvent, short *itemHit, void *yourDataPtr);
  162. typedef CALLBACK_API( void , UserItemProcPtr )(DialogRef theDialog, DialogItemIndex itemNo);
  163. typedef STACK_UPP_TYPE(SoundProcPtr) SoundUPP;
  164. typedef STACK_UPP_TYPE(ModalFilterProcPtr) ModalFilterUPP;
  165. typedef STACK_UPP_TYPE(ModalFilterYDProcPtr) ModalFilterYDUPP;
  166. typedef STACK_UPP_TYPE(UserItemProcPtr) UserItemUPP;
  167. #if CALL_NOT_IN_CARBON
  168. /*
  169. * NewSoundUPP()
  170. *
  171. * Availability:
  172. * Non-Carbon CFM: available as macro/inline
  173. * CarbonLib: not available
  174. * Mac OS X: not available
  175. */
  176. EXTERN_API_C( SoundUPP )
  177. NewSoundUPP(SoundProcPtr userRoutine);
  178. #if !OPAQUE_UPP_TYPES
  179. enum { uppSoundProcInfo = 0x00000080 }; /* pascal no_return_value Func(2_bytes) */
  180. #ifdef __cplusplus
  181. inline DEFINE_API_C(SoundUPP) NewSoundUPP(SoundProcPtr userRoutine) { return (SoundUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSoundProcInfo, GetCurrentArchitecture()); }
  182. #else
  183. #define NewSoundUPP(userRoutine) (SoundUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSoundProcInfo, GetCurrentArchitecture())
  184. #endif
  185. #endif
  186. #endif /* CALL_NOT_IN_CARBON */
  187. /*
  188. * NewModalFilterUPP()
  189. *
  190. * Availability:
  191. * Non-Carbon CFM: available as macro/inline
  192. * CarbonLib: in CarbonLib 1.0 and later
  193. * Mac OS X: in version 10.0 and later
  194. */
  195. EXTERN_API_C( ModalFilterUPP )
  196. NewModalFilterUPP(ModalFilterProcPtr userRoutine);
  197. #if !OPAQUE_UPP_TYPES
  198. enum { uppModalFilterProcInfo = 0x00000FD0 }; /* pascal 1_byte Func(4_bytes, 4_bytes, 4_bytes) */
  199. #ifdef __cplusplus
  200. inline DEFINE_API_C(ModalFilterUPP) NewModalFilterUPP(ModalFilterProcPtr userRoutine) { return (ModalFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppModalFilterProcInfo, GetCurrentArchitecture()); }
  201. #else
  202. #define NewModalFilterUPP(userRoutine) (ModalFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppModalFilterProcInfo, GetCurrentArchitecture())
  203. #endif
  204. #endif
  205. /*
  206. * NewModalFilterYDUPP()
  207. *
  208. * Availability:
  209. * Non-Carbon CFM: available as macro/inline
  210. * CarbonLib: in CarbonLib 1.0.2 and later
  211. * Mac OS X: in version 10.0 and later
  212. */
  213. EXTERN_API_C( ModalFilterYDUPP )
  214. NewModalFilterYDUPP(ModalFilterYDProcPtr userRoutine);
  215. #if !OPAQUE_UPP_TYPES
  216. enum { uppModalFilterYDProcInfo = 0x00003FD0 }; /* pascal 1_byte Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  217. #ifdef __cplusplus
  218. inline DEFINE_API_C(ModalFilterYDUPP) NewModalFilterYDUPP(ModalFilterYDProcPtr userRoutine) { return (ModalFilterYDUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppModalFilterYDProcInfo, GetCurrentArchitecture()); }
  219. #else
  220. #define NewModalFilterYDUPP(userRoutine) (ModalFilterYDUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppModalFilterYDProcInfo, GetCurrentArchitecture())
  221. #endif
  222. #endif
  223. /*
  224. * NewUserItemUPP()
  225. *
  226. * Availability:
  227. * Non-Carbon CFM: available as macro/inline
  228. * CarbonLib: in CarbonLib 1.0 and later
  229. * Mac OS X: in version 10.0 and later
  230. */
  231. EXTERN_API_C( UserItemUPP )
  232. NewUserItemUPP(UserItemProcPtr userRoutine);
  233. #if !OPAQUE_UPP_TYPES
  234. enum { uppUserItemProcInfo = 0x000002C0 }; /* pascal no_return_value Func(4_bytes, 2_bytes) */
  235. #ifdef __cplusplus
  236. inline DEFINE_API_C(UserItemUPP) NewUserItemUPP(UserItemProcPtr userRoutine) { return (UserItemUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppUserItemProcInfo, GetCurrentArchitecture()); }
  237. #else
  238. #define NewUserItemUPP(userRoutine) (UserItemUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppUserItemProcInfo, GetCurrentArchitecture())
  239. #endif
  240. #endif
  241. #if CALL_NOT_IN_CARBON
  242. /*
  243. * DisposeSoundUPP()
  244. *
  245. * Availability:
  246. * Non-Carbon CFM: available as macro/inline
  247. * CarbonLib: not available
  248. * Mac OS X: not available
  249. */
  250. EXTERN_API_C( void )
  251. DisposeSoundUPP(SoundUPP userUPP);
  252. #if !OPAQUE_UPP_TYPES
  253. #ifdef __cplusplus
  254. inline DEFINE_API_C(void) DisposeSoundUPP(SoundUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  255. #else
  256. #define DisposeSoundUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  257. #endif
  258. #endif
  259. #endif /* CALL_NOT_IN_CARBON */
  260. /*
  261. * DisposeModalFilterUPP()
  262. *
  263. * Availability:
  264. * Non-Carbon CFM: available as macro/inline
  265. * CarbonLib: in CarbonLib 1.0 and later
  266. * Mac OS X: in version 10.0 and later
  267. */
  268. EXTERN_API_C( void )
  269. DisposeModalFilterUPP(ModalFilterUPP userUPP);
  270. #if !OPAQUE_UPP_TYPES
  271. #ifdef __cplusplus
  272. inline DEFINE_API_C(void) DisposeModalFilterUPP(ModalFilterUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  273. #else
  274. #define DisposeModalFilterUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  275. #endif
  276. #endif
  277. /*
  278. * DisposeModalFilterYDUPP()
  279. *
  280. * Availability:
  281. * Non-Carbon CFM: available as macro/inline
  282. * CarbonLib: in CarbonLib 1.0.2 and later
  283. * Mac OS X: in version 10.0 and later
  284. */
  285. EXTERN_API_C( void )
  286. DisposeModalFilterYDUPP(ModalFilterYDUPP userUPP);
  287. #if !OPAQUE_UPP_TYPES
  288. #ifdef __cplusplus
  289. inline DEFINE_API_C(void) DisposeModalFilterYDUPP(ModalFilterYDUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  290. #else
  291. #define DisposeModalFilterYDUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  292. #endif
  293. #endif
  294. /*
  295. * DisposeUserItemUPP()
  296. *
  297. * Availability:
  298. * Non-Carbon CFM: available as macro/inline
  299. * CarbonLib: in CarbonLib 1.0 and later
  300. * Mac OS X: in version 10.0 and later
  301. */
  302. EXTERN_API_C( void )
  303. DisposeUserItemUPP(UserItemUPP userUPP);
  304. #if !OPAQUE_UPP_TYPES
  305. #ifdef __cplusplus
  306. inline DEFINE_API_C(void) DisposeUserItemUPP(UserItemUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  307. #else
  308. #define DisposeUserItemUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  309. #endif
  310. #endif
  311. #if CALL_NOT_IN_CARBON
  312. /*
  313. * InvokeSoundUPP()
  314. *
  315. * Availability:
  316. * Non-Carbon CFM: available as macro/inline
  317. * CarbonLib: not available
  318. * Mac OS X: not available
  319. */
  320. EXTERN_API_C( void )
  321. InvokeSoundUPP(
  322. SInt16 soundNumber,
  323. SoundUPP userUPP);
  324. #if !OPAQUE_UPP_TYPES
  325. #ifdef __cplusplus
  326. inline DEFINE_API_C(void) InvokeSoundUPP(SInt16 soundNumber, SoundUPP userUPP) { CALL_ONE_PARAMETER_UPP(userUPP, uppSoundProcInfo, soundNumber); }
  327. #else
  328. #define InvokeSoundUPP(soundNumber, userUPP) CALL_ONE_PARAMETER_UPP((userUPP), uppSoundProcInfo, (soundNumber))
  329. #endif
  330. #endif
  331. #endif /* CALL_NOT_IN_CARBON */
  332. /*
  333. * InvokeModalFilterUPP()
  334. *
  335. * Availability:
  336. * Non-Carbon CFM: available as macro/inline
  337. * CarbonLib: in CarbonLib 1.0 and later
  338. * Mac OS X: in version 10.0 and later
  339. */
  340. EXTERN_API_C( Boolean )
  341. InvokeModalFilterUPP(
  342. DialogRef theDialog,
  343. EventRecord * theEvent,
  344. DialogItemIndex * itemHit,
  345. ModalFilterUPP userUPP);
  346. #if !OPAQUE_UPP_TYPES
  347. #ifdef __cplusplus
  348. inline DEFINE_API_C(Boolean) InvokeModalFilterUPP(DialogRef theDialog, EventRecord * theEvent, DialogItemIndex * itemHit, ModalFilterUPP userUPP) { return (Boolean)CALL_THREE_PARAMETER_UPP(userUPP, uppModalFilterProcInfo, theDialog, theEvent, itemHit); }
  349. #else
  350. #define InvokeModalFilterUPP(theDialog, theEvent, itemHit, userUPP) (Boolean)CALL_THREE_PARAMETER_UPP((userUPP), uppModalFilterProcInfo, (theDialog), (theEvent), (itemHit))
  351. #endif
  352. #endif
  353. /*
  354. * InvokeModalFilterYDUPP()
  355. *
  356. * Availability:
  357. * Non-Carbon CFM: available as macro/inline
  358. * CarbonLib: in CarbonLib 1.0.2 and later
  359. * Mac OS X: in version 10.0 and later
  360. */
  361. EXTERN_API_C( Boolean )
  362. InvokeModalFilterYDUPP(
  363. DialogRef theDialog,
  364. EventRecord * theEvent,
  365. short * itemHit,
  366. void * yourDataPtr,
  367. ModalFilterYDUPP userUPP);
  368. #if !OPAQUE_UPP_TYPES
  369. #ifdef __cplusplus
  370. inline DEFINE_API_C(Boolean) InvokeModalFilterYDUPP(DialogRef theDialog, EventRecord * theEvent, short * itemHit, void * yourDataPtr, ModalFilterYDUPP userUPP) { return (Boolean)CALL_FOUR_PARAMETER_UPP(userUPP, uppModalFilterYDProcInfo, theDialog, theEvent, itemHit, yourDataPtr); }
  371. #else
  372. #define InvokeModalFilterYDUPP(theDialog, theEvent, itemHit, yourDataPtr, userUPP) (Boolean)CALL_FOUR_PARAMETER_UPP((userUPP), uppModalFilterYDProcInfo, (theDialog), (theEvent), (itemHit), (yourDataPtr))
  373. #endif
  374. #endif
  375. /*
  376. * InvokeUserItemUPP()
  377. *
  378. * Availability:
  379. * Non-Carbon CFM: available as macro/inline
  380. * CarbonLib: in CarbonLib 1.0 and later
  381. * Mac OS X: in version 10.0 and later
  382. */
  383. EXTERN_API_C( void )
  384. InvokeUserItemUPP(
  385. DialogRef theDialog,
  386. DialogItemIndex itemNo,
  387. UserItemUPP userUPP);
  388. #if !OPAQUE_UPP_TYPES
  389. #ifdef __cplusplus
  390. inline DEFINE_API_C(void) InvokeUserItemUPP(DialogRef theDialog, DialogItemIndex itemNo, UserItemUPP userUPP) { CALL_TWO_PARAMETER_UPP(userUPP, uppUserItemProcInfo, theDialog, itemNo); }
  391. #else
  392. #define InvokeUserItemUPP(theDialog, itemNo, userUPP) CALL_TWO_PARAMETER_UPP((userUPP), uppUserItemProcInfo, (theDialog), (itemNo))
  393. #endif
  394. #endif
  395. #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
  396. /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
  397. #define NewSoundProc(userRoutine) NewSoundUPP(userRoutine)
  398. #define NewModalFilterProc(userRoutine) NewModalFilterUPP(userRoutine)
  399. #define NewModalFilterYDProc(userRoutine) NewModalFilterYDUPP(userRoutine)
  400. #define NewUserItemProc(userRoutine) NewUserItemUPP(userRoutine)
  401. #define CallSoundProc(userRoutine, soundNumber) InvokeSoundUPP(soundNumber, userRoutine)
  402. #define CallModalFilterProc(userRoutine, theDialog, theEvent, itemHit) InvokeModalFilterUPP(theDialog, theEvent, itemHit, userRoutine)
  403. #define CallModalFilterYDProc(userRoutine, theDialog, theEvent, itemHit, yourDataPtr) InvokeModalFilterYDUPP(theDialog, theEvent, itemHit, yourDataPtr, userRoutine)
  404. #define CallUserItemProc(userRoutine, theDialog, itemNo) InvokeUserItemUPP(theDialog, itemNo, userRoutine)
  405. #endif /* CALL_NOT_IN_CARBON */
  406. #if !TARGET_OS_MAC
  407. /* QuickTime 3.0 */
  408. typedef CALLBACK_API_C( void , QTModelessCallbackProcPtr )(EventRecord *theEvent, DialogRef theDialog, DialogItemIndex itemHit);
  409. #if CALL_NOT_IN_CARBON
  410. /*
  411. * SetModelessDialogCallbackProc()
  412. *
  413. * Availability:
  414. * Non-Carbon CFM: not available
  415. * CarbonLib: not available
  416. * Mac OS X: not available
  417. */
  418. EXTERN_API( void )
  419. SetModelessDialogCallbackProc(
  420. DialogRef theDialog,
  421. QTModelessCallbackProcPtr callbackProc);
  422. #endif /* CALL_NOT_IN_CARBON */
  423. typedef QTModelessCallbackProcPtr QTModelessCallbackUPP;
  424. #if CALL_NOT_IN_CARBON
  425. /*
  426. * GetDialogControlNotificationProc()
  427. *
  428. * Availability:
  429. * Non-Carbon CFM: not available
  430. * CarbonLib: not available
  431. * Mac OS X: not available
  432. */
  433. EXTERN_API( OSErr )
  434. GetDialogControlNotificationProc(void * theProc);
  435. /*
  436. * SetDialogMovableModal()
  437. *
  438. * Availability:
  439. * Non-Carbon CFM: not available
  440. * CarbonLib: not available
  441. * Mac OS X: not available
  442. */
  443. EXTERN_API( void )
  444. SetDialogMovableModal(DialogRef theDialog);
  445. /*
  446. * GetDialogParent()
  447. *
  448. * Availability:
  449. * Non-Carbon CFM: not available
  450. * CarbonLib: not available
  451. * Mac OS X: not available
  452. */
  453. EXTERN_API( void * )
  454. GetDialogParent(DialogRef theDialog);
  455. #endif /* CALL_NOT_IN_CARBON */
  456. #endif /* !TARGET_OS_MAC */
  457. /*
  458. ---------------------------------------------------------------------------------------------------------
  459. o Following types are valid with Appearance 1.0 and later
  460. ---------------------------------------------------------------------------------------------------------
  461. */
  462. enum {
  463. /* Alert types to pass into StandardAlert */
  464. kAlertStopAlert = 0,
  465. kAlertNoteAlert = 1,
  466. kAlertCautionAlert = 2,
  467. kAlertPlainAlert = 3
  468. };
  469. typedef SInt16 AlertType;
  470. enum {
  471. kAlertDefaultOKText = -1, /* "OK"*/
  472. kAlertDefaultCancelText = -1, /* "Cancel"*/
  473. kAlertDefaultOtherText = -1 /* "Don't Save"*/
  474. };
  475. /* StandardAlert alert button numbers */
  476. enum {
  477. kAlertStdAlertOKButton = 1,
  478. kAlertStdAlertCancelButton = 2,
  479. kAlertStdAlertOtherButton = 3,
  480. kAlertStdAlertHelpButton = 4
  481. };
  482. enum {
  483. /* Dialog Flags for use in NewFeaturesDialog or dlgx resource */
  484. kDialogFlagsUseThemeBackground = (1 << 0),
  485. kDialogFlagsUseControlHierarchy = (1 << 1),
  486. kDialogFlagsHandleMovableModal = (1 << 2),
  487. kDialogFlagsUseThemeControls = (1 << 3)
  488. };
  489. enum {
  490. /* Alert Flags for use in alrx resource */
  491. kAlertFlagsUseThemeBackground = (1 << 0),
  492. kAlertFlagsUseControlHierarchy = (1 << 1),
  493. kAlertFlagsAlertIsMovable = (1 << 2),
  494. kAlertFlagsUseThemeControls = (1 << 3)
  495. };
  496. /* For dftb resource */
  497. enum {
  498. kDialogFontNoFontStyle = 0,
  499. kDialogFontUseFontMask = 0x0001,
  500. kDialogFontUseFaceMask = 0x0002,
  501. kDialogFontUseSizeMask = 0x0004,
  502. kDialogFontUseForeColorMask = 0x0008,
  503. kDialogFontUseBackColorMask = 0x0010,
  504. kDialogFontUseModeMask = 0x0020,
  505. kDialogFontUseJustMask = 0x0040,
  506. kDialogFontUseAllMask = 0x00FF,
  507. kDialogFontAddFontSizeMask = 0x0100,
  508. kDialogFontUseFontNameMask = 0x0200,
  509. kDialogFontAddToMetaFontMask = 0x0400
  510. };
  511. /* Also for dftb resource. This one is available in Mac OS X or later. */
  512. /* It corresponds directly to kControlUseThemeFontIDMask from Controls.h. */
  513. enum {
  514. kDialogFontUseThemeFontIDMask = 0x0080
  515. };
  516. struct AlertStdAlertParamRec {
  517. Boolean movable; /* Make alert movable modal */
  518. Boolean helpButton; /* Is there a help button? */
  519. ModalFilterUPP filterProc; /* Event filter */
  520. ConstStringPtr defaultText; /* Text for button in OK position */
  521. ConstStringPtr cancelText; /* Text for button in cancel position */
  522. ConstStringPtr otherText; /* Text for button in left position */
  523. SInt16 defaultButton; /* Which button behaves as the default */
  524. SInt16 cancelButton; /* Which one behaves as cancel (can be 0) */
  525. UInt16 position; /* Position (kWindowDefaultPosition in this case */
  526. /* equals kWindowAlertPositionParentWindowScreen) */
  527. };
  528. typedef struct AlertStdAlertParamRec AlertStdAlertParamRec;
  529. typedef AlertStdAlertParamRec * AlertStdAlertParamPtr;
  530. enum {
  531. kHICommandOther = FOUR_CHAR_CODE('othr') /* sent by standard sheet dialogs when the "other" button is pressed */
  532. };
  533. enum {
  534. kStdCFStringAlertVersionOne = 1 /* current version of AlertStdCFStringAlertParamRec */
  535. };
  536. /*
  537. * Summary:
  538. * Flags to CreateStandardAlert that are specified in the
  539. * AlertStdCFStringAlertParamRec.flags field.
  540. */
  541. enum {
  542. /*
  543. * Applies to StandardSheet only. Do not dispose of the sheet window
  544. * after closing it; allows the sheet to be re-used again in a later
  545. * call to ShowSheetWindow.
  546. */
  547. kStdAlertDoNotDisposeSheet = 1 << 0,
  548. /*
  549. * Applies to StandardSheet only. Causes the sheet window to be
  550. * hidden immediately without animation effects when the default
  551. * button is chosen by the user.
  552. */
  553. kStdAlertDoNotAnimateOnDefault = 1 << 1,
  554. /*
  555. * Applies to StandardSheet only. Causes the sheet window to be
  556. * hidden immediately without animation effects when the cancel
  557. * button is chosen by the user.
  558. */
  559. kStdAlertDoNotAnimateOnCancel = 1 << 2,
  560. /*
  561. * Applies to StandardSheet only. Causes the sheet window to be
  562. * hidden immediately without animation effects when the other button
  563. * is chosen by the user.
  564. */
  565. kStdAlertDoNotAnimateOnOther = 1 << 3
  566. };
  567. struct AlertStdCFStringAlertParamRec {
  568. UInt32 version; /* kStdCFStringAlertVersionOne */
  569. Boolean movable; /* Make alert movable modal */
  570. Boolean helpButton; /* Is there a help button? */
  571. CFStringRef defaultText; /* Text for button in OK position */
  572. CFStringRef cancelText; /* Text for button in cancel position */
  573. CFStringRef otherText; /* Text for button in left position */
  574. SInt16 defaultButton; /* Which button behaves as the default */
  575. SInt16 cancelButton; /* Which one behaves as cancel (can be 0) */
  576. UInt16 position; /* Position (kWindowDefaultPosition in this case */
  577. /* equals kWindowAlertPositionParentWindowScreen) */
  578. OptionBits flags; /* Options for the behavior of the alert or sheet */
  579. };
  580. typedef struct AlertStdCFStringAlertParamRec AlertStdCFStringAlertParamRec;
  581. typedef AlertStdCFStringAlertParamRec * AlertStdCFStringAlertParamPtr;
  582. /* --- end Appearance 1.0 or later stuff*/
  583. /*
  584. NOTE: Code running under MultiFinder or System 7.0 or newer
  585. should always pass NULL to InitDialogs.
  586. */
  587. #if CALL_NOT_IN_CARBON
  588. /*
  589. * InitDialogs()
  590. *
  591. * Availability:
  592. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  593. * CarbonLib: not available
  594. * Mac OS X: not available
  595. */
  596. EXTERN_API( void )
  597. InitDialogs(void * ignored) ONEWORDINLINE(0xA97B);
  598. /*
  599. * ErrorSound()
  600. *
  601. * Availability:
  602. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  603. * CarbonLib: not available
  604. * Mac OS X: not available
  605. */
  606. EXTERN_API( void )
  607. ErrorSound(SoundUPP soundProc) ONEWORDINLINE(0xA98C);
  608. #endif /* CALL_NOT_IN_CARBON */
  609. /*
  610. * NewDialog()
  611. *
  612. * Availability:
  613. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  614. * CarbonLib: in CarbonLib 1.0 and later
  615. * Mac OS X: in version 10.0 and later
  616. */
  617. EXTERN_API( DialogRef )
  618. NewDialog(
  619. void * dStorage,
  620. const Rect * boundsRect,
  621. ConstStr255Param title,
  622. Boolean visible,
  623. SInt16 procID,
  624. WindowRef behind,
  625. Boolean goAwayFlag,
  626. SInt32 refCon,
  627. Handle items) ONEWORDINLINE(0xA97D);
  628. /*
  629. * GetNewDialog()
  630. *
  631. * Availability:
  632. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  633. * CarbonLib: in CarbonLib 1.0 and later
  634. * Mac OS X: in version 10.0 and later
  635. */
  636. EXTERN_API( DialogRef )
  637. GetNewDialog(
  638. SInt16 dialogID,
  639. void * dStorage,
  640. WindowRef behind) ONEWORDINLINE(0xA97C);
  641. /*
  642. * NewColorDialog()
  643. *
  644. * Availability:
  645. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  646. * CarbonLib: in CarbonLib 1.0 and later
  647. * Mac OS X: in version 10.0 and later
  648. */
  649. EXTERN_API( DialogRef )
  650. NewColorDialog(
  651. void * dStorage,
  652. const Rect * boundsRect,
  653. ConstStr255Param title,
  654. Boolean visible,
  655. SInt16 procID,
  656. WindowRef behind,
  657. Boolean goAwayFlag,
  658. SInt32 refCon,
  659. Handle items) ONEWORDINLINE(0xAA4B);
  660. #if CALL_NOT_IN_CARBON
  661. /*
  662. * CloseDialog()
  663. *
  664. * Availability:
  665. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  666. * CarbonLib: not available
  667. * Mac OS X: not available
  668. */
  669. EXTERN_API( void )
  670. CloseDialog(DialogRef theDialog) ONEWORDINLINE(0xA982);
  671. #endif /* CALL_NOT_IN_CARBON */
  672. /*
  673. * DisposeDialog()
  674. *
  675. * Availability:
  676. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  677. * CarbonLib: in CarbonLib 1.0 and later
  678. * Mac OS X: in version 10.0 and later
  679. */
  680. EXTERN_API( void )
  681. DisposeDialog(DialogRef theDialog) ONEWORDINLINE(0xA983);
  682. /*
  683. * ModalDialog()
  684. *
  685. * Availability:
  686. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  687. * CarbonLib: in CarbonLib 1.0 and later
  688. * Mac OS X: in version 10.0 and later
  689. */
  690. EXTERN_API( void )
  691. ModalDialog(
  692. ModalFilterUPP modalFilter,
  693. DialogItemIndex * itemHit) ONEWORDINLINE(0xA991);
  694. /*
  695. * IsDialogEvent()
  696. *
  697. * Availability:
  698. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  699. * CarbonLib: in CarbonLib 1.0 and later
  700. * Mac OS X: in version 10.0 and later
  701. */
  702. EXTERN_API( Boolean )
  703. IsDialogEvent(const EventRecord * theEvent) ONEWORDINLINE(0xA97F);
  704. /*
  705. * DialogSelect()
  706. *
  707. * Availability:
  708. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  709. * CarbonLib: in CarbonLib 1.0 and later
  710. * Mac OS X: in version 10.0 and later
  711. */
  712. EXTERN_API( Boolean )
  713. DialogSelect(
  714. const EventRecord * theEvent,
  715. DialogRef * theDialog,
  716. DialogItemIndex * itemHit) ONEWORDINLINE(0xA980);
  717. /*
  718. * DrawDialog()
  719. *
  720. * Availability:
  721. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  722. * CarbonLib: in CarbonLib 1.0 and later
  723. * Mac OS X: in version 10.0 and later
  724. */
  725. EXTERN_API( void )
  726. DrawDialog(DialogRef theDialog) ONEWORDINLINE(0xA981);
  727. /*
  728. * UpdateDialog()
  729. *
  730. * Availability:
  731. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  732. * CarbonLib: in CarbonLib 1.0 and later
  733. * Mac OS X: in version 10.0 and later
  734. */
  735. EXTERN_API( void )
  736. UpdateDialog(
  737. DialogRef theDialog,
  738. RgnHandle updateRgn) ONEWORDINLINE(0xA978);
  739. /*
  740. * HideDialogItem()
  741. *
  742. * Availability:
  743. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  744. * CarbonLib: in CarbonLib 1.0 and later
  745. * Mac OS X: in version 10.0 and later
  746. */
  747. EXTERN_API( void )
  748. HideDialogItem(
  749. DialogRef theDialog,
  750. DialogItemIndex itemNo) ONEWORDINLINE(0xA827);
  751. /*
  752. * ShowDialogItem()
  753. *
  754. * Availability:
  755. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  756. * CarbonLib: in CarbonLib 1.0 and later
  757. * Mac OS X: in version 10.0 and later
  758. */
  759. EXTERN_API( void )
  760. ShowDialogItem(
  761. DialogRef theDialog,
  762. DialogItemIndex itemNo) ONEWORDINLINE(0xA828);
  763. /*
  764. * FindDialogItem()
  765. *
  766. * Availability:
  767. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  768. * CarbonLib: in CarbonLib 1.0 and later
  769. * Mac OS X: in version 10.0 and later
  770. */
  771. EXTERN_API( DialogItemIndexZeroBased )
  772. FindDialogItem(
  773. DialogRef theDialog,
  774. Point thePt) ONEWORDINLINE(0xA984);
  775. /*
  776. * DialogCut()
  777. *
  778. * Availability:
  779. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  780. * CarbonLib: in CarbonLib 1.0 and later
  781. * Mac OS X: in version 10.0 and later
  782. */
  783. EXTERN_API( void )
  784. DialogCut(DialogRef theDialog);
  785. /*
  786. * DialogPaste()
  787. *
  788. * Availability:
  789. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  790. * CarbonLib: in CarbonLib 1.0 and later
  791. * Mac OS X: in version 10.0 and later
  792. */
  793. EXTERN_API( void )
  794. DialogPaste(DialogRef theDialog);
  795. /*
  796. * DialogCopy()
  797. *
  798. * Availability:
  799. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  800. * CarbonLib: in CarbonLib 1.0 and later
  801. * Mac OS X: in version 10.0 and later
  802. */
  803. EXTERN_API( void )
  804. DialogCopy(DialogRef theDialog);
  805. /*
  806. * DialogDelete()
  807. *
  808. * Availability:
  809. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  810. * CarbonLib: in CarbonLib 1.0 and later
  811. * Mac OS X: in version 10.0 and later
  812. */
  813. EXTERN_API( void )
  814. DialogDelete(DialogRef theDialog);
  815. /*
  816. * Alert()
  817. *
  818. * Availability:
  819. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  820. * CarbonLib: in CarbonLib 1.0 and later
  821. * Mac OS X: in version 10.0 and later
  822. */
  823. EXTERN_API( DialogItemIndex )
  824. Alert(
  825. SInt16 alertID,
  826. ModalFilterUPP modalFilter) ONEWORDINLINE(0xA985);
  827. /*
  828. * StopAlert()
  829. *
  830. * Availability:
  831. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  832. * CarbonLib: in CarbonLib 1.0 and later
  833. * Mac OS X: in version 10.0 and later
  834. */
  835. EXTERN_API( DialogItemIndex )
  836. StopAlert(
  837. SInt16 alertID,
  838. ModalFilterUPP modalFilter) ONEWORDINLINE(0xA986);
  839. /*
  840. * NoteAlert()
  841. *
  842. * Availability:
  843. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  844. * CarbonLib: in CarbonLib 1.0 and later
  845. * Mac OS X: in version 10.0 and later
  846. */
  847. EXTERN_API( DialogItemIndex )
  848. NoteAlert(
  849. SInt16 alertID,
  850. ModalFilterUPP modalFilter) ONEWORDINLINE(0xA987);
  851. /*
  852. * CautionAlert()
  853. *
  854. * Availability:
  855. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  856. * CarbonLib: in CarbonLib 1.0 and later
  857. * Mac OS X: in version 10.0 and later
  858. */
  859. EXTERN_API( DialogItemIndex )
  860. CautionAlert(
  861. SInt16 alertID,
  862. ModalFilterUPP modalFilter) ONEWORDINLINE(0xA988);
  863. /*
  864. * GetDialogItem()
  865. *
  866. * Availability:
  867. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  868. * CarbonLib: in CarbonLib 1.0 and later
  869. * Mac OS X: in version 10.0 and later
  870. */
  871. EXTERN_API( void )
  872. GetDialogItem(
  873. DialogRef theDialog,
  874. DialogItemIndex itemNo,
  875. DialogItemType * itemType,
  876. Handle * item,
  877. Rect * box) ONEWORDINLINE(0xA98D);
  878. /*
  879. * SetDialogItem()
  880. *
  881. * Availability:
  882. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  883. * CarbonLib: in CarbonLib 1.0 and later
  884. * Mac OS X: in version 10.0 and later
  885. */
  886. EXTERN_API( void )
  887. SetDialogItem(
  888. DialogRef theDialog,
  889. DialogItemIndex itemNo,
  890. DialogItemType itemType,
  891. Handle item,
  892. const Rect * box) ONEWORDINLINE(0xA98E);
  893. /*
  894. * ParamText()
  895. *
  896. * Availability:
  897. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  898. * CarbonLib: in CarbonLib 1.0 and later
  899. * Mac OS X: in version 10.0 and later
  900. */
  901. EXTERN_API( void )
  902. ParamText(
  903. ConstStr255Param param0,
  904. ConstStr255Param param1,
  905. ConstStr255Param param2,
  906. ConstStr255Param param3) ONEWORDINLINE(0xA98B);
  907. /*
  908. * SelectDialogItemText()
  909. *
  910. * Availability:
  911. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  912. * CarbonLib: in CarbonLib 1.0 and later
  913. * Mac OS X: in version 10.0 and later
  914. */
  915. EXTERN_API( void )
  916. SelectDialogItemText(
  917. DialogRef theDialog,
  918. DialogItemIndex itemNo,
  919. SInt16 strtSel,
  920. SInt16 endSel) ONEWORDINLINE(0xA97E);
  921. /*
  922. * GetDialogItemText()
  923. *
  924. * Availability:
  925. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  926. * CarbonLib: in CarbonLib 1.0 and later
  927. * Mac OS X: in version 10.0 and later
  928. */
  929. EXTERN_API( void )
  930. GetDialogItemText(
  931. Handle item,
  932. Str255 text) ONEWORDINLINE(0xA990);
  933. /*
  934. * SetDialogItemText()
  935. *
  936. * Availability:
  937. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  938. * CarbonLib: in CarbonLib 1.0 and later
  939. * Mac OS X: in version 10.0 and later
  940. */
  941. EXTERN_API( void )
  942. SetDialogItemText(
  943. Handle item,
  944. ConstStr255Param text) ONEWORDINLINE(0xA98F);
  945. /*
  946. * GetAlertStage()
  947. *
  948. * Availability:
  949. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  950. * CarbonLib: in CarbonLib 1.0 and later
  951. * Mac OS X: in version 10.0 and later
  952. */
  953. EXTERN_API( SInt16 )
  954. GetAlertStage(void) TWOWORDINLINE(0x3EB8, 0x0A9A);
  955. /*
  956. * SetDialogFont()
  957. *
  958. * Availability:
  959. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  960. * CarbonLib: in CarbonLib 1.0 and later
  961. * Mac OS X: in version 10.0 and later
  962. */
  963. EXTERN_API( void )
  964. SetDialogFont(SInt16 fontNum) TWOWORDINLINE(0x31DF, 0x0AFA);
  965. /*
  966. * ResetAlertStage()
  967. *
  968. * Availability:
  969. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  970. * CarbonLib: in CarbonLib 1.0 and later
  971. * Mac OS X: in version 10.0 and later
  972. */
  973. EXTERN_API( void )
  974. ResetAlertStage(void) TWOWORDINLINE(0x4278, 0x0A9A);
  975. /* APIs in Carbon*/
  976. /*
  977. * GetParamText()
  978. *
  979. * Availability:
  980. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later
  981. * CarbonLib: in CarbonLib 1.0 and later
  982. * Mac OS X: in version 10.0 and later
  983. */
  984. EXTERN_API( void )
  985. GetParamText(
  986. StringPtr param0,
  987. StringPtr param1,
  988. StringPtr param2,
  989. StringPtr param3);
  990. #if CALL_NOT_IN_CARBON
  991. /*
  992. * newdialog()
  993. *
  994. * Availability:
  995. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  996. * CarbonLib: not available
  997. * Mac OS X: not available
  998. */
  999. EXTERN_API_C( DialogRef )
  1000. newdialog(
  1001. void * dStorage,
  1002. const Rect * boundsRect,
  1003. const char * title,
  1004. Boolean visible,
  1005. SInt16 procID,
  1006. WindowRef behind,
  1007. Boolean goAwayFlag,
  1008. SInt32 refCon,
  1009. Handle items);
  1010. /*
  1011. * newcolordialog()
  1012. *
  1013. * Availability:
  1014. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1015. * CarbonLib: not available
  1016. * Mac OS X: not available
  1017. */
  1018. EXTERN_API_C( DialogRef )
  1019. newcolordialog(
  1020. void * dStorage,
  1021. const Rect * boundsRect,
  1022. const char * title,
  1023. Boolean visible,
  1024. SInt16 procID,
  1025. WindowRef behind,
  1026. Boolean goAwayFlag,
  1027. SInt32 refCon,
  1028. Handle items);
  1029. /*
  1030. * paramtext()
  1031. *
  1032. * Availability:
  1033. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1034. * CarbonLib: not available
  1035. * Mac OS X: not available
  1036. */
  1037. EXTERN_API_C( void )
  1038. paramtext(
  1039. const char * param0,
  1040. const char * param1,
  1041. const char * param2,
  1042. const char * param3);
  1043. /*
  1044. * getdialogitemtext()
  1045. *
  1046. * Availability:
  1047. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1048. * CarbonLib: not available
  1049. * Mac OS X: not available
  1050. */
  1051. EXTERN_API_C( void )
  1052. getdialogitemtext(
  1053. Handle item,
  1054. char * text);
  1055. /*
  1056. * setdialogitemtext()
  1057. *
  1058. * Availability:
  1059. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1060. * CarbonLib: not available
  1061. * Mac OS X: not available
  1062. */
  1063. EXTERN_API_C( void )
  1064. setdialogitemtext(
  1065. Handle item,
  1066. const char * text);
  1067. /*
  1068. * finddialogitem()
  1069. *
  1070. * Availability:
  1071. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1072. * CarbonLib: not available
  1073. * Mac OS X: not available
  1074. */
  1075. EXTERN_API_C( DialogItemIndexZeroBased )
  1076. finddialogitem(
  1077. DialogRef theDialog,
  1078. Point * thePt);
  1079. #endif /* CALL_NOT_IN_CARBON */
  1080. /*
  1081. * AppendDITL()
  1082. *
  1083. * Availability:
  1084. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1085. * CarbonLib: in CarbonLib 1.0 and later
  1086. * Mac OS X: in version 10.0 and later
  1087. */
  1088. EXTERN_API( void )
  1089. AppendDITL(
  1090. DialogRef theDialog,
  1091. Handle theHandle,
  1092. DITLMethod method);
  1093. /*
  1094. * CountDITL()
  1095. *
  1096. * Availability:
  1097. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1098. * CarbonLib: in CarbonLib 1.0 and later
  1099. * Mac OS X: in version 10.0 and later
  1100. */
  1101. EXTERN_API( DialogItemIndex )
  1102. CountDITL(DialogRef theDialog);
  1103. /*
  1104. * ShortenDITL()
  1105. *
  1106. * Availability:
  1107. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1108. * CarbonLib: in CarbonLib 1.0 and later
  1109. * Mac OS X: in version 10.0 and later
  1110. */
  1111. EXTERN_API( void )
  1112. ShortenDITL(
  1113. DialogRef theDialog,
  1114. DialogItemIndex numberItems);
  1115. /*
  1116. * InsertDialogItem()
  1117. *
  1118. * Availability:
  1119. * Non-Carbon CFM: not available
  1120. * CarbonLib: in CarbonLib 1.0 and later
  1121. * Mac OS X: in version 10.0 and later
  1122. */
  1123. EXTERN_API( OSStatus )
  1124. InsertDialogItem(
  1125. DialogRef theDialog,
  1126. DialogItemIndex afterItem,
  1127. DialogItemType itemType,
  1128. Handle itemHandle,
  1129. const Rect * box);
  1130. /*
  1131. * RemoveDialogItems()
  1132. *
  1133. * Availability:
  1134. * Non-Carbon CFM: not available
  1135. * CarbonLib: in CarbonLib 1.0 and later
  1136. * Mac OS X: in version 10.0 and later
  1137. */
  1138. EXTERN_API( OSStatus )
  1139. RemoveDialogItems(
  1140. DialogRef theDialog,
  1141. DialogItemIndex itemNo,
  1142. DialogItemIndex amountToRemove,
  1143. Boolean disposeItemData);
  1144. /*
  1145. * StdFilterProc()
  1146. *
  1147. * Availability:
  1148. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1149. * CarbonLib: in CarbonLib 1.0 and later
  1150. * Mac OS X: in version 10.0 and later
  1151. */
  1152. EXTERN_API( Boolean )
  1153. StdFilterProc(
  1154. DialogRef theDialog,
  1155. EventRecord * event,
  1156. DialogItemIndex * itemHit);
  1157. /*
  1158. * GetStdFilterProc()
  1159. *
  1160. * Availability:
  1161. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1162. * CarbonLib: in CarbonLib 1.0 and later
  1163. * Mac OS X: in version 10.0 and later
  1164. */
  1165. EXTERN_API( OSErr )
  1166. GetStdFilterProc(ModalFilterUPP * theProc) THREEWORDINLINE(0x303C, 0x0203, 0xAA68);
  1167. /*
  1168. * SetDialogDefaultItem()
  1169. *
  1170. * Availability:
  1171. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1172. * CarbonLib: in CarbonLib 1.0 and later
  1173. * Mac OS X: in version 10.0 and later
  1174. */
  1175. EXTERN_API( OSErr )
  1176. SetDialogDefaultItem(
  1177. DialogRef theDialog,
  1178. DialogItemIndex newItem) THREEWORDINLINE(0x303C, 0x0304, 0xAA68);
  1179. /*
  1180. * SetDialogCancelItem()
  1181. *
  1182. * Availability:
  1183. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1184. * CarbonLib: in CarbonLib 1.0 and later
  1185. * Mac OS X: in version 10.0 and later
  1186. */
  1187. EXTERN_API( OSErr )
  1188. SetDialogCancelItem(
  1189. DialogRef theDialog,
  1190. DialogItemIndex newItem) THREEWORDINLINE(0x303C, 0x0305, 0xAA68);
  1191. /*
  1192. * SetDialogTracksCursor()
  1193. *
  1194. * Availability:
  1195. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1196. * CarbonLib: in CarbonLib 1.0 and later
  1197. * Mac OS X: in version 10.0 and later
  1198. */
  1199. EXTERN_API( OSErr )
  1200. SetDialogTracksCursor(
  1201. DialogRef theDialog,
  1202. Boolean tracks) THREEWORDINLINE(0x303C, 0x0306, 0xAA68);
  1203. /*
  1204. ---------------------------------------------------------------------------------------------------------
  1205. o Appearance Dialog Routines (available only with Appearance 1.0 and later)
  1206. ---------------------------------------------------------------------------------------------------------
  1207. */
  1208. /*
  1209. * NewFeaturesDialog()
  1210. *
  1211. * Availability:
  1212. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  1213. * CarbonLib: in CarbonLib 1.0 and later
  1214. * Mac OS X: in version 10.0 and later
  1215. */
  1216. EXTERN_API( DialogRef )
  1217. NewFeaturesDialog(
  1218. void * inStorage,
  1219. const Rect * inBoundsRect,
  1220. ConstStr255Param inTitle,
  1221. Boolean inIsVisible,
  1222. SInt16 inProcID,
  1223. WindowRef inBehind,
  1224. Boolean inGoAwayFlag,
  1225. SInt32 inRefCon,
  1226. Handle inItemListHandle,
  1227. UInt32 inFlags) THREEWORDINLINE(0x303C, 0x110C, 0xAA68);
  1228. /*
  1229. * AutoSizeDialog()
  1230. *
  1231. * Availability:
  1232. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  1233. * CarbonLib: in CarbonLib 1.0 and later
  1234. * Mac OS X: in version 10.0 and later
  1235. */
  1236. EXTERN_API( OSErr )
  1237. AutoSizeDialog(DialogRef inDialog) THREEWORDINLINE(0x303C, 0x020D, 0xAA68);
  1238. /*
  1239. Regarding StandardAlert and constness:
  1240. Even though the inAlertParam parameter is marked const here, there was
  1241. a chance Dialog Manager would modify it on versions of Mac OS prior to 9.
  1242. */
  1243. /*
  1244. * StandardAlert()
  1245. *
  1246. * Availability:
  1247. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  1248. * CarbonLib: in CarbonLib 1.0 and later
  1249. * Mac OS X: in version 10.0 and later
  1250. */
  1251. EXTERN_API( OSErr )
  1252. StandardAlert(
  1253. AlertType inAlertType,
  1254. ConstStr255Param inError,
  1255. ConstStr255Param inExplanation,
  1256. const AlertStdAlertParamRec * inAlertParam, /* can be NULL */
  1257. SInt16 * outItemHit) THREEWORDINLINE(0x303C, 0x090E, 0xAA68);
  1258. /* CFString-based StandardAlert and StandardSheet APIs are only available on Mac OS X and later*/
  1259. /*
  1260. * GetStandardAlertDefaultParams()
  1261. *
  1262. * Summary:
  1263. * Fills out an AlertStdCFStringAlertParamRec with default values: -
  1264. * not movable - no help button - default button with title
  1265. * kAlertDefaultOKText, meaning "OK" - no cancel or other buttons
  1266. *
  1267. * Parameters:
  1268. *
  1269. * param:
  1270. * The parameter block to initialize.
  1271. *
  1272. * version:
  1273. * The parameter block version; pass kStdCFStringAlertVersionOne.
  1274. *
  1275. * Availability:
  1276. * Non-Carbon CFM: not available
  1277. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  1278. * Mac OS X: in version 10.0 and later
  1279. */
  1280. EXTERN_API( OSStatus )
  1281. GetStandardAlertDefaultParams(
  1282. AlertStdCFStringAlertParamPtr param,
  1283. UInt32 version);
  1284. /*
  1285. * CreateStandardAlert()
  1286. *
  1287. * Summary:
  1288. * Creates an alert containing standard elements and using standard
  1289. * formatting rules.
  1290. *
  1291. * Discussion:
  1292. * CreateStandardAlert should be used in conjunction with
  1293. * RunStandardAlert. After CreateStandardAlert returns, the alert is
  1294. * still invisible. RunStandardAlert will show the alert and run a
  1295. * modal dialog loop to process events in the alert. The strings
  1296. * passed to this API in the error, explanation, and
  1297. * AlertStdCFStringAlertParamRec button title parameters will all be
  1298. * retained during the creation of the alert, and released when the
  1299. * alert is disposed by RunStandardAlert. There is no net change to
  1300. * the refcount of these strings across CreateStandardAlert and
  1301. * RunStandardAlert.
  1302. *
  1303. * Parameters:
  1304. *
  1305. * alertType:
  1306. * The type of alert to create.
  1307. *
  1308. * error:
  1309. * The error string to display. CreateStandardAlert increments the
  1310. * refcount on this string, so you may release it after
  1311. * CreateStandardAlert returns if you don't need it later.
  1312. *
  1313. * explanation:
  1314. * The explanation string to display. May be NULL or empty to
  1315. * display no explanation. CreateStandardAlert increments the
  1316. * refcount on this string, so you may release it after
  1317. * CreateStandardAlert returns if you don't need it later.
  1318. *
  1319. * param:
  1320. * The parameter block describing how to create the alert. May be
  1321. * NULL. CreateStandardAlert increments the refcount on the button
  1322. * title strings in the parameter block, so you may release them
  1323. * after CreateStandardAlert returns if you don't need them later.
  1324. *
  1325. * outAlert:
  1326. * On exit, contains the new alert.
  1327. *
  1328. * Availability:
  1329. * Non-Carbon CFM: not available
  1330. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  1331. * Mac OS X: in version 10.0 and later
  1332. */
  1333. EXTERN_API( OSStatus )
  1334. CreateStandardAlert(
  1335. AlertType alertType,
  1336. CFStringRef error,
  1337. CFStringRef explanation, /* can be NULL */
  1338. const AlertStdCFStringAlertParamRec * param, /* can be NULL */
  1339. DialogRef * outAlert);
  1340. /*
  1341. * RunStandardAlert()
  1342. *
  1343. * Summary:
  1344. * Shows, runs, and destroys a standard alert using a modal dialog
  1345. * loop.
  1346. *
  1347. * Discussion:
  1348. * RunStandardAlert displays and runs an alert created by
  1349. * CreateStandardAlert. It handles all user interaction with the
  1350. * alert. After the user has dismissed the alert, RunStandardAlert
  1351. * destroys the alert dialog; the DialogRef will be invalid after
  1352. * RunStandardAlert returns.
  1353. *
  1354. * NOTE: DO NOT call this function for a dialog that was not created
  1355. * with CreateStandardAlert! You will sorely regret it, I promise
  1356. * you.
  1357. *
  1358. * Parameters:
  1359. *
  1360. * inAlert:
  1361. * The alert to display.
  1362. *
  1363. * filterProc:
  1364. * An event filter function for handling events that do not apply
  1365. * to the alert. May be NULL.
  1366. *
  1367. * outItemHit:
  1368. * On exit, contains the item index of the button that was pressed
  1369. * to close the alert.
  1370. *
  1371. * Availability:
  1372. * Non-Carbon CFM: not available
  1373. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  1374. * Mac OS X: in version 10.0 and later
  1375. */
  1376. EXTERN_API( OSStatus )
  1377. RunStandardAlert(
  1378. DialogRef inAlert,
  1379. ModalFilterUPP filterProc, /* can be NULL */
  1380. DialogItemIndex * outItemHit);
  1381. /*
  1382. * CreateStandardSheet()
  1383. *
  1384. * Summary:
  1385. * Creates an alert containing standard elements and using standard
  1386. * formatting rules, and prepares it to be displayed as a sheet.
  1387. *
  1388. * Discussion:
  1389. * CreateStandardSheet should be used in conjunction with
  1390. * ShowSheetWindow. After CreateStandardSheet returns, the alert is
  1391. * still invisible. ShowSheetWindow will show the alert and then
  1392. * return. Events in the sheet are handled asynchronously; the
  1393. * application should be prepared for the sheet window to be part of
  1394. * its windowlist while running its own event loop. When a button in
  1395. * the sheet is pressed, the EventTargetRef passed to
  1396. * CreateStandardSheet will receive a command event with one of the
  1397. * command IDs kHICommandOK, kHICommandCancel, or kHICommandOther.
  1398. * The sheet is closed before the command is sent. The strings
  1399. * passed to this API in the error, explanation, and
  1400. * AlertStdCFStringAlertParamRec button title parameters will all be
  1401. * retained during the creation of the sheet, and released when the
  1402. * sheet is disposed. There is no net change to the refcount of
  1403. * these strings across CreateStandardSheet and sheet destruction.
  1404. *
  1405. * Parameters:
  1406. *
  1407. * alertType:
  1408. * The type of alert to create.
  1409. *
  1410. * error:
  1411. * The error string to display. CreateStandardSheet increments the
  1412. * refcount on this string, so you may release it after
  1413. * CreateStandardSheet returns if you don't need it later.
  1414. *
  1415. * explanation:
  1416. * The explanation string to display. May be NULL or empty to
  1417. * display no explanation. CreateStandardSheet increments the
  1418. * refcount on this string, so you may release it after
  1419. * CreateStandardSheet returns if you don't need it later.
  1420. *
  1421. * param:
  1422. * The parameter block describing how to create the alert. May be
  1423. * NULL. CreateStandardSheet increments the refcount on the button
  1424. * title strings in the parameter block, so you may release them
  1425. * after CreateStandardSheet returns if you don't need them later.
  1426. *
  1427. * notifyTarget:
  1428. * The event target to be notified when the sheet is closed. The
  1429. * caller should install an event handler on this target for the
  1430. * [kEventClassCommand, kEventProcessCommand] event.
  1431. *
  1432. * outSheet:
  1433. * On exit, contains the new alert.
  1434. *
  1435. * Availability:
  1436. * Non-Carbon CFM: not available
  1437. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  1438. * Mac OS X: in version 10.0 and later
  1439. */
  1440. EXTERN_API( OSStatus )
  1441. CreateStandardSheet(
  1442. AlertType alertType,
  1443. CFStringRef error,
  1444. CFStringRef explanation, /* can be NULL */
  1445. const AlertStdCFStringAlertParamRec * param, /* can be NULL */
  1446. EventTargetRef notifyTarget,
  1447. DialogRef * outSheet);
  1448. /*
  1449. * CloseStandardSheet()
  1450. *
  1451. * Summary:
  1452. * Closes a standard sheet dialog and releases the dialog data
  1453. * structures.
  1454. *
  1455. * Discussion:
  1456. * CloseStandardSheet is meant to be used when you need to remove a
  1457. * sheet because of a higher-priority request to close the sheet's
  1458. * document window. For example, you might have a Save Changes sheet
  1459. * open on a document window. Meanwhile, the user drags the document
  1460. * into the trash. When your application sees that the document has
  1461. * been moved to the trash, it knows that it should close the
  1462. * document window, but first it needs to close the sheet.
  1463. * CloseStandardSheet should not be used by your Carbon event
  1464. * handler in response to a click in one of the sheet buttons; the
  1465. * Dialog Manager will close the sheet automatically in that case.
  1466. * If kStdAlertDoNotDisposeSheet was specified when the sheet was
  1467. * created, the sheet dialog will be hidden but not released, and
  1468. * you can reuse the sheet later.
  1469. *
  1470. * Parameters:
  1471. *
  1472. * inSheet:
  1473. * The sheet to close.
  1474. *
  1475. * inResultCommand:
  1476. * This command, if not zero, will be sent to the EventTarget
  1477. * specified when the sheet was created.
  1478. *
  1479. * Availability:
  1480. * Non-Carbon CFM: not available
  1481. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  1482. * Mac OS X: in version 10.0 and later
  1483. */
  1484. EXTERN_API( OSStatus )
  1485. CloseStandardSheet(
  1486. DialogRef inSheet,
  1487. UInt32 inResultCommand);
  1488. /*
  1489. * GetDialogItemAsControl()
  1490. *
  1491. * Availability:
  1492. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  1493. * CarbonLib: in CarbonLib 1.0 and later
  1494. * Mac OS X: in version 10.0 and later
  1495. */
  1496. EXTERN_API( OSErr )
  1497. GetDialogItemAsControl(
  1498. DialogRef inDialog,
  1499. SInt16 inItemNo,
  1500. ControlRef * outControl) THREEWORDINLINE(0x303C, 0x050F, 0xAA68);
  1501. /*
  1502. * MoveDialogItem()
  1503. *
  1504. * Availability:
  1505. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  1506. * CarbonLib: in CarbonLib 1.0 and later
  1507. * Mac OS X: in version 10.0 and later
  1508. */
  1509. EXTERN_API( OSErr )
  1510. MoveDialogItem(
  1511. DialogRef inDialog,
  1512. SInt16 inItemNo,
  1513. SInt16 inHoriz,
  1514. SInt16 inVert) THREEWORDINLINE(0x303C, 0x0510, 0xAA68);
  1515. /*
  1516. * SizeDialogItem()
  1517. *
  1518. * Availability:
  1519. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  1520. * CarbonLib: in CarbonLib 1.0 and later
  1521. * Mac OS X: in version 10.0 and later
  1522. */
  1523. EXTERN_API( OSErr )
  1524. SizeDialogItem(
  1525. DialogRef inDialog,
  1526. SInt16 inItemNo,
  1527. SInt16 inWidth,
  1528. SInt16 inHeight) THREEWORDINLINE(0x303C, 0x0511, 0xAA68);
  1529. /*
  1530. * AppendDialogItemList()
  1531. *
  1532. * Availability:
  1533. * Non-Carbon CFM: in DialogsLib 8.5 and later
  1534. * CarbonLib: in CarbonLib 1.0 and later
  1535. * Mac OS X: in version 10.0 and later
  1536. */
  1537. EXTERN_API( OSErr )
  1538. AppendDialogItemList(
  1539. DialogRef dialog,
  1540. SInt16 ditlID,
  1541. DITLMethod method) THREEWORDINLINE(0x303C, 0x0412, 0xAA68);
  1542. /*
  1543. ---------------------------------------------------------------------------------------------------------
  1544. o Dialog Routines available only with Appearance 1.1 (Mac OS 8.5) and later
  1545. ---------------------------------------------------------------------------------------------------------
  1546. */
  1547. /*
  1548. * SetDialogTimeout()
  1549. *
  1550. * Summary:
  1551. * Sets the timeout for a modal dialog.
  1552. *
  1553. * Discussion:
  1554. * SetDialogTimeout sets the delay after which a dialog will be
  1555. * automatically dismissed. When SetDialogTimeout is called, the
  1556. * Dialog Manager takes the current time, adds the timeout to it,
  1557. * and stores the result as the time to dismiss the dialog. If the
  1558. * dismissal time is reached, the dialog is automatically closed and
  1559. * the specified dialog item index is returned from ModalDialog in
  1560. * the itemHit parameter. If the user moves the mouse or presses a
  1561. * key, the dismissal time is reset by adding the original timeout
  1562. * to the time of the event. Only the ModalDialog API observes the
  1563. * timeout value; if you are handling events in a modeless dialog or
  1564. * sheet using IsDialogEvent and DialogSelect, the timeout will be
  1565. * ignored.
  1566. *
  1567. * Parameters:
  1568. *
  1569. * inDialog:
  1570. * The dialog on which to set a timeout.
  1571. *
  1572. * inButtonToPress:
  1573. * The dialog item index that should be returned from ModalDialog
  1574. * when the timeout expires.
  1575. *
  1576. * inSecondsToWait:
  1577. * The time to wait before dismissing the dialog, in seconds.
  1578. *
  1579. * Result:
  1580. * An operating system result code.
  1581. *
  1582. * Availability:
  1583. * Non-Carbon CFM: in DialogsLib 8.5 and later
  1584. * CarbonLib: in CarbonLib 1.0 and later
  1585. * Mac OS X: in version 10.0 and later
  1586. */
  1587. EXTERN_API( OSStatus )
  1588. SetDialogTimeout(
  1589. DialogRef inDialog,
  1590. SInt16 inButtonToPress,
  1591. UInt32 inSecondsToWait);
  1592. /*
  1593. * GetDialogTimeout()
  1594. *
  1595. * Summary:
  1596. * Retrieves the timeout for a modal dialog.
  1597. *
  1598. * Parameters:
  1599. *
  1600. * inDialog:
  1601. * The dialog from which to retrieve the timeout.
  1602. *
  1603. * outButtonToPress:
  1604. * On exit, contains the dialog item index that should be returned
  1605. * from ModalDialog when the dialog is dismissed. May be NULL if
  1606. * you do not need this information.
  1607. *
  1608. * outSecondsToWait:
  1609. * On exit, contains the time to wait before dismissing the
  1610. * dialog, in seconds. May be NULL if you do not need this
  1611. * information.
  1612. *
  1613. * outSecondsRemaining:
  1614. * On exit, contains the time until the dialog is dismissed, in
  1615. * seconds. May be NULL if you do not need this information.
  1616. *
  1617. * Result:
  1618. * An operating system result code. Returns dialogNoTimeoutErr if no
  1619. * timeout has been set for this dialog.
  1620. *
  1621. * Availability:
  1622. * Non-Carbon CFM: in DialogsLib 8.5 and later
  1623. * CarbonLib: in CarbonLib 1.0 and later
  1624. * Mac OS X: in version 10.0 and later
  1625. */
  1626. EXTERN_API( OSStatus )
  1627. GetDialogTimeout(
  1628. DialogRef inDialog,
  1629. SInt16 * outButtonToPress, /* can be NULL */
  1630. UInt32 * outSecondsToWait, /* can be NULL */
  1631. UInt32 * outSecondsRemaining); /* can be NULL */
  1632. /*
  1633. * SetModalDialogEventMask()
  1634. *
  1635. * Availability:
  1636. * Non-Carbon CFM: in DialogsLib 8.5 and later
  1637. * CarbonLib: in CarbonLib 1.0 and later
  1638. * Mac OS X: in version 10.0 and later
  1639. */
  1640. EXTERN_API( OSStatus )
  1641. SetModalDialogEventMask(
  1642. DialogRef inDialog,
  1643. EventMask inMask);
  1644. /*
  1645. * GetModalDialogEventMask()
  1646. *
  1647. * Availability:
  1648. * Non-Carbon CFM: in DialogsLib 8.5 and later
  1649. * CarbonLib: in CarbonLib 1.0 and later
  1650. * Mac OS X: in version 10.0 and later
  1651. */
  1652. EXTERN_API( OSStatus )
  1653. GetModalDialogEventMask(
  1654. DialogRef inDialog,
  1655. EventMask * outMask);
  1656. /*
  1657. ---------------------------------------------------------------------------------------------------------
  1658. o Accessor functions
  1659. ---------------------------------------------------------------------------------------------------------
  1660. */
  1661. /*
  1662. * GetDialogWindow()
  1663. *
  1664. * Availability:
  1665. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  1666. * CarbonLib: in CarbonLib 1.0 and later
  1667. * Mac OS X: in version 10.0 and later
  1668. */
  1669. EXTERN_API( WindowRef )
  1670. GetDialogWindow(DialogRef dialog);
  1671. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  1672. #ifdef __cplusplus
  1673. inline DEFINE_API(WindowRef ) GetDialogWindow(DialogRef dialog) { return (WindowRef)dialog; }
  1674. #else
  1675. #define GetDialogWindow(dialog) ((WindowRef)dialog)
  1676. #endif
  1677. #endif
  1678. /*
  1679. * GetDialogTextEditHandle()
  1680. *
  1681. * Availability:
  1682. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  1683. * CarbonLib: in CarbonLib 1.0 and later
  1684. * Mac OS X: in version 10.0 and later
  1685. */
  1686. EXTERN_API( TEHandle )
  1687. GetDialogTextEditHandle(DialogRef dialog);
  1688. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  1689. #ifdef __cplusplus
  1690. inline DEFINE_API(TEHandle ) GetDialogTextEditHandle(DialogRef dialog) { return ((DialogPeek)dialog)->textH; }
  1691. #else
  1692. #define GetDialogTextEditHandle(dialog) (((DialogPeek)dialog)->textH)
  1693. #endif
  1694. #endif
  1695. /*
  1696. * GetDialogDefaultItem()
  1697. *
  1698. * Availability:
  1699. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  1700. * CarbonLib: in CarbonLib 1.0 and later
  1701. * Mac OS X: in version 10.0 and later
  1702. */
  1703. EXTERN_API( SInt16 )
  1704. GetDialogDefaultItem(DialogRef dialog);
  1705. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  1706. #ifdef __cplusplus
  1707. inline DEFINE_API(SInt16 ) GetDialogDefaultItem(DialogRef dialog) { return ((DialogPeek)dialog)->aDefItem; }
  1708. #else
  1709. #define GetDialogDefaultItem(dialog) (((DialogPeek)dialog)->aDefItem)
  1710. #endif
  1711. #endif
  1712. /*
  1713. * GetDialogCancelItem()
  1714. *
  1715. * Availability:
  1716. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  1717. * CarbonLib: in CarbonLib 1.0 and later
  1718. * Mac OS X: in version 10.0 and later
  1719. */
  1720. EXTERN_API( SInt16 )
  1721. GetDialogCancelItem(DialogRef dialog);
  1722. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  1723. #ifdef __cplusplus
  1724. inline DEFINE_API(SInt16 ) GetDialogCancelItem(DialogRef dialog) { return ((DialogPeek)dialog)->editOpen; }
  1725. #else
  1726. #define GetDialogCancelItem(dialog) (((DialogPeek)dialog)->editOpen)
  1727. #endif
  1728. #endif
  1729. /*
  1730. * GetDialogKeyboardFocusItem()
  1731. *
  1732. * Availability:
  1733. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  1734. * CarbonLib: in CarbonLib 1.0 and later
  1735. * Mac OS X: in version 10.0 and later
  1736. */
  1737. EXTERN_API( SInt16 )
  1738. GetDialogKeyboardFocusItem(DialogRef dialog);
  1739. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  1740. #ifdef __cplusplus
  1741. inline DEFINE_API(SInt16 ) GetDialogKeyboardFocusItem(DialogRef dialog) { return ((DialogPeek)dialog)->editField < 0 ? (short)(-1): (short)(((DialogPeek)dialog)->editField + 1); }
  1742. #else
  1743. #define GetDialogKeyboardFocusItem(dialog) (((DialogPeek)dialog)->editField < 0 ? (short)(-1): (short)(((DialogPeek)dialog)->editField + 1))
  1744. #endif
  1745. #endif
  1746. /*
  1747. * SetPortDialogPort()
  1748. *
  1749. * Availability:
  1750. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  1751. * CarbonLib: in CarbonLib 1.0 and later
  1752. * Mac OS X: in version 10.0 and later
  1753. */
  1754. EXTERN_API( void )
  1755. SetPortDialogPort(DialogRef dialog);
  1756. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  1757. #ifdef __cplusplus
  1758. inline DEFINE_API(void) SetPortDialogPort(DialogRef dialog) { MacSetPort((GrafPtr)dialog); }
  1759. #else
  1760. #define SetPortDialogPort(dialog) (MacSetPort((GrafPtr)dialog))
  1761. #endif
  1762. #endif
  1763. /*
  1764. * GetDialogPort()
  1765. *
  1766. * Availability:
  1767. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  1768. * CarbonLib: in CarbonLib 1.0 and later
  1769. * Mac OS X: in version 10.0 and later
  1770. */
  1771. EXTERN_API( CGrafPtr )
  1772. GetDialogPort(DialogRef dialog);
  1773. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  1774. #ifdef __cplusplus
  1775. inline DEFINE_API(CGrafPtr ) GetDialogPort(DialogRef dialog) { return (CGrafPtr)dialog; }
  1776. #else
  1777. #define GetDialogPort(dialog) ((CGrafPtr)dialog)
  1778. #endif
  1779. #endif
  1780. /*
  1781. * GetDialogFromWindow()
  1782. *
  1783. * Availability:
  1784. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  1785. * CarbonLib: in CarbonLib 1.0 and later
  1786. * Mac OS X: in version 10.0 and later
  1787. */
  1788. EXTERN_API( DialogRef )
  1789. GetDialogFromWindow(WindowRef window);
  1790. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  1791. #ifdef __cplusplus
  1792. inline DEFINE_API(DialogRef ) GetDialogFromWindow(WindowRef window) { return (DialogRef)window; }
  1793. #else
  1794. #define GetDialogFromWindow(window) ((DialogRef)window)
  1795. #endif
  1796. #endif
  1797. #if CALL_NOT_IN_CARBON
  1798. /*
  1799. * CouldDialog()
  1800. *
  1801. * Availability:
  1802. * Non-Carbon CFM: not available
  1803. * CarbonLib: not available
  1804. * Mac OS X: not available
  1805. */
  1806. EXTERN_API( void )
  1807. CouldDialog(SInt16 dialogID) ONEWORDINLINE(0xA979);
  1808. /*
  1809. * FreeDialog()
  1810. *
  1811. * Availability:
  1812. * Non-Carbon CFM: not available
  1813. * CarbonLib: not available
  1814. * Mac OS X: not available
  1815. */
  1816. EXTERN_API( void )
  1817. FreeDialog(SInt16 dialogID) ONEWORDINLINE(0xA97A);
  1818. /*
  1819. * CouldAlert()
  1820. *
  1821. * Availability:
  1822. * Non-Carbon CFM: not available
  1823. * CarbonLib: not available
  1824. * Mac OS X: not available
  1825. */
  1826. EXTERN_API( void )
  1827. CouldAlert(SInt16 alertID) ONEWORDINLINE(0xA989);
  1828. /*
  1829. * FreeAlert()
  1830. *
  1831. * Availability:
  1832. * Non-Carbon CFM: not available
  1833. * CarbonLib: not available
  1834. * Mac OS X: not available
  1835. */
  1836. EXTERN_API( void )
  1837. FreeAlert(SInt16 alertID) ONEWORDINLINE(0xA98A);
  1838. #endif /* CALL_NOT_IN_CARBON */
  1839. #if OLDROUTINENAMES
  1840. #define DisposDialog(theDialog) DisposeDialog(theDialog)
  1841. #define UpdtDialog(theDialog, updateRgn) UpdateDialog(theDialog, updateRgn)
  1842. #define GetDItem(theDialog, itemNo, itemType, item, box) GetDialogItem(theDialog, itemNo, itemType, item, box)
  1843. #define SetDItem(theDialog, itemNo, itemType, item, box) SetDialogItem(theDialog, itemNo, itemType, item, box)
  1844. #define HideDItem(theDialog, itemNo) HideDialogItem(theDialog, itemNo)
  1845. #define ShowDItem(theDialog, itemNo) ShowDialogItem(theDialog, itemNo)
  1846. #define SelIText(theDialog, itemNo, strtSel, endSel) SelectDialogItemText(theDialog, itemNo, strtSel, endSel)
  1847. #define GetIText(item, text) GetDialogItemText(item, text)
  1848. #define SetIText(item, text) SetDialogItemText(item, text)
  1849. #define FindDItem(theDialog, thePt) FindDialogItem(theDialog, thePt)
  1850. #define NewCDialog(dStorage, boundsRect, title, visible, procID, behind, goAwayFlag, refCon, items) \
  1851. NewColorDialog(dStorage, boundsRect, title, visible, procID, behind, goAwayFlag, refCon, items)
  1852. #define GetAlrtStage() GetAlertStage()
  1853. #define ResetAlrtStage() ResetAlertStage()
  1854. #define DlgCut(theDialog) DialogCut(theDialog)
  1855. #define DlgPaste(theDialog) DialogPaste(theDialog)
  1856. #define DlgCopy(theDialog) DialogCopy(theDialog)
  1857. #define DlgDelete(theDialog) DialogDelete(theDialog)
  1858. #define SetDAFont(fontNum) SetDialogFont(fontNum)
  1859. #define SetGrafPortOfDialog(dialog) SetPortDialogPort(dialog)
  1860. #if CGLUESUPPORTED
  1861. #define newcdialog(dStorage, boundsRect, title, visible, procID, behind, goAwayFlag, refCon, items) \
  1862. newcolordialog(dStorage, boundsRect, title, visible, procID, behind, goAwayFlag, refCon, items)
  1863. #define getitext(item, text) getdialogitemtext(item, text)
  1864. #define setitext(item, text) setdialogitemtext(item, text)
  1865. #define findditem(theDialog, thePt) finddialogitem(theDialog, thePt)
  1866. #endif
  1867. #endif /* OLDROUTINENAMES */
  1868. #if TARGET_OS_MAC
  1869. #endif /* TARGET_OS_MAC */
  1870. #if !TARGET_OS_MAC
  1871. #endif /* !TARGET_OS_MAC */
  1872. #if PRAGMA_STRUCT_ALIGN
  1873. #pragma options align=reset
  1874. #elif PRAGMA_STRUCT_PACKPUSH
  1875. #pragma pack(pop)
  1876. #elif PRAGMA_STRUCT_PACK
  1877. #pragma pack()
  1878. #endif
  1879. #ifdef PRAGMA_IMPORT_OFF
  1880. #pragma import off
  1881. #elif PRAGMA_IMPORT
  1882. #pragma import reset
  1883. #endif
  1884. #ifdef __cplusplus
  1885. }
  1886. #endif
  1887. #endif /* __DIALOGS__ */