home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Beta / Quicktime 2.0 Beta.iso / Programming Stuff / Interfaces / Universal Interfaces / Dialogs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-30  |  11.4 KB  |  351 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Dialogs.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __DIALOGS__
  13. #define __DIALOGS__
  14.  
  15. #ifndef __WINDOWS__
  16. #include <Windows.h>
  17. /*    #include <Quickdraw.h>                                        */
  18. /*        #include <Types.h>                                        */
  19. /*            #include <ConditionalMacros.h>                        */
  20. /*            #include <MixedMode.h>                                */
  21. /*                #include <Traps.h>                                */
  22. /*        #include <QuickdrawText.h>                                */
  23. /*            #include <IntlResources.h>                            */
  24. /*    #include <Events.h>                                            */
  25. /*        #include <OSUtils.h>                                    */
  26. /*    #include <Controls.h>                                        */
  27. /*        #include <Menus.h>                                        */
  28. #endif
  29.  
  30. #ifndef __TEXTEDIT__
  31. #include <TextEdit.h>
  32. #endif
  33.  
  34. enum  {
  35.     ctrlItem                    = 4,
  36.     btnCtrl                        = 0,
  37.     chkCtrl                        = 1,
  38.     radCtrl                        = 2,
  39.     resCtrl                        = 3,
  40.     statText                    = 8,
  41.     editText                    = 16,
  42.     iconItem                    = 32,
  43.     picItem                        = 64,
  44.     userItem                    = 0,
  45.     itemDisable                    = 128,
  46.     ok                            = 1,
  47.     cancel                        = 2,
  48.     stopIcon                    = 0,
  49.     noteIcon                    = 1,
  50.     cautionIcon                    = 2
  51. };
  52.  
  53.  
  54. /*    Dialog Item List Manipulation Constants    */
  55.  
  56. typedef short DITLMethod;
  57.  
  58. enum  {
  59.     overlayDITL                    = 0,
  60.     appendDITLRight                = 1,
  61.     appendDITLBottom            = 2
  62. };
  63.  
  64. typedef short StageList;
  65.  
  66. typedef WindowPtr DialogPtr;
  67.  
  68. typedef pascal void (*SoundProcPtr)(short soundNumber);
  69.  
  70. enum {
  71.     uppSoundProcInfo = kPascalStackBased
  72.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short)))
  73. };
  74.  
  75. #if USESROUTINEDESCRIPTORS
  76. typedef UniversalProcPtr SoundUPP;
  77.  
  78. #define CallSoundProc(userRoutine, soundNumber)        \
  79.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSoundProcInfo, (soundNumber))
  80. #define NewSoundProc(userRoutine)        \
  81.         (SoundUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSoundProcInfo, GetCurrentISA())
  82. #else
  83. typedef SoundProcPtr SoundUPP;
  84.  
  85. #define CallSoundProc(userRoutine, soundNumber)        \
  86.         (*(userRoutine))((soundNumber))
  87. #define NewSoundProc(userRoutine)        \
  88.         (SoundUPP)(userRoutine)
  89. #endif
  90.  
  91. typedef pascal Boolean (*ModalFilterProcPtr)(DialogPtr theDialog, EventRecord *theEvent, short *itemHit);
  92.  
  93. enum {
  94.     uppModalFilterProcInfo = kPascalStackBased
  95.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  96.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(DialogPtr)))
  97.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(EventRecord*)))
  98.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short*)))
  99. };
  100.  
  101. #if USESROUTINEDESCRIPTORS
  102. typedef UniversalProcPtr ModalFilterUPP;
  103.  
  104. #define CallModalFilterProc(userRoutine, theDialog, theEvent, itemHit)        \
  105.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppModalFilterProcInfo, (theDialog), (theEvent), (itemHit))
  106. #define NewModalFilterProc(userRoutine)        \
  107.         (ModalFilterUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppModalFilterProcInfo, GetCurrentISA())
  108. #else
  109. typedef ModalFilterProcPtr ModalFilterUPP;
  110.  
  111. #define CallModalFilterProc(userRoutine, theDialog, theEvent, itemHit)        \
  112.         (*(userRoutine))((theDialog), (theEvent), (itemHit))
  113. #define NewModalFilterProc(userRoutine)        \
  114.         (ModalFilterUPP)(userRoutine)
  115. #endif
  116.  
  117. typedef pascal void (*UserItemProcPtr)(WindowPtr theWindow, short itemNo);
  118.  
  119. enum {
  120.     uppUserItemProcInfo = kPascalStackBased
  121.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(WindowPtr)))
  122.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short)))
  123. };
  124.  
  125. #if USESROUTINEDESCRIPTORS
  126. typedef UniversalProcPtr UserItemUPP;
  127.  
  128. #define CallUserItemProc(userRoutine, theWindow, itemNo)        \
  129.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppUserItemProcInfo, (theWindow), (itemNo))
  130. #define NewUserItemProc(userRoutine)        \
  131.         (UserItemUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppUserItemProcInfo, GetCurrentISA())
  132. #else
  133. typedef UserItemProcPtr UserItemUPP;
  134.  
  135. #define CallUserItemProc(userRoutine, theWindow, itemNo)        \
  136.         (*(userRoutine))((theWindow), (itemNo))
  137. #define NewUserItemProc(userRoutine)        \
  138.         (UserItemUPP)(userRoutine)
  139. #endif
  140.  
  141. #if defined(powerc) || defined (__powerc)
  142. #pragma options align=mac68k
  143. #endif
  144. struct DialogRecord {
  145.     WindowRecord                window;
  146.     Handle                        items;
  147.     TEHandle                    textH;
  148.     short                        editField;
  149.     short                        editOpen;
  150.     short                        aDefItem;
  151. };
  152. #if defined(powerc) || defined(__powerc)
  153. #pragma options align=reset
  154. #endif
  155.  
  156. typedef struct DialogRecord DialogRecord;
  157.  
  158. typedef DialogRecord *DialogPeek;
  159.  
  160. #if defined(powerc) || defined (__powerc)
  161. #pragma options align=mac68k
  162. #endif
  163. struct DialogTemplate {
  164.     Rect                        boundsRect;
  165.     short                        procID;
  166.     Boolean                        visible;
  167.     Boolean                        filler1;
  168.     Boolean                        goAwayFlag;
  169.     Boolean                        filler2;
  170.     long                        refCon;
  171.     short                        itemsID;
  172.     Str255                        title;
  173. };
  174. #if defined(powerc) || defined(__powerc)
  175. #pragma options align=reset
  176. #endif
  177.  
  178. typedef struct DialogTemplate DialogTemplate;
  179.  
  180. typedef DialogTemplate *DialogTPtr, **DialogTHndl;
  181.  
  182. #if defined(powerc) || defined (__powerc)
  183. #pragma options align=mac68k
  184. #endif
  185. struct AlertTemplate {
  186.     Rect                        boundsRect;
  187.     short                        itemsID;
  188.     StageList                    stages;
  189. };
  190. #if defined(powerc) || defined(__powerc)
  191. #pragma options align=reset
  192. #endif
  193.  
  194. typedef struct AlertTemplate AlertTemplate;
  195.  
  196. typedef AlertTemplate *AlertTPtr, **AlertTHndl;
  197.  
  198. #ifdef __cplusplus
  199. extern "C" {
  200. #endif
  201.  
  202.  
  203. /*
  204.     NOTE: Code running under MultiFinder or System 7.0 or newer
  205.     should always pass NULL to InitDialogs.
  206. */
  207.  
  208. extern pascal void InitDialogs(long ignored)
  209.  ONEWORDINLINE(0xA97B);
  210. extern pascal void ErrorSound(SoundUPP soundProc)
  211.  ONEWORDINLINE(0xA98C);
  212. extern pascal DialogPtr NewDialog(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short procID, WindowPtr behind, Boolean goAwayFlag, long refCon, Handle itmLstHndl)
  213.  ONEWORDINLINE(0xA97D);
  214. extern DialogPtr newdialog(void *wStorage, const Rect *boundsRect, char *title, Boolean visible, short procID, WindowPtr behind, Boolean goAwayFlag, long refCon, Handle itmLstHndl);
  215. extern pascal DialogPtr GetNewDialog(short dialogID, void *dStorage, WindowPtr behind)
  216.  ONEWORDINLINE(0xA97C);
  217. extern pascal void CloseDialog(DialogPtr theDialog)
  218.  ONEWORDINLINE(0xA982);
  219. extern pascal void DisposeDialog(DialogPtr theDialog)
  220.  ONEWORDINLINE(0xA983);
  221. extern pascal void ParamText(ConstStr255Param param0, ConstStr255Param param1, ConstStr255Param param2, ConstStr255Param param3)
  222.  ONEWORDINLINE(0xA98B);
  223. extern pascal void ModalDialog(ModalFilterUPP modalFilter, short *itemHit)
  224.  ONEWORDINLINE(0xA991);
  225. extern pascal Boolean IsDialogEvent(const EventRecord *theEvent)
  226.  ONEWORDINLINE(0xA97F);
  227. extern pascal Boolean DialogSelect(const EventRecord *theEvent, DialogPtr *theDialog, short *itemHit)
  228.  ONEWORDINLINE(0xA980);
  229. extern pascal void DrawDialog(DialogPtr theDialog)
  230.  ONEWORDINLINE(0xA981);
  231. extern pascal void UpdateDialog(DialogPtr theDialog, RgnHandle updateRgn)
  232.  ONEWORDINLINE(0xA978);
  233. extern pascal short Alert(short alertID, ModalFilterUPP modalFilter)
  234.  ONEWORDINLINE(0xA985);
  235. extern pascal short StopAlert(short alertID, ModalFilterUPP modalFilter)
  236.  ONEWORDINLINE(0xA986);
  237. extern pascal short NoteAlert(short alertID, ModalFilterUPP modalFilter)
  238.  ONEWORDINLINE(0xA987);
  239. extern pascal short CautionAlert(short alertID, ModalFilterUPP modalFilter)
  240.  ONEWORDINLINE(0xA988);
  241. extern pascal void GetDialogItem(DialogPtr theDialog, short itemNo, short *itemType, Handle *item, Rect *box)
  242.  ONEWORDINLINE(0xA98D);
  243. extern pascal void SetDialogItem(DialogPtr theDialog, short itemNo, short itemType, Handle item, const Rect *box)
  244.  ONEWORDINLINE(0xA98E);
  245. extern pascal void HideDialogItem(DialogPtr theDialog, short itemNo)
  246.  ONEWORDINLINE(0xA827);
  247. extern pascal void ShowDialogItem(DialogPtr theDialog, short itemNo)
  248.  ONEWORDINLINE(0xA828);
  249. extern pascal void SelectDialogItemText(DialogPtr theDialog, short itemNo, short strtSel, short endSel)
  250.  ONEWORDINLINE(0xA97E);
  251. extern pascal void GetDialogItemText(Handle item, Str255 text)
  252.  ONEWORDINLINE(0xA990);
  253. extern pascal void SetDialogItemText(Handle item, ConstStr255Param text)
  254.  ONEWORDINLINE(0xA98F);
  255. extern pascal short FindDialogItem(DialogPtr theDialog, Point thePt)
  256.  ONEWORDINLINE(0xA984);
  257. extern pascal DialogPtr NewColorDialog(void *dStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short procID, WindowPtr behind, Boolean goAwayFlag, long refCon, Handle items)
  258.  ONEWORDINLINE(0xAA4B);
  259. extern DialogPtr newcolordialog(void *dStorage, const Rect *boundsRect, char *title, Boolean visible, short procID, WindowPtr behind, Boolean goAwayFlag, long refCon, Handle items);
  260. #if USESCODEFRAGMENTS
  261. extern pascal short GetAlertStage(void);
  262. #else
  263. #define GetAlertStage() (* (short*) 0x0A9A)
  264.  
  265. #endif
  266.  
  267. extern pascal void ResetAlertStage(void)
  268.  TWOWORDINLINE(0x4278, 0x0A9A);
  269. extern pascal void DialogCut(DialogPtr theDialog);
  270. extern pascal void DialogPaste(DialogPtr theDialog);
  271. extern pascal void DialogCopy(DialogPtr theDialog);
  272. extern pascal void DialogDelete(DialogPtr theDialog);
  273. extern pascal void SetDialogFont(short fontNum)
  274.  TWOWORDINLINE(0x31DF, 0x0AFA);
  275. extern void paramtext(char *param0, char *param1, char *param2, char *param3);
  276. extern void getdialogitemtext(Handle item, char *text);
  277. extern void setdialogitemtext(Handle item, char *text);
  278. extern short finddialogitem(DialogPtr theDialog, Point *thePt);
  279. extern pascal void AppendDITL(DialogPtr theDialog, Handle theHandle, DITLMethod method);
  280. extern pascal short CountDITL(DialogPtr theDialog);
  281. extern pascal void ShortenDITL(DialogPtr theDialog, short numberItems);
  282. extern pascal Boolean StdFilterProc(DialogPtr theDialog, EventRecord *event, short *itemHit);
  283. extern pascal OSErr GetStdFilterProc(ModalFilterUPP *theProc)
  284.  THREEWORDINLINE(0x303C, 0x0203, 0xAA68);
  285. extern pascal OSErr SetDialogDefaultItem(DialogPtr theDialog, short newItem)
  286.  THREEWORDINLINE(0x303C, 0x0304, 0xAA68);
  287. extern pascal OSErr SetDialogCancelItem(DialogPtr theDialog, short newItem)
  288.  THREEWORDINLINE(0x303C, 0x0305, 0xAA68);
  289. extern pascal OSErr SetDialogTracksCursor(DialogPtr theDialog, Boolean tracks)
  290.  THREEWORDINLINE(0x303C, 0x0306, 0xAA68);
  291. #if OLDROUTINENAMES
  292. #define DisposDialog(theDialog) DisposeDialog(theDialog)
  293.  
  294. #define UpdtDialog(theDialog, updateRgn) UpdateDialog(theDialog, updateRgn)
  295.  
  296. #define GetDItem(theDialog, itemNo, itemType, item, box)  \
  297.     GetDialogItem(theDialog, itemNo, itemType, item, box)
  298.  
  299. #define SetDItem(theDialog, itemNo, itemType, item, box)  \
  300.     SetDialogItem(theDialog, itemNo, itemType, item, box)
  301.  
  302. #define HideDItem(theDialog, itemNo) HideDialogItem(theDialog, itemNo)
  303.  
  304. #define ShowDItem(theDialog, itemNo) ShowDialogItem(theDialog, itemNo)
  305.  
  306. #define SelIText(theDialog, itemNo, strtSel, endSel)  \
  307.     SelectDialogItemText(theDialog, itemNo, strtSel, endSel)
  308.  
  309. #define GetIText(item, text) GetDialogItemText(item, text)
  310.  
  311. #define SetIText(item, text) SetDialogItemText(item, text)
  312.  
  313. #define FindDItem(theDialog, thePt) FindDialogItem(theDialog, thePt)
  314.  
  315. #define NewCDialog(dStorage, boundsRect, title, visible, procID, behind, goAwayFlag, refCon, items)  \
  316.     NewColorDialog(dStorage, boundsRect, title, visible, procID, behind,  \
  317.     goAwayFlag, refCon, items)
  318.  
  319. #define GetAlrtStage() GetAlertStage()
  320.  
  321. #define ResetAlrtStage() ResetAlertStage()
  322.  
  323. #define DlgCut(theDialog) DialogCut(theDialog)
  324.  
  325. #define DlgPaste(theDialog) DialogPaste(theDialog)
  326.  
  327. #define DlgCopy(theDialog) DialogCopy(theDialog)
  328.  
  329. #define DlgDelete(theDialog) DialogDelete(theDialog)
  330.  
  331. #define SetDAFont(fontNum) SetDialogFont(fontNum)
  332.  
  333. #define newcdialog(dStorage, boundsRect, title, visible, procID, behind, goAwayFlag, refCon, items)  \
  334.     newcolordialog(dStorage, boundsRect, title, visible, procID, behind,  \
  335.     goAwayFlag, refCon, items)
  336.  
  337. #define getitext(item, text) getdialogitemtext(item, text)
  338.  
  339. #define setitext(item, text) setdialogitemtext(item, text)
  340.  
  341. #define findditem(theDialog, thePt) finddialogitem(theDialog, thePt)
  342.  
  343. #endif
  344.  
  345. #ifdef __cplusplus
  346. }
  347. #endif
  348.  
  349. #endif
  350.  
  351.