home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 April: Mac OS SDK / Dev.CD Apr 00 SDK1.toast / Development Kits / Mac OS / Appearance SDK 1.0.4 / Appearance Sample Code / Headers / CIncludes / MacWindows.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-07-16  |  36.7 KB  |  1,137 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        MacWindows.h
  3.  
  4.      Contains:    Window Manager Interfaces.
  5.  
  6.      Version:    Technology:    Appearance 1.0.2
  7.                  Release:    To be used with Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __MACWINDOWS__
  19. #define __MACWINDOWS__
  20.  
  21. #ifndef __ALIASES__
  22. #include <Aliases.h>
  23. #endif
  24. #ifndef __APPLEEVENTS__
  25. #include <AppleEvents.h>
  26. #endif
  27. #ifndef __COLLECTIONS__
  28. #include <Collections.h>
  29. #endif
  30. #ifndef __DRAG__
  31. #include <Drag.h>
  32. #endif
  33. #ifndef __EVENTS__
  34. #include <Events.h>
  35. #endif
  36. #ifndef __MIXEDMODE__
  37. #include <MixedMode.h>
  38. #endif
  39. #ifndef __QDOFFSCREEN__
  40. #include <QDOffscreen.h>
  41. #endif
  42. #ifndef __QUICKDRAW__
  43. #include <Quickdraw.h>
  44. #endif
  45. #ifndef __TEXTCOMMON__
  46. #include <TextCommon.h>
  47. #endif
  48. #ifndef __TYPES__
  49. #include <Types.h>
  50. #endif
  51.  
  52.  
  53.  
  54. #if PRAGMA_ONCE
  55. #pragma once
  56. #endif
  57.  
  58. #ifdef __cplusplus
  59. extern "C" {
  60. #endif
  61.  
  62. #if PRAGMA_IMPORT
  63. #pragma import on
  64. #endif
  65.  
  66. #if PRAGMA_STRUCT_ALIGN
  67.     #pragma options align=mac68k
  68. #elif PRAGMA_STRUCT_PACKPUSH
  69.     #pragma pack(push, 2)
  70. #elif PRAGMA_STRUCT_PACK
  71.     #pragma pack(2)
  72. #endif
  73.  
  74. /*
  75.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  76.    • Window Definition Type
  77.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  78. */
  79.  
  80. enum {
  81.     kWindowDefProcType            = FOUR_CHAR_CODE('WDEF')
  82. };
  83.  
  84. /*
  85.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  86.    • Window Definition ID’s
  87.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  88. */
  89.  
  90.  
  91. enum {
  92.     kStandardWindowDefinition    = 0,                            /* for document windows and dialogs*/
  93.     kRoundWindowDefinition        = 1,                            /* old da-style window*/
  94.     kFloatingWindowDefinition    = 124                            /* for floating windows*/
  95. };
  96.  
  97. /*
  98.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  99.    • Variant Codes
  100.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  101. */
  102.  
  103. enum {
  104.                                                                 /* for use with kStandardWindowDefinition */
  105.     kDocumentWindowVariantCode    = 0,
  106.     kModalDialogVariantCode        = 1,
  107.     kPlainDialogVariantCode        = 2,
  108.     kShadowDialogVariantCode    = 3,
  109.     kMovableModalDialogVariantCode = 5,
  110.     kAlertVariantCode            = 7,
  111.     kMovableAlertVariantCode    = 9,                            /* for use with kFloatingWindowDefinition */
  112.     kSideFloaterVariantCode        = 8
  113. };
  114.  
  115.  
  116. /*
  117.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  118.    • DefProc ID’s
  119.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  120. */
  121.  
  122.  
  123. enum {
  124.     documentProc                = 0,
  125.     dBoxProc                    = 1,
  126.     plainDBox                    = 2,
  127.     altDBoxProc                    = 3,
  128.     noGrowDocProc                = 4,
  129.     movableDBoxProc                = 5,
  130.     zoomDocProc                    = 8,
  131.     zoomNoGrow                    = 12,
  132.     rDocProc                    = 16,                            /* floating window defproc ids */
  133.     floatProc                    = 1985,
  134.     floatGrowProc                = 1987,
  135.     floatZoomProc                = 1989,
  136.     floatZoomGrowProc            = 1991,
  137.     floatSideProc                = 1993,
  138.     floatSideGrowProc            = 1995,
  139.     floatSideZoomProc            = 1997,
  140.     floatSideZoomGrowProc        = 1999
  141. };
  142.  
  143.  
  144. enum {
  145.                                                                 /* Resource IDs for theme-savvy window defprocs */
  146.     kWindowDocumentDefProcResID    = 64,
  147.     kWindowDialogDefProcResID    = 65,
  148.     kWindowUtilityDefProcResID    = 66,
  149.     kWindowUtilitySideTitleDefProcResID = 67
  150. };
  151.  
  152.  
  153. enum {
  154.                                                                 /* Proc IDs for theme-savvy windows */
  155.     kWindowDocumentProc            = 1024,
  156.     kWindowGrowDocumentProc        = 1025,
  157.     kWindowVertZoomDocumentProc    = 1026,
  158.     kWindowVertZoomGrowDocumentProc = 1027,
  159.     kWindowHorizZoomDocumentProc = 1028,
  160.     kWindowHorizZoomGrowDocumentProc = 1029,
  161.     kWindowFullZoomDocumentProc    = 1030,
  162.     kWindowFullZoomGrowDocumentProc = 1031
  163. };
  164.  
  165.  
  166. enum {
  167.                                                                 /* Proc IDs for theme-savvy dialogs */
  168.     kWindowPlainDialogProc        = 1040,
  169.     kWindowShadowDialogProc        = 1041,
  170.     kWindowModalDialogProc        = 1042,
  171.     kWindowMovableModalDialogProc = 1043,
  172.     kWindowAlertProc            = 1044,
  173.     kWindowMovableAlertProc        = 1045
  174. };
  175.  
  176. /* procIDs available in Appearance 1.0.1 or later */
  177.  
  178. enum {
  179.     kWindowMovableModalGrowProc    = 1046
  180. };
  181.  
  182.  
  183. enum {
  184.                                                                 /* Proc IDs for top title bar theme-savvy floating windows */
  185.     kWindowFloatProc            = 1057,
  186.     kWindowFloatGrowProc        = 1059,
  187.     kWindowFloatVertZoomProc    = 1061,
  188.     kWindowFloatVertZoomGrowProc = 1063,
  189.     kWindowFloatHorizZoomProc    = 1065,
  190.     kWindowFloatHorizZoomGrowProc = 1067,
  191.     kWindowFloatFullZoomProc    = 1069,
  192.     kWindowFloatFullZoomGrowProc = 1071
  193. };
  194.  
  195.  
  196.  
  197. enum {
  198.                                                                 /* Proc IDs for side title bar theme-savvy floating windows */
  199.     kWindowFloatSideProc        = 1073,
  200.     kWindowFloatSideGrowProc    = 1075,
  201.     kWindowFloatSideVertZoomProc = 1077,
  202.     kWindowFloatSideVertZoomGrowProc = 1079,
  203.     kWindowFloatSideHorizZoomProc = 1081,
  204.     kWindowFloatSideHorizZoomGrowProc = 1083,
  205.     kWindowFloatSideFullZoomProc = 1085,
  206.     kWindowFloatSideFullZoomGrowProc = 1087
  207. };
  208.  
  209.  
  210. /* Window positioning constants */
  211.  
  212. enum {
  213.     kWindowNoPosition            = 0x00000000,                    /* these are passed into StandardAlert and used in WIND, DLOG, and ALRT templates*/
  214.     kWindowDefaultPosition        = 0x0000,
  215.     kWindowCenterMainScreen        = 0x280A,
  216.     kWindowAlertPositionMainScreen = 0x300A,
  217.     kWindowStaggerMainScreen    = 0x380A,
  218.     kWindowCenterParentWindow    = 0xA80A,
  219.     kWindowAlertPositionParentWindow = 0xB00A,
  220.     kWindowStaggerParentWindow    = 0xB80A,
  221.     kWindowCenterParentWindowScreen = 0x680A,
  222.     kWindowAlertPositionParentWindowScreen = 0x700A,
  223.     kWindowStaggerParentWindowScreen = 0x780A
  224. };
  225.  
  226. /*
  227.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  228.    • GetWindowRegion Types
  229.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  230. */
  231.  
  232.  
  233.  
  234. enum {
  235.                                                                 /* Region values to pass into GetWindowRegion */
  236.     kWindowTitleBarRgn            = 0,
  237.     kWindowTitleTextRgn            = 1,
  238.     kWindowCloseBoxRgn            = 2,
  239.     kWindowZoomBoxRgn            = 3,
  240.     kWindowDragRgn                = 5,
  241.     kWindowGrowRgn                = 6,
  242.     kWindowCollapseBoxRgn        = 7,
  243.     kWindowStructureRgn            = 32,
  244.     kWindowContentRgn            = 33
  245. };
  246.  
  247. typedef UInt16                             WindowRegionCode;
  248. /* GetWindowRegionRec - used for WDEF calls with kWindowMsgGetRegion */
  249. struct GetWindowRegionRec {
  250.     RgnHandle                         winRgn;
  251.     WindowRegionCode                 regionCode;
  252. };
  253. typedef struct GetWindowRegionRec GetWindowRegionRec;
  254.  
  255. typedef GetWindowRegionRec *            GetWindowRegionPtr;
  256.  
  257. /*
  258.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  259.    • Standard Window Kinds
  260.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  261. */
  262.  
  263.  
  264. enum {
  265.     dialogKind                    = 2,
  266.     userKind                    = 8,
  267.     kDialogWindowKind            = 2,
  268.     kApplicationWindowKind        = 8
  269. };
  270.  
  271.  
  272. /*
  273.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  274.    • FindWindow Result Codes
  275.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  276. */
  277.  
  278.  
  279. enum {
  280.     inDesk                        = 0,
  281.     inNoWindow                    = 0,
  282.     inMenuBar                    = 1,
  283.     inSysWindow                    = 2,
  284.     inContent                    = 3,
  285.     inDrag                        = 4,
  286.     inGrow                        = 5,
  287.     inGoAway                    = 6,
  288.     inZoomIn                    = 7,
  289.     inZoomOut                    = 8,
  290.     inCollapseBox                = 11
  291. };
  292.  
  293. /*
  294.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  295.    • Window Definition Hit Test Result Codes
  296.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  297. */
  298.  
  299. enum {
  300.     wNoHit                        = 0,
  301.     wInContent                    = 1,
  302.     wInDrag                        = 2,
  303.     wInGrow                        = 3,
  304.     wInGoAway                    = 4,
  305.     wInZoomIn                    = 5,
  306.     wInZoomOut                    = 6,
  307.     wInCollapseBox                = 9
  308. };
  309.  
  310. /*
  311.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  312.    • Window Definition Messages
  313.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  314. */
  315.  
  316.  
  317.  
  318. enum {
  319.     kWindowMsgDraw                = 0,
  320.     kWindowMsgHitTest            = 1,
  321.     kWindowMsgCalculateShape    = 2,
  322.     kWindowMsgInitialize        = 3,
  323.     kWindowMsgCleanUp            = 4,
  324.     kWindowMsgDrawGrowOutline    = 5,
  325.     kWindowMsgDrawGrowBox        = 6,
  326.     kWindowMsgGetFeatures        = 7,
  327.     kWindowMsgGetRegion            = 8,                            /* old names*/
  328.     wDraw                        = 0,
  329.     wHit                        = 1,
  330.     wCalcRgns                    = 2,
  331.     wNew                        = 3,
  332.     wDispose                    = 4,
  333.     wGrow                        = 5,
  334.     wDrawGIcon                    = 6
  335. };
  336.  
  337.  
  338. /*
  339.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  340.    • Window Features
  341.       returned by GetWindowFeatures
  342.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  343. */
  344.  
  345.  
  346. enum {
  347.     kWindowCanGrow                = (1 << 0),
  348.     kWindowCanZoom                = (1 << 1),
  349.     kWindowCanCollapse            = (1 << 2),
  350.     kWindowIsModal                = (1 << 3),
  351.     kWindowCanGetWindowRegion    = (1 << 4),
  352.     kWindowIsAlert                = (1 << 5),
  353.     kWindowHasTitleBar            = (1 << 6)
  354. };
  355.  
  356.  
  357. /*
  358.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  359.    • Probably don’t need this
  360.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  361. */
  362.  
  363.  
  364. enum {
  365.     deskPatID                    = 16
  366. };
  367.  
  368.  
  369.  
  370. /*
  371.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  372.    • Window Color Part Codes
  373.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  374. */
  375.  
  376.  
  377. enum {
  378.     wContentColor                = 0,
  379.     wFrameColor                    = 1,
  380.     wTextColor                    = 2,
  381.     wHiliteColor                = 3,
  382.     wTitleBarColor                = 4
  383. };
  384.  
  385.  
  386. /*
  387.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  388.       • Region Dragging Types
  389.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  390. */
  391.  
  392.  
  393.  
  394. enum {
  395.     kMouseUpOutOfSlop            = (long)0x80008000
  396. };
  397.  
  398. /*
  399.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  400.    • Window Color Table
  401.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  402. */
  403. struct WinCTab {
  404.     long                             wCSeed;                        /* reserved */
  405.     short                             wCReserved;                    /* reserved */
  406.     short                             ctSize;                        /* usually 4 for windows */
  407.     ColorSpec                         ctTable[5];
  408. };
  409. typedef struct WinCTab WinCTab;
  410.  
  411. typedef WinCTab *                        WCTabPtr;
  412. typedef WCTabPtr *                        WCTabHandle;
  413. /*
  414.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  415.    • WindowRecord
  416.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  417. */
  418. typedef struct WindowRecord             WindowRecord;
  419. typedef WindowRecord *                    WindowPeek;
  420. struct WindowRecord {
  421.     GrafPort                         port;
  422.     short                             windowKind;
  423.     Boolean                         visible;
  424.     Boolean                         hilited;
  425.     Boolean                         goAwayFlag;
  426.     Boolean                         spareFlag;
  427.     RgnHandle                         strucRgn;
  428.     RgnHandle                         contRgn;
  429.     RgnHandle                         updateRgn;
  430.     Handle                             windowDefProc;
  431.     Handle                             dataHandle;
  432.     StringHandle                     titleHandle;
  433.     short                             titleWidth;
  434.     Handle                             controlList;
  435.     WindowPeek                         nextWindow;
  436.     PicHandle                         windowPic;
  437.     long                             refCon;
  438. };
  439.  
  440. /*
  441.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  442.    • Color WindowRecord
  443.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  444. */
  445. typedef struct CWindowRecord             CWindowRecord;
  446. typedef CWindowRecord *                    CWindowPeek;
  447. struct CWindowRecord {
  448.     CGrafPort                         port;
  449.     short                             windowKind;
  450.     Boolean                         visible;
  451.     Boolean                         hilited;
  452.     Boolean                         goAwayFlag;
  453.     Boolean                         spareFlag;
  454.     RgnHandle                         strucRgn;
  455.     RgnHandle                         contRgn;
  456.     RgnHandle                         updateRgn;
  457.     Handle                             windowDefProc;
  458.     Handle                             dataHandle;
  459.     StringHandle                     titleHandle;
  460.     short                             titleWidth;
  461.     Handle                             controlList;
  462.     CWindowPeek                     nextWindow;
  463.     PicHandle                         windowPic;
  464.     long                             refCon;
  465. };
  466.  
  467. /*
  468.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  469.    • AuxWinHandle
  470.       Windows do not necessarily have associated AuxWinHandles at this stage.
  471.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  472. */
  473. typedef struct AuxWinRec                 AuxWinRec;
  474. typedef AuxWinRec *                        AuxWinPtr;
  475. typedef AuxWinPtr *                        AuxWinHandle;
  476. struct AuxWinRec {
  477.     AuxWinHandle                     awNext;                        /*handle to next AuxWinRec*/
  478.     WindowPtr                         awOwner;                    /*ptr to window */
  479.     CTabHandle                         awCTable;                    /*color table for this window*/
  480.     Handle                             reserved;
  481.     long                             awFlags;                    /*reserved for expansion*/
  482.     CTabHandle                         awReserved;                    /*reserved for expansion*/
  483.     long                             awRefCon;                    /*user Constant*/
  484. };
  485.  
  486.  
  487. /*
  488.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  489.    • Window Class Ordering
  490.       These constants are special cases passed in the “behind” parameter to
  491.       several window manager calls.
  492.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  493. */
  494.  
  495. #ifndef __cplusplus
  496.  
  497. enum {
  498.     kFirstWindowOfClass            = (-1),
  499.     kLastWindowOfClass            = 0
  500. };
  501.  
  502. #else
  503. const WindowPtr        kFirstWindowOfClass            = (WindowPtr) -1;
  504. const WindowPtr        kLastWindowOfClass            = (WindowPtr) 0L;
  505. #endif  /*  ! defined(__cplusplus)  */
  506.  
  507. /*
  508.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  509.    • Zoom Information Handle (WState)
  510.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  511. */
  512.  
  513. struct WStateData {
  514.     Rect                             userState;                    /*user zoom state*/
  515.     Rect                             stdState;                    /*standard zoom state*/
  516. };
  517. typedef struct WStateData WStateData;
  518.  
  519. typedef WStateData *                    WStateDataPtr;
  520. typedef WStateDataPtr *                    WStateDataHandle;
  521.  
  522. /*
  523.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  524.    • PopUpWindow Types
  525.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  526. */
  527.  
  528.  
  529. /*
  530.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  531.    • Window Creation & Persistence
  532.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  533. */
  534.  
  535. EXTERN_API( WindowPtr )
  536. GetNewCWindow                    (short                     windowID,
  537.                                  void *                    wStorage,
  538.                                  WindowPtr                 behind)                                ONEWORDINLINE(0xAA46);
  539.  
  540. EXTERN_API( WindowPtr )
  541. NewWindow                        (void *                    wStorage,
  542.                                  const Rect *            boundsRect,
  543.                                  ConstStr255Param         title,
  544.                                  Boolean                 visible,
  545.                                  short                     theProc,
  546.                                  WindowPtr                 behind,
  547.                                  Boolean                 goAwayFlag,
  548.                                  long                     refCon)                                ONEWORDINLINE(0xA913);
  549.  
  550. EXTERN_API( WindowPtr )
  551. GetNewWindow                    (short                     windowID,
  552.                                  void *                    wStorage,
  553.                                  WindowPtr                 behind)                                ONEWORDINLINE(0xA9BD);
  554.  
  555. EXTERN_API( WindowPtr )
  556. NewCWindow                        (void *                    wStorage,
  557.                                  const Rect *            boundsRect,
  558.                                  ConstStr255Param         title,
  559.                                  Boolean                 visible,
  560.                                  short                     procID,
  561.                                  WindowPtr                 behind,
  562.                                  Boolean                 goAwayFlag,
  563.                                  long                     refCon)                                ONEWORDINLINE(0xAA45);
  564.  
  565. EXTERN_API( void )
  566. DisposeWindow                    (WindowPtr                 theWindow)                            ONEWORDINLINE(0xA914);
  567.  
  568. EXTERN_API( void )
  569. CloseWindow                        (WindowPtr                 theWindow)                            ONEWORDINLINE(0xA92D);
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576. /*
  577.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  578.    • Background Imaging
  579.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  580. */
  581.  
  582. EXTERN_API( void )
  583. SetWinColor                        (WindowPtr                 theWindow,
  584.                                  WCTabHandle             newColorTable)                        ONEWORDINLINE(0xAA41);
  585.  
  586. EXTERN_API( void )
  587. SetDeskCPat                        (PixPatHandle             deskPixPat)                            ONEWORDINLINE(0xAA47);
  588.  
  589.  
  590.  
  591.  
  592. /*
  593.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  594.    • Low-Level
  595.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  596. */
  597.  
  598. EXTERN_API( void )
  599. ClipAbove                        (WindowPtr                 window)                                ONEWORDINLINE(0xA90B);
  600.  
  601. EXTERN_API( void )
  602. SaveOld                            (WindowPtr                 window)                                ONEWORDINLINE(0xA90E);
  603.  
  604. EXTERN_API( void )
  605. DrawNew                            (WindowPtr                 window,
  606.                                  Boolean                 update)                                ONEWORDINLINE(0xA90F);
  607.  
  608. EXTERN_API( void )
  609. PaintOne                        (WindowPtr                 window,
  610.                                  RgnHandle                 clobberedRgn)                        ONEWORDINLINE(0xA90C);
  611.  
  612. EXTERN_API( void )
  613. PaintBehind                        (WindowPtr                 startWindow,
  614.                                  RgnHandle                 clobberedRgn)                        ONEWORDINLINE(0xA90D);
  615.  
  616. EXTERN_API( void )
  617. CalcVis                            (WindowPtr                 window)                                ONEWORDINLINE(0xA909);
  618.  
  619. EXTERN_API( void )
  620. CalcVisBehind                    (WindowPtr                 startWindow,
  621.                                  RgnHandle                 clobberedRgn)                        ONEWORDINLINE(0xA90A);
  622.  
  623. EXTERN_API( Boolean )
  624. CheckUpdate                        (EventRecord *            theEvent)                            ONEWORDINLINE(0xA911);
  625.  
  626.  
  627.  
  628. /*
  629.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  630.    • Window List
  631.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  632. */
  633.  
  634. EXTERN_API( short )
  635. FindWindow                        (Point                     thePoint,
  636.                                  WindowPtr *            theWindow)                            ONEWORDINLINE(0xA92C);
  637.  
  638. EXTERN_API( WindowPtr )
  639. FrontWindow                        (void)                                                        ONEWORDINLINE(0xA924);
  640.  
  641. EXTERN_API( void )
  642. BringToFront                    (WindowPtr                 theWindow)                            ONEWORDINLINE(0xA920);
  643.  
  644. EXTERN_API( void )
  645. SendBehind                        (WindowPtr                 theWindow,
  646.                                  WindowPtr                 behindWindow)                        ONEWORDINLINE(0xA921);
  647.  
  648. EXTERN_API( void )
  649. SelectWindow                    (WindowPtr                 theWindow)                            ONEWORDINLINE(0xA91F);
  650.  
  651.  
  652. /*
  653.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  654.    • Misc
  655.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  656. */
  657.  
  658. EXTERN_API( void )
  659. InitWindows                        (void)                                                        ONEWORDINLINE(0xA912);
  660.  
  661. EXTERN_API( void )
  662. GetWMgrPort                        (GrafPtr *                wPort)                                ONEWORDINLINE(0xA910);
  663.  
  664. EXTERN_API( void )
  665. GetCWMgrPort                    (CGrafPtr *                wMgrCPort)                            ONEWORDINLINE(0xAA48);
  666.  
  667.  
  668.  
  669. /*
  670.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  671.    • Window Accessors
  672.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  673. */
  674.  
  675.  
  676. EXTERN_API( OSStatus )
  677. GetWindowFeatures                (WindowPtr                 inWindow,
  678.                                  UInt32 *                outFeatures)                        THREEWORDINLINE(0x303C, 0x0013, 0xAA74);
  679.  
  680. EXTERN_API( OSStatus )
  681. GetWindowRegion                    (WindowPtr                 inWindow,
  682.                                  WindowRegionCode         inRegionCode,
  683.                                  RgnHandle                 ioWinRgn)                            THREEWORDINLINE(0x303C, 0x0014, 0xAA74);
  684.  
  685.  
  686. EXTERN_API( void )
  687. SetWRefCon                        (WindowPtr                 theWindow,
  688.                                  long                     data)                                ONEWORDINLINE(0xA918);
  689.  
  690. EXTERN_API( long )
  691. GetWRefCon                        (WindowPtr                 theWindow)                            ONEWORDINLINE(0xA917);
  692.  
  693. EXTERN_API( void )
  694. SetWindowPic                    (WindowPtr                 theWindow,
  695.                                  PicHandle                 pic)                                ONEWORDINLINE(0xA92E);
  696.  
  697. EXTERN_API( PicHandle )
  698. GetWindowPic                    (WindowPtr                 theWindow)                            ONEWORDINLINE(0xA92F);
  699.  
  700. EXTERN_API( short )
  701. GetWVariant                        (WindowPtr                 theWindow)                            ONEWORDINLINE(0xA80A);
  702.  
  703. /*
  704.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  705.    • Update Events
  706.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  707. */
  708.  
  709. EXTERN_API( void )
  710. InvalRect                        (const Rect *            badRect)                            ONEWORDINLINE(0xA928);
  711.  
  712. EXTERN_API( void )
  713. InvalRgn                        (RgnHandle                 badRgn)                                ONEWORDINLINE(0xA927);
  714.  
  715. EXTERN_API( void )
  716. ValidRect                        (const Rect *            goodRect)                            ONEWORDINLINE(0xA92A);
  717.  
  718. EXTERN_API( void )
  719. ValidRgn                        (RgnHandle                 goodRgn)                            ONEWORDINLINE(0xA929);
  720.  
  721. EXTERN_API( void )
  722. BeginUpdate                        (WindowPtr                 theWindow)                            ONEWORDINLINE(0xA922);
  723.  
  724. EXTERN_API( void )
  725. EndUpdate                        (WindowPtr                 theWindow)                            ONEWORDINLINE(0xA923);
  726.  
  727.  
  728.  
  729. /*
  730.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  731.    • Misc Imaging Stuff
  732.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  733. */
  734.  
  735.  
  736.  
  737. EXTERN_API( void )
  738. DrawGrowIcon                    (WindowPtr                 theWindow)                            ONEWORDINLINE(0xA904);
  739.  
  740. EXTERN_API( void )
  741. HiliteWindow                    (WindowPtr                 theWindow,
  742.                                  Boolean                 fHilite)                            ONEWORDINLINE(0xA91C);
  743.  
  744.  
  745.  
  746.  
  747.  
  748. /*
  749.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  750.    • Window Titles & Document Support
  751.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  752. */
  753.  
  754. EXTERN_API( void )
  755. SetWTitle                        (WindowPtr                 theWindow,
  756.                                  ConstStr255Param         title)                                ONEWORDINLINE(0xA91A);
  757.  
  758. EXTERN_API( void )
  759. GetWTitle                        (WindowPtr                 theWindow,
  760.                                  Str255                 title)                                ONEWORDINLINE(0xA919);
  761.  
  762.  
  763.  
  764. /*
  765.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  766.    • Window Positioning
  767. */
  768. /*—————————————————————————————————————————————————————————————————————————————————————————————————————————*/
  769. EXTERN_API( Boolean )
  770. IsWindowCollapsable                (WindowPtr                 inWindow)                            THREEWORDINLINE(0x303C, 0x000F, 0xAA74);
  771.  
  772. EXTERN_API( Boolean )
  773. IsWindowCollapsed                (WindowPtr                 inWindow)                            THREEWORDINLINE(0x303C, 0x0010, 0xAA74);
  774.  
  775. EXTERN_API( OSStatus )
  776. CollapseWindow                    (WindowPtr                 inWindow,
  777.                                  Boolean                 inCollapseIt)                        THREEWORDINLINE(0x303C, 0x0011, 0xAA74);
  778.  
  779. EXTERN_API( OSStatus )
  780. CollapseAllWindows                (Boolean                 inCollapseEm)                        THREEWORDINLINE(0x303C, 0x0012, 0xAA74);
  781.  
  782. EXTERN_API( void )
  783. MoveWindow                        (WindowPtr                 theWindow,
  784.                                  short                     hGlobal,
  785.                                  short                     vGlobal,
  786.                                  Boolean                 front)                                ONEWORDINLINE(0xA91B);
  787.  
  788. EXTERN_API( void )
  789. SizeWindow                        (WindowPtr                 theWindow,
  790.                                  short                     w,
  791.                                  short                     h,
  792.                                  Boolean                 fUpdate)                            ONEWORDINLINE(0xA91D);
  793.  
  794.  
  795. EXTERN_API( void )
  796. ZoomWindow                        (WindowPtr                 theWindow,
  797.                                  short                     partCode,
  798.                                  Boolean                 front)                                ONEWORDINLINE(0xA83A);
  799.  
  800. EXTERN_API( long )
  801. GrowWindow                        (WindowPtr                 theWindow,
  802.                                  Point                     startPt,
  803.                                  const Rect *            bBox)                                ONEWORDINLINE(0xA92B);
  804.  
  805. EXTERN_API( void )
  806. DragWindow                        (WindowPtr                 theWindow,
  807.                                  Point                     startPt,
  808.                                  const Rect *            boundsRect)                            ONEWORDINLINE(0xA925);
  809.  
  810.  
  811. /*
  812.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  813.    • Window Visibility
  814.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  815. */
  816.  
  817.  
  818. EXTERN_API( void )
  819. HideWindow                        (WindowPtr                 theWindow)                            ONEWORDINLINE(0xA916);
  820.  
  821. EXTERN_API( void )
  822. ShowWindow                        (WindowPtr                 theWindow)                            ONEWORDINLINE(0xA915);
  823.  
  824. EXTERN_API( void )
  825. ShowHide                        (WindowPtr                 theWindow,
  826.                                  Boolean                 showFlag)                            ONEWORDINLINE(0xA908);
  827.  
  828.  
  829. /*
  830.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  831.    • Utilities
  832.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  833. */
  834.  
  835. EXTERN_API( long )
  836. PinRect                            (const Rect *            theRect,
  837.                                  Point                     thePt)                                ONEWORDINLINE(0xA94E);
  838.  
  839.  
  840. EXTERN_API( RgnHandle )
  841. GetGrayRgn                        (void)                                                        TWOWORDINLINE(0x2EB8, 0x09EE);
  842.  
  843.  
  844. /*
  845.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  846.    • Window Part Tracking
  847.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  848. */
  849.  
  850. EXTERN_API( Boolean )
  851. TrackBox                        (WindowPtr                 theWindow,
  852.                                  Point                     thePt,
  853.                                  short                     partCode)                            ONEWORDINLINE(0xA83B);
  854.  
  855. EXTERN_API( Boolean )
  856. TrackGoAway                        (WindowPtr                 theWindow,
  857.                                  Point                     thePt)                                ONEWORDINLINE(0xA91E);
  858.  
  859.  
  860. /*
  861.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  862.    • Region Dragging
  863.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  864. */
  865. EXTERN_API( long )
  866. DragGrayRgn                        (RgnHandle                 theRgn,
  867.                                  Point                     startPt,
  868.                                  const Rect *            limitRect,
  869.                                  const Rect *            slopRect,
  870.                                  short                     axis,
  871.                                  DragGrayRgnUPP         actionProc)                            ONEWORDINLINE(0xA905);
  872.  
  873. EXTERN_API( long )
  874. DragTheRgn                        (RgnHandle                 theRgn,
  875.                                  Point                     startPt,
  876.                                  const Rect *            limitRect,
  877.                                  const Rect *            slopRect,
  878.                                  short                     axis,
  879.                                  DragGrayRgnUPP         actionProc)                            ONEWORDINLINE(0xA926);
  880.  
  881.  
  882. /*
  883.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  884.    • Cruft
  885.       Avoid using GetAuxWin, lest ye be boiled in hot oil.  AuxWinRecs are going Away.
  886.   ————————————————————————————————————————————————————————————————————————————————————————————————————————— 
  887. */
  888.  
  889. EXTERN_API( Boolean )
  890. GetAuxWin                        (WindowPtr                 theWindow,
  891.                                  AuxWinHandle *            awHndl)                                ONEWORDINLINE(0xAA42);
  892.  
  893.  
  894. /*
  895.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  896.    • MixedMode & ProcPtrs
  897.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  898. */
  899.  
  900. typedef CALLBACK_API( long , WindowDefProcPtr )(short varCode, WindowPtr theWindow, short message, long param);
  901. typedef CALLBACK_API( void , DeskHookProcPtr )(Boolean mouseClick, EventRecord *theEvent);
  902. /*
  903.     WARNING: DeskHookProcPtr uses register based parameters under classic 68k
  904.              and cannot be written in a high-level language without 
  905.              the help of mixed mode or assembly glue.
  906. */
  907. typedef STACK_UPP_TYPE(WindowDefProcPtr)                         WindowDefUPP;
  908. typedef REGISTER_UPP_TYPE(DeskHookProcPtr)                         DeskHookUPP;
  909. enum { uppWindowDefProcInfo = 0x00003BB0 };                     /* pascal 4_bytes Func(2_bytes, 4_bytes, 2_bytes, 4_bytes) */
  910. enum { uppDeskHookProcInfo = 0x00130802 };                         /* register no_return_value Func(1_byte:D0, 4_bytes:A0) */
  911. #define NewWindowDefProc(userRoutine)                             (WindowDefUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppWindowDefProcInfo, GetCurrentArchitecture())
  912. #define NewDeskHookProc(userRoutine)                             (DeskHookUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDeskHookProcInfo, GetCurrentArchitecture())
  913. #define CallWindowDefProc(userRoutine, varCode, theWindow, message, param)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppWindowDefProcInfo, (varCode), (theWindow), (message), (param))
  914. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  915.     #pragma parameter CallDeskHookProc(__A1, __D0, __A0)
  916.     void CallDeskHookProc(DeskHookUPP routine, Boolean mouseClick, EventRecord * theEvent) = 0x4E91;
  917. #else
  918.     #define CallDeskHookProc(userRoutine, mouseClick, theEvent)  CALL_TWO_PARAMETER_UPP((userRoutine), uppDeskHookProcInfo, (mouseClick), (theEvent))
  919. #endif
  920. /*
  921.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  922.    • C Glue
  923.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  924. */
  925.  
  926. #if CGLUESUPPORTED
  927. EXTERN_API_C( void )
  928. setwtitle                        (WindowPtr                 theWindow,
  929.                                  const char *            title);
  930.  
  931. EXTERN_API_C( Boolean )
  932. trackgoaway                        (WindowPtr                 theWindow,
  933.                                  Point *                thePt);
  934.  
  935. EXTERN_API_C( short )
  936. findwindow                        (Point *                thePoint,
  937.                                  WindowPtr *            theWindow);
  938.  
  939. EXTERN_API_C( void )
  940. getwtitle                        (WindowPtr                 theWindow,
  941.                                  char *                    title);
  942.  
  943. EXTERN_API_C( long )
  944. growwindow                        (WindowPtr                 theWindow,
  945.                                  Point *                startPt,
  946.                                  const Rect *            bBox);
  947.  
  948. EXTERN_API_C( WindowPtr )
  949. newwindow                        (void *                    wStorage,
  950.                                  const Rect *            boundsRect,
  951.                                  const char *            title,
  952.                                  Boolean                 visible,
  953.                                  short                     theProc,
  954.                                  WindowPtr                 behind,
  955.                                  Boolean                 goAwayFlag,
  956.                                  long                     refCon);
  957.  
  958. EXTERN_API_C( WindowPtr )
  959. newcwindow                        (void *                    wStorage,
  960.                                  const Rect *            boundsRect,
  961.                                  const char *            title,
  962.                                  Boolean                 visible,
  963.                                  short                     procID,
  964.                                  WindowPtr                 behind,
  965.                                  Boolean                 goAwayFlag,
  966.                                  long                     refCon);
  967.  
  968. EXTERN_API_C( long )
  969. pinrect                            (const Rect *            theRect,
  970.                                  Point *                thePt);
  971.  
  972. EXTERN_API_C( Boolean )
  973. trackbox                        (WindowPtr                 theWindow,
  974.                                  Point *                thePt,
  975.                                  short                     partCode);
  976.  
  977. EXTERN_API_C( long )
  978. draggrayrgn                        (RgnHandle                 theRgn,
  979.                                  Point *                startPt,
  980.                                  const Rect *            boundsRect,
  981.                                  const Rect *            slopRect,
  982.                                  short                     axis,
  983.                                  DragGrayRgnUPP         actionProc);
  984.  
  985. EXTERN_API_C( void )
  986. dragwindow                        (WindowPtr                 theWindow,
  987.                                  Point *                startPt,
  988.                                  const Rect *            boundsRect);
  989.  
  990. #endif  /* CGLUESUPPORTED */
  991.  
  992. /*
  993.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  994.    • WindowRecord accessor macros
  995.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  996. */
  997.  
  998. /*
  999.     *****************************************************************************
  1000.     *                                                                           *
  1001.     * The conditional STRICT_WINDOWS has been removed from this interface file. *
  1002.     * The accessor macros to a WindowRecord are no longer necessary.            *
  1003.     *                                                                           *
  1004.     * All ≈Ref Types have reverted to their original Handle and Ptr Types.      *
  1005.     *                                                                           *
  1006.     *****************************************************************************
  1007.  
  1008.     Details:
  1009.     The original purpose of the STRICT_ conditionals and accessor macros was to
  1010.     help ease the transition to Copland.  Shared data structures are difficult
  1011.     to coordinate in a preemptive multitasking OS.  By hiding the fields in a
  1012.     WindowRecord and other data structures, we would begin the migration to the
  1013.     discipline wherein system data structures are completely hidden from
  1014.     applications.
  1015.     
  1016.     After many design reviews, we finally concluded that with this sort of
  1017.     migration, the system could never tell when an application was no longer
  1018.     peeking at a WindowRecord, and thus the data structure might never become
  1019.     system owned.  Additionally, there were many other limitations in the
  1020.     classic toolbox that were begging to be addressed.  The final decision was
  1021.     to leave the traditional toolbox as a compatibility mode.
  1022.     
  1023.     We also decided to use the Handle and Ptr based types in the function
  1024.     declarations.  For example, NewWindow now returns a WindowPtr rather than a
  1025.     WindowRef.  The Ref types are still defined in the header files, so all
  1026.     existing code will still compile exactly as it did before.  There are
  1027.     several reasons why we chose to do this:
  1028.     
  1029.     - The importance of backwards compatibility makes it unfeasible for us to
  1030.     enforce real opaque references in the implementation anytime in the
  1031.     foreseeable future.  Therefore, any opaque data types (e.g. WindowRef,
  1032.     ControlRef, etc.) in the documentation and header files would always be a
  1033.     fake veneer of opacity.
  1034.     
  1035.     - There exists a significant base of books and sample code that neophyte
  1036.     Macintosh developers use to learn how to program the Macintosh.  These
  1037.     books and sample code all use direct data access.  Introducing opaque data
  1038.     types at this point would confuse neophyte programmers more than it would
  1039.     help them.
  1040.     
  1041.     - Direct data structure access is used by nearly all Macintosh developers. 
  1042.     Changing the interfaces to reflect a false opacity would not provide any
  1043.     benefit to these developers.
  1044.     
  1045.     - Accessor functions are useful in and of themselves as convenience
  1046.     functions.
  1047. */
  1048. #ifdef __cplusplus
  1049. inline CGrafPtr    GetWindowPort(WindowPtr w)                     { return (CGrafPtr) w;                                                     }
  1050. inline void        SetPortWindowPort(WindowPtr w)                {    SetPort( (GrafPtr) GetWindowPort(w)); }
  1051. inline SInt16        GetWindowKind(WindowPtr w)                     { return ( *(SInt16 *)    (((UInt8 *) w) + sizeof(GrafPort)));             }
  1052. inline void        SetWindowKind(WindowPtr    w, SInt16 wKind)    {  *(SInt16 *)    (((UInt8 *) w) + sizeof(GrafPort)) = wKind;              }
  1053. inline    Boolean        IsWindowVisible(WindowPtr w)                { return *(Boolean *)    (((UInt8 *) w) + sizeof(GrafPort) + 0x2);         }
  1054. inline Boolean        IsWindowHilited(WindowPtr w)                { return *(Boolean *)    (((UInt8 *) w) + sizeof(GrafPort) + 0x3);        }
  1055. inline Boolean        GetWindowGoAwayFlag(WindowPtr w)            { return *(Boolean *)    (((UInt8 *) w) + sizeof(GrafPort) + 0x4);        }
  1056. inline Boolean        GetWindowZoomFlag(WindowPtr w)                { return *(Boolean *)    (((UInt8 *) w) + sizeof(GrafPort) + 0x5);        }
  1057. inline void        GetWindowStructureRgn(WindowPtr w, RgnHandle r)    {    CopyRgn( *(RgnHandle *)(((UInt8 *) w) + sizeof(GrafPort) + 0x6), r );    }
  1058. inline void        GetWindowContentRgn(WindowPtr w, RgnHandle r)    {    CopyRgn( *(RgnHandle *)(((UInt8 *) w) + sizeof(GrafPort) + 0xA), r );    }
  1059. inline void        GetWindowUpdateRgn(WindowPtr w, RgnHandle r)    {    CopyRgn( *(RgnHandle *)(((UInt8 *) w) + sizeof(GrafPort) + 0xE), r );    }
  1060. inline SInt16        GetWindowTitleWidth(WindowPtr w)                { return *(SInt16 *)(((UInt8 *) w) + sizeof(GrafPort) + 0x1E);            }
  1061. inline WindowPtr    GetNextWindow(WindowPtr w)                        { return *(WindowPtr *)    (((UInt8 *) w) + sizeof(GrafPort) + 0x24);        }
  1062.  
  1063. inline void    GetWindowStandardState(WindowPtr w, Rect *r)
  1064. {    Rect *stateRects = (  (Rect *) (**(Handle *) (((UInt8 *) w) + sizeof(GrafPort) + 0x16)));
  1065. if (stateRects != NULL)    *r = stateRects[1];        }
  1066. inline void    SetWindowStandardState(WindowPtr w, const Rect *r)
  1067. {     Rect *stateRects = (  (Rect *) (**(Handle *) (((UInt8 *) w) + sizeof(GrafPort) + 0x16)));
  1068. if (stateRects != NULL)    stateRects[1] = *r;     }
  1069. inline void    GetWindowUserState(WindowPtr w, Rect *r)
  1070. {     Rect *stateRects = (  (Rect *) (**(Handle *) (((UInt8 *) w) + sizeof(GrafPort) + 0x16)));
  1071. if (stateRects != NULL)    *r = stateRects[0]; }
  1072. inline void    SetWindowUserState(WindowPtr w, const Rect *r)
  1073. { Rect *stateRects = (  (Rect *) (**(Handle *) (((UInt8 *) w) + sizeof(GrafPort) + 0x16)));
  1074. if (stateRects != NULL)    stateRects[0] = *r; }
  1075. inline Handle    GetWindowDataHandle(WindowPtr w)                {    return    (((WindowPeek) (w))->dataHandle);                }
  1076. inline void    SetWindowDataHandle(WindowPtr w, Handle data)    {    (((WindowPeek) (w))->dataHandle) = ((Handle) (data));    }
  1077. #else
  1078. #define ShowHideWindow(w)                        ShowHide(w)
  1079. #define SetPortWindowPort(w)                    SetPort( (GrafPtr) GetWindowPort(w) )
  1080. #define GetWindowPort(w)                        ( (CGrafPtr) w)
  1081. #define GetWindowKind(w)                        ( *(SInt16 *)    (((UInt8 *) w) + sizeof(GrafPort)))
  1082. #define SetWindowKind(w, wKind)                ( *(SInt16 *)    (((UInt8 *) w) + sizeof(GrafPort)) = wKind )
  1083. #define IsWindowVisible(w)                        ( *(Boolean *)    (((UInt8 *) w) + sizeof(GrafPort) + 0x2))
  1084. #define IsWindowHilited(w)                        ( *(Boolean *)    (((UInt8 *) w) + sizeof(GrafPort) + 0x3))
  1085. #define GetWindowGoAwayFlag(w)                    ( *(Boolean *)    (((UInt8 *) w) + sizeof(GrafPort) + 0x4))
  1086. #define GetWindowZoomFlag(w)                    ( *(Boolean *)    (((UInt8 *) w) + sizeof(GrafPort) + 0x5))
  1087. #define GetWindowStructureRgn(w, aRgnHandle)    CopyRgn( *(RgnHandle *)(((UInt8 *) w) + sizeof(GrafPort) + 0x6), aRgnHandle )
  1088. #define GetWindowContentRgn(w, aRgnHandle)        CopyRgn( *(RgnHandle *)(((UInt8 *) w) + sizeof(GrafPort) + 0xA), aRgnHandle )
  1089.  
  1090. #define GetWindowUpdateRgn(w, aRgnHandle)        CopyRgn( *(RgnHandle *)(((UInt8 *) w) + sizeof(GrafPort) + 0xE), aRgnHandle )
  1091.  
  1092. #define GetWindowTitleWidth(w)                    ( *(SInt16 *)        (((UInt8 *) w) + sizeof(GrafPort) + 0x1E))
  1093. #define GetNextWindow(w)                        ( *(WindowPtr *)    (((UInt8 *) w) + sizeof(GrafPort) + 0x24))
  1094.  
  1095. #define GetWindowStandardState(w, aRectPtr)    do { Rect *stateRects = (  (Rect *) (**(Handle *) (((UInt8 *) w) + sizeof(GrafPort) + 0x16)));    \
  1096.                                                                 if (stateRects != NULL)    *aRectPtr = stateRects[1]; } while (false)
  1097. #define SetWindowStandardState(w, aRectPtr)    do { Rect *stateRects = (  (Rect *) (**(Handle *) (((UInt8 *) w) + sizeof(GrafPort) + 0x16)));    \
  1098.                                                                 if (stateRects != NULL)    stateRects[1] = *aRectPtr; } while (false)
  1099. #define GetWindowUserState(w, aRectPtr)        do { Rect *stateRects = (  (Rect *) (**(Handle *) (((UInt8 *) w) + sizeof(GrafPort) + 0x16)));    \
  1100.                                                                 if (stateRects != NULL)    *aRectPtr = stateRects[0]; } while (false)
  1101. #define SetWindowUserState(w, aRectPtr)        do { Rect *stateRects = (  (Rect *) (**(Handle *) (((UInt8 *) w) + sizeof(GrafPort) + 0x16)));    \
  1102.                                                                 if (stateRects != NULL)    stateRects[0] = *aRectPtr; } while (false)
  1103. #define GetWindowDataHandle(windowRef)                (((WindowPeek) (windowRef))->dataHandle)
  1104. #define SetWindowDataHandle(windowRef, data)        (((WindowPeek) (windowRef))->dataHandle) = ((Handle) (data))
  1105.  
  1106. #endif  /*  defined(__cplusplus)  */
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117. #if PRAGMA_STRUCT_ALIGN
  1118.     #pragma options align=reset
  1119. #elif PRAGMA_STRUCT_PACKPUSH
  1120.     #pragma pack(pop)
  1121. #elif PRAGMA_STRUCT_PACK
  1122.     #pragma pack()
  1123. #endif
  1124.  
  1125. #ifdef PRAGMA_IMPORT_OFF
  1126. #pragma import off
  1127. #elif PRAGMA_IMPORT
  1128. #pragma import reset
  1129. #endif
  1130.  
  1131. #ifdef __cplusplus
  1132. }
  1133. #endif
  1134.  
  1135. #endif /* __MACWINDOWS__ */
  1136.  
  1137.