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

  1. /*
  2.     File:        Windows.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 __WINDOWS__
  13. #define __WINDOWS__
  14.  
  15. #ifndef __QUICKDRAW__
  16. #include <Quickdraw.h>
  17. /*    #include <Types.h>                                            */
  18. /*        #include <ConditionalMacros.h>                            */
  19. /*        #include <MixedMode.h>                                    */
  20. /*            #include <Traps.h>                                    */
  21. /*    #include <QuickdrawText.h>                                    */
  22. /*        #include <IntlResources.h>                                */
  23. #endif
  24.  
  25. #ifndef __EVENTS__
  26. #include <Events.h>
  27. /*    #include <OSUtils.h>                                        */
  28. #endif
  29.  
  30. #ifndef __CONTROLS__
  31. #include <Controls.h>
  32. /*    #include <Menus.h>                                            */
  33. #endif
  34.  
  35. enum  {
  36.     documentProc                = 0,
  37.     dBoxProc                    = 1,
  38.     plainDBox                    = 2,
  39.     altDBoxProc                    = 3,
  40.     noGrowDocProc                = 4,
  41.     movableDBoxProc                = 5,
  42.     zoomDocProc                    = 8,
  43.     zoomNoGrow                    = 12,
  44.     rDocProc                    = 16,
  45.     dialogKind                    = 2,
  46.     userKind                    = 8,
  47. /*FindWindow Result Codes*/
  48.     inDesk                        = 0,
  49.     inMenuBar                    = 1,
  50.     inSysWindow                    = 2,
  51.     inContent                    = 3,
  52.     inDrag                        = 4,
  53.     inGrow                        = 5,
  54.     inGoAway                    = 6,
  55.     inZoomIn                    = 7,
  56.     inZoomOut                    = 8
  57. };
  58.  
  59. enum  {
  60. /*window messages*/
  61.     wDraw                        = 0,
  62.     wHit                        = 1,
  63.     wCalcRgns                    = 2,
  64.     wNew                        = 3,
  65.     wDispose                    = 4,
  66.     wGrow                        = 5,
  67.     wDrawGIcon                    = 6,
  68. /*defProc hit test codes*/
  69.     wNoHit                        = 0,
  70.     wInContent                    = 1,
  71.     wInDrag                        = 2,
  72.     wInGrow                        = 3,
  73.     wInGoAway                    = 4,
  74.     wInZoomIn                    = 5,
  75.     wInZoomOut                    = 6,
  76.     deskPatID                    = 16,
  77. /*Window Part Identifiers which correlate color table entries with window elements*/
  78.     wContentColor                = 0,
  79.     wFrameColor                    = 1,
  80.     wTextColor                    = 2,
  81.     wHiliteColor                = 3,
  82.     wTitleBarColor                = 4
  83. };
  84.  
  85. typedef pascal void (*DragGrayRgnProcPtr)(void);
  86.  
  87. enum {
  88.     uppDragGrayRgnProcInfo = kPascalStackBased
  89. };
  90.  
  91. #if USESROUTINEDESCRIPTORS
  92. typedef UniversalProcPtr DragGrayRgnUPP;
  93.  
  94. #define CallDragGrayRgnProc(userRoutine)        \
  95.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDragGrayRgnProcInfo)
  96. #define NewDragGrayRgnProc(userRoutine)        \
  97.         (DragGrayRgnUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragGrayRgnProcInfo, GetCurrentISA())
  98. #else
  99. typedef DragGrayRgnProcPtr DragGrayRgnUPP;
  100.  
  101. #define CallDragGrayRgnProc(userRoutine)        \
  102.         (*(userRoutine))()
  103. #define NewDragGrayRgnProc(userRoutine)        \
  104.         (DragGrayRgnUPP)(userRoutine)
  105. #endif
  106.  
  107. #if defined(powerc) || defined (__powerc)
  108. #pragma options align=mac68k
  109. #endif
  110. struct WindowRecord {
  111.     GrafPort                    port;
  112.     short                        windowKind;
  113.     Boolean                        visible;
  114.     Boolean                        hilited;
  115.     Boolean                        goAwayFlag;
  116.     Boolean                        spareFlag;
  117.     RgnHandle                    strucRgn;
  118.     RgnHandle                    contRgn;
  119.     RgnHandle                    updateRgn;
  120.     Handle                        windowDefProc;
  121.     Handle                        dataHandle;
  122.     StringHandle                titleHandle;
  123.     short                        titleWidth;
  124.     ControlHandle                controlList;
  125.     struct WindowRecord            *nextWindow;
  126.     PicHandle                    windowPic;
  127.     long                        refCon;
  128. };
  129. #if defined(powerc) || defined(__powerc)
  130. #pragma options align=reset
  131. #endif
  132.  
  133. typedef struct WindowRecord WindowRecord;
  134.  
  135. typedef WindowRecord *WindowPeek;
  136.  
  137. #if defined(powerc) || defined (__powerc)
  138. #pragma options align=mac68k
  139. #endif
  140. struct CWindowRecord {
  141.     CGrafPort                    port;
  142.     short                        windowKind;
  143.     Boolean                        visible;
  144.     Boolean                        hilited;
  145.     Boolean                        goAwayFlag;
  146.     Boolean                        spareFlag;
  147.     RgnHandle                    strucRgn;
  148.     RgnHandle                    contRgn;
  149.     RgnHandle                    updateRgn;
  150.     Handle                        windowDefProc;
  151.     Handle                        dataHandle;
  152.     StringHandle                titleHandle;
  153.     short                        titleWidth;
  154.     ControlHandle                controlList;
  155.     struct CWindowRecord        *nextWindow;
  156.     PicHandle                    windowPic;
  157.     long                        refCon;
  158. };
  159. #if defined(powerc) || defined(__powerc)
  160. #pragma options align=reset
  161. #endif
  162.  
  163. typedef struct CWindowRecord CWindowRecord;
  164.  
  165. typedef CWindowRecord *CWindowPeek;
  166.  
  167. typedef pascal long (*WindowDefProcPtr)(short varCode, WindowPtr theWindow, short message, long param);
  168.  
  169. enum {
  170.     uppWindowDefProcInfo = kPascalStackBased
  171.          | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  172.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short)))
  173.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(WindowPtr)))
  174.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short)))
  175.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
  176. };
  177.  
  178. #if USESROUTINEDESCRIPTORS
  179. typedef UniversalProcPtr WindowDefUPP;
  180.  
  181. #define CallWindowDefProc(userRoutine, varCode, theWindow, message, param)        \
  182.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppWindowDefProcInfo, (varCode), (theWindow), (message), (param))
  183. #define NewWindowDefProc(userRoutine)        \
  184.         (WindowDefUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppWindowDefProcInfo, GetCurrentISA())
  185. #else
  186. typedef WindowDefProcPtr WindowDefUPP;
  187.  
  188. #define CallWindowDefProc(userRoutine, varCode, theWindow, message, param)        \
  189.         (*(userRoutine))((varCode), (theWindow), (message), (param))
  190. #define NewWindowDefProc(userRoutine)        \
  191.         (WindowDefUPP)(userRoutine)
  192. #endif
  193.  
  194. #if defined(powerc) || defined (__powerc)
  195. #pragma options align=mac68k
  196. #endif
  197. struct WStateData {
  198.     Rect                        userState;                        /*user state*/
  199.     Rect                        stdState;                        /*standard state*/
  200. };
  201. #if defined(powerc) || defined(__powerc)
  202. #pragma options align=reset
  203. #endif
  204.  
  205. typedef struct WStateData WStateData;
  206.  
  207. typedef WStateData *WStateDataPtr, **WStateDataHandle;
  208.  
  209. #if defined(powerc) || defined (__powerc)
  210. #pragma options align=mac68k
  211. #endif
  212. struct AuxWinRec {
  213.     struct AuxWinRec            **awNext;                        /*handle to next AuxWinRec*/
  214.     WindowPtr                    awOwner;                        /*ptr to window */
  215.     CTabHandle                    awCTable;                        /*color table for this window*/
  216.     Handle                        dialogCItem;                    /*handle to dialog manager structures*/
  217.     long                        awFlags;                        /*reserved for expansion*/
  218.     CTabHandle                    awReserved;                        /*reserved for expansion*/
  219.     long                        awRefCon;                        /*user Constant*/
  220. };
  221. #if defined(powerc) || defined(__powerc)
  222. #pragma options align=reset
  223. #endif
  224.  
  225. typedef struct AuxWinRec AuxWinRec;
  226.  
  227. typedef AuxWinRec *AuxWinPtr, **AuxWinHandle;
  228.  
  229. #if defined(powerc) || defined (__powerc)
  230. #pragma options align=mac68k
  231. #endif
  232. struct WinCTab {
  233.     long                        wCSeed;                            /*reserved*/
  234.     short                        wCReserved;                        /*reserved*/
  235.     short                        ctSize;                            /*usually 4 for windows*/
  236.     ColorSpec                    ctTable[5];
  237. };
  238. #if defined(powerc) || defined(__powerc)
  239. #pragma options align=reset
  240. #endif
  241.  
  242. typedef struct WinCTab WinCTab;
  243.  
  244. typedef WinCTab *WCTabPtr, **WCTabHandle;
  245.  
  246.  
  247. /*
  248.     DeskHookProcs cannot be written in or called from a high-level 
  249.     language without the help of mixed mode or assembly glue because they 
  250.     use the following parameter-passing convention:
  251.  
  252.     typedef pascal void (*DeskHookProcPtr)(Boolean mouseClick, EventRecord *theEvent);
  253.  
  254.         In:
  255.             =>     mouseClick                D0.B
  256.             =>     theEvent                A0.L
  257.         Out:
  258.             none
  259. */
  260.  
  261. enum  {
  262.     uppDeskHookProcInfo            = kRegisterBased|REGISTER_ROUTINE_PARAMETER(1,kRegisterD0,kOneByteCode)|REGISTER_ROUTINE_PARAMETER(2,kRegisterA0,kFourByteCode)
  263. };
  264.  
  265. #if USESROUTINEDESCRIPTORS
  266. typedef pascal void (*DeskHookProcPtr)(Boolean mouseClick, EventRecord *theEvent);
  267.  
  268. typedef UniversalProcPtr DeskHookUPP;
  269.  
  270. #define CallDeskHookProc(userRoutine, mouseClick, theEvent)  \
  271.     CallUniversalProc((UniversalProcPtr)(userRoutine), uppDeskHookProcInfo, (mouseClick), (theEvent))
  272.  
  273. #define NewDeskHookProc(userRoutine)  \
  274.     (DeskHookUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDeskHookProcInfo, GetCurrentISA())
  275.  
  276. #else
  277. typedef ProcPtr DeskHookUPP;
  278.  
  279. #define NewDeskHookProc(userRoutine)  \
  280.     (DeskHookUPP)(userRoutine)
  281.  
  282. #endif
  283.  
  284. #ifdef __cplusplus
  285. extern "C" {
  286. #endif
  287.  
  288. #if USESCODEFRAGMENTS
  289. extern pascal RgnHandle GetGrayRgn(void);
  290. #else
  291. #define GetGrayRgn() (* (RgnHandle*) 0x09EE)
  292.  
  293. #endif
  294.  
  295. extern pascal void InitWindows(void)
  296.  ONEWORDINLINE(0xA912);
  297. extern pascal void GetWMgrPort(GrafPtr *wPort)
  298.  ONEWORDINLINE(0xA910);
  299. extern pascal WindowPtr NewWindow(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short theProc, WindowPtr behind, Boolean goAwayFlag, long refCon)
  300.  ONEWORDINLINE(0xA913);
  301. extern pascal WindowPtr GetNewWindow(short windowID, void *wStorage, WindowPtr behind)
  302.  ONEWORDINLINE(0xA9BD);
  303. extern pascal void CloseWindow(WindowPtr theWindow)
  304.  ONEWORDINLINE(0xA92D);
  305. extern pascal void DisposeWindow(WindowPtr theWindow)
  306.  ONEWORDINLINE(0xA914);
  307. extern void setwtitle(WindowPtr theWindow, char *title);
  308. extern pascal void GetWTitle(WindowPtr theWindow, Str255 title)
  309.  ONEWORDINLINE(0xA919);
  310. extern pascal void SelectWindow(WindowPtr theWindow)
  311.  ONEWORDINLINE(0xA91F);
  312. extern pascal void HideWindow(WindowPtr theWindow)
  313.  ONEWORDINLINE(0xA916);
  314. extern pascal void ShowWindow(WindowPtr theWindow)
  315.  ONEWORDINLINE(0xA915);
  316. extern pascal void ShowHide(WindowPtr theWindow, Boolean showFlag)
  317.  ONEWORDINLINE(0xA908);
  318. extern pascal void HiliteWindow(WindowPtr theWindow, Boolean fHilite)
  319.  ONEWORDINLINE(0xA91C);
  320. extern pascal void BringToFront(WindowPtr theWindow)
  321.  ONEWORDINLINE(0xA920);
  322. extern pascal void SendBehind(WindowPtr theWindow, WindowPtr behindWindow)
  323.  ONEWORDINLINE(0xA921);
  324. extern pascal WindowPtr FrontWindow(void)
  325.  ONEWORDINLINE(0xA924);
  326. extern pascal void DrawGrowIcon(WindowPtr theWindow)
  327.  ONEWORDINLINE(0xA904);
  328. extern pascal void MoveWindow(WindowPtr theWindow, short hGlobal, short vGlobal, Boolean front)
  329.  ONEWORDINLINE(0xA91B);
  330. extern pascal void SizeWindow(WindowPtr theWindow, short w, short h, Boolean fUpdate)
  331.  ONEWORDINLINE(0xA91D);
  332. extern pascal void ZoomWindow(WindowPtr theWindow, short partCode, Boolean front)
  333.  ONEWORDINLINE(0xA83A);
  334. extern pascal void InvalRect(const Rect *badRect)
  335.  ONEWORDINLINE(0xA928);
  336. extern pascal void InvalRgn(RgnHandle badRgn)
  337.  ONEWORDINLINE(0xA927);
  338. extern pascal void ValidRect(const Rect *goodRect)
  339.  ONEWORDINLINE(0xA92A);
  340. extern pascal void ValidRgn(RgnHandle goodRgn)
  341.  ONEWORDINLINE(0xA929);
  342. extern pascal void BeginUpdate(WindowPtr theWindow)
  343.  ONEWORDINLINE(0xA922);
  344. extern pascal void EndUpdate(WindowPtr theWindow)
  345.  ONEWORDINLINE(0xA923);
  346. extern pascal void SetWRefCon(WindowPtr theWindow, long data)
  347.  ONEWORDINLINE(0xA918);
  348. extern pascal long GetWRefCon(WindowPtr theWindow)
  349.  ONEWORDINLINE(0xA917);
  350. extern pascal void SetWindowPic(WindowPtr theWindow, PicHandle pic)
  351.  ONEWORDINLINE(0xA92E);
  352. extern pascal PicHandle GetWindowPic(WindowPtr theWindow)
  353.  ONEWORDINLINE(0xA92F);
  354. extern pascal Boolean CheckUpdate(EventRecord *theEvent)
  355.  ONEWORDINLINE(0xA911);
  356. extern pascal void ClipAbove(WindowPeek window)
  357.  ONEWORDINLINE(0xA90B);
  358. extern pascal void SaveOld(WindowPeek window)
  359.  ONEWORDINLINE(0xA90E);
  360. extern pascal void DrawNew(WindowPeek window, Boolean update)
  361.  ONEWORDINLINE(0xA90F);
  362. extern pascal void PaintOne(WindowPeek window, RgnHandle clobberedRgn)
  363.  ONEWORDINLINE(0xA90C);
  364. extern pascal void PaintBehind(WindowPeek startWindow, RgnHandle clobberedRgn)
  365.  ONEWORDINLINE(0xA90D);
  366. extern pascal void CalcVis(WindowPeek window)
  367.  ONEWORDINLINE(0xA909);
  368. extern pascal void CalcVisBehind(WindowPeek startWindow, RgnHandle clobberedRgn)
  369.  ONEWORDINLINE(0xA90A);
  370. extern pascal long GrowWindow(WindowPtr theWindow, Point startPt, const Rect *bBox)
  371.  ONEWORDINLINE(0xA92B);
  372. extern Boolean trackgoaway(WindowPtr theWindow, Point *thePt);
  373. extern pascal short FindWindow(Point thePoint, WindowPtr *theWindow)
  374.  ONEWORDINLINE(0xA92C);
  375. extern short findwindow(Point *thePoint, WindowPtr *theWindow);
  376. extern pascal long PinRect(const Rect *theRect, Point thePt)
  377.  ONEWORDINLINE(0xA94E);
  378. extern pascal long DragGrayRgn(RgnHandle theRgn, Point startPt, const Rect *limitRect, const Rect *slopRect, short axis, DragGrayRgnUPP actionProc)
  379.  ONEWORDINLINE(0xA905);
  380. extern pascal long DragTheRgn(RgnHandle theRgn, Point startPt, const Rect *limitRect, const Rect *slopRect, short axis, DragGrayRgnUPP actionProc)
  381.  ONEWORDINLINE(0xA926);
  382. extern pascal Boolean TrackBox(WindowPtr theWindow, Point thePt, short partCode)
  383.  ONEWORDINLINE(0xA83B);
  384. extern pascal void GetCWMgrPort(CGrafPtr *wMgrCPort)
  385.  ONEWORDINLINE(0xAA48);
  386. extern void getwtitle(WindowPtr theWindow, char *title);
  387. extern pascal void SetWinColor(WindowPtr theWindow, WCTabHandle newColorTable)
  388.  ONEWORDINLINE(0xAA41);
  389. extern pascal Boolean GetAuxWin(WindowPtr theWindow, AuxWinHandle *awHndl)
  390.  ONEWORDINLINE(0xAA42);
  391. extern long growwindow(WindowPtr theWindow, Point *startPt, const Rect *bBox);
  392. extern pascal void SetDeskCPat(PixPatHandle deskPixPat)
  393.  ONEWORDINLINE(0xAA47);
  394. extern WindowPtr newwindow(void *wStorage, const Rect *boundsRect, char *title, Boolean visible, short theProc, WindowPtr behind, Boolean goAwayFlag, long refCon);
  395. extern pascal WindowPtr NewCWindow(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short procID, WindowPtr behind, Boolean goAwayFlag, long refCon)
  396.  ONEWORDINLINE(0xAA45);
  397. extern WindowPtr newcwindow(void *wStorage, const Rect *boundsRect, char *title, Boolean visible, short procID, WindowPtr behind, Boolean goAwayFlag, long refCon);
  398. extern pascal WindowPtr GetNewCWindow(short windowID, void *wStorage, WindowPtr behind)
  399.  ONEWORDINLINE(0xAA46);
  400. extern pascal short GetWVariant(WindowPtr theWindow)
  401.  ONEWORDINLINE(0xA80A);
  402. extern long pinrect(const Rect *theRect, Point *thePt);
  403. extern pascal void SetWTitle(WindowPtr theWindow, ConstStr255Param title)
  404.  ONEWORDINLINE(0xA91A);
  405. extern Boolean trackbox(WindowPtr theWindow, Point *thePt, short partCode);
  406. extern pascal Boolean TrackGoAway(WindowPtr theWindow, Point thePt)
  407.  ONEWORDINLINE(0xA91E);
  408. extern pascal void DragWindow(WindowPtr theWindow, Point startPt, const Rect *boundsRect)
  409.  ONEWORDINLINE(0xA925);
  410. extern long draggrayrgn(RgnHandle theRgn, Point *startPt, const Rect *boundsRect, const Rect *slopRect, short axis, DragGrayRgnUPP actionProc);
  411. extern void dragwindow(WindowPtr theWindow, Point *startPt, const Rect *boundsRect);
  412. #ifdef __cplusplus
  413. }
  414. #endif
  415.  
  416. #endif
  417.  
  418.