home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / OB3.2D3.DMS / in.adf / Interfaces / Intuition.mod < prev    next >
Encoding:
Text File  |  1993-10-23  |  171.1 KB  |  4,068 lines

  1. (*-------------------------------------------------------------------------*)
  2. (*                                                                         *)
  3. (*  Amiga Oberon Interface Module:                    Date: 21-May-93      *)
  4. (*                                                                         *)
  5. (*   © 1992 by Fridtjof Siebert                                            *)
  6. (*   updated for V39 by hartmut Goebel                                     *)
  7. (*                                                                         *)
  8. (*-------------------------------------------------------------------------*)
  9.  
  10. MODULE Intuition;
  11.  
  12. IMPORT e  * := Exec,
  13.        g  * := Graphics,
  14.        ie * := InputEvent,
  15.        t  * := Timer,
  16.        u  * := Utility,
  17.        km * := KeyMap,
  18.        sys  := SYSTEM;
  19.  
  20. TYPE
  21.   MenuPtr          * = UNTRACED POINTER TO Menu;
  22.   MenuItemPtr      * = UNTRACED POINTER TO MenuItem;
  23.   RequesterPtr     * = UNTRACED POINTER TO Requester;
  24.   GadgetPtr        * = UNTRACED POINTER TO Gadget;
  25.   GadSpecialInfoPtr* = UNTRACED POINTER TO GadSpecialInfo;
  26.   BoolInfoPtr      * = UNTRACED POINTER TO BoolInfo;
  27.   PropInfoPtr      * = UNTRACED POINTER TO PropInfo;
  28.   StringInfoPtr    * = UNTRACED POINTER TO StringInfo;
  29.   IntuiTextPtr     * = UNTRACED POINTER TO IntuiText;
  30.   BorderPtr        * = UNTRACED POINTER TO Border;
  31.   ImagePtr         * = UNTRACED POINTER TO Image;
  32.   IntuiMessagePtr  * = UNTRACED POINTER TO IntuiMessage;
  33.   IBoxPtr          * = UNTRACED POINTER TO IBox;
  34.   WindowPtr        * = UNTRACED POINTER TO Window;
  35.   NewWindowPtr     * = UNTRACED POINTER TO NewWindow;
  36.   ExtNewWindowPtr  * = UNTRACED POINTER TO ExtNewWindow;
  37.   RememberPtr      * = UNTRACED POINTER TO Remember;
  38.   ColorSpecPtr     * = UNTRACED POINTER TO ColorSpec;
  39.   EasyStructPtr    * = UNTRACED POINTER TO EasyStruct;
  40.   GadgetInfoPtr    * = UNTRACED POINTER TO GadgetInfo;
  41.   PGXPtr           * = UNTRACED POINTER TO PGX;
  42.   MsgPtr           * = UNTRACED POINTER TO Msg;
  43.   OpSetPtr         * = UNTRACED POINTER TO OpSet;
  44.   OpUpdatePtr      * = UNTRACED POINTER TO OpUpdate;
  45.   OpGetPtr         * = UNTRACED POINTER TO OpGet;
  46.   OpAddTailPtr     * = UNTRACED POINTER TO OpAddTail;
  47.   OpMemberPtr      * = UNTRACED POINTER TO OpMember;
  48.   IClassPtr        * = UNTRACED POINTER TO IClass;
  49.   ObjectPtr        * = UNTRACED POINTER TO Object;
  50.   HitTestPtr       * = UNTRACED POINTER TO HitTest;
  51.   RenderPtr        * = UNTRACED POINTER TO Render;
  52.   InputPtr         * = UNTRACED POINTER TO Input;
  53.   GoInactivePtr    * = UNTRACED POINTER TO GoInactive;
  54.   FrameBoxPtr      * = UNTRACED POINTER TO FrameBox;
  55.   DrawPtr          * = UNTRACED POINTER TO Draw;
  56.   ErasePtr         * = UNTRACED POINTER TO Erase;
  57.   IMHitTestPtr     * = UNTRACED POINTER TO IMHitTest;
  58.   PreferencesPtr   * = UNTRACED POINTER TO Preferences;
  59.   DrawInfoPtr      * = UNTRACED POINTER TO DrawInfo;
  60.   ScreenPtr        * = UNTRACED POINTER TO Screen;
  61.   NewScreenPtr     * = UNTRACED POINTER TO NewScreen;
  62.   ExtNewScreenPtr  * = UNTRACED POINTER TO ExtNewScreen;
  63.   PubScreenNodePtr * = UNTRACED POINTER TO PubScreenNode;
  64.   StringExtendPtr  * = UNTRACED POINTER TO StringExtend;
  65.   SGWorkPtr        * = UNTRACED POINTER TO SGWork;
  66.   IntuitionBasePtr * = UNTRACED POINTER TO IntuitionBase;
  67.   GadgetDummyPtr   * = UNTRACED POINTER TO GadgetDummy;
  68.   ExtGadgetPtr     * = UNTRACED POINTER TO ExtGadget;
  69.   ExtIntuiMessagePtr * = UNTRACED POINTER TO ExtIntuiMessage;
  70.   TabletDataPtr    * = UNTRACED POINTER TO TabletData;
  71.   TabletHookDataPtr * = UNTRACED POINTER TO TabletHookData;
  72.   LayoutPtr        * = UNTRACED POINTER TO Layout;
  73.   ScreenBufferPtr  * = UNTRACED POINTER TO ScreenBuffer;
  74.  
  75. CONST
  76.   intuitionName * = "intuition.library";
  77.  
  78. TYPE
  79. (* ======================================================================== *)
  80. (* === Menu =============================================================== *)
  81. (* ======================================================================== *)
  82.   Menu * = STRUCT
  83.     nextMenu * : MenuPtr;             (* same level *)
  84.     leftEdge * , topEdge * : INTEGER; (* position of the select box *)
  85.     width * , height * : INTEGER;     (* dimensions of the select box *)
  86.     flags * : SET;                    (* see flag definitions below *)
  87.     menuName * : e.STRPTR;            (* text for this Menu Header *)
  88.     firstItem * : MenuItemPtr;        (* pointer to first in chain *)
  89.  
  90.     (* these mysteriously-named variables are for internal use only *)
  91.     jazzX * , jazzY * , beatX * , beatY * : INTEGER;
  92.   END;
  93.  
  94. CONST
  95.  
  96. (* FLAGS SET BY BOTH THE APPLIPROG AND INTUITION *)
  97.   menuEnabled * = 0;      (* whether or not this menu is enabled *)
  98.  
  99. (* FLAGS SET BY INTUITION *)
  100.   miDrawn * = 8;          (* this menu's items are currently drawn *)
  101.  
  102.  
  103.  
  104. TYPE
  105.  
  106. (* ======================================================================== *)
  107. (* === MenuItem =========================================================== *)
  108. (* ======================================================================== *)
  109.   MenuItem * = STRUCT
  110.     nextItem * : MenuItemPtr;            (* pointer to next in chained list *)
  111.     leftEdge * , topEdge * : INTEGER;    (* position of the select box *)
  112.     width * , height * : INTEGER;        (* dimensions of the select box *)
  113.     flags * : SET;                       (* see the defines below *)
  114.  
  115.     mutualExclude * : LONGSET;           (* set bits mean this item excludes that *)
  116.  
  117.     itemFill * : e.APTR;                 (* points to Image, IntuiText, or NULL *)
  118.  
  119.     (* when this item is pointed to by the cursor and the items highlight
  120.      *  mode HIGHIMAGE is selected, this alternate image will be displayed
  121.      *)
  122.     selectFill * : e.APTR;               (* points to Image, IntuiText, or NULL *)
  123.  
  124.     command * : CHAR;                    (* only if appliprog sets the COMMSEQ flag *)
  125.  
  126.     subItem * : MenuItemPtr;             (* if non-zero, points to MenuItem for submenu *)
  127.  
  128.     (* The NextSelect field represents the menu number of next selected
  129.      *  item (when user has drag-selected several items)
  130.      *)
  131.     nextSelect * : INTEGER;
  132.   END;
  133.  
  134. CONST
  135.  
  136. (* FLAGS SET BY THE APPLIPROG *)
  137.   checkIt         * = 0;  (* set to indicate checkmarkable item *)
  138.   itemText        * = 1;  (* set if textual, clear if graphical item *)
  139.   commSeq         * = 2;  (* set if there's an command sequence *)
  140.   menuToggle      * = 3;  (* set for toggling checks (else mut. exclude) *)
  141.   itemEnabled     * = 4;  (* set if this item is enabled *)
  142.  
  143. (* these are the SPECIAL HIGHLIGHT FLAG state meanings *)
  144.   highFlags       * = {6,7};               (* see definitions below for these bits *)
  145.   highImage       * = {};                  (* use the user's "select image" *)
  146.   highComp        * = 6;                   (* highlight by complementing the selectbox *)
  147.   highBox         * = 7;                   (* highlight by "boxing" the selectbox *)
  148.   highNone        * = {highBox,highComp};  (* don't highlight *)
  149.  
  150. (* FLAGS SET BY BOTH APPLIPROG AND INTUITION *)
  151.   checked         * = 8;  (* state of the checkmark *)
  152.  
  153. (* FLAGS SET BY INTUITION *)
  154.   isDrawn         * = 12; (* this item's subs are currently drawn *)
  155.   highItem        * = 13; (* this item is currently highlighted *)
  156.   menuToggled     * = 14; (* this item was already toggled *)
  157.  
  158.  
  159.  
  160. TYPE
  161.  
  162. (* ======================================================================== *)
  163. (* === Requester ========================================================== *)
  164. (* ======================================================================== *)
  165.   Requester * = STRUCT
  166.     olderRequest * : RequesterPtr;
  167.     leftEdge * , topEdge * : INTEGER;   (* dimensions of the entire box *)
  168.     width * , height * : INTEGER;       (* dimensions of the entire box *)
  169.     relLeft * , relTop * : INTEGER;     (* for Pointer relativity offsets *)
  170.  
  171.     reqGadget * : GadgetDummyPtr;       (* pointer to a list of Gadgets *)
  172.     reqBorder * : BorderPtr;            (* the box's border *)
  173.     reqText   * : IntuiTextPtr;         (* the box's text *)
  174.     flags * : SET;                      (* see definitions below *)
  175.  
  176.     (* pen number for back-plane fill before draws *)
  177.     backFill * : SHORTINT;
  178.     (* Layer in place of clip rect      *)
  179.     reqLayer * : g.LayerPtr;
  180.  
  181.     reqPad1 * : ARRAY 32 OF e.BYTE;
  182.  
  183.     (* If the BitMap plane pointers are non-zero, this tells the system
  184.      * that the image comes pre-drawn (if the appliprog wants to define
  185.      * its own box, in any shape or size it wants!);  this is OK by
  186.      * Intuition as long as there's a good correspondence between
  187.      * the image and the specified Gadgets
  188.      *)
  189.     imageBMap * : g.BitMapPtr;          (* points to the BitMap of PREDRAWN imagery *)
  190.     rWindow * : WindowPtr;              (* added.  points back to Window *)
  191.  
  192.     reqImage * : ImagePtr;              (* new for V36: drawn if USEREQIMAGE set *)
  193.  
  194.     reqPad2 * : ARRAY 32 OF e.BYTE;
  195.   END;
  196.  
  197.  
  198. CONST
  199.  
  200. (* FLAGS SET BY THE APPLIPROG *)
  201.   pointRel        * = 0;
  202.                           (* if POINTREL set, TopLeft is relative to pointer
  203.                            * for DMRequester, relative to window center
  204.                            * for Request().
  205.                            *)
  206.   preDrawn        * = 1;
  207.         (* set if Requester.ImageBMap points to predrawn Requester imagery *)
  208.   noisyReq        * = 2;
  209.         (* if you don't want requester to filter input     *)
  210.   simpleReq       * = 4;
  211.         (* to use SIMPLEREFRESH layer (recommended)     *)
  212.  
  213. (* New for V36          *)
  214.   useReqImage     * = 5;
  215.         (*  render linked list ReqImage after BackFill
  216.          * but before gadgets and text
  217.          *)
  218.   noReqBackFill   * = 6;
  219.         (* don't bother filling requester with Requester.BackFill pen   *)
  220.  
  221.  
  222. (* FLAGS SET BY INTUITION *)
  223.   reqOffWindow    * = 12; (* part of one of the Gadgets was offwindow *)
  224.   reqActive       * = 13; (* this requester is active *)
  225.   sysRequest      * = 14; (* this requester caused by system *)
  226.   deferRefresh    * = 15; (* this Requester stops a Refresh broadcast *)
  227.  
  228.  
  229.  
  230.  
  231.  
  232. TYPE
  233.  
  234. (* ======================================================================== *)
  235. (* === Gadget ============================================================= *)
  236. (* ======================================================================== *)
  237.  
  238.   GadgetDummy * = STRUCT END;    (* dummy base type for Gadget and ExtGadget *)
  239.   GadSpecialInfo * = STRUCT END; (* dummy base type of all SpecialInfos *)
  240.  
  241.   Gadget * = STRUCT (dummy: GadgetDummy)
  242.     nextGadget * : GadgetDummyPtr;    (* next gadget in the list *)
  243.  
  244.     leftEdge * , topEdge * : INTEGER; (* "hit box" of gadget *)
  245.     width * , height * : INTEGER;     (* "hit box" of gadget *)
  246.  
  247.     flags * : SET;                    (* see below for list of defines *)
  248.  
  249.     activation * : SET;               (* see below for list of defines *)
  250.  
  251.     gadgetType * : INTEGER;           (* see below for defines *)
  252.  
  253.     (* appliprog can specify that the Gadget be rendered as either as Border
  254.      * or an Image.  This variable points to which (or equals NULL if there's
  255.      * nothing to be rendered about this Gadget)
  256.      *)
  257.     gadgetRender * : e.APTR;
  258.  
  259.     (* appliprog can specify "highlighted" imagery rather than algorithmic
  260.      * this can point to either Border or Image data
  261.      *)
  262.     selectRender * : e.APTR;
  263.  
  264.     gadgetText * : IntuiTextPtr;      (* text for this gadget *)
  265.  
  266.     (* MutualExclude, never implemented, is now declared obsolete.
  267.      * There are published examples of implementing a more general
  268.      * and practical exclusion in your applications.
  269.      *
  270.      * Starting with V36, this field is used to point to a hook
  271.      * for a custom gadget.
  272.      *
  273.      * Programs using this field for their own processing will
  274.      * continue to work, as long as they don't try the
  275.      * trick with custom gadgets.
  276.      *)
  277.     mutualExclude * : LONGSET;        (* obsolete *)
  278.  
  279.     (* pointer to a structure of special data required by Proportional,
  280.      * String and Integer Gadgets
  281.      *)
  282.     specialInfo * : GadSpecialInfoPtr;
  283.  
  284.     gadgetID * : INTEGER;             (* user-definable ID field *)
  285.     userData * : e.APTR;              (* ptr to general purpose User data (ignored by In) *)
  286.   END;
  287.  
  288.  
  289. TYPE
  290.   ExtGadget * = STRUCT (dummy: GadgetDummy)
  291.     nextGadget * : GadgetDummyPtr;     (* Matches struct Gadget *)
  292.     leftEdge * , topEdge * : INTEGER;  (* Matches struct Gadget *)
  293.     width * , height * : INTEGER;      (* Matches struct Gadget *)
  294.     flags * : SET;                     (* Matches struct Gadget *)
  295.     activation * : SET;                (* Matches struct Gadget *)
  296.     gadgetType * : INTEGER;            (* Matches struct Gadget *)
  297.     gadgetRender * : e.APTR;           (* Matches struct Gadget *)
  298.     selectRender * : e.APTR;           (* Matches struct Gadget *)
  299.     gadgetText * : IntuiTextPtr;       (* Matches struct Gadget *)
  300.     mutualExclude * : LONGSET;         (* Matches struct Gadget *)
  301.     specialInfo * : GadSpecialInfoPtr; (* Matches struct Gadget *)
  302.     gadgetID * : INTEGER;              (* Matches struct Gadget *)
  303.     userData * : e.APTR;               (* Matches struct Gadget *)
  304.  
  305.     (* These fields only exist under V39 and only if GFLG_EXTENDED is set *)
  306.     moreFlags      * : LONGSET;        (* see GMORE_ flags below *)
  307.     boundsLeftEdge * : INTEGER;        (* Bounding extent for gadget, valid   *)
  308.     boundsTopEdge  * : INTEGER;        (* only if GMORE_BOUNDS is set.  The   *)
  309.     boundsWidth    * : INTEGER;        (* GFLG_RELxxx flags affect these      *)
  310.     boundsHeight   * : INTEGER;        (* coordinates as well.        *)
  311.   END;
  312.  
  313. CONST
  314. (* --- Gadget.Flags values      --- *)
  315. (* combinations in these bits describe the highlight technique to be used *)
  316.   gadgHighBits * = {0,1};
  317.   gadgHComp    * = {};    (* Complement the select box *)
  318.   gadgHBox     * = 0;     (* Draw a box around the image *)
  319.   gadgHImage   * = 1;     (* Blast in this alternate image *)
  320.   gadgHNone    * = {0,1}; (* don't highlight *)
  321.  
  322.   gadgImage    * = 2;  (* set if GadgetRender and SelectRender
  323.                         * point to an Image structure, clear
  324.                         * if they point to Border structures
  325.                         *)
  326.  
  327. (*  combinations in these next two bits specify to which corner the gadget's
  328.  *  Left & Top coordinates are relative.  If relative to Top/Left,
  329.  *  these are "normal" coordinates (everything is relative to something in
  330.  *  this universe).
  331.  *
  332.  * Gadget positions and dimensions are relative to the window or
  333.  * requester which contains the gadget
  334.  *)
  335.   gRelBottom    * = 3;  (* vert. pos. is relative to bottom edge *)
  336.   gRelRight     * = 4;  (* horiz. pos. is relative to right edge *)
  337.   gRelWidth     * = 5;  (* width is relative to req/window    *)
  338.   gRelHeight    * = 6;  (* height is relative to req/window   *)
  339.  
  340. (* New for V39: GFLG_RELSPECIAL allows custom gadget implementors to
  341.  * make gadgets whose position and size depend in an arbitrary way
  342.  * on their window's dimensions.  The GM_LAYOUT method will be invoked
  343.  * for such a gadget (or any other GREL_xxx gadget) at suitable times,
  344.  * such as when the window opens or the window's size changes.
  345.  *)
  346.   gRelSpecial * =  14;  (* custom gadget has special relativity.
  347.                          * Gadget box values are absolutes, but
  348.                          * can be changed via the GM_LAYOUT method.
  349.                          *)
  350.   selected     * = 7;  (* you may initialize and look at this        *)
  351.  
  352. (* the GFLG_DISABLED flag is initialized by you and later set by Intuition
  353.  * according to your calls to On/OffGadget().  It specifies whether or not
  354.  * this Gadget is currently disabled from being selected
  355.  *)
  356.   gadgDisabled * = 8;
  357.  
  358. (* These flags specify the type of text field that Gadget.GadgetText
  359.  * points to.  In all normal (pre-V36) gadgets which you initialize
  360.  * this field should always be zero.  Some types of gadget objects
  361.  * created from classes will use these fields to keep track of
  362.  * types of labels/contents that different from IntuiText, but are
  363.  * stashed in GadgetText.
  364.  *)
  365.  
  366.   labelMask    * = {12,13};
  367.   labelIText   * = {}; (* GadgetText points to IntuiText     *)
  368.   labelString  * = 12; (* GadgetText points to STRING        *)
  369.   labelImage   * = 13; (* GadgetText points to Image (object)        *)
  370. (* New for V37: GFLG_TABCYCLE *)
  371.   tabCycle     * =  9; (* (string or custom) gadget participates in
  372.                         * cycling activation with Tab or Shift-Tab
  373.                         *)
  374. (* New for V37: GFLG_STRINGEXTEND.  We discovered that V34 doesn't properly
  375.  * ignore the value we had chosen for the Gadget->Activation flag
  376.  * GACT_STRINGEXTEND.  NEVER SET THAT FLAG WHEN RUNNING UNDER V34.
  377.  * The Gadget->Flags bit GFLG_STRINGEXTEND is provided as a synonym which is
  378.  * safe under V34, and equivalent to GACT_STRINGEXTEND under V37.
  379.  * (Note that the two flags are not numerically equal)
  380.  *)
  381.   stringExtend * = 10; (* this String Gadget has StringExtend        *)
  382.  
  383. (* New for V39: GFLG_IMAGEDISABLE.  This flag is automatically set if
  384.  * the custom image of this gadget knows how to do disabled rendering
  385.  * (more specifically, if its IA_SupportsDisable attribute is TRUE).
  386.  * Intuition uses this to defer the ghosting to the image-class,
  387.  * instead of doing it itself (the old compatible way).
  388.  * Do not set this flag yourself - Intuition will do it for you.
  389.  *)
  390.  
  391.   gImagedisable * = 11;  (* Gadget's image knows how to do disabled
  392.                           * rendering
  393.                           *)
  394.  
  395. (* New for V39:  If set, this bit means that the Gadget is actually
  396.  * a struct ExtGadget, with new fields and flags.  All V39 boopsi
  397.  * gadgets are ExtGadgets.  Never ever attempt to read the extended
  398.  * fields of a gadget if this flag is not set.
  399.  *)
  400.   gExtended     * =  15;  (* Gadget is extended *)
  401.  
  402.  
  403. (* ---  Gadget.Activation flag values   --- *)
  404. (* Set GACT_RELVERIFY if you want to verify that the pointer was still over
  405.  * the gadget when the select button was released.  Will cause
  406.  * an IDCMP_GADGETUP message to be sent if so.
  407.  *)
  408.   relVerify    * = 0;
  409.  
  410. (* the flag GACT_IMMEDIATE, when set, informs the caller that the gadget
  411.  *  was activated when it was activated.  This flag works in conjunction with
  412.  *  the GACT_RELVERIFY flag
  413.  *)
  414.   gadgImmediate* = 1;
  415.  
  416. (* the flag GACT_ENDGADGET, when set, tells the system that this gadget,
  417.  * when selected, causes the Requester to be ended.  Requesters
  418.  * that are ended are erased and unlinked from the system.
  419.  *)
  420.   endGadget    * = 2;
  421.  
  422. (* the GACT_FOLLOWMOUSE flag, when set, specifies that you want to receive
  423.  * reports on mouse movements while this gadget is active.
  424.  * You probably want to set the GACT_IMMEDIATE flag when using
  425.  * GACT_FOLLOWMOUSE, since that's the only reasonable way you have of
  426.  * learning why Intuition is suddenly sending you a stream of mouse
  427.  * movement events.  If you don't set GACT_RELVERIFY, you'll get at
  428.  * least one Mouse Position event.
  429.  *)
  430.   followMouse  * = 3;
  431.  
  432. (* if any of the BORDER flags are set in a Gadget that's included in the
  433.  * Gadget list when a Window is opened, the corresponding Border will
  434.  * be adjusted to make room for the Gadget
  435.  *)
  436.   rightBorder  * = 4;
  437.   leftBorder   * = 5;
  438.   topBorder    * = 6;
  439.   bottomBorder * = 7;
  440.   borderSniff  * = 15;  (* neither set nor rely on this bit   *)
  441.  
  442.   toggleSelect * = 8;   (* this bit for toggle-select mode *)
  443.   boolExtend   * = 13;  (* this Boolean Gadget has a BoolInfo *)
  444.  
  445. (* should properly be in StringInfo, but aren't *)
  446.   stringLeft   * = {};  (* NOTE WELL: that this has value zero        *)
  447.   stringCenter * = 9;
  448.   stringRight  * = 10;
  449.   longint      * = 11;  (* this String Gadget is for Long Ints        *)
  450.   altKeyMap    * = 12;  (* this String has an alternate keymap        *)
  451.   actStringExtend * = 13;  (* this String Gadget has StringExtend        *)
  452.                         (* NOTE: NEVER SET GACT_STRINGEXTEND IF YOU
  453.                          * ARE RUNNING ON LESS THAN V36!  SEE
  454.                          * GFLG_STRINGEXTEND (ABOVE) INSTEAD
  455.                          *)
  456.  
  457.  
  458.   activeGadget * = 14; (* this gadget is "active".  This flag
  459.                         * is maintained by Intuition, and you
  460.                         * cannot count on its value persisting
  461.                         * while you do something on your program's
  462.                         * task.  It can only be trusted by
  463.                         * people implementing custom gadgets
  464.                         *)
  465.  
  466. (* note 0x8000 is used above (GACT_BORDERSNIFF);
  467.  * all Activation flags defined *)
  468.  
  469. (* --- GADGET TYPES ------------------------------------------------------- *)
  470. (* These are the Gadget Type definitions for the variable GadgetType
  471.  * gadget number type MUST start from one.  NO TYPES OF ZERO ALLOWED.
  472.  * first comes the mask for Gadget flags reserved for Gadget typing
  473.  *)
  474.   gadgetType * = 0FC00U;  (* all Gadget Global Type flags (padded) *)
  475.   sysGadget  * = 08000U;  (* 1 = Allocated by the system, 0 = by app. *)
  476.   scrGadget  * = 04000U;  (* 1 = ScreenGadget, 0 = WindowGadget *)
  477.   gzzGadget  * = 02000U;  (* 1 = for WFLG_GIMMEZEROZERO borders *)
  478.   reqGadget  * = 01000U;  (* 1 = this is a Requester Gadget *)
  479. (* system gadgets *)
  480.   sizing     * = 00010U;
  481.   wDragging  * = 00020U;
  482.   sDragging  * = 00030U;
  483.   wUpFront   * = 00040U;
  484.   sUpFront   * = 00050U;
  485.   wDownBack  * = 00060U;
  486.   sDownBack  * = 00070U;
  487.   close      * = 00080U;
  488. (* application gadgets *)
  489.   boolGadget   * = 00001U;
  490.   gadget0002   * = 00002U;
  491.   propGadget   * = 00003U;
  492.   strGadget    * = 00004U;
  493.   customGadget * = 00005U;
  494.   gTypeMask    * = 00007U;  (* masks out to gadget class    *)
  495.  
  496. (* This bit in GadgetType is reserved for undocumented internal use
  497.  * by the Gadget Toolkit, and cannot be used nor relied on by
  498.  * applications:        0x0100
  499.  *)
  500.  
  501. (* New for V39.  Gadgets which have the GFLG_EXTENDED flag set are
  502.  * actually ExtGadgets, which have more flags.        The GMORE_xxx
  503.  * identifiers describe those flags:
  504.  *)
  505.   gmoreBounds       * =  0; (* ExtGadget has valid Bounds *)
  506.   gmoreGadgetHelp   * =  1; (* This gadget responds to gadget help *)
  507.   gmoreScrollRaster * =  2; (* This (custom) gadget uses ScrollRaster *)
  508.  
  509.  
  510. TYPE
  511. (* ======================================================================== *)
  512. (* === BoolInfo =========================================================== *)
  513. (* ======================================================================== *)
  514. (* This is the special data needed by an Extended Boolean Gadget
  515.  * Typically this structure will be pointed to by the Gadget field SpecialInfo
  516.  *)
  517.   BoolInfo * = STRUCT (dummy : GadSpecialInfo)
  518.     flags * : SET;        (* defined below *)
  519.     mask * : e.APTR;      (* bit mask for highlighting and selecting
  520.                            * mask must follow the same rules as an Image
  521.                            * plane.  Its width and height are determined
  522.                            * by the width and height of the gadget's
  523.                            * select box. (i.e. Gadget.Width and .Height).
  524.                            *)
  525.     reserved * : LONGINT; (* set to 0     *)
  526.   END;
  527.  
  528. CONST
  529.  
  530. (* set BoolInfo.Flags to this flag bit.
  531.  * in the future, additional bits might mean more stuff hanging
  532.  * off of BoolInfo.Reserved.
  533.  *)
  534.   boolMask * = 0;   (* extension is for masked gadget *)
  535.  
  536. TYPE
  537.  
  538. (* ======================================================================== *)
  539. (* === PropInfo =========================================================== *)
  540. (* ======================================================================== *)
  541. (* this is the special data required by the proportional Gadget
  542.  * typically, this data will be pointed to by the Gadget variable SpecialInfo
  543.  *)
  544.   PropInfo * = STRUCT (dummy: GadSpecialInfo)
  545.     flags * : SET;        (* general purpose flag bits (see defines below) *)
  546.  
  547.     (* You initialize the Pot variables before the Gadget is added to
  548.      * the system.  Then you can look here for the current settings
  549.      * any time, even while User is playing with this Gadget.  To
  550.      * adjust these after the Gadget is added to the System, use
  551.      * ModifyProp();  The Pots are the actual proportional settings,
  552.      * where a value of zero means zero and a value of MAXPOT means
  553.      * that the Gadget is set to its maximum setting.
  554.      *)
  555.     horizPot * : INTEGER; (* 16-bit FixedPoint horizontal quantity percentage *)
  556.     vertPot * : INTEGER;  (* 16-bit FixedPoint vertical quantity percentage *)
  557.  
  558.     (* the 16-bit FixedPoint Body variables describe what percentage of
  559.      * the entire body of stuff referred to by this Gadget is actually
  560.      * shown at one time.  This is used with the AUTOKNOB routines,
  561.      * to adjust the size of the AUTOKNOB according to how much of
  562.      * the data can be seen.  This is also used to decide how far
  563.      * to advance the Pots when User hits the Container of the Gadget.
  564.      * For instance, if you were controlling the display of a 5-line
  565.      * Window of text with this Gadget, and there was a total of 15
  566.      * lines that could be displayed, you would set the VertBody value to
  567.      *     (MAXBODY / (TotalLines / DisplayLines)) = MAXBODY / 3.
  568.      * Therefore, the AUTOKNOB would fill 1/3 of the container, and
  569.      * if User hits the Cotainer outside of the knob, the pot would
  570.      * advance 1/3 (plus or minus) If there's no body to show, or
  571.      * the total amount of displayable info is less than the display area,
  572.      * set the Body variables to the MAX.  To adjust these after the
  573.      * Gadget is added to the System, use ModifyProp();
  574.      *)
  575.     horizBody * : INTEGER;           (* horizontal Body *)
  576.     vertBody * : INTEGER;            (* vertical Body *)
  577.  
  578.     (* these are the variables that Intuition sets and maintains *)
  579.     cWidth * : INTEGER;      (* Container width (with any relativity absoluted) *)
  580.     cHeight * : INTEGER;     (* Container height (with any relativity absoluted) *)
  581.     hPotRes * , vPotRes * : INTEGER; (* pot increments *)
  582.     leftBorder * : INTEGER;          (* Container borders *)
  583.     topBorder * : INTEGER;           (* Container borders *)
  584.   END;
  585.  
  586. CONST
  587.  
  588. (* --- FLAG BITS ---------------------------------------------------------- *)
  589.   autoKnob        * = 0;    (* this flag sez:  gimme that old auto-knob *)
  590. (* NOTE: if you do not use an AUTOKNOB for a proportional gadget,
  591.  * you are currently limited to using a single Image of your own
  592.  * design: Intuition won't handle a linked list of images as
  593.  * a proportional gadget knob.
  594.  *)
  595.  
  596.   freeHoriz       * = 1;  (* if set, the knob can move horizontally *)
  597.   freeVert        * = 2;  (* if set, the knob can move vertically *)
  598.   propBorderless  * = 3;  (* if set, no border will be rendered *)
  599.   knobHit         * = 8;  (* set when this Knob is hit *)
  600.   propNewLook     * = 4;  (* set this if you want to get the new
  601.                            * V36 look
  602.                            *)
  603.  
  604.   knobHmin   * = 6;  (* minimum horizontal size of the Knob *)
  605.   knobVmin   * = 4;  (* minimum vertical size of the Knob *)
  606.   maxBody    * = 0FFFFU;  (* maximum body value *)
  607.   maxPot     * = 0FFFFU;  (* maximum pot value *)
  608.  
  609.  
  610. TYPE
  611.  
  612. (* ======================================================================== *)
  613. (* === StringInfo ========================================================= *)
  614. (* ======================================================================== *)
  615. (* this is the special data required by the string Gadget
  616.  * typically, this data will be pointed to by the Gadget variable SpecialInfo
  617.  *)
  618.   StringInfo * = STRUCT (dummy : GadSpecialInfo)
  619.     (* you initialize these variables, and then Intuition maintains them *)
  620.     buffer * : e.STRPTR;      (* the buffer containing the start and final string *)
  621.     undoBuffer * : e.STRPTR;  (* optional buffer for undoing current entry *)
  622.     bufferPos * : INTEGER;    (* character position in Buffer *)
  623.     maxChars * : INTEGER;     (* max number of chars in Buffer (including NULL) *)
  624.     dispPos * : INTEGER;      (* Buffer position of first displayed character *)
  625.  
  626.     (* Intuition initializes and maintains these variables for you *)
  627.     undoPos * : INTEGER;      (* character position in the undo buffer *)
  628.     numChars * : INTEGER;     (* number of characters currently in Buffer *)
  629.     dispCount * : INTEGER;    (* number of whole characters visible in Container *)
  630.     cLeft * , cTop * : INTEGER;  (* topleft offset of the container *)
  631.  
  632.     (* This unused field is changed to allow extended specification
  633.      * of string gadget parameters.  It is ignored unless the flag
  634.      * GACT_STRINGEXTEND is set in the Gadget's Activation field
  635.      * or the GFLG_STRINGEXTEND flag is set in the Gadget Flags field.
  636.      * (See GFLG_STRINGEXTEND for an important note)
  637.      *)
  638.     (* layerPtr * : LayerPtr;  --- obsolete --- *)
  639.     extension * : StringExtendPtr;
  640.  
  641.     (* you can initialize this variable before the gadget is submitted to
  642.      * Intuition, and then examine it later to discover what integer
  643.      * the user has entered (if the user never plays with the gadget,
  644.      * the value will be unchanged from your initial setting)
  645.      *)
  646.     longInt * : LONGINT;
  647.  
  648.     (* If you want this Gadget to use your own Console keymapping, you
  649.      * set the GACT_ALTKEYMAP bit in the Activation flags of the Gadget,
  650.      * and then set this variable to point to your keymap.  If you don't
  651.      * set the GACT_ALTKEYMAP, you'll get the standard ASCII keymapping.
  652.      *)
  653.     altKeyMap * : km.KeyMapPtr;
  654.   END;
  655.  
  656. (* ======================================================================== *)
  657. (* === IntuiText ========================================================== *)
  658. (* ======================================================================== *)
  659. (* IntuiText is a series of strings that start with a location
  660.  *  (always relative to the upper-left corner of something) and then the
  661.  *  text of the string.  The text is null-terminated.
  662.  *)
  663.   IntuiText * = STRUCT
  664.     frontPen * , backPen * : SHORTINT; (* the pen numbers for the rendering *)
  665.     drawMode * : SHORTSET;             (* the mode for rendering the text *)
  666.     leftEdge * : INTEGER;              (* relative start location for the text *)
  667.     topEdge * : INTEGER;               (* relative start location for the text *)
  668.     iTextFont * : g.TextAttrPtr;       (* if NULL, you accept the default *)
  669.     iText * : e.STRPTR;                (* pointer to null-terminated text *)
  670.     nextText * : IntuiTextPtr;         (* pointer to another IntuiText to render *)
  671.   END;
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678. (* ======================================================================== *)
  679. (* === Border ============================================================= *)
  680. (* ======================================================================== *)
  681. (* Data type Border, used for drawing a series of lines which is intended for
  682.  *  use as a border drawing, but which may, in fact, be used to render any
  683.  *  arbitrary vector shape.
  684.  *  The routine DrawBorder sets up the RastPort with the appropriate
  685.  *  variables, then does a Move to the first coordinate, then does Draws
  686.  *  to the subsequent coordinates.
  687.  *  After all the Draws are done, if NextBorder is non-zero we call DrawBorder
  688.  *  on NextBorder
  689.  *)
  690.   Border * = STRUCT
  691.     leftEdge * , topEdge * : INTEGER;  (* initial offsets from the origin *)
  692.     frontPen * , backPen * : SHORTINT; (* pens numbers for rendering *)
  693.     drawMode * : SHORTSET;             (* mode for rendering *)
  694.     count * : SHORTINT;                (* number of XY pairs *)
  695.     xy * : e.APTR;                     (* vector coordinate pairs rel to LeftTop*)
  696.     nextBorder * : BorderPtr;          (* pointer to any other Border too *)
  697.   END;
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704. (* ======================================================================== *)
  705. (* === Image ============================================================== *)
  706. (* ======================================================================== *)
  707. (* This is a brief image structure for very simple transfers of
  708.  * image data to a RastPort
  709.  *)
  710.   Image * = STRUCT
  711.     leftEdge * : INTEGER;             (* starting offset relative to some origin *)
  712.     topEdge * : INTEGER;              (* starting offsets relative to some origin *)
  713.     width * : INTEGER;                (* pixel size (though data is word-aligned) *)
  714.     height * : INTEGER;
  715.     depth * : INTEGER;                (* >= 0, for images you create          *)
  716.     imageData * : e.APTR;             (* pointer to the actual word-aligned bits *)
  717.  
  718.     (* the PlanePick and PlaneOnOff variables work much the same way as the
  719.      * equivalent GELS Bob variables.  It's a space-saving
  720.      * mechanism for image data.  Rather than defining the image data
  721.      * for every plane of the RastPort, you need define data only
  722.      * for the planes that are not entirely zero or one.  As you
  723.      * define your Imagery, you will often find that most of the planes
  724.      * ARE just as color selectors.  For instance, if you're designing
  725.      * a two-color Gadget to use colors one and three, and the Gadget
  726.      * will reside in a five-plane display, bit plane zero of your
  727.      * imagery would be all ones, bit plane one would have data that
  728.      * describes the imagery, and bit planes two through four would be
  729.      * all zeroes.  Using these flags avoids wasting all
  730.      * that memory in this way:  first, you specify which planes you
  731.      * want your data to appear in using the PlanePick variable.  For
  732.      * each bit set in the variable, the next "plane" of your image
  733.      * data is blitted to the display.  For each bit clear in this
  734.      * variable, the corresponding bit in PlaneOnOff is examined.
  735.      * If that bit is clear, a "plane" of zeroes will be used.
  736.      * If the bit is set, ones will go out instead.  So, for our example:
  737.      *   Gadget.PlanePick = 0x02;
  738.      *   Gadget.PlaneOnOff = 0x01;
  739.      * Note that this also allows for generic Gadgets, like the
  740.      * System Gadgets, which will work in any number of bit planes.
  741.      * Note also that if you want an Image that is only a filled
  742.      * rectangle, you can get this by setting PlanePick to zero
  743.      * (pick no planes of data) and set PlaneOnOff to describe the pen
  744.      * color of the rectangle.
  745.      *
  746.      * NOTE:  Intuition relies on PlanePick to know how many planes
  747.      * of data are found in ImageData.  There should be no more
  748.      * '1'-bits in PlanePick than there are planes in ImageData.
  749.      *)
  750.     planePick * , planeOnOff * : SHORTSET;
  751.  
  752.     (* if the NextImage variable is not NULL, Intuition presumes that
  753.      * it points to another Image structure with another Image to be
  754.      * rendered
  755.      *)
  756.     nextImage * : ImagePtr;
  757.   END;
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764. (* ======================================================================== *)
  765. (* === IntuiMessage ======================================================= *)
  766. (* ======================================================================== *)
  767.   IntuiMessage * = STRUCT (execMessage * : e.Message)
  768.  
  769.     (* the Class bits correspond directly with the IDCMP Flags, except for the
  770.      * special bit IDCMP_LONELYMESSAGE (defined below)
  771.      *)
  772.     class * : LONGSET;
  773.  
  774.     (* the Code field is for special values like MENU number *)
  775.     code * : INTEGER;
  776.  
  777.     (* the Qualifier field is a copy of the current InputEvent's Qualifier *)
  778.     qualifier * : SET;
  779.  
  780.     (* IAddress contains particular addresses for Intuition functions, like
  781.      * the pointer to the Gadget or the Screen
  782.      *)
  783.     iAddress * : e.APTR;
  784.  
  785.     (* when getting mouse movement reports, any event you get will have the
  786.      * the mouse coordinates in these variables.  the coordinates are relative
  787.      * to the upper-left corner of your Window (WFLG_GIMMEZEROZERO
  788.      * notwithstanding).  If IDCMP_DELTAMOVE is set, these values will
  789.      * be deltas from the last reported position.
  790.      *)
  791.     mouseX * , mouseY * : INTEGER;
  792.  
  793.     (* the time values are copies of the current system clock time.  Micros
  794.      * are in units of microseconds, Seconds in seconds.
  795.      *)
  796.     time * : t.TimeVal;
  797.  
  798.     (* the IDCMPWindow variable will always have the address of the Window of
  799.      * this IDCMP
  800.      *)
  801.     idcmpWindow * : WindowPtr;
  802.  
  803.     (* system-use variable *)
  804.     specialLink * : IntuiMessagePtr;
  805.   END;
  806.  
  807. (* New for V39:
  808.  * All IntuiMessages are now slightly extended.  The ExtIntuiMessage
  809.  * structure has an additional field for tablet data, which is usually
  810.  * NULL.  If a tablet driver which is sending IESUBCLASS_NEWTABLET
  811.  * events is installed in the system, windows with the WA_TabletMessages
  812.  * property set will find that eim_TabletData points to the TabletData
  813.  * structure.  Applications must first check that this field is non-NULL;
  814.  * it will be NULL for certain kinds of message, including mouse activity
  815.  * generated from other than the tablet (i.e. the keyboard equivalents
  816.  * or the mouse itself).
  817.  *
  818.  * NEVER EVER examine any extended fields when running under pre-V39!
  819.  *
  820.  * NOTE: This structure is subject to grow in the future.  Making
  821.  * assumptions about its size is A BAD IDEA.
  822.  *)
  823.  
  824.   ExtIntuiMessage * = STRUCT (intuiMessage *: IntuiMessage)
  825.     tabletData * : TabletDataPtr;
  826.   END;
  827.  
  828.  
  829. CONST
  830. (* --- IDCMP Classes ------------------------------------------------------ *)
  831. (* Please refer to the Autodoc for OpenWindow() and to the Rom Kernel
  832.  * Manual for full details on the IDCMP classes.
  833.  *)
  834.   sizeVerify        * = 0;
  835.   newSize           * = 1;
  836.   refreshWindow     * = 2;
  837.   mouseButtons      * = 3;
  838.   mouseMove         * = 4;
  839.   gadgetDown        * = 5;
  840.   gadgetUp          * = 6;
  841.   reqSet            * = 7;
  842.   menuPick          * = 8;
  843.   closeWindow       * = 9;
  844.   rawKey            * = 10;
  845.   reqVerify         * = 11;
  846.   reqClear          * = 12;
  847.   menuVerify        * = 13;
  848.   newPrefs          * = 14;
  849.   diskInserted      * = 15;
  850.   diskRemoved       * = 16;
  851.   wbenchMessage     * = 17;  (*  System use only         *)
  852.   activeWindow      * = 18;
  853.   inactiveWindow    * = 19;
  854.   deltaMove         * = 20;
  855.   vanillaKey        * = 21;
  856.   intuiTicks        * = 22;
  857. (*  for notifications from "boopsi" gadgets     *)
  858.   idcmpUpdate       * = 23;  (* new for V36      *)
  859. (* for getting help key report during menu session      *)
  860.   menuHelp          * = 24;  (* new for V36      *)
  861. (* for notification of any move/size/zoom/change window         *)
  862.   changeWindow      * = 25;  (* new for V36      *)
  863.   gadgetHelp   * = 26;  (* new for V39      *)
  864.  
  865. (* NOTEZ-BIEN:          31   is reserved for internal use   *)
  866.  
  867. (* the IDCMP Flags do not use this special bit, which is cleared when
  868.  * Intuition sends its special message to the Task, and set when Intuition
  869.  * gets its Message back from the Task.  Therefore, I can check here to
  870.  * find out fast whether or not this Message is available for me to send
  871.  *)
  872.   lonelyMessage     * = 31;
  873.  
  874.  
  875. (* --- IDCMP Codes -------------------------------------------------------- *)
  876. (* This group of codes is for the IDCMP_CHANGEWINDOW message *)
  877.   cwcodeMovesize * =  0000H;  (* Window was moved and/or sized *)
  878.   cwcodeDepth    * =  0001H;  (* Window was depth-arranged (new for V39) *)
  879.  
  880. (* This group of codes is for the IDCMP_MENUVERIFY function *)
  881.   menuHot         * = 0001H;  (* IntuiWants verification or MENUCANCEL    *)
  882.   menuCancel      * = 0002H;  (* HOT Reply of this cancels Menu operation *)
  883.   menuWaiting     * = 0003H;  (* Intuition simply wants a ReplyMsg() ASAP *)
  884.  
  885. (* These are internal tokens to represent state of verification attempts
  886.  * shown here as a clue.
  887.  *)
  888.   okOk            * = menuHot;    (* guy didn't care                      *)
  889.   okAbort         * = 0004H;      (* window rendered question moot        *)
  890.   okCancel        * = menuCancel; (* window sent cancel reply          *)
  891.  
  892. (* This group of codes is for the IDCMP_WBENCHMESSAGE messages *)
  893.   wbenchOpen      * = 0001H;
  894.   wbenchClose     * = 0002H;
  895.  
  896.  
  897. TYPE
  898.  
  899. (* A data structure common in V36 Intuition processing   *)
  900.   IBox * = STRUCT
  901.     left * : INTEGER;
  902.     top * : INTEGER;
  903.     width * : INTEGER;
  904.     height * : INTEGER;
  905.   END;
  906.  
  907.  
  908.  
  909. (* ======================================================================== *)
  910. (* === Window ============================================================= *)
  911. (* ======================================================================== *)
  912.   Window * = STRUCT
  913.     nextWindow * : WindowPtr;           (* for the linked list in a screen *)
  914.  
  915.     leftEdge * , topEdge * : INTEGER;   (* screen dimensions of window *)
  916.     width * , height * : INTEGER;       (* screen dimensions of window *)
  917.  
  918.     mouseY * , mouseX * : INTEGER;      (* relative to upper-left of window *)
  919.  
  920.     minWidth * , minHeight * : INTEGER; (* minimum sizes *)
  921.     maxWidth * , maxHeight * : INTEGER; (* maximum sizes *)
  922.  
  923.     flags * : LONGSET;                  (* see below for defines *)
  924.  
  925.     menuStrip * : MenuPtr;              (* the strip of Menu headers *)
  926.  
  927.     title * : e.STRPTR;                 (* the title text for this window *)
  928.  
  929.     firstRequest * : RequesterPtr;      (* all active Requesters *)
  930.  
  931.     dmRequest * : RequesterPtr;         (* double-click Requester *)
  932.  
  933.     reqCount * : INTEGER;               (* count of reqs blocking Window *)
  934.  
  935.     wScreen * : ScreenPtr;              (* this Window's Screen *)
  936.     rPort * : g.RastPortPtr;            (* this Window's very own RastPort *)
  937.  
  938.     (* the border variables describe the window border.  If you specify
  939.      * WFLG_GIMMEZEROZERO when you open the window, then the upper-left of
  940.      * the ClipRect for this window will be upper-left of the BitMap (with
  941.      * correct offsets when in SuperBitMap mode; you MUST select
  942.      * WFLG_GIMMEZEROZERO when using SuperBitMap).  If you don't specify
  943.      * ZeroZero, then you save memory (no allocation of RastPort, Layer,
  944.      * ClipRect and associated Bitmaps), but you also must offset all your
  945.      * writes by BorderTop, BorderLeft and do your own mini-clipping to
  946.      * prevent writing over the system gadgets
  947.      *)
  948.     borderLeft * , borderTop * , borderRight * , borderBottom * : SHORTINT;
  949.     borderRPort * : g.RastPortPtr;
  950.  
  951.  
  952.     (* You supply a linked-list of Gadgets for your Window.
  953.      * This list DOES NOT include system gadgets.  You get the standard
  954.      * window system gadgets by setting flag-bits in the variable Flags (see
  955.      * the bit definitions below)
  956.      *)
  957.     firstGadget * : GadgetDummyPtr;
  958.  
  959.     (* these are for opening/closing the windows *)
  960.     parent * , descendant * : WindowPtr;
  961.  
  962.     (* sprite data information for your own Pointer
  963.      * set these AFTER you Open the Window by calling SetPointer()
  964.      *)
  965.     pointer * : e.APTR;    (* sprite data *)
  966.     ptrHeight * : SHORTINT;     (* sprite height (not including sprite padding) *)
  967.     ptrWidth * : SHORTINT;      (* sprite width (must be less than or equal to 16) *)
  968.     xOffset * , yOffset * : SHORTINT;      (* sprite offsets *)
  969.  
  970.     (* the IDCMP Flags and User's and Intuition's Message Ports *)
  971.     idcmpFlags * : LONGSET;   (* User-selected flags *)
  972.     userPort * : e.MsgPortPtr;
  973.     windowPort * : e.MsgPortPtr;
  974.     messageKey * : IntuiMessagePtr;
  975.  
  976.     detailPen * , blockPen * : SHORTINT;  (* for bar/border/gadget rendering *)
  977.  
  978.     (* the CheckMark is a pointer to the imagery that will be used when
  979.      * rendering MenuItems of this Window that want to be checkmarked
  980.      * if this is equal to NULL, you'll get the default imagery
  981.      *)
  982.     checkMark * : ImagePtr;
  983.  
  984.     screenTitle * : e.STRPTR; (* if non-null, Screen title when Window is active *)
  985.  
  986.     (* These variables have the mouse coordinates relative to the
  987.      * inner-Window of WFLG_GIMMEZEROZERO Windows.  This is compared with the
  988.      * MouseX and MouseY variables, which contain the mouse coordinates
  989.      * relative to the upper-left corner of the Window, WFLG_GIMMEZEROZERO
  990.      * notwithstanding
  991.      *)
  992.     gzzMouseX * : INTEGER;
  993.     gzzMouseY * : INTEGER;
  994.     (* these variables contain the width and height of the inner-Window of
  995.      * WFLG_GIMMEZEROZERO Windows
  996.      *)
  997.     gzzWidth * : INTEGER;
  998.     gzzHeight * : INTEGER;
  999.  
  1000.     extData * : e.APTR;
  1001.  
  1002.     userData * : e.APTR;     (* general-purpose pointer to User data extension *)
  1003.  
  1004.     (* 11/18/85: this pointer keeps a duplicate of what
  1005.      * Window.RPort->Layer is _supposed_ to be pointing at
  1006.      *)
  1007.     wLayer * : g.LayerPtr;
  1008.  
  1009.     (* NEW 1.2: need to keep track of the font that
  1010.      * OpenWindow opened, in case user SetFont's into RastPort
  1011.      *)
  1012.     iFont * : g.TextFontPtr;
  1013.  
  1014.     (* (V36) another flag word (the Flags field is used up).
  1015.      * At present, all flag values are system private.
  1016.      * Until further notice, you may not change nor use this field.
  1017.      *)
  1018.     moreFlags * : LONGSET;
  1019.  
  1020.     (**** Data beyond this point are Intuition Private.  DO NOT USE ****)
  1021.   END;
  1022.  
  1023. CONST
  1024. (* --- Flags requested at OpenWindow() time by the application --------- *)
  1025.   windowSizing   * = 0;      (* include sizing system-gadget? *)
  1026.   windowDrag     * = 1;      (* include dragging system-gadget? *)
  1027.   windowDepth    * = 2;      (* include depth arrangement gadget? *)
  1028.   windowClose    * = 3;      (* include close-box system-gadget? *)
  1029.  
  1030.   sizeBRight     * = 4;      (* size gadget uses right border *)
  1031.   sizeBBottom    * = 5;      (* size gadget uses bottom border *)
  1032.  
  1033. (* --- refresh modes ------------------------------------------------------ *)
  1034. (* combinations of the WFLG_REFRESHBITS select the refresh type *)
  1035.   refreshBits    * = LONGSET{6,7};
  1036.   smartRefresh   * = LONGSET{};
  1037.   simpleRefresh  * = 6;
  1038.   superBitMap    * = 7;
  1039.   otherRefresh   * = LONGSET{6,7};
  1040.  
  1041.   backDrop       * = 8;      (* this is a backdrop window *)
  1042.  
  1043.   reportMouse    * = 9;      (* to hear about every mouse move *)
  1044.  
  1045.   gimmeZeroZero  * = 10;     (* a GimmeZeroZero window       *)
  1046.  
  1047.   borderless     * = 11;     (* to get a Window sans border *)
  1048.  
  1049.   activate       * = 12;     (* when Window opens, it's Active *)
  1050.  
  1051. (* --- Other User Flags --------------------------------------------------- *)
  1052.   rmbTrap        * = 16;     (* Catch RMB events for your own *)
  1053.   noCareRefresh  * = 17;     (* not to be bothered with REFRESH *)
  1054.  
  1055. (* - V36 new Flags which the programmer may specify in NewWindow.Flags  *)
  1056.   nwExtended     * = 18;     (* extension data provided      *)
  1057.  
  1058. (* - V39 new Flags which the programmer may specify in NewWindow.Flags        *)
  1059.   newLookMenus   * = 21;     (* window has NewLook menus     *)
  1060.  
  1061.  
  1062. (* These flags are set only by Intuition.  YOU MAY NOT SET THEM YOURSELF! *)
  1063.   windowActive   * = 13;     (* this window is the active one *)
  1064.   inRequest      * = 14;     (* this window is in request mode *)
  1065.   menuState      * = 15;     (* Window is active with Menus on *)
  1066.   windowRefresh  * = 24;     (* Window is currently refreshing *)
  1067.   wbenchWindow   * = 25;     (* WorkBench tool ONLY Window *)
  1068.   windowTicked   * = 26;     (* only one timer tick at a time *)
  1069.  
  1070. (* V36 and higher flags to be set only by Intuition: *)
  1071.   visitor        * = 27;     (* visitor window               *)
  1072.   zoomed         * = 28;     (* identifies "zoom state"      *)
  1073.   hasZoom        * = 29;     (* windowhas a zoom gadget      *)
  1074.  
  1075. (* --- Other Window Values ---------------------------------------------- *)
  1076.   defaultMouseQueue * = 5;        (* no more mouse messages       *)
  1077.  
  1078. (* --- see struct IntuiMessage for the IDCMP Flag definitions ------------- *)
  1079.  
  1080.  
  1081.  
  1082. TYPE
  1083.  
  1084. (* ======================================================================== *)
  1085. (* === NewWindow ========================================================== *)
  1086. (* ======================================================================== *)
  1087. (*
  1088.  * Note that the new extension fields have been removed.  Use ExtNewWindow
  1089.  * structure below to make use of these fields
  1090.  *)
  1091.   NewWindow * = STRUCT
  1092.     leftEdge * , topEdge * : INTEGER;     (* screen dimensions of window *)
  1093.     width * , height * : INTEGER;         (* screen dimensions of window *)
  1094.  
  1095.     detailPen * , blockPen * : SHORTINT;  (* for bar/border/gadget rendering *)
  1096.  
  1097.     idcmpFlags * : LONGSET;               (* User-selected IDCMP flags *)
  1098.  
  1099.     flags * : LONGSET;                    (* see Window struct for defines *)
  1100.  
  1101.     (* You supply a linked-list of Gadgets for your Window.
  1102.      *  This list DOES NOT include system Gadgets.  You get the standard
  1103.      *  system Window Gadgets by setting flag-bits in the variable Flags (see
  1104.      *  the bit definitions under the Window structure definition)
  1105.      *)
  1106.     firstGadget * : GadgetDummyPtr;
  1107.  
  1108.     (* the CheckMark is a pointer to the imagery that will be used when
  1109.      * rendering MenuItems of this Window that want to be checkmarked
  1110.      * if this is equal to NULL, you'll get the default imagery
  1111.      *)
  1112.     checkMark * : ImagePtr;
  1113.  
  1114.     title * : e.STRPTR;                   (* the title text for this window *)
  1115.  
  1116.     (* the Screen pointer is used only if you've defined a CUSTOMSCREEN and
  1117.      * want this Window to open in it.  If so, you pass the address of the
  1118.      * Custom Screen structure in this variable.  Otherwise, this variable
  1119.      * is ignored and doesn't have to be initialized.
  1120.      *)
  1121.     screen * : ScreenPtr;
  1122.  
  1123.     (* WFLG_SUPER_BITMAP Window?  If so, put the address of your BitMap
  1124.      * structure in this variable.  If not, this variable is ignored and
  1125.      * doesn't have to be initialized
  1126.      *)
  1127.     bitMap * : g.BitMapPtr;
  1128.  
  1129.     (* the values describe the minimum and maximum sizes of your Windows.
  1130.      * these matter only if you've chosen the WFLG_SIZEGADGET option,
  1131.      * which means that you want to let the User to change the size of
  1132.      * this Window.  You describe the minimum and maximum sizes that the
  1133.      * Window can grow by setting these variables.  You can initialize
  1134.      * any one these to zero, which will mean that you want to duplicate
  1135.      * the setting for that dimension (if MinWidth == 0, MinWidth will be
  1136.      * set to the opening Width of the Window).
  1137.      * You can change these settings later using SetWindowLimits().
  1138.      * If you haven't asked for a SIZING Gadget, you don't have to
  1139.      * initialize any of these variables.
  1140.      *)
  1141.     minWidth * , minHeight * : INTEGER;       (* minimums *)
  1142.     maxWidth * , maxHeight * : INTEGER;       (* maximums *)
  1143.  
  1144.     (* the type variable describes the Screen in which you want this Window to
  1145.      * open.  The type value can either be CUSTOMSCREEN or one of the
  1146.      * system standard Screen Types such as WBENCHSCREEN.  See the
  1147.      * type definitions under the Screen structure.
  1148.      *)
  1149.     type * : SET;
  1150.   END;
  1151.  
  1152. (* The following structure is the future NewWindow.  Compatibility
  1153.  * issues require that the size of NewWindow not change.
  1154.  * Data in the common part (NewWindow) indicates the the extension
  1155.  * fields are being used.
  1156.  * NOTE WELL: This structure may be subject to future extension.
  1157.  * Writing code depending on its size is not allowed.
  1158.  *)
  1159.   ExtNewWindow * = STRUCT (nw * : NewWindow)
  1160.  
  1161.     (* ------------------------------------------------------- *
  1162.      * extensions for V36
  1163.      * if the NewWindow Flag value WFLG_NW_EXTENDED is set, then
  1164.      * this field is assumed to point to an array ( or chain of arrays)
  1165.      * of TagItem structures.  See also ExtNewScreen for another
  1166.      * use of TagItems to pass optional data.
  1167.      *
  1168.      * see below for tag values and the corresponding data.
  1169.      *)
  1170.     extension * : u.TagListPtr;
  1171.   END;
  1172.  
  1173. CONST
  1174.  
  1175. (*
  1176.  * The TagItem ID's (ti_Tag values) for OpenWindowTagList() follow.
  1177.  * They are values in a TagItem array passed as extension/replacement
  1178.  * values for the data in NewWindow.  OpenWindowTagList() can actually
  1179.  * work well with a NULL NewWindow pointer.
  1180.  *)
  1181.  
  1182.   waDummy            * = u.user + 99;  (* 0x80000063   *)
  1183.  
  1184. (* these tags simply override NewWindow parameters *)
  1185.   waLeft             * = waDummy + 001H;
  1186.   waTop              * = waDummy + 002H;
  1187.   waWidth            * = waDummy + 003H;
  1188.   waHeight           * = waDummy + 004H;
  1189.   waDetailPen        * = waDummy + 005H;
  1190.   waBlockPen         * = waDummy + 006H;
  1191.   waIDCMP            * = waDummy + 007H;
  1192.                   (* "bulk" initialization of NewWindow.Flags *)
  1193.   waFlags            * = waDummy + 008H;
  1194.   waGadgets          * = waDummy + 009H;
  1195.   waCheckmark        * = waDummy + 00AH;
  1196.   waTitle            * = waDummy + 00BH;
  1197.                   (* means you don't have to call SetWindowTitles
  1198.                    * after you open your window
  1199.                    *)
  1200.   waScreenTitle      * = waDummy + 00CH;
  1201.   waCustomScreen     * = waDummy + 00DH;
  1202.   waSuperBitMap      * = waDummy + 00EH;
  1203.                   (* also implies WFLG_SUPER_BITMAP property      *)
  1204.   waMinWidth         * = waDummy + 00FH;
  1205.   waMinHeight        * = waDummy + 010H;
  1206.   waMaxWidth         * = waDummy + 011H;
  1207.   waMaxHeight        * = waDummy + 012H;
  1208.  
  1209. (* The following are specifications for new features    *)
  1210.  
  1211.   waInnerWidth       * = waDummy + 013H;
  1212.   waInnerHeight      * = waDummy + 014H;
  1213.                   (* You can specify the dimensions of the interior
  1214.                    * region of your window, independent of what
  1215.                    * the border widths will be.  You probably want
  1216.                    * to also specify WA_AutoAdjust to allow
  1217.                    * Intuition to move your window or even
  1218.                    * shrink it so that it is completely on screen.
  1219.                    *)
  1220.  
  1221.   waPubScreenName    * = waDummy + 015H;
  1222.                   (* declares that you want the window to open as
  1223.                    * a visitor on the public screen whose name is
  1224.                    * pointed to by (UBYTE * )  ti_Data
  1225.                    *)
  1226.   waPubScreen        * = waDummy + 016H;
  1227.                   (* open as a visitor window on the public screen
  1228.                    * whose address is in (struct Screen * ) ti_Data.
  1229.                    * To ensure that this screen remains open, you
  1230.                    * should either be the screen's owner, have a
  1231.                    * window open on the screen, or use LockPubScreen().
  1232.                    *)
  1233.   waPubScreenFallBack* = waDummy + 017H;
  1234.                   (* A Boolean, specifies whether a visitor window
  1235.                    * should "fall back" to the default public screen
  1236.                    * (or Workbench) if the named public screen isn't
  1237.                    * available
  1238.                    *)
  1239.   waWindowName       * = waDummy + 018H;
  1240.                   (* not implemented      *)
  1241.   waColors           * = waDummy + 019H;
  1242.                   (* a ColorSpec array for colors to be set
  1243.                    * when this window is active.  This is not
  1244.                    * implemented, and may not be, since the default
  1245.                    * values to restore would be hard to track.
  1246.                    * We'd like to at least support per-window colors
  1247.                    * for the mouse pointer sprite.
  1248.                    *)
  1249.   waZoom             * = waDummy + 01AH;
  1250.                   (* ti_Data points to an array of four WORD's,
  1251.                    * the initial Left/Top/Width/Height values of
  1252.                    * the "alternate" zoom position/dimensions.
  1253.                    * It also specifies that you want a Zoom gadget
  1254.                    * for your window, whether or not you have a
  1255.                    * sizing gadget.
  1256.                    *)
  1257.   waMouseQueue       * = waDummy + 01BH;
  1258.                   (* ti_Data contains initial value for the mouse
  1259.                    * message backlog limit for this window.
  1260.                    *)
  1261.   waBackFill         * = waDummy + 01CH;
  1262.                   (* provides a "backfill hook" for your window's Layer.
  1263.                    * See layers.library/CreateUpfrontHookLayer().
  1264.                    *)
  1265.   waRptQueue         * = waDummy + 01DH;
  1266.                   (* initial value of repeat key backlog limit    *)
  1267.  
  1268.   (* These Boolean tag items are alternatives to the NewWindow.Flags
  1269.    * boolean flags with similar names.
  1270.    *)
  1271.   waSizeGadget       * = waDummy + 01EH;
  1272.   waDragBar          * = waDummy + 01FH;
  1273.   waDepthGadget      * = waDummy + 020H;
  1274.   waCloseGadget      * = waDummy + 021H;
  1275.   waBackdrop         * = waDummy + 022H;
  1276.   waReportMouse      * = waDummy + 023H;
  1277.   waNoCareRefresh    * = waDummy + 024H;
  1278.   waBorderless       * = waDummy + 025H;
  1279.   waActivate         * = waDummy + 026H;
  1280.   waRMBTrap          * = waDummy + 027H;
  1281.   waWBenchWindow     * = waDummy + 028H;      (* PIVATE!!! *)
  1282.   waSimpleRefresh    * = waDummy + 029H;
  1283.                   (* only specify if TRUE *)
  1284.   waSmartRefresh     * = waDummy + 02AH;
  1285.                   (* only specify if TRUE *)
  1286.   waSizeBRight       * = waDummy + 02BH;
  1287.   waSizeBBottom      * = waDummy + 02CH;
  1288.  
  1289.   (* New Boolean properties   *)
  1290.   waAutoAdjust       * = waDummy + 02DH;
  1291.                   (* shift or squeeze the window's position and
  1292.                    * dimensions to fit it on screen.
  1293.                    *)
  1294.  
  1295.   waGimmeZeroZero    * = waDummy + 02EH;
  1296.                   (* equiv. to NewWindow.Flags WFLG_GIMMEZEROZERO *)
  1297.  
  1298. (* New for V37: WA_MenuHelp (ignored by V36) *)
  1299.   waMenuHelp         * = waDummy + 02FH;
  1300.                   (* Enables IDCMP_MENUHELP:  Pressing HELP during menus
  1301.                    * will return IDCMP_MENUHELP message.
  1302.                    *)
  1303. (* New for V39:  (ignored by V37 and earlier) *)
  1304.   waNewLookMenus     * = waDummy + 030H;
  1305.                       (* Set to TRUE if you want NewLook menus *)
  1306.   waAmigaKey         * = waDummy + 031H;
  1307.                       (* Pointer to image for Amiga-key equiv in menus *)
  1308.   waNotifyDepth      * = waDummy + 032H;
  1309.                       (* Requests IDCMP_CHANGEWINDOW message when
  1310.                        * window is depth arranged
  1311.                        * (imsg->Code = CWCODE_DEPTH)
  1312.                        *)
  1313.  
  1314. (* WA_Dummy + 033 is obsolete *)
  1315.  
  1316.   waPointer          * = waDummy + 034H;
  1317.                       (* Allows you to specify a custom pointer
  1318.                        * for your window.  ti_Data points to a
  1319.                        * pointer object you obtained via
  1320.                        * "pointerclass". NULL signifies the
  1321.                        * default pointer.
  1322.                        * This tag may be passed to OpenWindowTags()
  1323.                        * or SetWindowPointer().
  1324.                        *)
  1325.  
  1326.   waBusyPointer      * = waDummy + 035H;
  1327.                       (* ti_Data is boolean.  Set to TRUE to
  1328.                        * request the standard busy pointer.
  1329.                        * This tag may be passed to OpenWindowTags()
  1330.                        * or SetWindowPointer().
  1331.                        *)
  1332.  
  1333.   waPointerDelay     * = waDummy + 036H;
  1334.                       (* ti_Data is boolean.  Set to TRUE to
  1335.                        * request that the changing of the
  1336.                        * pointer be slightly delayed.  The change
  1337.                        * will be called off if you call NewSetPointer()
  1338.                        * before the delay expires.  This allows
  1339.                        * you to post a busy-pointer even if you think
  1340.                        * the busy-time may be very short, without
  1341.                        * fear of a flashing pointer.
  1342.                        * This tag may be passed to OpenWindowTags()
  1343.                        * or SetWindowPointer().
  1344.                        *)
  1345.  
  1346.   waTabletMessages   * = waDummy + 037H;
  1347.                       (* ti_Data is a boolean.  Set to TRUE to
  1348.                        * request that tablet information be included
  1349.                        * in IntuiMessages sent to your window.
  1350.                        * Requires that something (i.e. a tablet driver)
  1351.                        * feed IESUBCLASS_NEWTABLET InputEvents into
  1352.                        * the system.  For a pointer to the TabletData,
  1353.                        * examine the ExtIntuiMessage->eim_TabletData
  1354.                        * field.  It is UNSAFE to check this field
  1355.                        * when running on pre-V39 systems.  It's always
  1356.                        * safe to check this field under V39 and up,
  1357.                        * though it may be NULL.
  1358.                        *)
  1359.  
  1360.   waHelpGroup        * = waDummy + 038H;
  1361.                       (* When the active window has gadget help enabled,
  1362.                        * other windows of the same HelpGroup number
  1363.                        * will also get GadgetHelp.  This allows GadgetHelp
  1364.                        * to work for multi-windowed applications.
  1365.                        * Use GetGroupID() to get an ID number.  Pass
  1366.                        * this number as ti_Data to all your windows.
  1367.                        * See also the HelpControl() function.
  1368.                        *)
  1369.  
  1370.   waHelpGroupWindow  * = waDummy + 039H;
  1371.                       (* When the active window has gadget help enabled,
  1372.                        * other windows of the same HelpGroup will also get
  1373.                        * GadgetHelp.  This allows GadgetHelp to work
  1374.                        * for multi-windowed applications.  As an alternative
  1375.                        * to WA_HelpGroup, you can pass a pointer to any
  1376.                        * other window of the same group to join its help
  1377.                        * group.  Defaults to NULL, which has no effect.
  1378.                        * See also the HelpControl() function.
  1379.                        *)
  1380.  
  1381.  
  1382. (* HelpControl() flags:
  1383.  *
  1384.  * HC_GADGETHELP - Set this flag to enable Gadget-Help for one or more
  1385.  * windows.
  1386.  *)
  1387.  
  1388.   hcGadgetHelp * = 1; (* is this flag bit or flag mask? [hG] *)
  1389.  
  1390.  
  1391. TYPE
  1392.  
  1393. (* ======================================================================== *)
  1394. (* === Remember =========================================================== *)
  1395. (* ======================================================================== *)
  1396. (* this structure is used for remembering what memory has been allocated to
  1397.  * date by a given routine, so that a premature abort or systematic exit
  1398.  * can deallocate memory cleanly, easily, and completely
  1399.  *)
  1400.   Remember * = STRUCT
  1401.     nextRemember * : RememberPtr;
  1402.     rememberSize * : LONGINT;
  1403.     memory * : e.APTR;
  1404.   END;
  1405.  
  1406.  
  1407. (* === Color Spec ====================================================== *)
  1408. (* How to tell Intuition about RGB values for a color table entry.
  1409.  * NOTE:  The way the structure was defined, the color value was
  1410.  * right-justified within each UWORD.  This poses problems for
  1411.  * extensibility to more bits-per-gun.        The SA_Colors32 tag to
  1412.  * OpenScreenTags() provides an alternate way to specify colors
  1413.  * with greater precision.
  1414.  *)
  1415.   ColorSpec * = STRUCT
  1416.     colorIndex * : INTEGER;     (* -1 terminates an array of ColorSpec  *)
  1417.     red        * : INTEGER;     (* only _bottom_ 4 bits recognized in V36 *)
  1418.     green      * : INTEGER;     (* only _bottom_ 4 bits recognized in V36 *)
  1419.     blue       * : INTEGER;     (* only _bottom_ 4 bits recognized in V36 *)
  1420.   END;
  1421.  
  1422. (* === Easy Requester Specification ======================================= *)
  1423. (* see also autodocs for EasyRequest and BuildEasyRequest       *)
  1424. (* NOTE: This structure may grow in size in the future          *)
  1425.   EasyStruct * = STRUCT
  1426.     structSize * : LONGINT;    (* should be sizeof (struct EasyStruct )*)
  1427.     flags * : LONGSET;         (* should be 0 for now                  *)
  1428.     title * : e.STRPTR;        (* title of requester window            *)
  1429.     textFormat * : e.STRPTR;   (* 'printf' style formatting string     *)
  1430.     gadgetFormat * : e.STRPTR; (* 'printf' style formatting string   *)
  1431.   END;
  1432.  
  1433.  
  1434.  
  1435. CONST
  1436.  
  1437. (* ======================================================================== *)
  1438. (* === Miscellaneous ====================================================== *)
  1439. (* ======================================================================== *)
  1440.  
  1441. (* = MENU STUFF =========================================================== *)
  1442.   noMenu   * = 0001FU;
  1443.   noItem   * = 0003FU;
  1444.   noSub    * = 0001FU;
  1445.   menuNull * = 0FFFFU;
  1446.  
  1447.  
  1448. (* these defines are for the COMMSEQ and CHECKIT menu stuff.  If CHECKIT,
  1449.  * I'll use a generic Width (for all resolutions) for the CheckMark.
  1450.  * If COMMSEQ, likewise I'll use this generic stuff
  1451.  *)
  1452.   checkWidth     * = 19;
  1453.   commWidth      * = 27;
  1454.   lowCheckWidth  * = 13;
  1455.   lowCommWidth   * = 16;
  1456.  
  1457.  
  1458. (* these are the AlertNumber defines.  if you are calling DisplayAlert()
  1459.  * the AlertNumber you supply must have the ALERT_TYPE bits set to one
  1460.  * of these patterns
  1461.  *)
  1462.   alertType     * = 80000000H;
  1463.   recoveryAlert * = 00000000H;      (* the system can recover from this *)
  1464.   deadendAlert  * = 80000000H;      (* no recovery possible, this is it *)
  1465.  
  1466.  
  1467. (* When you're defining IntuiText for the Positive and Negative Gadgets
  1468.  * created by a call to AutoRequest(), these defines will get you
  1469.  * reasonable-looking text.  The only field without a define is the IText
  1470.  * field; you decide what text goes with the Gadget
  1471.  *)
  1472.   autoFrontPen  * = 0;
  1473.   autoBackPen   * = 1;
  1474.   autoDrawMode  * = g.jam2;
  1475.   autoLeftEdge  * = 6;
  1476.   autoTopEdge   * = 3;
  1477.   autoITextFont * = NIL;
  1478.   autoNextText  * = NIL;
  1479.  
  1480.  
  1481. (* --- RAWMOUSE Codes and Qualifiers (Console OR IDCMP) ------------------- *)
  1482.   selectUp        * = ie.lButton + ie.upPrefix;
  1483.   selectDown      * = ie.lButton;
  1484.   menuUp          * = ie.rButton + ie.upPrefix;
  1485.   menuDown        * = ie.rButton;
  1486.   middleUp        * = ie.mButton + ie.upPrefix;
  1487.   middleDown      * = ie.mButton;
  1488.  
  1489.   altLeft         * = {ie.lAlt};
  1490.   altRight        * = {ie.rAlt};
  1491.   amigaLeft       * = {ie.lCommand};
  1492.   amigaRight      * = {ie.rCommand};
  1493.   amigaKeys       * = amigaLeft + amigaRight;
  1494.  
  1495.   cursorUp        * = 04CH;
  1496.   cursorLeft      * = 04FH;
  1497.   cursorRight     * = 04EH;
  1498.   cursorDown      * = 04DH;
  1499.   keyCodeQ        * = 010H;
  1500.   keyCodeZ        * = 031H;
  1501.   keyCodeX        * = 032H;
  1502.   keyCodeV        * = 034H;
  1503.   keyCodeB        * = 035H;
  1504.   keyCodeN        * = 036H;
  1505.   keyCodeM        * = 037H;
  1506.   keyCodeLess     * = 038H;
  1507.   keyCodeGreater  * = 039H;
  1508.  
  1509. (* New for V39, Intuition supports the IESUBCLASS_NEWTABLET subclass
  1510.  * of the IECLASS_NEWPOINTERPOS event.        The ie_EventAddress of such
  1511.  * an event points to a TabletData structure (see below).
  1512.  *
  1513.  * The TabletData structure contains certain elements including a taglist.
  1514.  * The taglist can be used for special tablet parameters.  A tablet driver
  1515.  * should include only those tag-items the tablet supports.  An application
  1516.  * can listen for any tag-items that interest it.  Note: an application
  1517.  * must set the WA_TabletMessages attribute to TRUE to receive this
  1518.  * extended information in its IntuiMessages.
  1519.  *
  1520.  * The definitions given here MUST be followed.  Pay careful attention
  1521.  * to normalization and the interpretation of signs.
  1522.  *
  1523.  * TABLETA_TabletZ:  the current value of the tablet in the Z direction.
  1524.  * This unsigned value should typically be in the natural units of the
  1525.  * tablet.  You should also provide TABLETA_RangeZ.
  1526.  *
  1527.  * TABLETA_RangeZ:  the maximum value of the tablet in the Z direction.
  1528.  * Normally specified along with TABLETA_TabletZ, this allows the
  1529.  * application to scale the actual Z value across its range.
  1530.  *
  1531.  * TABLETA_AngleX:  the angle of rotation or tilt about the X-axis.  This
  1532.  * number should be normalized to fill a signed long integer.  Positive
  1533.  * values imply a clockwise rotation about the X-axis when viewing
  1534.  * from +X towards the origin.
  1535.  *
  1536.  * TABLETA_AngleY:  the angle of rotation or tilt about the Y-axis.  This
  1537.  * number should be normalized to fill a signed long integer.  Positive
  1538.  * values imply a clockwise rotation about the Y-axis when viewing
  1539.  * from +Y towards the origin.
  1540.  *
  1541.  * TABLETA_AngleZ:  the angle of rotation or tilt about the Z axis.  This
  1542.  * number should be normalized to fill a signed long integer.  Positive
  1543.  * values imply a clockwise rotation about the Z-axis when viewing
  1544.  * from +Z towards the origin.
  1545.  *
  1546.  *    Note: a stylus that supports tilt should use the TABLETA_AngleX
  1547.  *    and TABLETA_AngleY attributes.  Tilting the stylus so the tip
  1548.  *    points towards increasing or decreasing X is actually a rotation
  1549.  *    around the Y-axis.  Thus, if the stylus tip points towards
  1550.  *    positive X, then that tilt is represented as a negative
  1551.  *    TABLETA_AngleY.  Likewise, if the stylus tip points towards
  1552.  *    positive Y, that tilt is represented by positive TABLETA_AngleX.
  1553.  *
  1554.  * TABLETA_Pressure:  the pressure reading of the stylus.  The pressure
  1555.  * should be normalized to fill a signed long integer.        Typical devices
  1556.  * won't generate negative pressure, but the possibility is not precluded.
  1557.  * The pressure threshold which is considered to cause a button-click is
  1558.  * expected to be set in a Preferences program supplied by the tablet
  1559.  * vendor.  The tablet driver would send IECODE_LBUTTON-type events as
  1560.  * the pressure crossed that threshold.
  1561.  *
  1562.  * TABLETA_ButtonBits:        ti_Data is a long integer whose bits are to
  1563.  * be interpreted at the state of the first 32 buttons of the tablet.
  1564.  *
  1565.  * TABLETA_InProximity:  ti_Data is a boolean.        For tablets that support
  1566.  * proximity, they should send the {TABLETA_InProximity,FALSE} tag item
  1567.  * when the stylus is out of proximity.  One possible use we can forsee
  1568.  * is a mouse-blanking commodity which keys off this to blank the
  1569.  * mouse.  When this tag is absent, the stylus is assumed to be
  1570.  * in proximity.
  1571.  *)
  1572.  
  1573.   tabletaDummy       * = u.user + 03A000H;
  1574.   tabletaTabletZ     * = tabletaDummy + 001H;
  1575.   tabletaRangeZ      * = tabletaDummy + 002H;
  1576.   tabletaAngleX      * = tabletaDummy + 003H;
  1577.   tabletaAngleY      * = tabletaDummy + 004H;
  1578.   tabletaAngleZ      * = tabletaDummy + 005H;
  1579.   tabletaPressure    * = tabletaDummy + 006H;
  1580.   tabletaButtonBits  * = tabletaDummy + 007H;
  1581.   tabletaInproximitY * = tabletaDummy + 008H;
  1582.  
  1583. (* If your window sets WA_TabletMessages to TRUE, then it will receive
  1584.  * extended IntuiMessages (struct ExtIntuiMessage) whose eim_TabletData
  1585.  * field points at a TabletData structure.  This structure contains
  1586.  * additional information about the input event.
  1587.  *)
  1588.  
  1589. TYPE
  1590.   TabletData * = STRUCT
  1591.     (* Sub-pixel position of tablet, in screen coordinates,
  1592.      * scaled to fill a UWORD fraction:
  1593.      *)
  1594.     xFraction *, yFraction *: INTEGER;
  1595.  
  1596.     (* Current tablet coordinates along each axis: *)
  1597.     tabletX *, tabletY: LONGINT;
  1598.  
  1599.     (* Tablet range along each axis.  For example, if td_TabletX
  1600.      * can take values 0-999, td_RangeX should be 1000.
  1601.      *)
  1602.     rangeX *, rangeY * : LONGINT;
  1603.  
  1604.     (* Pointer to tag-list of additional tablet attributes.
  1605.      * See <intuition/intuition.h> for the tag values.
  1606.      *)
  1607.     tagList * : u.TagListPtr;
  1608.   END;
  1609.  
  1610. (* If a tablet driver supplies a hook for td_CallBack, it will be
  1611.  * invoked in the standard hook manner.  A0 will point to the Hook
  1612.  * itself, A2 will point to the InputEvent that was sent, and
  1613.  * A1 will point to a TabletHookData structure.  The InputEvent's
  1614.  * ie_EventAddress field points at the IENewTablet structure that
  1615.  * the driver supplied.
  1616.  *
  1617.  * Based on the thd_Screen, thd_Width, and thd_Height fields, the driver
  1618.  * should scale the ient_TabletX and ient_TabletY fields and store the
  1619.  * result in ient_ScaledX, ient_ScaledY, ient_ScaledXFraction, and
  1620.  * ient_ScaledYFraction.
  1621.  *
  1622.  * The tablet hook must currently return NULL.        This is the only
  1623.  * acceptable return-value under V39.
  1624.  *)
  1625.  
  1626.   TabletHookData * = STRUCT
  1627.     (* Pointer to the active screen:
  1628.      * Note: if there are no open screens, thd_Screen will be NULL.
  1629.      * thd_Width and thd_Height will then describe an NTSC 640x400
  1630.      * screen.        Please scale accordingly.
  1631.      *)
  1632.     screen * : ScreenPtr;
  1633.  
  1634.     (* The width and height (measured in pixels of the active screen)
  1635.      * that your are to scale to:
  1636.      *)
  1637.     width  * : LONGINT;
  1638.     height * : LONGINT;
  1639.  
  1640.     (* Non-zero if the screen or something about the screen
  1641.      * changed since the last time you were invoked:
  1642.      *)
  1643.     screenChanged * : LONGINT;
  1644.   END;
  1645.  
  1646.  
  1647. TYPE
  1648.  
  1649. (*
  1650.  * Package of information passed to custom and 'boopsi'
  1651.  * gadget "hook" functions.  This structure is READ ONLY.
  1652.  *)
  1653.   GadgetInfo * = STRUCT
  1654.  
  1655.     screen * : ScreenPtr;
  1656.     window * : WindowPtr;                (* null for screen gadgets *)
  1657.     requester * : RequesterPtr;          (* null if not GTYP_REQGADGET *)
  1658.  
  1659.     (* rendering information:
  1660.      * don't use these without cloning/locking.
  1661.      * Official way is to call ObtainRPort()
  1662.      *)
  1663.     rastPort * : g.RastPortPtr;
  1664.     layer * : g.LayerPtr;
  1665.  
  1666.     (* copy of dimensions of screen/window/g00/req(/group)
  1667.      * that gadget resides in.  Left/Top of this box is
  1668.      * offset from window mouse coordinates to gadget coordinates
  1669.      *          screen gadgets:                 0,0 (from screen coords)
  1670.      *  window gadgets (no g00):        0,0
  1671.      *  GTYP_GZZGADGETs (borderlayer):          0,0
  1672.      *  GZZ innerlayer gadget:          borderleft, bordertop
  1673.      *  Requester gadgets:              reqleft, reqtop
  1674.      *)
  1675.     domain * : IBox;
  1676.  
  1677.     (* these are the pens for the window or screen      *)
  1678.  
  1679.     pens * : STRUCT
  1680.       detailPen * : SHORTINT;
  1681.       blockPen * : SHORTINT;
  1682.     END;
  1683.  
  1684.     (* the Detail and Block pens in gi_DrInfo->dri_Pens[] are
  1685.      * for the screen.  Use the above for window-sensitive
  1686.      * colors.
  1687.      *)
  1688.     drInfo * : DrawInfoPtr;
  1689.  
  1690.     (* reserved space: this structure is extensible
  1691.      * anyway, but using these saves some recompilation
  1692.      *)
  1693.     reserved * : ARRAY 6 OF LONGINT;
  1694.   END;
  1695.  
  1696. (*** system private data structure for now ***)
  1697. (* prop gadget extra info       *)
  1698.   PGX * = STRUCT
  1699.     container * : IBox;
  1700.     newKnob * : IBox;
  1701.   END;
  1702.  
  1703.  
  1704. (*** User visible handles on objects, classes, messages ***)
  1705.   ObjectUsr * = LONGINT;         (* abstract handle *)
  1706.  
  1707.   ClassID * = e.STRPTR;
  1708.  
  1709. (* you can use this type to point to a "generic" message,
  1710.  * in the object-oriented programming parlance.  Based on
  1711.  * the value of 'MethodID', you dispatch to processing
  1712.  * for the various message types.  The meaningful parameter
  1713.  * packet structure definitions are defined below.
  1714.  *)
  1715.   Msg * = STRUCT
  1716.     methodID * : LONGINT;
  1717.     (* method-specific data follows, some examples below *)
  1718.   END;
  1719.  
  1720. CONST
  1721.  
  1722. (*
  1723.  * Class id strings for Intuition classes.
  1724.  * There's no real reason to use the uppercase constants
  1725.  * over the lowercase strings, but this makes a good place
  1726.  * to list the names of the built-in classes.
  1727.  *)
  1728.   rootClass       * = "rootclass";             (* classusr.h   *)
  1729.   imageClass      * = "imageclass";            (* imageclass.h *)
  1730.   frameIClass     * = "frameiclass";
  1731.   sysIClass       * = "sysiclass";
  1732.   fillRectClass   * = "fillrectclass";
  1733.   gadgetClass     * = "gadgetclass";           (* gadgetclass.h *)
  1734.   propGClass      * = "propgclass";
  1735.   strGClass       * = "strgclass";
  1736.   buttonGClass    * = "buttongclass";
  1737.   frButtonClass   * = "frbuttonclass";
  1738.   groupGClass     * = "groupgclass";
  1739.   icClass         * = "icclass";               (* icclass.h    *)
  1740.   modelClass      * = "modelclass";
  1741.   itextIClass     * = "itexticlass";
  1742.   pointerClass    * = "pointerclass";          (* pointerclass.h *)
  1743.  
  1744.  
  1745. (* Dispatched method ID's
  1746.  * NOTE: Applications should use Intuition entry points, not direct
  1747.  * DoMethod() calls, for NewObject, DisposeObject, SetAttrs,
  1748.  * SetGadgetAttrs, and GetAttr.
  1749.  *)
  1750.  
  1751.   dummy        * = 0100H;
  1752.   new          * = 0101H; (* 'object' parameter is "true class"   *)
  1753.   dispose      * = 0102H; (* delete self (no parameters)          *)
  1754.   set          * = 0103H; (* set attributes (in tag list)         *)
  1755.   get          * = 0104H; (* return single attribute value        *)
  1756.   addTail      * = 0105H; (* add self to a List (let root do it)  *)
  1757.   remove       * = 0106H; (* remove self from list                *)
  1758.   notify       * = 0107H; (* send to self: notify dependents      *)
  1759.   update       * = 0108H; (* notification message from somebody   *)
  1760.   addMember    * = 0109H; (* used by various classes with lists   *)
  1761.   remMember    * = 010AH; (* used by various classes with lists   *)
  1762.  
  1763. (* Parameter "Messages" passed to methods       *)
  1764.  
  1765. TYPE
  1766.  
  1767. (* OM_NEW and OM_SET    *)
  1768.   OpSet * = STRUCT (msg * : Msg)
  1769.     attrList * : u.TagListPtr;  (* new attributes       *)
  1770.     gInfo * : GadgetInfoPtr;    (* always there for gadgets,
  1771.                                  * when SetGadgetAttrs() is used,
  1772.                                  * but will be NULL for OM_NEW
  1773.                                  *)
  1774.   END;
  1775.  
  1776. (* OM_NOTIFY, and OM_UPDATE     *)
  1777.   OpUpdate * = STRUCT (msg * : Msg)
  1778.     attrList * : u.TagListPtr;  (* new attributes       *)
  1779.     gInfo * : GadgetInfoPtr;    (* non-NULL when SetGadgetAttrs or
  1780.                                  * notification resulting from gadget
  1781.                                  * input occurs.
  1782.                                  *)
  1783.     flags * : LONGSET;      (* defined below        *)
  1784.   END;
  1785.  
  1786. CONST
  1787.  
  1788. (* this flag means that the update message is being issued from
  1789.  * something like an active gadget, a la GACT_FOLLOWMOUSE.  When
  1790.  * the gadget goes inactive, it will issue a final update
  1791.  * message with this bit cleared.  Examples of use are for
  1792.  * GACT_FOLLOWMOUSE equivalents for propgadclass, and repeat strobes
  1793.  * for buttons.
  1794.  *)
  1795.   interim * = 0;
  1796.  
  1797. TYPE
  1798.  
  1799. (* OM_GET       *)
  1800.   OpGet * = STRUCT (msg * : Msg)
  1801.     attrID  * : LONGINT;
  1802.     storage * : e.APTR;   (* may be other types, but "int"
  1803.                            * types are all ULONG
  1804.                            *)
  1805.   END;
  1806.  
  1807. (* OM_ADDTAIL   *)
  1808.   OpAddTail * = STRUCT (msg * : Msg)
  1809.     list * : e.ListPtr;
  1810.   END;
  1811.  
  1812. (* OM_ADDMEMBER, OM_REMMEMBER   *)
  1813.   OpMember * = STRUCT (msg * : Msg)
  1814.     object * : ObjectPtr;
  1815.   END;
  1816.  
  1817.  
  1818. (*******************************************)
  1819. (*** "White box" access to struct IClass ***)
  1820. (*******************************************)
  1821.  
  1822. (* This structure is READ-ONLY, and allocated only by Intuition *)
  1823.   IClass * = STRUCT (dispatcher * : u.Hook)
  1824.     reserved * : LONGINT;            (* must be 0  *)
  1825.     super    * : IClassPtr;
  1826.     id       * : ClassID;
  1827.  
  1828.     (* where within an object is the instance data for this class? *)
  1829.     instOffset * : INTEGER;
  1830.     instSize   * : INTEGER;
  1831.  
  1832.     userData      * : LONGINT; (* per-class data of your choice *)
  1833.     subclassCount * : LONGINT; (* how many direct subclasses?  *)
  1834.     objectCount   * : LONGINT; (* how many objects created of this class? *)
  1835.     flags         * : LONGSET;
  1836.   END;
  1837.  
  1838. CONST
  1839.   inList * = 0;        (* class is in public class list *)
  1840.  
  1841. TYPE
  1842.  
  1843. (**************************************************)
  1844. (*** "White box" access to struct _Object       ***)
  1845. (**************************************************)
  1846.  
  1847. (*
  1848.  * We have this, the instance data of the root class, PRECEDING
  1849.  * the "object".  This is so that Gadget objects are Gadget pointers,
  1850.  * and so on.  If this structure grows, it will always have o_Class
  1851.  * at the end, so the macro OCLASS(o) will always have the same
  1852.  * offset back from the pointer returned from NewObject().
  1853.  *
  1854.  * This data structure is subject to change.  Do not use the o_Node
  1855.  * embedded structure.
  1856.  *)
  1857.   Object * = STRUCT (node * : e.MinNode)
  1858.     class * : IClassPtr;
  1859.   END;
  1860.  
  1861. CONST
  1862.  
  1863. (* Gadget Class attributes      *)
  1864.  
  1865.   gaDummy             * = u.user + 30000H;
  1866.   gaLeft              * = gaDummy + 0001H;
  1867.   gaRelRight          * = gaDummy + 0002H;
  1868.   gaTop               * = gaDummy + 0003H;
  1869.   gaRelBottom         * = gaDummy + 0004H;
  1870.   gaWidth             * = gaDummy + 0005H;
  1871.   gaRelWidth          * = gaDummy + 0006H;
  1872.   gaHeight            * = gaDummy + 0007H;
  1873.   gaRelHeight         * = gaDummy + 0008H;
  1874.   gaText              * = gaDummy + 0009H; (* ti_Data is e.STRPTR *)
  1875.   gaImage             * = gaDummy + 000AH;
  1876.   gaBorder            * = gaDummy + 000BH;
  1877.   gaSelectRender      * = gaDummy + 000CH;
  1878.   gaHighlight         * = gaDummy + 000DH;
  1879.   gaDisabled          * = gaDummy + 000EH;
  1880.   gaGZZGadget         * = gaDummy + 000FH;
  1881.   gaID                * = gaDummy + 0010H;
  1882.   gaUserData          * = gaDummy + 0011H;
  1883.   gaSpecialInfo       * = gaDummy + 0012H;
  1884.   gaSelected          * = gaDummy + 0013H;
  1885.   gaEndGadget         * = gaDummy + 0014H;
  1886.   gaImmediate         * = gaDummy + 0015H;
  1887.   gaRelVerify         * = gaDummy + 0016H;
  1888.   gaFollowMouse       * = gaDummy + 0017H;
  1889.   gaRightBorder       * = gaDummy + 0018H;
  1890.   gaLeftBorder        * = gaDummy + 0019H;
  1891.   gaTopBorder         * = gaDummy + 001AH;
  1892.   gaBottomBorder      * = gaDummy + 001BH;
  1893.   gaToggleSelect      * = gaDummy + 001CH;
  1894.  
  1895.     (* internal use only, until further notice, please *)
  1896.   gaSysGadget         * = gaDummy + 001DH;
  1897.         (* bool, sets GTYP_SYSGADGET field in type      *)
  1898.   gaSysGType          * = gaDummy + 001EH;
  1899.         (* e.g., GTYP_WUPFRONT, ...     *)
  1900.  
  1901.   gaPrevious          * = gaDummy + 001FH;
  1902.         (* previous gadget (or (struct Gadget ** )) in linked list
  1903.          * NOTE: This attribute CANNOT be used to link new gadgets
  1904.          * into the gadget list of an open window or requester.
  1905.          * You must use AddGList().
  1906.          *)
  1907.  
  1908.   gaNext              * = gaDummy + 0020H;
  1909.          (* not implemented *)
  1910.  
  1911.   gaDrawInfo          * = gaDummy + 0021H;
  1912.         (* some fancy gadgets need to see a DrawInfo
  1913.          * when created or for layout
  1914.          *)
  1915.  
  1916. (* You should use at most ONE of gaText, gaIntuiText, and gaLabelImage *)
  1917.   gaIntuiText         * = gaDummy + 0022H;
  1918.         (* ti_Data is (struct IntuiText * ) *)
  1919.  
  1920.   gaLabelImage        * = gaDummy + 0023H;
  1921.         (* ti_Data is an image (object), used in place of
  1922.          * GadgetText
  1923.          *)
  1924.  
  1925.   gaTabCycle          * = gaDummy + 0024H;
  1926.        (* New for V37:
  1927.         * Boolean indicates that this gadget is to participate in
  1928.         * cycling activation with Tab or Shift-Tab.
  1929.         *)
  1930.  
  1931.   gaGadgetHelp       * = gaDummy + 00025H;
  1932.       (* New for V39:
  1933.        * Boolean indicates that this gadget sends gadget-help
  1934.        *)
  1935.  
  1936.   gaBounds           * = gaDummy + 00026H;
  1937.       (* New for V39:
  1938.        * ti_Data is a pointer to an IBox structure which is
  1939.        * to be copied into the extended gadget's bounds.
  1940.        *)
  1941.  
  1942.   gaRelSpecial       * = gaDummy + 00027H;
  1943.       (* New for V39:
  1944.        * Boolean indicates that this gadget has the "special relativity"
  1945.        * property, which is useful for certain fancy relativity
  1946.        * operations through the GM_LAYOUT method.
  1947.        *)
  1948.  
  1949.  
  1950.  
  1951. (* PROPGCLASS attributes *)
  1952.  
  1953.   pgaDummy       * = u.user  + 31000H;
  1954.   pgaFreedom     * = pgaDummy + 0001H;
  1955.   (* only one of FREEVERT or FREEHORIZ *)
  1956.   pgaBorderless  * = pgaDummy + 0002H;
  1957.   pgaHorizPot    * = pgaDummy + 0003H;
  1958.   pgaHorizBody   * = pgaDummy + 0004H;
  1959.   pgaVertPot     * = pgaDummy + 0005H;
  1960.   pgaVertBody    * = pgaDummy + 0006H;
  1961.   pgaTotal       * = pgaDummy + 0007H;
  1962.   pgaVisible     * = pgaDummy + 0008H;
  1963.   pgaTop         * = pgaDummy + 0009H;
  1964.   pgaNewLook     * = pgaDummy + 000AH;
  1965.  
  1966. (* STRGCLASS attributes *)
  1967.  
  1968.   stringaDummy           * = u.user + 32000H;
  1969.   stringaMaxChars        * = stringaDummy + 0001H;
  1970.  
  1971. (* Note:  There is a minor problem with Intuition when using boopsi integer
  1972.  * gadgets (which are requested by using STRINGA_LongInt).  Such gadgets
  1973.  * must not have a STRINGA_MaxChars to be bigger than 15.  Setting
  1974.  * STRINGA_MaxChars for a boopsi integer gadget will cause a mismatched
  1975.  * FreeMem() to occur.
  1976.  *)
  1977.  
  1978.   stringaBuffer          * = stringaDummy + 0002H;
  1979.   stringaUndoBuffer      * = stringaDummy + 0003H;
  1980.   stringaWorkBuffer      * = stringaDummy + 0004H;
  1981.   stringaBufferPos       * = stringaDummy + 0005H;
  1982.   stringaDispPos         * = stringaDummy + 0006H;
  1983.   stringaAltKeyMap       * = stringaDummy + 0007H;
  1984.   stringaFont            * = stringaDummy + 0008H;
  1985.   stringaPens            * = stringaDummy + 0009H;
  1986.   stringaActivePens      * = stringaDummy + 000AH;
  1987.   stringaEditHook        * = stringaDummy + 000BH;
  1988.   stringaEditModes       * = stringaDummy + 000CH;
  1989.  
  1990. (* booleans *)
  1991.   stringaReplaceMode     * = stringaDummy + 000DH;
  1992.   stringaFixedFieldMode  * = stringaDummy + 000EH;
  1993.   stringaNoFilterMode    * = stringaDummy + 000FH;
  1994.  
  1995.   stringaJustification   * = stringaDummy + 0010H;
  1996.   (* GACT_STRINGCENTER, GACT_STRINGLEFT, GACT_STRINGRIGHT *)
  1997.   stringaLongVal         * = stringaDummy + 0011H;
  1998.   stringaTextVal         * = stringaDummy + 0012H;
  1999.  
  2000.   stringaExitHelp        * = stringaDummy + 0013H;
  2001.         (* STRINGA_ExitHelp is new for V37, and ignored by V36.
  2002.          * Set this if you want the gadget to exit when Help is
  2003.          * pressed.  Look for a code of 0x5F, the rawkey code for Help
  2004.          *)
  2005.  
  2006.   sgDefaultMaxChars      * = 128;
  2007.  
  2008. (* Gadget Layout related attributes     *)
  2009.  
  2010.   layoutaDummy           * = u.user + 38000H;
  2011.   layoutaLayoutObj       * = layoutaDummy + 0001H;
  2012.   layoutaSpacing         * = layoutaDummy + 0002H;
  2013.   layoutaOrientation     * = layoutaDummy + 0003H;
  2014.  
  2015. (* orientation values   *)
  2016.   lorientNone   * = 0;
  2017.   lorientHoriz  * = 1;
  2018.   lorientVert   * = 2;
  2019.  
  2020.  
  2021. (* Gadget Method ID's   *)
  2022.  
  2023.   gmDummy       * = -1;    (* not used for anything                   *)
  2024.   gmHitTest      * =  0;   (* return GMR_GADGETHIT if you are clicked on
  2025.                             * (whether or not you are disabled).
  2026.                             *)
  2027.   gmRender      * = 1;     (* draw yourself, in the appropriate state *)
  2028.   gmGoActive    * = 2;     (* you are now going to be fed input    *)
  2029.   gmHandleInput * = 3;     (* handle that input                    *)
  2030.   gmGoInactive  * = 4;     (* whether or not by choice, you are done  *)
  2031.   gmHelpTest    * = 5;     (* Will you send gadget help if the mouse is
  2032.                             * at the specified coordinates?  See below
  2033.                             * for possible GMR_ values.
  2034.                             *)
  2035.   gmLayout      * = 6;     (* re-evaluate your size based on the GadgetInfo
  2036.                             * Domain.  Do NOT re-render yourself yet, you
  2037.                             * will be called when it is time...
  2038.                             *)
  2039.  
  2040. TYPE
  2041.  
  2042. (* Parameter "Messages" passed to gadget class methods  *)
  2043.  
  2044. (* GM_HITTEST and GM_HELPTEST send this message.
  2045.  * For GM_HITTEST, gpht_Mouse are coordinates relative to the gadget
  2046.  * select box.        For GM_HELPTEST, the coordinates are relative to
  2047.  * the gadget bounding box (which defaults to the select box).
  2048.  *)
  2049. (* GM_HITTEST   *)
  2050.   HitTest * = STRUCT (msg * : Msg)
  2051.     gInfo * : GadgetInfoPtr;
  2052.     mouse * : g.Point;
  2053.   END;
  2054.  
  2055.  
  2056. CONST
  2057.  (* For GM_HITTEST, return GMR_GADGETHIT if you were indeed hit,
  2058.  * otherwise return zero.
  2059.  *
  2060.  * For GM_HELPTEST, return GMR_NOHELPHIT (zero) if you were not hit.
  2061.  * Typically, return GMR_HELPHIT if you were hit.
  2062.  * It is possible to pass a UWORD to the application via the Code field
  2063.  * of the IDCMP_GADGETHELP message.  Return GMR_HELPCODE or'd with
  2064.  * the UWORD-sized result you wish to return.
  2065.  *
  2066.  * GMR_HELPHIT yields a Code value of ((UWORD) ~0), which should
  2067.  * mean "nothing particular" to the application.
  2068.  *)
  2069.  
  2070.   gadgetHit   * = 000000004;    (* GM_HITTEST hit *)
  2071.  
  2072.   noHelpHit   * = 000000000H;   (* GM_HELPTEST didn't hit *)
  2073.   helpHit     * = 0FFFFFFFFH;   (* GM_HELPTEST hit, return code = ~0 *)
  2074.   helpCode    * = 000010000H;   (* GM_HELPTEST hit, return low word as code *)
  2075.  
  2076.  
  2077. TYPE
  2078.  
  2079. (* GM_RENDER    *)
  2080.   Render * = STRUCT (msg * : Msg)
  2081.     gInfo * : GadgetInfoPtr;     (* gadget context               *)
  2082.     rPort * : g.RastPortPtr;     (* all ready for use            *)
  2083.     redraw * : LONGINT;          (* might be a "highlight pass"  *)
  2084.   END;
  2085.  
  2086. CONST
  2087.  
  2088. (* values of gpr_Redraw *)
  2089.   gRedrawUpdate * = 2;    (* incremental update, e.g. prop slider *)
  2090.   gRedrawRedraw * = 1;    (* redraw gadget        *)
  2091.   gRedrawToggle * = 0;    (* toggle highlight, if applicable      *)
  2092.  
  2093. TYPE
  2094.  
  2095. (* GM_GOACTIVE, GM_HANDLEINPUT  *)
  2096.   Input * = STRUCT (msg * : Msg)
  2097.     gInfo * : GadgetInfoPtr;
  2098.     iEvent * : ie.InputEventPtr;
  2099.     termination * : e.APTR;
  2100.     mouse * : g.Point;
  2101.  
  2102.     (* (V39) Pointer to TabletData structure, if this event originated
  2103.      * from a tablet which sends IESUBCLASS_NEWTABLET events, or NULL if
  2104.      * not.
  2105.      *
  2106.      * DO NOT ATTEMPT TO READ THIS FIELD UNDER INTUITION PRIOR TO V39!
  2107.      * IT WILL BE INVALID!
  2108.      *)
  2109.     tabletData * : TabletDataPtr;
  2110.   END;
  2111.  
  2112. CONST
  2113.  
  2114. (* GM_HANDLEINPUT and GM_GOACTIVE  return code flags    *)
  2115. (* return GMR_MEACTIVE (0) alone if you want more input.
  2116.  * Otherwise, return ONE of GMR_NOREUSE and GMR_REUSE, and optionally
  2117.  * GMR_VERIFY.
  2118.  *)
  2119.   gmrMeActive    * = 0;
  2120.   gmrNoReuse     * = 2;
  2121.   gmrReuse       * = 4;
  2122.   gmrVerify      * = 8;       (* you MUST set gpi_Termination *)
  2123.  
  2124.  
  2125. (* New for V37:
  2126.  * You can end activation with one of GMR_NEXTACTIVE and GMR_PREVACTIVE,
  2127.  * which instructs Intuition to activate the next or previous gadget
  2128.  * that has GFLG_TABCYCLE set.
  2129.  *)
  2130.   gmrNextActive  * = 16;
  2131.   gmrPrevActive  * = 32;
  2132.  
  2133. TYPE
  2134.  
  2135.   GoInactive * = STRUCT (msg * : Msg)
  2136.     gInfo * : GadgetInfoPtr;
  2137.     (* V37 field only!        DO NOT attempt to read under V36! *)
  2138.     abort * : LONGINT;                (* gpgi_Abort=1 if gadget was aborted
  2139.                                        * by Intuition and 0 if gadget went
  2140.                                        * inactive at its own request
  2141.                                        *)
  2142.   END;
  2143.  
  2144. (* New for V39: Intuition sends GM_LAYOUT to any GREL_ gadget when
  2145.  * the window opens, or when the gadget is activated, or when the
  2146.  * window is sized.  Your gadget can set the GA_RelSpecial property
  2147.  * to get GM_LAYOUT events without Intuition changing the interpretation
  2148.  * of your gadget select box.
  2149.  *)
  2150. (* GM_LAYOUT *)
  2151.   Layout * = STRUCT (msg * : Msg)
  2152.     gInfo * : GadgetInfoPtr;
  2153.     initial *: LONGINT;    (* non-zero if this method was invoked
  2154.                             * during AddGList() or OpenWindow()
  2155.                             * time.  zero if this method was invoked
  2156.                             * during window resizing.
  2157.                             *)
  2158.   END;
  2159.  
  2160.  
  2161. CONST
  2162.  (* ICCClass: *)
  2163.  
  2164.   icmDummy       * = 00401H;       (* used for nothing             *)
  2165.   icmSetLoop     * = 00402H;       (* set/increment loop counter   *)
  2166.   icmClearLoop   * = 00403H;       (* clear/decrement loop counter *)
  2167.   icmCheckLoop   * = 00404H;       (* set/increment loop           *)
  2168.  
  2169. (* no parameters for ICM_SETLOOP, ICM_CLEARLOOP, ICM_CHECKLOOP  *)
  2170.  
  2171. (* interconnection attributes used by icclass, modelclass, and gadgetclass *)
  2172.   icaDummy       * = u.user + 040000H;
  2173.   icatarget      * = icaDummy + 1;
  2174.   (* interconnection target               *)
  2175.   icamap         * = icaDummy + 2;
  2176.   (* interconnection map tagitem list     *)
  2177.   icSpecialCode  * = icaDummy + 3;
  2178.   (* a "pseudo-attribute", see below.     *)
  2179.  
  2180. (* Normally, the value for ICA_TARGET is some object pointer,
  2181.  * but if you specify the special value ICTARGET_IDCMP, notification
  2182.  * will be send as an IDCMP_IDCMPUPDATE message to the appropriate window's
  2183.  * IDCMP port.  See the definition of IDCMP_IDCMPUPDATE.
  2184.  *
  2185.  * When you specify ICTARGET_IDCMP for ICA_TARGET, the map you
  2186.  * specify will be applied to derive the attribute list that is
  2187.  * sent with the IDCMP_IDCMPUPDATE message.  If you specify a map list
  2188.  * which results in the attribute tag id ICSPECIAL_CODE, the
  2189.  * lower sixteen bits of the corresponding ti_Data value will
  2190.  * be copied into the Code field of the IDCMP_IDCMPUPDATE IntuiMessage.
  2191.  *)
  2192.   icTargetIDCMP * = -LONGSET{};
  2193.  
  2194.  
  2195. (* ImageClass: *)
  2196.  
  2197.   customImageDepth * = -1;
  2198. (* if image.depth is this, it's a new Image class object *)
  2199.  
  2200. (******************************************************)
  2201.   iaDummy                * = u.user + 20000H;
  2202.   iaLeft                 * = iaDummy + 001H;
  2203.   iaTop                  * = iaDummy + 002H;
  2204.   iaWidth                * = iaDummy + 003H;
  2205.   iaHeight               * = iaDummy + 004H;
  2206.   iaFGPen                * = iaDummy + 005H;
  2207.               (* iaFGPen also means "PlanePick"  *)
  2208.   iaBGPen                * = iaDummy + 006H;
  2209.               (* iaBGPen also means "PlaneOnOff" *)
  2210.   iaData                 * = iaDummy + 007H;
  2211.               (* bitplanes, for classic image,
  2212.                * other image classes may use it for other things
  2213.                *)
  2214.   iaLineWidth            * = iaDummy + 008H;
  2215.   iaPens                 * = iaDummy + 00EH;
  2216.               (* pointer to UWORD pens[],
  2217.                * ala DrawInfo.Pens, MUST be
  2218.                * terminated by ~0.  Some classes can
  2219.                * choose to have this, or SYSiaDrawInfo,
  2220.                * or both.
  2221.                *)
  2222.   iaResolution           * = iaDummy + 00FH;
  2223.               (* packed uwords for x/y resolution into a longword
  2224.                * ala DrawInfo.Resolution
  2225.                *)
  2226.  
  2227. (**** see class documentation to learn which    *****)
  2228. (**** classes recognize these                   *****)
  2229.   iaAPattern             * = iaDummy + 010H;
  2230.   iaAPatSize             * = iaDummy + 011H;
  2231.   iaMode                 * = iaDummy + 012H;
  2232.   iaFont                 * = iaDummy + 013H;
  2233.   iaOutline              * = iaDummy + 014H;
  2234.   iaRecessed             * = iaDummy + 015H;
  2235.   iaDoubleEmboss         * = iaDummy + 016H;
  2236.   iaEdgesOnly            * = iaDummy + 017H;
  2237.  
  2238. (**** "sysiclass" attributes                    *****)
  2239.   sysiaSize              * = iaDummy + 00BH;
  2240.               (* #define's below          *)
  2241.   sysiaDepth             * = iaDummy + 00CH;
  2242.               (* this is unused by Intuition.  sysiaDrawInfo
  2243.                * is used instead for V36
  2244.                *)
  2245.   sysiaWhich             * = iaDummy + 00DH;
  2246.               (* see #define's below      *)
  2247.   sysiaDrawInfo          * = iaDummy + 018H;
  2248.               (* pass to sysiclass, please *)
  2249.  
  2250. (*****  obsolete: don't use these, use iaPens  *****)
  2251.   sysiaPens              * = iaPens;
  2252.   iaShadowPen            * = iaDummy + 009H;
  2253.   iaHighlightPen         * = iaDummy + 00AH;
  2254.  
  2255. (* New for V39: *)
  2256.   sysiaReferencefont     * = iaDummy + 019H;
  2257.                   (* Font to use as reference for scaling
  2258.                    * certain sysiclass images
  2259.                    *)
  2260.   iaSupportsdisable      * = iaDummy + 01AH;
  2261.                   (* By default, Intuition ghosts gadgets itself,
  2262.                    * instead of relying on IDS_DISABLED or
  2263.                    * IDS_SELECTEDDISABLED.  An imageclass that
  2264.                    * supports these states should return this attribute
  2265.                    * as TRUE.  You cannot set or clear this attribute,
  2266.                    * however.
  2267.                    *)
  2268.  
  2269.   iaFrametype            * = iaDummy + 01BH;
  2270.                   (* Starting with V39, FrameIClass recognizes
  2271.                    * several standard types of frame.  Use one
  2272.                    * of the FRAME_ specifiers below.  Defaults
  2273.                    * to FRAME_DEFAULT.
  2274.                    *)
  2275.  
  2276. (** next attribute: (iaDummy + 0x1c)   **)
  2277. (*************************************************)
  2278.  
  2279. (* data values for sysiaSize   *)
  2280.   sysIsSizeMedRes * = 0;
  2281.   sysIsSizeLowRes * = 1;
  2282.   sysIsSizeHires  * = 2;
  2283.  
  2284. (*
  2285.  * sysiaWhich tag data values:
  2286.  * Specifies which system gadget you want an image for.
  2287.  * Some numbers correspond to internal Intuition #defines
  2288.  *)
  2289.   depthImage  * = 000H; (* Window depth gadget image *)
  2290.   zoomImage   * = 001H; (* Window zoom gadget image *)
  2291.   sizeImage   * = 002H; (* Window sizing gadget image *)
  2292.   closeImage  * = 003H; (* Window close gadget image *)
  2293.   sDepthImage * = 005H; (* Screen depth gadget image *)
  2294.   leftImage   * = 00AH; (* Left-arrow gadget image *)
  2295.   upImage     * = 00BH; (* Up-arrow gadget image *)
  2296.   rightImage  * = 00CH; (* Right-arrow gadget image *)
  2297.   downImage   * = 00DH; (* Down-arrow gadget image *)
  2298.   checkImage  * = 00EH; (* GadTools checkbox image *)
  2299.   mxImage     * = 00FH; (* GadTools mutual exclude "button" image *)
  2300. (* New for V39: *)
  2301.   menucheck   * = 010H; (* Menu checkmark image *)
  2302.   amigakey    * = 011H; (* Menu Amiga-key image *)
  2303.  
  2304. (* Data values for IA_FrameType (recognized by FrameIClass)
  2305.  *
  2306.  * FRAME_DEFAULT:  The standard V37-type frame, which has
  2307.  *    thin edges.
  2308.  * FRAME_BUTTON:  Standard button gadget frames, having thicker
  2309.  *    sides and nicely edged corners.
  2310.  * FRAME_RIDGE:  A ridge such as used by standard string gadgets.
  2311.  *    You can recess the ridge to get a groove image.
  2312.  * FRAME_ICONDROPBOX: A broad ridge which is the standard imagery
  2313.  *    for areas in AppWindows where icons may be dropped.
  2314.  *)
  2315.  
  2316.   frameDefault     * =  0;
  2317.   frameButton      * =  1;
  2318.   frameRidge       * =  2;
  2319.   frameIcondropbox * =  3;
  2320.  
  2321.  
  2322. (* image message id's   *)
  2323.   imDraw       * = 0202H;  (* draw yourself, with "state"          *)
  2324.   imHitTest    * = 0203H;  (* return TRUE if click hits image      *)
  2325.   imErase      * = 0204H;  (* erase yourself                       *)
  2326.   imMove       * = 0205H;  (* draw new and erase old, smoothly     *)
  2327.  
  2328.   imDrawFrame  * = 0206H;  (* draw with specified dimensions       *)
  2329.   imFrameBox   * = 0207H;  (* get recommended frame around some box*)
  2330.   imHitFrame   * = 0208H;  (* hittest with dimensions              *)
  2331.   imEraseFrame * = 0209H; (* hittest with dimensions              *)
  2332.  
  2333. (* image draw states or styles, for IM_DRAW *)
  2334. (* Note that they have no bitwise meanings (unfortunately) *)
  2335.   idsNormal           * = 0;
  2336.   idsSelected         * = 1;    (* for selected gadgets     *)
  2337.   idsDisabled         * = 2;    (* for disabled gadgets     *)
  2338.   idsBusy             * = 3;    (* for future functionality *)
  2339.   idsIndeterminate    * = 4;    (* for future functionality *)
  2340.   idsInactiveNormal   * = 5;    (* normal, in inactive window border *)
  2341.   idsInactiveSelected * = 6;    (* selected, in inactive border *)
  2342.   idsInactiveDisabled * = 7;    (* disabled, in inactive border *)
  2343.   idsSelectedDisabled * = 8;    (* disabled and selected    *)
  2344.  
  2345. TYPE
  2346.  
  2347. (* IM_FRAMEBOX  *)
  2348.   FrameBox * = STRUCT (msg * : Msg)
  2349.     contentsBox * : IBoxPtr;       (* input: relative box of contents *)
  2350.     frameBox * : IBoxPtr;          (* output: rel. box of encl frame  *)
  2351.     drInfo * : DrawInfoPtr;
  2352.     frameFlags * : LONGSET;
  2353.   END;
  2354.  
  2355. CONST
  2356.  
  2357.   frameFSpecify * = 0;   (* Make do with the dimensions of FrameBox
  2358.                           * provided.
  2359.                           *)
  2360.  
  2361. TYPE
  2362.   Dimensions * = STRUCT  (* used by the following structs *)
  2363.     width * : INTEGER;
  2364.     height * : INTEGER;
  2365.   END;
  2366.  
  2367. (* IM_DRAW, IM_DRAWFRAME        *)
  2368.   Draw * = STRUCT (msg * : Msg)
  2369.     rPort * : g.RastPortPtr;
  2370.     offset * : g.Point;
  2371.     state * : LONGINT;
  2372.     drInfo * : DrawInfoPtr;
  2373.  
  2374.     (* these parameters only valid for IM_DRAWFRAME *)
  2375.     dimensions * : Dimensions;
  2376.   END;
  2377.  
  2378. (* IM_ERASE, IM_ERASEFRAME      *)
  2379. (* NOTE: This is a subset of impDraw    *)
  2380.   Erase * = STRUCT (msg * : Msg)
  2381.     rPort * : g.RastPortPtr;
  2382.     offset * : g.Point;
  2383.  
  2384.     (* these parameters only valid for IM_ERASEFRAME *)
  2385.     dimensions * : Dimensions;
  2386.   END;
  2387.  
  2388. (* IM_HITTEST, IM_HITFRAME      *)
  2389.   IMHitTest * = STRUCT (msg * : Msg)
  2390.     point * : g.Point;
  2391.  
  2392.     (* these parameters only valid for IM_HITFRAME *)
  2393.     dimensions * : Dimensions;
  2394.   END;
  2395.  
  2396. CONST
  2397.  
  2398. (* ---- pointer class --------------------------------------------- *)
  2399.  
  2400.  
  2401. (* The following tags are recognized at NewObject() time by
  2402.  * pointerclass:
  2403.  *
  2404.  * POINTERA_BitMap (struct BitMap * ) - Pointer to bitmap to
  2405.  *      get pointer imagery from.  Bitplane data need not be
  2406.  *      in chip RAM.
  2407.  * POINTERA_XOffset (LONG) - X-offset of the pointer hotspot.
  2408.  * POINTERA_YOffset (LONG) - Y-offset of the pointer hotspot.
  2409.  * POINTERA_WordWidth (ULONG) - designed width of the pointer in words
  2410.  * POINTERA_XResolution (ULONG) - one of the POINTERXRESN_ flags below
  2411.  * POINTERA_YResolution (ULONG) - one of the POINTERYRESN_ flags below
  2412.  *
  2413.  *)
  2414.  
  2415.   pointeraDummy       * =  u.user + 039000H;
  2416.  
  2417.   pointeraBitMap      * =  pointeraDummy + 001H;
  2418.   pointeraXOffset     * =  pointeraDummy + 002H;
  2419.   pointeraYOffset     * =  pointeraDummy + 003H;
  2420.   pointeraWordWidth   * =  pointeraDummy + 004H;
  2421.   pointeraXResolution * =  pointeraDummy + 005H;
  2422.   pointeraYResolution * =  pointeraDummy + 006H;
  2423.  
  2424. (* These are the choices for the POINTERA_XResolution attribute which
  2425.  * will determine what resolution pixels are used for this pointer.
  2426.  *
  2427.  * POINTERXRESN_DEFAULT (ECS-compatible pointer width)
  2428.  *      = 70 ns if SUPERHIRES-type mode, 140 ns if not
  2429.  *
  2430.  * POINTERXRESN_SCREENRES
  2431.  *      = Same as pixel speed of screen
  2432.  *
  2433.  * POINTERXRESN_LORES (pointer always in lores-like pixels)
  2434.  *      = 140 ns in 15kHz modes, 70 ns in 31kHz modes
  2435.  *
  2436.  * POINTERXRESN_HIRES (pointer always in hires-like pixels)
  2437.  *      = 70 ns in 15kHz modes, 35 ns in 31kHz modes
  2438.  *
  2439.  * POINTERXRESN_140NS (pointer always in 140 ns pixels)
  2440.  *      = 140 ns always
  2441.  *
  2442.  * POINTERXRESN_70NS (pointer always in 70 ns pixels)
  2443.  *      = 70 ns always
  2444.  *
  2445.  * POINTERXRESN_35NS (pointer always in 35 ns pixels)
  2446.  *      = 35 ns always
  2447.  *)
  2448.  
  2449.   pointerXResnDefault   * = 0;
  2450.   pointerXResn140ns     * = 1;
  2451.   pointerXResn70ns      * = 2;
  2452.   pointerXResn35ns      * = 3;
  2453.  
  2454.   pointerXResnScreenRes * = 4;
  2455.   pointerXResnLores     * = 5;
  2456.   pointerXResnHires     * = 6;
  2457.  
  2458. (* These are the choices for the POINTERA_YResolution attribute which
  2459.  * will determine what vertical resolution is used for this pointer.
  2460.  *
  2461.  * POINTERYRESN_DEFAULT
  2462.  *      = In 15 kHz modes, the pointer resolution will be the same
  2463.  *        as a non-interlaced screen.  In 31 kHz modes, the pointer
  2464.  *        will be doubled vertically.  This means there will be about
  2465.  *        200-256 pointer lines per screen.
  2466.  *
  2467.  * POINTERYRESN_HIGH
  2468.  * POINTERYRESN_HIGHASPECT
  2469.  *      = Where the hardware/software supports it, the pointer resolution
  2470.  *        will be high.  This means there will be about 400-480 pointer
  2471.  *        lines per screen.  POINTERYRESN_HIGHASPECT also means that
  2472.  *        when the pointer comes out double-height due to hardware/software
  2473.  *        restrictions, its width would be doubled as well, if possible
  2474.  *        (to preserve aspect).
  2475.  *
  2476.  * POINTERYRESN_SCREENRES
  2477.  * POINTERYRESN_SCREENRESASPECT
  2478.  *      = Will attempt to match the vertical resolution of the pointer
  2479.  *        to the screen's vertical resolution.  POINTERYRESN_HIGHASPECT also
  2480.  *        means that when the pointer comes out double-height due to
  2481.  *        hardware/software restrictions, its width would be doubled as well,
  2482.  *        if possible (to preserve aspect).
  2483.  *
  2484.  *)
  2485.  
  2486.   pointerYResnDefault         * = 0;
  2487.   pointerYResnHigh            * = 2;
  2488.   pointerYResnHighAspect      * = 3;
  2489.   pointerYResnScreenRes       * = 4;
  2490.   pointerYResnScreenResAspect * = 5;
  2491.  
  2492.  
  2493. (* ======================================================================== *)
  2494. (* === Preferences ======================================================== *)
  2495. (* ======================================================================== *)
  2496.  
  2497. (* these are the definitions for the printer configurations *)
  2498.   filenameSize * = 30;      (* Filename size *)
  2499.   devNameSize  * = 16;      (* Device-name size *)
  2500.  
  2501.   pointerSize * = (1 + 16 + 1) * 2;    (* Size of Pointer data buffer *)
  2502.  
  2503. (* These defines are for the default font size.  These actually describe the
  2504.  * height of the defaults fonts.  The default font type is the topaz
  2505.  * font, which is a fixed width font that can be used in either
  2506.  * eighty-column or sixty-column mode.  The Preferences structure reflects
  2507.  * which is currently selected by the value found in the variable FontSize,
  2508.  * which may have either of the values defined below.  These values actually
  2509.  * are used to select the height of the default font.  By changing the
  2510.  * height, the resolution of the font changes as well.
  2511.  *)
  2512.   topazEighty * = 8;
  2513.   topazSixty * = 9;
  2514.  
  2515. TYPE
  2516.   Filename * = ARRAY filenameSize OF CHAR;
  2517.  
  2518. (* Note:  Starting with V36, and continuing with each new version of
  2519.  * Intuition, an increasing number of fields of struct Preferences
  2520.  * are ignored by SetPrefs().  (Some fields are obeyed only at the
  2521.  * initial SetPrefs(), which comes from the devs:system-configuration
  2522.  * file).  Elements are generally superseded as new hardware or software
  2523.  * features demand more information than fits in struct Preferences.
  2524.  * Parts of struct Preferences must be ignored so that applications
  2525.  * calling GetPrefs(), modifying some other part of struct Preferences,
  2526.  * then calling SetPrefs(), don't end up truncating the extended
  2527.  * data.
  2528.  *
  2529.  * Consult the autodocs for SetPrefs() for further information as
  2530.  * to which fields are not always respected.
  2531.  *)
  2532.  
  2533.   Preferences * = STRUCT
  2534.  
  2535.     (* the default font height *)
  2536.     fontHeight  * : SHORTINT;          (* height for system default font  *)
  2537.  
  2538.     (* constant describing what's hooked up to the port *)
  2539.     printerPort * : SHORTINT;          (* printer port connection         *)
  2540.  
  2541.     (* the baud rate of the port *)
  2542.     baudRate    * : INTEGER;           (* baud rate for the serial port   *)
  2543.  
  2544.     (* various timing rates *)
  2545.     keyRptSpeed * : t.TimeVal;         (* repeat speed for keyboard       *)
  2546.     keyRptDelay * : t.TimeVal;         (* Delay before keys repeat        *)
  2547.     doubleClick * : t.TimeVal;         (* Interval allowed between clicks *)
  2548.  
  2549.     (* Intuition Pointer data *)
  2550.     pointerMatrix * : ARRAY pointerSize OF INTEGER;  (* Definition of pointer sprite    *)
  2551.     xOffset      * : SHORTINT;         (* X-Offset for active 'bit'       *)
  2552.     yOffset      * : SHORTINT;         (* Y-Offset for active 'bit'       *)
  2553.     color17      * : INTEGER;          (***********************************)
  2554.     color18      * : INTEGER;          (* Colours for sprite pointer      *)
  2555.     color19      * : INTEGER;          (***********************************)
  2556.     pointerTicks * : INTEGER;          (* Sensitivity of the pointer      *)
  2557.  
  2558.     (* Workbench Screen colors *)
  2559.     color0 * : INTEGER;                (***********************************)
  2560.     color1 * : INTEGER;                (*  Standard default colours       *)
  2561.     color2 * : INTEGER;                (*   Used in the Workbench         *)
  2562.     color3 * : INTEGER;                (***********************************)
  2563.  
  2564.     (* positioning data for the Intuition View *)
  2565.     viewXOffset  * : SHORTINT;         (* Offset for top lefthand corner  *)
  2566.     viewYOffset  * : SHORTINT;         (* X and Y dimensions              *)
  2567.     viewInitX    * ,
  2568.     viewInitY    * : INTEGER;          (* View initial offset values      *)
  2569.  
  2570.     enableCLI    * : SET;              (* CLI availability switch *)
  2571.  
  2572.     (* printer configurations *)
  2573.     printerType     * : INTEGER;       (* printer type            *)
  2574.     printerFilename * : Filename;      (* file for printer        *)
  2575.  
  2576.     (* print format and quality configurations *)
  2577.     printPitch       * : INTEGER;      (* print pitch                     *)
  2578.     printQuality     * : INTEGER;      (* print quality                   *)
  2579.     printSpacing     * : INTEGER;      (* number of lines per inch        *)
  2580.     printLeftMargin  * : INTEGER;      (* left margin in characters       *)
  2581.     printRightMargin * : INTEGER;      (* right margin in characters      *)
  2582.     printImage       * : INTEGER;      (* positive or negative            *)
  2583.     printAspect      * : INTEGER;      (* horizontal or vertical          *)
  2584.     printShade       * : INTEGER;      (* b&w, half-tone, or color        *)
  2585.     printThreshold   * : INTEGER;      (* darkness ctrl for b/w dumps     *)
  2586.  
  2587.     (* print paper descriptors *)
  2588.     paperSize   * : INTEGER;           (* paper size                      *)
  2589.     paperLength * : INTEGER;           (* paper length in number of lines *)
  2590.     paperType   * : INTEGER;           (* continuous or single sheet      *)
  2591.  
  2592.     (* Serial device settings: These are six nibble-fields in three bytes *)
  2593.     (* (these look a little strange so the defaults will map out to zero) *)
  2594.     serRWBits  * : e.BYTE;              (* upper nibble = (8-number of read bits)   *)
  2595.                                        (* lower nibble = (8-number of write bits)   *)
  2596.     serStopBuf * : e.BYTE;             (* upper nibble = (number of stop bits - 1)  *)
  2597.                                        (* lower nibble = (table value for BufSize)  *)
  2598.     serParShk  * : e.BYTE;             (* upper nibble = (value for Parity setting) *)
  2599.                                        (* lower nibble = (value for Handshake mode) *)
  2600.     laceWB     * : SHORTSET;           (* if workbench is to be interlaced          *)
  2601.  
  2602.     pad        *: ARRAY 12 OF e.UBYTE;
  2603.     prtDevName *: ARRAY devNameSize OF CHAR; (* device used by printer.device
  2604.                                               * (omit the ".device")
  2605.                                               *)
  2606.     defaultPrtUnit * : SHORTINT;       (* default unit opened by printer.device *)
  2607.     defaultSerUnit * : SHORTINT;       (* default serial unit *)
  2608.  
  2609.     rowSizeChange    * : SHORTINT;     (* affect NormalDisplayRows/Columns     *)
  2610.     columnSizeChange * : SHORTINT;
  2611.  
  2612.     printFlags     * : SET;            (* user preference flags *)
  2613.     printMaxWidth  * : INTEGER;        (* max width of printed picture in 10ths/in  *)
  2614.     printMaxHeight * : INTEGER;        (* max height of printed picture in 10ths/in *)
  2615.     printDensity   * : SHORTINT;       (* print density *)
  2616.     printXOffset   * : SHORTINT;       (* offset of printed picture in 10ths/inch *)
  2617.  
  2618.     width   * : INTEGER;               (* override default workbench width  *)
  2619.     height  * : INTEGER;               (* override default workbench height *)
  2620.     depth   * : SHORTINT;              (* override default workbench depth  *)
  2621.  
  2622.     extSize * : SHORTINT;              (* extension information -- do not touch! *)
  2623.                                        (* extension size in blocks of 64 bytes   *)
  2624.   END;
  2625.  
  2626. CONST
  2627.  
  2628. (* Workbench Interlace (use one bit) *)
  2629.   laceWB          * = 0;
  2630.   lwReserved      * = 1;          (* internal use only *)
  2631.  
  2632. (* Enable_CLI   *)
  2633.   screenDrag      * = 14;
  2634.   mouseAccel      * = 15;
  2635.  
  2636. (* PrinterPort *)
  2637.   parallelPrinter * = 00H;
  2638.   serialPrinter   * = 01H;
  2639.  
  2640. (* BaudRate *)
  2641.   baud110      * = 000H;
  2642.   baud300      * = 001H;
  2643.   baud1200     * = 002H;
  2644.   baud2400     * = 003H;
  2645.   baud4800     * = 004H;
  2646.   baud9600     * = 005H;
  2647.   baud19200    * = 006H;
  2648.   baudMidi     * = 007H;
  2649.  
  2650. (* PaperType *)
  2651.   fanfold      * = 000H;
  2652.   single       * = 080H;
  2653.  
  2654. (* PrintPitch *)
  2655.   pica         * = 0000H;
  2656.   elite        * = 0400H;
  2657.   fine         * = 0800H;
  2658.  
  2659. (* PrintQuality *)
  2660.   draft        * = 0000H;
  2661.   letter       * = 0100H;
  2662.  
  2663. (* PrintSpacing *)
  2664.   sixLPI       * = 0000H;
  2665.   eightLPI     * = 0200H;
  2666.  
  2667. (* Print Image *)
  2668.   imagePositive * = 000H;
  2669.   imageNegative * = 001H;
  2670.  
  2671. (* PrintAspect *)
  2672.   aspectHoriz  * = 000H;
  2673.   aspectVert   * = 001H;
  2674.  
  2675. (* PrintShade *)
  2676.   shadeBW        * = 000H;
  2677.   shadeGreyScale * = 001H;
  2678.   shadeColor     * = 002H;
  2679.  
  2680. (* PaperSize (all paper sizes have a zero in the lowest nybble) *)
  2681.   usLetter     * = 000H;
  2682.   usLegal      * = 010H;
  2683.   nTractor     * = 020H;
  2684.   wTractor     * = 030H;
  2685.   custom       * = 040H;
  2686.  
  2687. (* PrinterType *)
  2688.   customName           * = 000H;
  2689.   alphaP101            * = 001H;
  2690.   brother15XL          * = 002H;
  2691.   cbmMps1000           * = 003H;
  2692.   diab630              * = 004H;
  2693.   diabAdvD25           * = 005H;
  2694.   diabC150             * = 006H;
  2695.   epson                * = 007H;
  2696.   epsonJX80            * = 008H;
  2697.   okimate20            * = 009H;
  2698.   qumeLP20             * = 00AH;
  2699. (* new printer entries, 3 October 1985 *)
  2700.   hpLaserjet           * = 00BH;
  2701.   hpLaserjetPlus       * = 00CH;
  2702.  
  2703. (* Serial Input Buffer Sizes *)
  2704.   buf512     * = 000H;
  2705.   buf1024    * = 001H;
  2706.   buf2048    * = 002H;
  2707.   buf4096    * = 003H;
  2708.   buf8000    * = 004H;
  2709.   buf16000   * = 005H;
  2710.  
  2711. (* Serial Bit Masks *)
  2712.   readBits    * = 0F0X; (* for SerRWBits   *)
  2713.   writeBits   * = 00FX;
  2714.  
  2715.   stopBits    * = 0F0X; (* for SerStopBuf  *)
  2716.   bufSizeBits * = 00FX;
  2717.  
  2718.   parityBits  * = 0F0X; (* for SerParShk   *)
  2719.   hShakeBits  * = 00FX;
  2720.  
  2721. (* Serial Parity (upper nibble, after being shifted by
  2722.  * macro SPARNUM() )
  2723.  *)
  2724.   parityNone  * = 0;
  2725.   parityEven  * = 1;
  2726.   parityOdd   * = 2;
  2727.  
  2728. (* Serial Handshake Mode (lower nibble, after masking using
  2729.  * macro SHANKNUM() )
  2730.  *)
  2731.   shakeXon   * = 0;
  2732.   shakeRts   * = 1;
  2733.   shakeNone  * = 2;
  2734.  
  2735. (* new defines for PrintFlags *)
  2736.  
  2737.   correctRed          * = 0;  (* color correct red shades *)
  2738.   correctGreen        * = 1;  (* color correct green shades *)
  2739.   correctBlue         * = 2;  (* color correct blue shades *)
  2740.  
  2741.   centerImage         * = 3;  (* center image on paper *)
  2742.  
  2743.   ignoreDimensions    * = {}; (* ignore max width/height settings *)
  2744.   boundedDimensions   * = 4;  (* use max width/height as boundaries *)
  2745.   absoluteDimensions  * = 5;  (* use max width/height as absolutes *)
  2746.   pixelDimensions     * = 6;  (* use max width/height as prt pixels *)
  2747.   multiplyDimensions  * = 7;  (* use max width/height as multipliers *)
  2748.  
  2749.   integerScaling      * = 8;  (* force integer scaling *)
  2750.  
  2751.   orderedDithering    * = {}; (* ordered dithering *)
  2752.   halftoneDithering   * = 9;  (* halftone dithering *)
  2753.   floydDithering      * = 10; (* Floyd-Steinberg dithering *)
  2754.  
  2755.   antiAlias           * = 11; (* anti-alias image *)
  2756.   greyScale2          * = 12; (* for use with hi-res monitor *)
  2757.  
  2758. (* masks used for checking bits *)
  2759.  
  2760.   correctRGBMask      * = {correctRed,correctGreen,correctBlue};
  2761.   dimensionsMask      * = {boundedDimensions,absoluteDimensions,pixelDimensions,multiplyDimensions};
  2762.   ditheringMask       * = {halftoneDithering,floydDithering};
  2763.  
  2764. (* ======================================================================== *)
  2765. (* === DrawInfo ========================================================= *)
  2766. (* ======================================================================== *)
  2767.  
  2768. (* This is a packet of information for graphics rendering.  It originates
  2769.  * with a Screen, and is gotten using GetScreenDrawInfo( screen );
  2770.  *)
  2771.  
  2772. (* You can use the Intuition version number to tell which fields are
  2773.  * present in this structure.
  2774.  *
  2775.  * DRI_VERSION of 1 corresponds to V37 release.
  2776.  * DRI_VERSION of 2 corresponds to V39, and includes three new pens
  2777.  *    and the dri_CheckMark and dri_AmigaKey fields.
  2778.  *
  2779.  * Note that sometimes applications need to create their own DrawInfo
  2780.  * structures, in which case the DRI_VERSION won't correspond exactly
  2781.  * to the OS version!!!
  2782.  *)
  2783.  
  2784.   driVersion * = 2;
  2785.  
  2786. TYPE
  2787.  
  2788.   DrawInfo * = STRUCT
  2789.     version * : INTEGER;      (* will be  DRI_VERSION                 *)
  2790.     numPens * : INTEGER;      (* guaranteed to be >= 9                *)
  2791.     pens * : e.APTR;          (* pointer to pen array                 *)
  2792.  
  2793.     font * : g.TextFontPtr;   (* screen default font                  *)
  2794.     depth * : INTEGER;        (* (initial) depth of screen bitmap     *)
  2795.  
  2796.     resolution * : g.Point;   (* from DisplayInfo database for initial display mode *)
  2797.  
  2798.     flags * : LONGSET;        (* defined below                *)
  2799. (* New for V39: dri_CheckMark, dri_AmigaKey. *)
  2800.     checkMark * : ImagePtr;   (* pointer to scaled checkmark image
  2801.                                * Will be NULL if DRI_VERSION < 2
  2802.                                *)
  2803.     amigaKey *: ImagePtr;      (* pointer to scaled Amiga-key image
  2804.                                * Will be NULL if DRI_VERSION < 2
  2805.                                *)
  2806.     reserved * : ARRAY 5 OF LONGINT;   (* avoid recompilation ;^)      *)
  2807.   END;
  2808.  
  2809. CONST
  2810.  
  2811.   drifNewLook * = 0;    (* specified SA_Pens, full treatment *)
  2812.  
  2813. (* rendering pen number indexes into DrawInfo.dri_Pens[]        *)
  2814.   detailPen        * = 0000H;       (* compatible Intuition rendering pens  *)
  2815.   blockPen         * = 0001H;       (* compatible Intuition rendering pens  *)
  2816.   textPen          * = 0002H;       (* text on background                   *)
  2817.   shinePen         * = 0003H;       (* bright edge on 3D objects            *)
  2818.   shadowPen        * = 0004H;       (* dark edge on 3D objects              *)
  2819.   fillPen          * = 0005H;       (* active-window/selected-gadget fill   *)
  2820.   fillTextPen      * = 0006H;       (* text over FILLPEN                    *)
  2821.   backGroundPen    * = 0007H;       (* always color 0                       *)
  2822.   highLightTextPen * = 0008H;       (* special color text, on background    *)
  2823.  
  2824. (* New for V39, only present if DRI_VERSION >= 2: *)
  2825.   bardetailpen     * = 00009H;      (* text/detail in screen-bar/menus *)
  2826.   barblockpen      * = 0000AH;      (* screen-bar/menus fill *)
  2827.   bartrimpen       * = 0000BH;      (* trim under screen-bar *)
  2828.  
  2829.   numDRIPens       * = 000CH;
  2830.  
  2831.  
  2832. (* New for V39:  It is sometimes useful to specify that a pen value
  2833.  * is to be the complement of color zero to three.  The "magic" numbers
  2834.  * serve that purpose:
  2835.  *)
  2836.   penC3 * =  0FEFCH;          (* Complement of color 3 *)
  2837.   penC2 * =  0FEFDH;          (* Complement of color 2 *)
  2838.   penC1 * =  0FEFEH;          (* Complement of color 1 *)
  2839.   penC0 * =  0FEFFH;          (* Complement of color 0 *)
  2840.  
  2841.  
  2842. TYPE
  2843.  
  2844. (* ======================================================================== *)
  2845. (* === Screen ============================================================= *)
  2846. (* ======================================================================== *)
  2847.  
  2848.  
  2849. (* VERY IMPORTANT NOTE ABOUT Screen->BitMap.  In the future, bitmaps
  2850.  * will need to grow.  The embedded instance of a bitmap in the screen
  2851.  * will no longer be large enough to hold the whole description of
  2852.  * the bitmap.
  2853.  *
  2854.  * YOU ARE STRONGLY URGED to use Screen->RastPort.BitMap in place of
  2855.  * &Screen->BitMap whenever and whereever possible.
  2856.  *)
  2857.  
  2858.   Screen * = STRUCT
  2859.  
  2860.     nextScreen * : ScreenPtr;           (* linked list of screens *)
  2861.     firstWindow * : WindowPtr;          (* linked list Screen's Windows *)
  2862.  
  2863.     leftEdge * , topEdge * : INTEGER;   (* parameters of the screen *)
  2864.     width * , height * : INTEGER;       (* parameters of the screen *)
  2865.  
  2866.     mouseY * , mouseX * : INTEGER;      (* position relative to upper-left *)
  2867.  
  2868.     flags * : SET;                      (* see definitions below *)
  2869.  
  2870.     title * : e.STRPTR;                 (* null-terminated Title text *)
  2871.     defaultTitle * : e.STRPTR;          (* for Windows without ScreenTitle *)
  2872.  
  2873.     (* Bar sizes for this Screen and all Window's in this Screen *)
  2874.     (* Note that BarHeight is one less than the actual menu bar
  2875.      * height.  We're going to keep this in V36 for compatibility,
  2876.      * although V36 artwork might use that extra pixel
  2877.      *
  2878.      * Also, the title bar height of a window is calculated from the
  2879.      * screen's WBorTop field, plus the font height, plus one.
  2880.      *)
  2881.     barHeight * , barVBorder * , barHBorder * ,
  2882.     menuVBorder * , menuHBorder * : SHORTINT;
  2883.     wBorTop * , wBorLeft * , wBorRight * , wBorBottom * : SHORTINT;
  2884.  
  2885.     font * : g.TextAttrPtr;             (* this screen's default font      *)
  2886.  
  2887.     (* the display data structures for this Screen *)
  2888.     viewPort * : g.ViewPort;            (* describing the Screen's display *)
  2889.     rastPort * : g.RastPort;            (* describing Screen rendering     *)
  2890.     bitMap * : g.BitMap;                (* SEE WARNING ABOVE!              *)
  2891.     layerInfo * : g.LayerInfo;          (* each screen gets a LayerInfo    *)
  2892.  
  2893.     (* Only system gadgets may be attached to a screen.
  2894.      *  You get the standard system Screen Gadgets automatically
  2895.      *)
  2896.     firstGadget * : GadgetDummyPtr;
  2897.  
  2898.     detailPen * , blockPen * : SHORTINT;    (* for bar/border/gadget rendering *)
  2899.  
  2900.     (* the following variable(s) are maintained by Intuition to support the
  2901.      * DisplayBeep() color flashing technique
  2902.      *)
  2903.     saveColor0 * : INTEGER;
  2904.  
  2905.     (* This layer is for the Screen and Menu bars *)
  2906.     barLayer * : g.LayerPtr;
  2907.  
  2908.     extData * : e.APTR;
  2909.  
  2910.     userData * : e.APTR;    (* general-purpose pointer to User data extension *)
  2911.  
  2912.     (**** Data below this point are SYSTEM PRIVATE ****)
  2913.  
  2914.   END;
  2915.  
  2916. CONST
  2917.  
  2918. (* --- FLAGS SET BY INTUITION --------------------------------------------- *)
  2919. (* The SCREENTYPE bits are reserved for describing various Screen types
  2920.  * available under Intuition.
  2921.  *)
  2922.   screenType      * = {0..3};  (* all the screens types available      *)
  2923. (* --- the definitions for the Screen Type ------------------------------- *)
  2924.   wbenchScreen    * = 0;      (* identifies the Workbench screen      *)
  2925.   publicScreen    * = 1;      (* public shared (custom) screen        *)
  2926.   customScreen    * = {0..3}; (* original custom screens              *)
  2927.  
  2928.   showTitle       * = 4;      (* this gets set by a call to ShowTitle() *)
  2929.  
  2930.   beeping         * = 5;  (* set when Screen is beeping (private) *)
  2931.  
  2932.   customBitMap    * = 6;  (* if you are supplying your own BitMap *)
  2933.  
  2934.   screenBehind    * = 7;  (* if you want your screen to open behind
  2935.                            * already open screens
  2936.                            *)
  2937.   screenQuiet     * = 8;  (* if you do not want Intuition to render
  2938.                            * into your screen (gadgets, title)
  2939.                            *)
  2940.   screenHiRes     * = 9;  (* do not use lowres gadgets  (private) *)
  2941.  
  2942.   nsExtended      * = 12;         (* ExtNewScreen.Extension is valid      *)
  2943. (* V36 applications can use OpenScreenTagList() instead of NS_EXTENDED       *)
  2944.  
  2945.   autoScroll      * = 14; (* screen is to autoscoll               *)
  2946.  
  2947. (* New for V39: *)
  2948.   penshared       * = 10;  (* Screen opener set {SA_SharePens,TRUE} *)
  2949.  
  2950.  
  2951.  
  2952.   stdScreenHeight * = -1; (* supply in NewScreen.height           *)
  2953.   stdScreenWidth  * = -1; (* supply in NewScreen.width            *)
  2954.  
  2955. (*
  2956.  * Screen attribute tag ID's.  These are used in the ti_Tag field of
  2957.  * TagItem arrays passed to OpenScreenTagList() (or in the
  2958.  * ExtNewScreen.Extension field).
  2959.  *)
  2960.  
  2961. (* Screen attribute tags.  Please use these versions, not those in
  2962.  * iobsolete.h.
  2963.  *)
  2964.  
  2965.   saDummy        * = u.user + 32;
  2966. (*
  2967.  * these items specify items equivalent to fields in NewScreen
  2968.  *)
  2969.   saLeft         * = saDummy + 00001H;
  2970.   saTop          * = saDummy + 00002H;
  2971.   saWidth        * = saDummy + 00003H;
  2972.   saHeight       * = saDummy + 00004H; (* traditional screen positions and dimensions  *)
  2973.   saDepth        * = saDummy + 00005H; (* screen bitmap depth                          *)
  2974.   saDetailPen    * = saDummy + 00006H; (* serves as default for windows, too           *)
  2975.   saBlockPen     * = saDummy + 00007H;
  2976.   saTitle        * = saDummy + 00008H; (* default screen title                         *)
  2977.   saColors       * = saDummy + 00009H;
  2978.                   (* ti_Data is an array of struct ColorSpec,
  2979.                    * terminated by ColorIndex = -1.  Specifies
  2980.                    * initial screen palette colors.
  2981.                    * Also see SA_Colors32 for use under V39.
  2982.                    *)
  2983.   saErrorCode    * = saDummy + 0000AH; (* ti_Data points to LONG error code (values below)*)
  2984.   saFont         * = saDummy + 0000BH; (* equiv. to NewScreen.Font                     *)
  2985.   saSysFont      * = saDummy + 0000CH;
  2986.                   (* Selects one of the preferences system fonts:
  2987.                    *      0 - old DefaultFont, fixed-width
  2988.                    *      1 - WB Screen preferred font
  2989.                    *)
  2990.   saType         * = saDummy + 0000DH;
  2991.                   (* ti_Data is PUBLICSCREEN or CUSTOMSCREEN.  For other
  2992.                    * fields of NewScreen.Type, see individual tags,
  2993.                    * eg. SA_Behind, SA_Quiet.
  2994.                    *)
  2995.   saBitMap       * = saDummy + 0000EH;
  2996.                   (* ti_Data is pointer to custom BitMap.  This
  2997.                    * implies type of CUSTOMBITMAP
  2998.                    *)
  2999.   saPubName      * = saDummy + 0000FH;
  3000.                   (* presence of this tag means that the screen
  3001.                    * is to be a public screen.  Please specify
  3002.                    * BEFORE the two tags below
  3003.                    *)
  3004.   saPubSig       * = saDummy + 00010H;
  3005.   saPubTask      * = saDummy + 00011H;
  3006.                   (* Task ID and signal for being notified that
  3007.                    * the last window has closed on a public screen.
  3008.                    *)
  3009.   saDisplayID    * = saDummy + 00012H;
  3010.                   (* ti_Data is new extended display ID from
  3011.                    * <graphics/displayinfo.h> (V37) or from
  3012.                    * <graphics/modeid.h> (V39 and up)
  3013.                    *)
  3014.   saDClip        * = saDummy + 00013H;
  3015.                   (* ti_Data points to a rectangle which defines
  3016.                    * screen display clip region
  3017.                    *)
  3018.   saOverscan     * = saDummy + 00014H;
  3019.                   (* Set to one of the oScan
  3020.                    * specifiers below to get a system standard
  3021.                    * overscan region for your display clip,
  3022.                    * screen dimensions (unless otherwise specified),
  3023.                    * and automatically centered position (partial
  3024.                    * support only so far).
  3025.                    * If you use this, you shouldn't specify
  3026.                    * saDClip.  saOverscan is for "standard"
  3027.                    * overscan dimensions, saDClip is for
  3028.                    * your custom numeric specifications.
  3029.                    *)
  3030.   saObsolete1    * = saDummy + 00015H; (* obsolete S_MONITORNAME *)
  3031.  
  3032. (** booleans **)
  3033.   saShowTitle    * = saDummy + 00016H; (* boolean equivalent to flag SHOWTITLE         *)
  3034.   saBehind       * = saDummy + 00017H; (* boolean equivalent to flag SCREENBEHIND      *)
  3035.   saQuiet        * = saDummy + 00018H; (* boolean equivalent to flag SCREENQUIET       *)
  3036.   saAutoScroll   * = saDummy + 00019H; (* boolean equivalent to flag AUTOSCROLL        *)
  3037.   saPens         * = saDummy + 0001AH;
  3038.                   (* pointer to ~0 terminated UWORD array, as
  3039.                    * found in struct DrawInfo
  3040.                    *)
  3041.   saFullPalette  * = saDummy + 0001BH;
  3042.                   (* boolean: initialize color table to entire
  3043.                    *  preferences palette (32 for V36), rather
  3044.                    * than compatible pens 0-3, 17-19, with
  3045.                    * remaining palette as returned by GetColorMap()
  3046.                    *)
  3047.   saColorMapEntries * = saDummy + 0001CH;
  3048.                       (* New for V39:
  3049.                        * Allows you to override the number of entries
  3050.                        * in the ColorMap for your screen.  Intuition
  3051.                        * normally allocates (1<<depth) or 32, whichever
  3052.                        * is more, but you may require even more if you
  3053.                        * use certain V39 graphics.library features
  3054.                        * (eg. palette-banking).
  3055.                        *)
  3056.  
  3057.   saParent       * = saDummy + 0001DH;
  3058.                       (* New for V39:
  3059.                        * ti_Data is a pointer to a "parent" screen to
  3060.                        * attach this one to.  Attached screens slide
  3061.                        * and depth-arrange together.
  3062.                        *)
  3063.  
  3064.   saDraggable    * = saDummy + 0001EH;
  3065.                       (* New for V39:
  3066.                        * Boolean tag allowing non-draggable screens.
  3067.                        * Do not use without good reason!
  3068.                        * (Defaults to TRUE).
  3069.                        *)
  3070.  
  3071.   saExclusive    * = saDummy + 0001FH;
  3072.                       (* New for V39:
  3073.                        * Boolean tag allowing screens that won't share
  3074.                        * the display. Use sparingly! (Defaults to FALSE).
  3075.                        *)
  3076.  
  3077.   saSharePens    * = saDummy + 00020H;
  3078.                       (* New for V39:
  3079.                        * For those pens in the screen's DrawInfo->dri_Pens,
  3080.                        * Intuition obtains them in shared mode (see
  3081.                        * graphics.library/ObtainPen()).  For compatibility,
  3082.                        * Intuition obtains the other pens of a public
  3083.                        * screen as PEN_EXCLUSIVE.  Screens that wish to
  3084.                        * manage the pens themselves should generally set
  3085.                        * this tag to TRUE.  This instructs Intuition to
  3086.                        * leave the other pens unallocated.
  3087.                        *)
  3088.  
  3089.   saBackFill     * = saDummy + 00021H;
  3090.                       (* New for V39:
  3091.                        * provides a "backfill hook" for your screen's
  3092.                        * Layer_Info.
  3093.                        * See layers.library/InstallLayerInfoHook()
  3094.                        *)
  3095.  
  3096.   saInterleaved  * = saDummy + 00022H;
  3097.                       (* New for V39:
  3098.                        * Boolean tag requesting that the bitmap
  3099.                        * allocated for you be interleaved.
  3100.                        * (Defaults to FALSE).
  3101.                        *)
  3102.  
  3103.   saColors32     * = saDummy + 00023H;
  3104.                       (* New for V39:
  3105.                        * Tag to set the screen's initial palette colors
  3106.                        * at 32 bits-per-gun.  ti_Data is a pointer
  3107.                        * to a table to be passed to the
  3108.                        * graphics.library/LoadRGB32() function.
  3109.                        * This format supports both runs of color
  3110.                        * registers and sparse registers.  See the
  3111.                        * autodoc for that function for full details.
  3112.                        * Any color set here has precedence over
  3113.                        * the same register set by SA_Colors.
  3114.                        *)
  3115.  
  3116.   saVideoControl * = saDummy + 00024H;
  3117.                       (* New for V39:
  3118.                        * ti_Data is a pointer to a taglist that Intuition
  3119.                        * will pass to graphics.library/VideoControl(),
  3120.                        * upon opening the screen.
  3121.                        *)
  3122.  
  3123.   saFrontChild   * = saDummy + 00025H;
  3124.                       (* New for V39:
  3125.                        * ti_Data is a pointer to an already open screen
  3126.                        * that is to be the child of the screen being
  3127.                        * opened.  The child screen will be moved to the
  3128.                        * front of its family.
  3129.                        *)
  3130.  
  3131.   saBackChild    * = saDummy + 00026H;
  3132.                       (* New for V39:
  3133.                        * ti_Data is a pointer to an already open screen
  3134.                        * that is to be the child of the screen being
  3135.                        * opened.  The child screen will be moved to the
  3136.                        * back of its family.
  3137.                        *)
  3138.  
  3139.   saLikeWorkbench * = saDummy + 00027H;
  3140.                       (* New for V39:
  3141.                        * Set ti_Data to 1 to request a screen which
  3142.                        * is just like the Workbench.  This gives
  3143.                        * you the same screen mode, depth, size,
  3144.                        * colors, etc., as the Workbench screen.
  3145.                        *)
  3146.  
  3147.   saReserved     * = saDummy + 00028H;
  3148.                       (* Reserved for private Intuition use *)
  3149.  
  3150.  
  3151. (* OpenScreen error codes, which are returned in the (optional) LONG
  3152.  * pointed to by ti_Data for the saErrorCode tag item
  3153.  *)
  3154.   osErrNoMonitor * = 1;     (* named monitor spec not available     *)
  3155.   osErrNoChips   * = 2;     (* you need newer custom chips          *)
  3156.   osErrNoMem     * = 3;     (* couldn't get normal memory           *)
  3157.   osErrNoChipMem * = 4;     (* couldn't get chipmem                 *)
  3158.   osErrPubNotUnique * = 5;  (* public screen name already used      *)
  3159.   osErrUnknownMode  * = 6;  (* don't recognize mode asked for       *)
  3160.   oserrTooDeep      * = 7;  (* Screen deeper than HW supports       *)
  3161.   oserrAttachFail   * = 8;  (* Failed to attach screens             *)
  3162.   oserrNotAvailable * = 9;  (* Mode not available for other reason  *)
  3163.  
  3164. TYPE
  3165.  
  3166. (* ======================================================================== *)
  3167. (* === NewScreen ========================================================== *)
  3168. (* ======================================================================== *)
  3169. (* note: to use the Extended field, you must use the
  3170.  * new ExtNewScreen structure, below
  3171.  *)
  3172.   NewScreen * = STRUCT
  3173.  
  3174.     leftEdge * , topEdge * , width * , height * , depth * : INTEGER;  (* screen dimensions *)
  3175.  
  3176.     detailPen * , blockPen * : SHORTINT; (* for bar/border/gadget rendering      *)
  3177.  
  3178.     viewModes * : SET;                   (* the Modes for the ViewPort (and View) *)
  3179.  
  3180.     type * : SET;                        (* the Screen type (see defines above)  *)
  3181.  
  3182.     font * : g.TextAttrPtr;              (* this Screen's default text attributes *)
  3183.  
  3184.     defaultTitle * : e.STRPTR;           (* the default title for this Screen    *)
  3185.  
  3186.     gadgets * : GadgetDummyPtr;          (* UNUSED:  Leave this NULL             *)
  3187.  
  3188.     (* if you are opening a CUSTOMSCREEN and already have a BitMap
  3189.      * that you want used for your Screen, you set the flags CUSTOMBITMAP in
  3190.      * the Type field and you set this variable to point to your BitMap
  3191.      * structure.  The structure will be copied into your Screen structure,
  3192.      * after which you may discard your own BitMap if you want
  3193.      *)
  3194.     customBitMap * : g.BitMapPtr;
  3195.  
  3196.   END;
  3197.  
  3198. (*
  3199.  * For compatibility reasons, we need a new structure for extending
  3200.  * NewScreen.  Use this structure is you need to use the new Extension
  3201.  * field.
  3202.  *
  3203.  * NOTE: V36-specific applications should use the
  3204.  * OpenScreenTagList( newscreen, tags ) version of OpenScreen().
  3205.  * Applications that want to be V34-compatible as well may safely use the
  3206.  * ExtNewScreen structure.  Its tags will be ignored by V34 Intuition.
  3207.  *
  3208.  *)
  3209.   ExtNewScreen * = STRUCT (ns * : NewScreen)
  3210.  
  3211.     extension * : u.TagListPtr; (* more specification data, scanned if
  3212.                                  * NS_EXTENDED is set in NewScreen.Type
  3213.                                  *)
  3214.   END;
  3215.  
  3216. CONST
  3217.  
  3218. (* === Overscan Types ===       *)
  3219.   oScanText      * = 1;     (* entirely visible     *)
  3220.   oScanStandard  * = 2;     (* just past edges      *)
  3221.   oScanMax       * = 3;     (* as much as possible  *)
  3222.   oScanVideo     * = 4;     (* even more than is possible   *)
  3223.  
  3224.  
  3225. TYPE
  3226.  
  3227. (* === Public Shared Screen Node ===    *)
  3228.  
  3229. (* This is the representative of a public shared screen.
  3230.  * This is an internal data structure, but some functions may
  3231.  * present a copy of it to the calling application.  In that case,
  3232.  * be aware that the screen pointer of the structure can NOT be
  3233.  * used safely, since there is no guarantee that the referenced
  3234.  * screen will remain open and a valid data structure.
  3235.  *
  3236.  * Never change one of these.
  3237.  *)
  3238.  
  3239.   PubScreenNode * = STRUCT (node * : e.Node)         (* ln_Name is screen name *)
  3240.     screen * : ScreenPtr;
  3241.     flags * : SET;            (* below                *)
  3242.     size * : INTEGER;         (* includes name buffer *)
  3243.     visitorCount * : INTEGER; (* how many visitor windows *)
  3244.     sigTask * : e.TaskPtr;    (* who to signal when visitors gone *)
  3245.     sigBit * : SHORTINT;      (* which signal *)
  3246.   END;
  3247.  
  3248. CONST
  3249.  
  3250.   psnfPrivate * = 0;
  3251.  
  3252.   maxPubScreenName * = 139;   (* names no longer, please      *)
  3253.  
  3254. (* pub screen modes     *)
  3255.   shanghai      * = 0;  (* put workbench windows on pub screen *)
  3256.   popPubScreen  * = 1;  (* pop pub screen to front when visitor opens *)
  3257.  
  3258. (* New for V39:  Intuition has new screen depth-arrangement and movement
  3259.  * functions called ScreenDepth() and ScreenPosition() respectively.
  3260.  * These functions permit the old behavior of ScreenToFront(),
  3261.  * ScreenToBack(), and MoveScreen().  ScreenDepth() also allows
  3262.  * independent depth control of attached screens.  ScreenPosition()
  3263.  * optionally allows positioning screens even though they were opened
  3264.  * {SA_Draggable,FALSE}.
  3265.  *)
  3266.  
  3267. (* For ScreenDepth(), specify one of SDEPTH_TOFRONT or SDEPTH_TOBACK,
  3268.  * and optionally also SDEPTH_INFAMILY.
  3269.  *
  3270.  * NOTE: ONLY THE OWNER OF THE SCREEN should ever specify
  3271.  * SDEPTH_INFAMILY.  Commodities, "input helper" programs,
  3272.  * or any other program that did not open a screen should never
  3273.  * use that flag.  (Note that this is a style-behavior
  3274.  * requirement;  there is no technical requirement that the
  3275.  * task calling this function need be the task which opened
  3276.  * the screen).
  3277.  *)
  3278.  
  3279.   sdepthToFront  * = 0;     (* Bring screen to front *)
  3280.   sdepthToBack   * = 1;     (* Send screen to back *)
  3281.   sdepthInFamily * = 2;     (* Move an attached screen with
  3282.                              * respect to other screens of
  3283.                              * its family
  3284.                              *)
  3285.  
  3286. (* Here's an obsolete name equivalent to SDEPTH_INFAMILY: *)
  3287.   sdepthChildOnly * = sdepthInFamily;
  3288.  
  3289.  
  3290. (* For ScreenPosition(), specify one of SPOS_RELATIVE, SPOS_ABSOLUTE,
  3291.  * or SPOS_MAKEVISIBLE to describe the kind of screen positioning you
  3292.  * wish to perform:
  3293.  *
  3294.  * SPOS_RELATIVE: The x1 and y1 parameters to ScreenPosition() describe
  3295.  *    the offset in coordinates you wish to move the screen by.
  3296.  * SPOS_ABSOLUTE: The x1 and y1 parameters to ScreenPosition() describe
  3297.  *    the absolute coordinates you wish to move the screen to.
  3298.  * SPOS_MAKEVISIBLE: (x1,y1)-(x2,y2) describes a rectangle on the
  3299.  *    screen which you would like autoscrolled into view.
  3300.  *
  3301.  * You may additionally set SPOS_FORCEDRAG along with any of the
  3302.  * above.  Set this if you wish to reposition an {SA_Draggable,FALSE}
  3303.  * screen that you opened.
  3304.  *
  3305.  * NOTE: ONLY THE OWNER OF THE SCREEN should ever specify
  3306.  * SPOS_FORCEDRAG.  Commodities, "input helper" programs,
  3307.  * or any other program that did not open a screen should never
  3308.  * use that flag.
  3309.  *)
  3310.  
  3311.   sposRelative   * = 0;     (* Coordinates are relative *)
  3312.  
  3313.   sposAbsolute   * = 1;     (* Coordinates are expressed as
  3314.                              * absolutes, not relatives.
  3315.                              *)
  3316.  
  3317.   sposMakeVisible * = 2;    (* Coordinates describe a box on
  3318.                              * the screen you wish to be
  3319.                              * made visible by autoscrolling
  3320.                              *)
  3321.  
  3322.   sposForceDrag  * = 4;     (* Move non-draggable screen *)
  3323.  
  3324.  
  3325. TYPE
  3326. (* New for V39: Intuition supports double-buffering in screens,
  3327.  * with friendly interaction with menus and certain gadgets.
  3328.  * For each buffer, you need to get one of these structures
  3329.  * from the AllocScreenBuffer() call.  Never allocate your
  3330.  * own ScreenBuffer structures!
  3331.  *
  3332.  * The sb_DBufInfo field is for your use.  See the graphics.library
  3333.  * AllocDBufInfo() autodoc for details.
  3334.  *)
  3335.   ScreenBuffer * = STRUCT
  3336.      bitMap * : g.BitMapPtr;         (* BitMap of this buffer *)
  3337.     dBufInfo *: g.DBufInfoPtr;     (* DBufInfo for this buffer *)
  3338.   END;
  3339.  
  3340. CONST
  3341. (* These are the flags that may be passed to AllocScreenBuffer().
  3342.  *)
  3343.   sbScreenBitMap * = 1;
  3344.   sbCopyBitMap   * = 2;
  3345.  
  3346. TYPE
  3347.  
  3348.   StringExtend * = STRUCT
  3349.     (* display specifications   *)
  3350.     font * : g.TextFontPtr;              (* must be an open Font (not TextAttr)  *)
  3351.     pens * : ARRAY 2 OF SHORTINT;        (* color of text/background             *)
  3352.     activePens * : ARRAY 2 OF SHORTINT;  (* colors when gadget is active         *)
  3353.  
  3354.     (* edit specifications      *)
  3355.     initialMode * : LONGSET;             (* inital mode flags, below             *)
  3356.     editHook * : u.HookPtr;              (* if non-NULL, must supply WorkBuffer  *)
  3357.     workBuffer * : e.APTR;               (* must be as large as StringInfo.Buffer*)
  3358.  
  3359.     reserved * : ARRAY 4 OF LONGINT;     (* set to 0                             *)
  3360.   END;
  3361.  
  3362.   SGWork * = STRUCT
  3363.     (* set up when gadget is first activated    *)
  3364.     gadget * : GadgetDummyPtr;     (* the contestant itself        *)
  3365.     stringInfo * : StringInfoPtr;  (* easy access to sinfo         *)
  3366.     workBuffer * : e.APTR;         (* intuition's planned result   *)
  3367.     prevBuffer * : e.APTR;         (* what was there before        *)
  3368.     modes * : LONGSET;             (* current mode                 *)
  3369.  
  3370.     (* modified for each input event    *)
  3371.     iEvent * : ie.InputEventPtr;   (* actual event: do not change  *)
  3372.     code * : INTEGER;              (* character code, if one byte  *)
  3373.     bufferPos * : INTEGER;         (* cursor position              *)
  3374.     numChars * : INTEGER;
  3375.     actions * : LONGSET;           (* what Intuition will do       *)
  3376.     longInt * : LONGINT;           (* temp storage for longint     *)
  3377.  
  3378.     gadgetInfo * : GadgetInfoPtr;  (* see cghooks.h                *)
  3379.     editOp * : INTEGER;            (* from constants below         *)
  3380.   END;
  3381.  
  3382. CONST
  3383.  
  3384. (* SGWork.editOp -
  3385.  * These values indicate what basic type of operation the global
  3386.  * editing hook has performed on the string before your gadget's custom
  3387.  * editing hook gets called.  You do not have to be concerned with the
  3388.  * value your custom hook leaves in the EditOp field, only if you
  3389.  * write a global editing hook.
  3390.  *
  3391.  * For most of these general edit operations, you'll want to compare
  3392.  * the BufferPos and NumChars of the StringInfo (before global editing)
  3393.  * and SGWork (after global editing).
  3394.  *)
  3395.  
  3396.   eoNoOp        * = 01H; (* did nothing                                                  *)
  3397.   eoDelBackward * = 02H; (* deleted some chars (maybe 0).                                *)
  3398.   eoDelForward  * = 03H; (* deleted some characters under and in front of the cursor     *)
  3399.   eoMoveCursor  * = 04H; (* moved the cursor                                             *)
  3400.   eoEnter       * = 05H; (* "enter" or "return" key, terminate                           *)
  3401.   eoReset       * = 06H; (* current Intuition-style undo                                 *)
  3402.   eoReplaceChar * = 07H; (* replaced one character and (maybe) advanced cursor           *)
  3403.   eoInsertChar  * = 08H; (* inserted one char into string or added one at end            *)
  3404.   eoBadFormat   * = 09H; (* didn't like the text data, e.g., Bad LONGINT                 *)
  3405.   eoBigChange   * = 0AH; (* complete or major change to the text, e.g. new string        *) (* unused by Intuition  *)
  3406.   eoUndo        * = 0BH; (* some other style of undo                                     *) (* unused by Intuition  *)
  3407.   eoClear       * = 0CH; (* clear the string                                             *)
  3408.   eoSpecial     * = 0DH; (* some operation that doesn't fit into the categories here     *) (* unused by Intuition  *)
  3409.  
  3410.  
  3411. (* Mode Flags definitions (ONLY first group allowed as InitialModes)    *)
  3412.   sgmReplace     * = 0;          (* replace mode                 *)
  3413. (* please initialize StringInfo with in-range value of BufferPos
  3414.  * if you are using sgmREPLACE mode.
  3415.  *)
  3416.  
  3417.   sgmFixedField  * = 1;          (* fixed length buffer          *)
  3418.                                         (* always set sgmREPLACE, too  *)
  3419.   sgmNoFilter    * = 2;          (* don't filter control chars   *)
  3420.  
  3421. (* SGM_EXITHELP is new for V37, and ignored by V36: *)
  3422.   sgmExitHelp    * = 7;          (* exit with code = 0x5F if HELP hit *)
  3423.  
  3424.  
  3425. (* These Mode Flags are for internal use only                           *)
  3426.   sgmNoChange    * = 3;          (* no edit changes yet          *)
  3427.   sgmNoWorkB     * = 4;          (* Buffer == PrevBuffer         *)
  3428.   sgmControl     * = 5;          (* control char escape mode     *)
  3429.   sgmLongint     * = 6;          (* an intuition longint gadget  *)
  3430.  
  3431. (* String Gadget Action Flags (put in SGWork.Actions by EditHook)       *)
  3432.   sgaUse         * = 0;  (* use contents of SGWork               *)
  3433.   sgaEnd         * = 1;  (* terminate gadget, code in Code field *)
  3434.   sgaBeep        * = 2;  (* flash the screen for the user        *)
  3435.   sgaReuse       * = 3;  (* reuse input event                    *)
  3436.   sgaRedisplay   * = 4;  (* gadget visuals changed               *)
  3437.  
  3438. (* New for V37: *)
  3439.   sgaNextActive  * = 5;  (* Make next possible gadget active.    *)
  3440.   sgaPrevActive  * = 6;  (* Make previous possible gadget active.*)
  3441.  
  3442. (* function id for only existing custom string gadget edit hook *)
  3443.  
  3444.   sghKey         * = 1;  (* process editing keystroke            *)
  3445.   sghClick       * = 2;  (* process mouse click cursor position  *)
  3446.  
  3447. (* Here's a brief summary of how the custom string gadget edit hook works:
  3448.  *    You provide a hook in StringInfo.Extension.EditHook.
  3449.  *    The hook is called in the standard way with the 'object'
  3450.  *    a pointer to SGWork, and the 'message' a pointer to a command
  3451.  *    block, starting either with (longword) sghKEY, sghCLICK,
  3452.  *    or something new.
  3453.  *
  3454.  *    You return 0 if you don't understand the command (sghKEY is
  3455.  *    required and assumed).  Return non-zero if you implement the
  3456.  *    command.
  3457.  *
  3458.  * sghKEY:
  3459.  *
  3460.  *    There are no parameters following the command longword.
  3461.  *
  3462.  *    Intuition will put its idea of proper values in the SGWork
  3463.  *    before calling you, and if you leave sgaUSE set in the
  3464.  *    SGWork.Actions field, Intuition will use the values
  3465.  *    found in SGWork fields WorkBuffer, NumChars, BufferPos,
  3466.  *    and LongInt, copying the WorkBuffer back to the StringInfo
  3467.  *    Buffer.
  3468.  *
  3469.  *    NOTE WELL: You may NOT change other SGWork fields.
  3470.  *
  3471.  *    If you clear sgaUSE, the string gadget will be unchanged.
  3472.  *
  3473.  *    If you set sgaEND, Intuition will terminate the activation
  3474.  *    of the string gadget.  If you also set sgaREUSE, Intuition
  3475.  *    will reuse the input event after it deactivates your gadget.
  3476.  *
  3477.  *    In this case, Intuition will put the value found in SGWork.Code
  3478.  *    into the IntuiMessage.Code field of the IDCMP_GADGETUP message it
  3479.  *    sends to the application.
  3480.  *
  3481.  *    If you set sgaBEEP, Intuition will call DisplayBeep(); use
  3482.  *    this if the user has typed in error, or buffer is full.
  3483.  *
  3484.  *    Set sgaREDISPLAY if the changes to the gadget warrant a
  3485.  *    gadget redisplay.  Note: cursor movement requires a redisplay.
  3486.  *
  3487.  *    Starting in V37, you may set SGA_PREVACTIVE or SGA_NEXTACTIVE
  3488.  *    when you set SGA_END.  This tells Intuition that you want
  3489.  *    the next or previous gadget with GFLG_TABCYCLE to be activated.
  3490.  *
  3491.  * sghCLICK:
  3492.  *    This hook command is called when Intuition wants to position
  3493.  *    the cursor in response to a mouse click in the string gadget.
  3494.  *
  3495.  *    Again, here are no parameters following the command longword.
  3496.  *
  3497.  *    This time, Intuition has already calculated the mouse position
  3498.  *    character cell and put it in SGWork.BufferPos.  The previous
  3499.  *    BufferPos value remains in the SGWork.StringInfo.BufferPos.
  3500.  *
  3501.  *    Intuition will again use the SGWork fields listed above for
  3502.  *    sghKEY.  One restriction is that you are NOT allowed to set
  3503.  *    sgaEND or sgaREUSE for this command.  Intuition will not
  3504.  *    stand for a gadget which goes inactive when you click in it.
  3505.  *
  3506.  *    You should always leave the sgaREDISPLAY flag set, since Intuition
  3507.  *    uses this processing when activating a string gadget.
  3508.  *)
  3509.  
  3510. (* IntuitionBase: *)
  3511.  
  3512. (* these are the display modes for which we have corresponding parameter
  3513.  *  settings in the config arrays
  3514.  *)
  3515.   dModeCount    * = 2;    (* how many modes there are *)
  3516.   hiresPick     * = 0;
  3517.   lowresPick    * = 1;
  3518.  
  3519.   eventMax * = 10;        (* size of event array *)
  3520.  
  3521. (* these are the system Gadget defines *)
  3522.   resCount      * = 2;
  3523.   hiresGadget   * = 0;
  3524.   lowresGadget  * = 1;
  3525.  
  3526.   gadgetCount     * = 8;
  3527.   upFrontGadget   * = 0;
  3528.   downBackGadget  * = 1;
  3529.   sizeGadget      * = 2;
  3530.   closeGadget     * = 3;
  3531.   dragGadget      * = 4;
  3532.   sUpFrontGadget  * = 5;
  3533.   sDownBackGadget * = 6;
  3534.   sDragGadget     * = 7;
  3535.  
  3536. (* ======================================================================== *)
  3537. (* === IntuitionBase ====================================================== *)
  3538. (* ======================================================================== *)
  3539. (*
  3540.  * Be sure to protect yourself against someone modifying these data as
  3541.  * you look at them.  This is done by calling:
  3542.  *
  3543.  * lock = LockIBase(0), which returns a ULONG.  When done call
  3544.  * UnlockIBase(lock) where lock is what LockIBase() returned.
  3545.  *)
  3546.  
  3547. TYPE
  3548.  
  3549. (* This structure is strictly READ ONLY *)
  3550.   IntuitionBase * = STRUCT (libNode * : e.Library)
  3551.  
  3552.     viewLord * : g.View;
  3553.  
  3554.     activeWindow * : WindowPtr;
  3555.     activeScreen * : ScreenPtr;
  3556.  
  3557.     (* the FirstScreen variable points to the frontmost Screen.  Screens are
  3558.      * then maintained in a front to back order using Screen.NextScreen
  3559.      *)
  3560.     firstScreen * : ScreenPtr; (* for linked list of all screens *)
  3561.  
  3562.     flags * : LONGSET;         (* values are all system private *)
  3563.     mouseY * , mouseX * : INTEGER;
  3564.                                (* note "backwards" order of these              *)
  3565.  
  3566.     time * : t.TimeVal         (* timestamp of most current input event *)
  3567.  
  3568.     (* I told you this was private.
  3569.      * The data beyond this point has changed, is changing, and
  3570.      * will continue to change.
  3571.      *)
  3572.  
  3573.   END;
  3574.  
  3575. (* Boolean Parameters must be 4 Bytes long: *)
  3576.  
  3577. TYPE
  3578.   LONGBOOL * = LONGINT;
  3579.  
  3580. CONST
  3581.   LTRUE  * = -1;
  3582.   LFALSE * = 0;
  3583.  
  3584.  
  3585. VAR
  3586.  int *, base * : IntuitionBasePtr;
  3587.  
  3588.  
  3589. PROCEDURE OpenIntuition  *{int,- 30}();
  3590. PROCEDURE Intuition      *{int,- 36}(iEvent{8}        : ie.InputEventPtr);
  3591. PROCEDURE AddGadget      *{int,- 42}(window{8}        : WindowPtr;
  3592.                                      VAR gadget{9}    : Gadget;
  3593.                                      position{0}      : LONGINT): INTEGER;
  3594. PROCEDURE ClearDMRequest *{int,- 48}(window{8}        : WindowPtr): BOOLEAN;
  3595. PROCEDURE ClearMenuStrip *{int,- 54}(window{8}        : WindowPtr);
  3596. PROCEDURE ClearPointer   *{int,- 60}(window{8}        : WindowPtr);
  3597. PROCEDURE CloseScreen    *{int,- 66}(screen{8}        : ScreenPtr): BOOLEAN;
  3598. PROCEDURE OldCloseScreen *{int,- 66}(screen{8}        : ScreenPtr); (* version<36 had no result *)
  3599. PROCEDURE CloseWindow    *{int,- 72}(window{8}        : WindowPtr);
  3600. PROCEDURE CloseWorkBench *{int,- 78}(): BOOLEAN;
  3601. PROCEDURE CurrentTime    *{int,- 84}(VAR seconds{8}   : LONGINT;
  3602.                                      VAR micros{9}    : LONGINT);
  3603. PROCEDURE DisplayAlert   *{int,- 90}(alertNumber{0}   : LONGINT;
  3604.                                      string{8}        : ARRAY OF CHAR;
  3605.                                      height{1}        : LONGINT): BOOLEAN;
  3606. PROCEDURE DisplayBeep    *{int,- 96}(screen{8}        : ScreenPtr);
  3607. PROCEDURE DoubleClick    *{int,-102}(sSeconds{0}      : LONGINT;
  3608.                                      sMicros{1}       : LONGINT;
  3609.                                      cSeconds{2}      : LONGINT;
  3610.                                      cMicros{3}       : LONGINT): BOOLEAN;
  3611. PROCEDURE DrawBorder     *{int,-108}(rp{8}            : g.RastPortPtr;
  3612.                                      border{9}        : BorderPtr;
  3613.                                      leftOffset{0}    : LONGINT;
  3614.                                      topOffset{1}     : LONGINT);
  3615. PROCEDURE DrawImage      *{int,-114}(rp{8}            : g.RastPortPtr;
  3616.                                      image{9}         : Image;
  3617.                                      leftOffset{0}    : LONGINT;
  3618.                                      topOffset{1}     : LONGINT);
  3619. PROCEDURE EndRequest     *{int,-120}(requester{8}     : RequesterPtr;
  3620.                                      window{9}        : WindowPtr);
  3621. PROCEDURE GetDefPrefs    *{int,-126}(VAR preferences{8} : ARRAY OF e.BYTE;
  3622.                                      size{0}          : LONGINT);
  3623. PROCEDURE GetPrefs       *{int,-132}(VAR preferences{8} : ARRAY OF e.BYTE;
  3624.                                      size{0}          : LONGINT);
  3625. PROCEDURE InitRequester  *{int,-138}(VAR requester{8} : Requester);
  3626. PROCEDURE ItemAddress    *{int,-144}(menuStrip{8}     : Menu;
  3627.                                      menuNumber{0}    : LONGINT):  MenuItemPtr;
  3628. PROCEDURE ModifyIDCMP    *{int,-150}(window{8}        : WindowPtr;
  3629.                                      flags{0}         : LONGSET): BOOLEAN;
  3630. PROCEDURE OldModifyIDCMP *{int,-150}(window{8}        : WindowPtr;
  3631.                                      flags{0}         : LONGSET);
  3632. PROCEDURE ModifyProp     *{int,-156}(VAR gadget{8}    : Gadget;
  3633.                                      window{9}        : WindowPtr;
  3634.                                      requester{10}    : RequesterPtr;
  3635.                                      flags{0}         : SET;
  3636.                                      horizPot{1}      : LONGINT;
  3637.                                      vertPot{2}       : LONGINT;
  3638.                                      horizBody{3}     : LONGINT;
  3639.                                      vertBody{4}      : LONGINT);
  3640. PROCEDURE MoveScreen     *{int,-162}(screen{8}        : ScreenPtr;
  3641.                                      dx{0}            : LONGINT;
  3642.                                      dy{1}            : LONGINT);
  3643. PROCEDURE MoveWindow     *{int,-168}(window{8}        : WindowPtr;
  3644.                                      dx{0}            : LONGINT;
  3645.                                      dy{1}            : LONGINT);
  3646. PROCEDURE OffGadget      *{int,-174}(VAR gadget{8}    : Gadget;
  3647.                                      window{9}        : WindowPtr;
  3648.                                      requester{10}    : RequesterPtr);
  3649. PROCEDURE OffMenu        *{int,-180}(window{8}        : WindowPtr;
  3650.                                      menuNumber{0}    : LONGINT);
  3651. PROCEDURE OnGadget       *{int,-186}(VAR gadget{8}    : Gadget;
  3652.                                      window{9}        : WindowPtr;
  3653.                                      requester{10}    : RequesterPtr);
  3654. PROCEDURE OnMenu         *{int,-192}(window{8}        : WindowPtr;
  3655.                                      menuNumber{0}    : LONGINT);
  3656. PROCEDURE OpenScreen     *{int,-198}(newScreen{8}     : NewScreen): ScreenPtr;
  3657. PROCEDURE OpenWindow     *{int,-204}(newWindow{8}     : NewWindow ): WindowPtr;
  3658. PROCEDURE OpenWorkBench  *{int,-210}(): ScreenPtr;
  3659. PROCEDURE PrintIText     *{int,-216}(rp{8}            : g.RastPortPtr;
  3660.                                      iText{9}         : IntuiText;
  3661.                                      left{0}          : LONGINT;
  3662.                                      top{1}           : LONGINT);
  3663. PROCEDURE RefreshGadgets *{int,-222}(gadgets{8}       : GadgetDummyPtr;
  3664.                                      window{9}        : WindowPtr;
  3665.                                      requester{10}    : RequesterPtr);
  3666. PROCEDURE RemoveGadget   *{int,-228}(window{8}        : WindowPtr;
  3667.                                      VAR gadget{9}    : Gadget): INTEGER;
  3668. PROCEDURE ReportMouse    *{int,-234}(window{8}        : WindowPtr;
  3669.                                      flag{0}          : LONGBOOL);
  3670. PROCEDURE Request        *{int,-240}(requester{8}     : RequesterPtr;
  3671.                                      window{9}        : WindowPtr ): BOOLEAN;
  3672. PROCEDURE ScreenToBack   *{int,-246}(screen{8}        : ScreenPtr);
  3673. PROCEDURE ScreenToFront  *{int,-252}(screen{8}        : ScreenPtr);
  3674. PROCEDURE SetDMRequest   *{int,-258}(window{8}        : WindowPtr;
  3675.                                      requester{9}     : RequesterPtr): BOOLEAN;
  3676. PROCEDURE SetMenuStrip   *{int,-264}(window{8}        : WindowPtr;
  3677.                                      VAR menu{9}      : Menu): BOOLEAN;
  3678. PROCEDURE SetPointer     *{int,-270}(window{8}        : WindowPtr;
  3679.                                      pointer{9}       : ARRAY OF e.BYTE;
  3680.                                      height{0}        : LONGINT;
  3681.                                      width{1}         : LONGINT;
  3682.                                      xOffset{2}       : LONGINT;
  3683.                                      yOffset{3}       : LONGINT);
  3684. PROCEDURE SetWindowTitles*{int,-276}(window{8}        : WindowPtr;
  3685.                                      windowTitle{9}   : e.ADDRESS;
  3686.                                      screenTitle{10}  : e.ADDRESS);
  3687. PROCEDURE SetWindowTitlesStr*{int,-276}(window{8}        : WindowPtr;
  3688.                                      windowTitle{9}   : ARRAY OF CHAR;
  3689.                                      screenTitle{10}  : ARRAY OF CHAR);
  3690. PROCEDURE ShowTitle      *{int,-282}(screen{8}        : ScreenPtr;
  3691.                                      showIt{0}        : LONGBOOL);
  3692. PROCEDURE SizeWindow     *{int,-288}(window{8}        : WindowPtr;
  3693.                                      dx{0}            : LONGINT;
  3694.                                      dy{1}            : LONGINT);
  3695. PROCEDURE ViewAddress    *{int,-294}(): g.ViewPtr;
  3696. PROCEDURE ViewPortAddress*{int,-300}(window{8}        : WindowPtr): g.ViewPortPtr;
  3697. PROCEDURE WindowToBack   *{int,-306}(window{8}        : WindowPtr);
  3698. PROCEDURE WindowToFront  *{int,-312}(window{8}        : WindowPtr);
  3699. PROCEDURE WindowLimits   *{int,-318}(window{8}        : WindowPtr;
  3700.                                      widthMin{0}      : LONGINT;
  3701.                                      heightMin{1}     : LONGINT;
  3702.                                      widthMax{2}      : LONGINT;
  3703.                                      heightMax{3}     : LONGINT): BOOLEAN;
  3704. (*--- start of next generation of names -------------------------------------*)
  3705. PROCEDURE SetPrefs       *{int,-324}(preferences{8}   : ARRAY OF e.BYTE;
  3706.                                      size{0}          : LONGINT;
  3707.                                      inform{1}        : LONGBOOL);
  3708. (*--- start of next next generation of names --------------------------------*)
  3709. PROCEDURE IntuiTextLength*{int,-330}(iText{8}         : IntuiText): INTEGER;
  3710. PROCEDURE WBenchToBack   *{int,-336}(): BOOLEAN;
  3711. PROCEDURE WBenchToFront  *{int,-342}(): BOOLEAN;
  3712. (*--- start of next next next generation of names ---------------------------*)
  3713. PROCEDURE AutoRequest    *{int,-348}(window{8}        : WindowPtr;
  3714.                                      body{9}          : IntuiTextPtr;
  3715.                                      posText{10}      : IntuiTextPtr;
  3716.                                      negText{11}      : IntuiTextPtr;
  3717.                                      pFlag{0}         : LONGSET;
  3718.                                      nFlag{1}         : LONGSET;
  3719.                                      width{2}         : LONGINT;
  3720.                                      height{3}        : LONGINT): BOOLEAN;
  3721. PROCEDURE BeginRefresh   *{int,-354}(window{8}        : WindowPtr);
  3722. PROCEDURE BuildSysRequest*{int,-360}(window{8}        : WindowPtr;
  3723.                                      body{9}          : IntuiTextPtr;
  3724.                                      posText{10}      : IntuiTextPtr;
  3725.                                      negText{11}      : IntuiTextPtr;
  3726.                                      flags{0}         : LONGSET;
  3727.                                      width{1}         : LONGINT;
  3728.                                      height{2}        : LONGINT): WindowPtr;
  3729. PROCEDURE EndRefresh     *{int,-366}(window{8}        : WindowPtr;
  3730.                                      complete{0}      : LONGBOOL);
  3731. PROCEDURE FreeSysRequest *{int,-372}(window{8}        : WindowPtr);
  3732. PROCEDURE OldMakeScreen     *{int,-378}(screen{8}        : ScreenPtr);
  3733. PROCEDURE OldRemakeDisplay  *{int,-384}();
  3734. PROCEDURE OldRethinkDisplay *{int,-390}();
  3735. (* The return codes for MakeScreen(), RemakeDisplay(), and RethinkDisplay() *)
  3736. (* are only valid under V39 and greater.  Do not examine them when running *)
  3737. (* on pre-V39 systems! *)
  3738. PROCEDURE MakeScreen     *{int,-378}(screen{8}        : ScreenPtr): LONGINT;
  3739. PROCEDURE RemakeDisplay  *{int,-384}(): LONGINT;
  3740. PROCEDURE RethinkDisplay *{int,-390}(): LONGINT;
  3741. (*--- start of next next next next generation of names ----------------------*)
  3742. PROCEDURE AllocRemember  *{int,-396}(VAR rememberKey{8} : RememberPtr;
  3743.                                      size{0}          : LONGINT;
  3744.                                      flags{1}         : LONGSET): e.APTR;
  3745. PROCEDURE AlohaWorkbench *{int,-402}(wbport{8}        : e.MsgPortPtr);
  3746. PROCEDURE FreeRemember   *{int,-408}(VAR rememberKey{8} : RememberPtr;
  3747.                                      reallyForget{0}  : LONGBOOL);
  3748. (*--- start of 15 Nov 85 names ------------------------*)
  3749. PROCEDURE LockIBase      *{int,-414}(dontknow{0}      : LONGINT): LONGINT;
  3750. PROCEDURE UnlockIBase    *{int,-420}(ibLock{8}        : LONGINT);
  3751. (*--- functions in V33 or higher (distributed as Release 1.2) ---*)
  3752. PROCEDURE GetScreenData  *{int,-426}(VAR buffer{8}    : Screen;
  3753.                                      size{0}          : LONGINT;
  3754.                                      type{1}          : SET;
  3755.                                      screen{9}        : ScreenPtr): BOOLEAN;
  3756. PROCEDURE RefreshGList   *{int,-432}(gadgets{8}       : GadgetDummyPtr;
  3757.                                      window{9}        : WindowPtr;
  3758.                                      requester{10}    : RequesterPtr;
  3759.                                      numGad{0}        : LONGINT);
  3760. PROCEDURE AddGList       *{int,-438}(window{8}        : WindowPtr;
  3761.                                      gadget{9}        : GadgetDummyPtr;
  3762.                                      position{0}      : LONGINT;
  3763.                                      numGad{1}        : LONGINT;
  3764.                                      requester{10}    : RequesterPtr): INTEGER;
  3765. PROCEDURE RemoveGList    *{int,-444}(remPtr{8}        : WindowPtr;
  3766.                                      gadget{9}        : GadgetDummyPtr;
  3767.                                      numGad{0}        : LONGINT): INTEGER;
  3768. PROCEDURE ActivateWindow *{int,-450}(window{8}        : WindowPtr); (* no result, even for V36+ *)
  3769. PROCEDURE RefreshWindowFrame*{int,-456}(window{8}     : WindowPtr);
  3770. PROCEDURE ActivateGadget *{int,-462}(VAR gadget{8}    : Gadget;
  3771.                                      window{9}        : WindowPtr;
  3772.                                      requester{10}    : RequesterPtr): BOOLEAN;
  3773. PROCEDURE NewModifyProp  *{int,-468}(VAR gadget{8}    : Gadget;
  3774.                                      window{9}        : WindowPtr;
  3775.                                      requester{10}    : RequesterPtr;
  3776.                                      flags{0}         : SET;
  3777.                                      horizPot{1}      : LONGINT;
  3778.                                      vertPot{2}       : LONGINT;
  3779.                                      horizBody{3}     : LONGINT;
  3780.                                      vertBody{4}      : LONGINT;
  3781.                                      numGad{5}        : LONGINT);
  3782. (*--- functions in V36 or higher (distributed as Release 2.0) ---*)
  3783. (*---     REMEMBER: You are to check int.libNode.version !    ---*)
  3784. PROCEDURE QueryOverscan  *{int,-474}(displayID{8}     : LONGINT;
  3785.                                      VAR rect{9}      : g.Rectangle;
  3786.                                      oScanType{0}     : LONGINT): LONGINT;
  3787. PROCEDURE MoveWindowInFrontOf*{int,-480}(window{8}    : WindowPtr;
  3788.                                          behindWin{9} : WindowPtr);
  3789. PROCEDURE ChangeWindowBox*{int,-486}(window{8}        : WindowPtr;
  3790.                                      left{0}          : LONGINT;
  3791.                                      top{1}           : LONGINT;
  3792.                                      width{2}         : LONGINT;
  3793.                                      height{3}        : LONGINT);
  3794. PROCEDURE SetEditHook    *{int,-492}(hook{8}          : u.HookPtr): u.HookPtr;
  3795. PROCEDURE SetMouseQueue  *{int,-498}(window{8}        : LONGINT;
  3796.                                      queueLength{0}   : LONGINT): LONGINT;
  3797. PROCEDURE ZipWindow      *{int,-504}(window{8}        : WindowPtr);
  3798. (*--- public screens ---*)
  3799. PROCEDURE LockPubScreen  *{int,-510}(name{8}          : ARRAY OF CHAR): ScreenPtr;
  3800. PROCEDURE UnlockPubScreen*{int,-516}(name{8}          : ARRAY OF CHAR;
  3801.                                      screen{9}        : ScreenPtr);
  3802. PROCEDURE LockPubScreenList*{int,-522}(): e.ListPtr;
  3803. PROCEDURE UnlockPubScreenList*{int,-528}();
  3804. PROCEDURE NextPubScreen  *{int,-534}(screen{8}        : ScreenPtr;
  3805.                                      VAR name{9}      : ARRAY OF CHAR): e.STRPTR;
  3806. PROCEDURE SetDefaultPubScreen*{int,-540}(name{8}      : ARRAY OF CHAR);
  3807. PROCEDURE SetPubScreenModes*{int,-546}(modes{0}       : SET): SET;
  3808. PROCEDURE PubScreenStatus*{int,-552}(screen{8}        : ScreenPtr;
  3809.                                      statusFlags{0}   : SET): SET;
  3810. (**)
  3811. PROCEDURE ObtainGIRPort  *{int,-558}(gInfo{8}         : GadgetInfoPtr): g.RastPortPtr;
  3812. PROCEDURE ReleaseGIRPort *{int,-564}(rp{8}            : g.RastPortPtr);
  3813. PROCEDURE GadgetMouse    *{int,-570}(VAR gadget{8}    : Gadget;
  3814.                                      gInfo{9}         : GadgetInfoPtr;
  3815.                                      VAR mousePoint{10} : g.Point);
  3816. (* SetIPrefs is system private and not to be used by applications *)
  3817. PROCEDURE SetIPrefs      *{int,-576}(ptr{8}           : e.APTR;
  3818.                                      size{0}          : LONGINT;
  3819.                                      type{1}          : LONGINT);
  3820. PROCEDURE GetDefaultPubScreen*{int,-582}(VAR nameBuffer{8} : ARRAY OF CHAR);
  3821. PROCEDURE EasyRequestArgs*{int,-588}(window{8}        : WindowPtr;
  3822.                                      easyStruct{9}    : EasyStructPtr;
  3823.                                      idcmpPtr{10}     : e.APTR;
  3824.                                      args{11}         : e.APTR): LONGINT;
  3825. PROCEDURE EasyRequest    *{int,-588}(window{8}        : WindowPtr;
  3826.                                      easyStruct{9}    : EasyStructPtr;
  3827.                                      idcmpPtr{10}     : e.APTR;
  3828.                                      arg1{11}..       : e.APTR): LONGINT;
  3829. PROCEDURE BuildEasyRequestArgs*{int,-594}(window{8}   : WindowPtr;
  3830.                                      easyStruct{9}    : EasyStructPtr;
  3831.                                      idcmp{0}         : LONGSET;
  3832.                                      args{10}         : e.APTR): WindowPtr;
  3833. PROCEDURE BuildEasyRequest*{int,-594}(window{8}       : WindowPtr;
  3834.                                      easyStruct{9}    : EasyStructPtr;
  3835.                                      idcmp{0}         : LONGSET;
  3836.                                      arg1{10}..       : e.APTR): WindowPtr;
  3837. PROCEDURE SysReqHandler  *{int,-600}(window{8}        : WindowPtr;
  3838.                                      idcmpPtr{9}      : e.APTR;
  3839.                                      waitInput{0}     : LONGBOOL): LONGINT;
  3840. PROCEDURE OpenWindowTagList*{int,-606}(newWindow{8}   : NewWindow;
  3841.                                      tagList{9}       : ARRAY OF u.TagItem): WindowPtr;
  3842. PROCEDURE OpenWindowTags *{int,-606}(newWindow{8}     : NewWindow;
  3843.                                      tag1{9}..        : u.Tag): WindowPtr;
  3844. PROCEDURE OpenWindowTagListA*{int,-606}(newWindow{8}  : NewWindowPtr;
  3845.                                      tagList{9}       : ARRAY OF u.TagItem): WindowPtr;
  3846. PROCEDURE OpenWindowTagsA *{int,-606}(newWindow{8}    : NewWindowPtr;
  3847.                                      tag1{9}..        : u.Tag): WindowPtr;
  3848. PROCEDURE OpenScreenTagList*{int,-612}(newScreen{8}   : NewScreen;
  3849.                                      tagList{9}       : ARRAY OF u.TagItem): ScreenPtr;
  3850. PROCEDURE OpenScreenTags *{int,-612}(newScreen{8}     : NewScreen;
  3851.                                      tag1{9}..        : u.Tag): ScreenPtr;
  3852. PROCEDURE OpenScreenTagListA*{int,-612}(newScreen{8}   : NewScreenPtr;
  3853.                                      tagList{9}       : ARRAY OF u.TagItem): ScreenPtr;
  3854. PROCEDURE OpenScreenTagsA *{int,-612}(newScreen{8}     : NewScreenPtr;
  3855.                                      tag1{9}..        : u.Tag): ScreenPtr;
  3856. (**)
  3857. (*      new Image functions *)
  3858. PROCEDURE DrawImageState *{int,-618}(rp{8}            : g.RastPortPtr;
  3859.                                      image{9}         : Image;
  3860.                                      leftOffset{0}    : LONGINT;
  3861.                                      topOffset{1}     : LONGINT;
  3862.                                      state{2}         : LONGINT;
  3863.                                      drawInfo{10}     : DrawInfoPtr);
  3864. PROCEDURE PointInImage   *{int,-624}(point{0}         : LONGINT;
  3865.                                      image{8}         : Image): BOOLEAN;
  3866. PROCEDURE EraseImage     *{int,-630}(rp{8}            : g.RastPortPtr;
  3867.                                      image{9}         : Image;
  3868.                                      leftOffset{0}    : LONGINT;
  3869.                                      topOffset{1}     : LONGINT);
  3870. (**)
  3871. PROCEDURE NewObjectA     *{int,-636}(clacc{8}         : IClassPtr;
  3872.                                      classID{9}       : ARRAY OF CHAR;
  3873.                                      tagList{10}      : ARRAY OF u.TagItem): e.APTR;
  3874. PROCEDURE NewObject      *{int,-636}(clacc{8}         : IClassPtr;
  3875.                                      classID{9}       : ARRAY OF CHAR;
  3876.                                      tag1{10}..       : u.Tag): e.APTR;
  3877. (**)
  3878. PROCEDURE DisposeObject  *{int,-642}(object{8}        : e.APTR);
  3879. PROCEDURE SetAttrsA      *{int,-648}(object{8}        : e.APTR;
  3880.                                      tagList{9}       : ARRAY OF u.TagItem): LONGINT;
  3881. PROCEDURE SetAttrs       *{int,-648}(object{8}        : e.APTR;
  3882.                                      tag1{9}..        : u.Tag): LONGINT;
  3883. (**)
  3884. PROCEDURE GetAttr        *{int,-654}(attrID{0}        : LONGINT;
  3885.                                      object{8}        : e.APTR;
  3886.                                      VAR storage{9}   : ARRAY OF e.BYTE): LONGINT;
  3887. (**)
  3888. (*      special set attribute call for gadgets *)
  3889. PROCEDURE SetGadgetAttrsA*{int,-660}(VAR gadget{8}    : Gadget;
  3890.                                      window{9}        : WindowPtr;
  3891.                                      requester{10}    : RequesterPtr;
  3892.                                      tagList{11}      : ARRAY OF u.TagItem): LONGINT;
  3893. PROCEDURE SetGadgetAttrs *{int,-660}(VAR gadget{8}    : Gadget;
  3894.                                      window{9}        : WindowPtr;
  3895.                                      requester{10}    : RequesterPtr;
  3896.                                      tag1{11}..       : u.Tag): LONGINT;
  3897. (**)
  3898. (*      for class implementors only *)
  3899. PROCEDURE NextObject     *{int,-666}(VAR objectPtr{8} : ObjectPtr): e.APTR;
  3900. PROCEDURE FindClass      *{int,-672}(classID{8}       : ARRAY OF CHAR): IClassPtr;
  3901. PROCEDURE MakeClass      *{int,-678}(classID{8}       : ARRAY OF CHAR;
  3902.                                      superClassID{9}  : ARRAY OF CHAR;
  3903.                                      superClassPtr{10}: IClassPtr;
  3904.                                      instanceSize{0}  : LONGINT;
  3905.                                      flags{1}         : LONGSET): IClassPtr;
  3906. PROCEDURE AddClass       *{int,-684}(class{8}         : IClassPtr);
  3907. (**)
  3908. (**)
  3909. PROCEDURE GetScreenDrawInfo*{int,-690}(screen{8}      : ScreenPtr): DrawInfoPtr;
  3910. PROCEDURE FreeScreenDrawInfo*{int,-696}(screen{8}     : ScreenPtr;
  3911.                                      drawInfo{9}      : DrawInfoPtr);
  3912. (**)
  3913. PROCEDURE ResetMenuStrip *{int,-702}(window{8}        : WindowPtr;
  3914.                                      VAR menu{9}      : Menu): BOOLEAN;
  3915. PROCEDURE RemoveClass    *{int,-708}(classPtr{8}      : IClassPtr);
  3916. PROCEDURE FreeClass      *{int,-714}(classPtr{8}      : IClassPtr): BOOLEAN;
  3917.  
  3918. (*--- functions in V39 or higher (beta release for developers only) ---*)
  3919. PROCEDURE AllocScreenBuffer *{int,-0300H}(sc{8}       : ScreenPtr;
  3920.                                           bm{9}       : g.BitMapPtr;
  3921.                                           flags{0}    : LONGSET): ScreenBufferPtr;
  3922. PROCEDURE FreeScreenBuffer  *{int,-0306H}(sc{8}       : ScreenPtr;
  3923.                                           sb{9}       : ScreenBufferPtr);
  3924. PROCEDURE ChangeScreenBuffer*{int,-030CH}(sc{8}       : ScreenPtr;
  3925.                                           sb{9}       : ScreenBufferPtr): BOOLEAN;
  3926. PROCEDURE ScreenDepth       *{int,-0312H}(screen{8}   : ScreenPtr;
  3927.                                           flags{0}    : LONGSET;
  3928.                                           reserved{9} : e.APTR);
  3929. PROCEDURE ScreenPosition    *{int,-0318H}(screen{8}   : ScreenPtr;
  3930.                                           flags{0}    : LONGSET;
  3931.                                           x1{1}       : LONGINT;
  3932.                                           y1{2}       : LONGINT;
  3933.                                           x2{3}       : LONGINT;
  3934.                                           y2{4}       : LONGINT);
  3935. PROCEDURE ScrollWindowRaster *{int,-031EH}(win{9}     : WindowPtr;
  3936.                                           dx{0}       : LONGINT;
  3937.                                           dy{1}       : LONGINT;
  3938.                                           xMin{2}     : LONGINT;
  3939.                                           yMin{3}     : LONGINT;
  3940.                                           xMax{4}     : LONGINT;
  3941.                                           yMax{5}     : LONGINT);
  3942. PROCEDURE LendMenus         *{int,-0324H}(fromWin{8}  : WindowPtr;
  3943.                                           toWindow{9} : WindowPtr);
  3944. PROCEDURE DoGadgetMethodA   *{int,-032AH}(gad{8}      : GadgetPtr;
  3945.                                           win{9}      : WindowPtr;
  3946.                                           eq{10}      : RequesterPtr;
  3947.                                           message{11} : Msg): LONGINT;
  3948. PROCEDURE DoGadgetMethod    *{int,-032AH}(gad{8}      : GadgetPtr;
  3949.                                           win{9}      : WindowPtr;
  3950.                                           req{10}     : RequesterPtr;
  3951.                                           MethodID{11}..: e.ADDRESS): LONGINT;
  3952. PROCEDURE SetWindowPointerA *{int,-0330H}(win{8}      : WindowPtr;
  3953.                                           taglist{9}  : ARRAY OF u.TagItem);
  3954. PROCEDURE SetWindowPointer  *{int,-0330H}(win{8}      : WindowPtr;
  3955.                                           tag1{9}..   : u.Tag);
  3956. PROCEDURE TimedDisplayAlert *{int,-0336H}(alertNum{0} : LONGINT;
  3957.                                           string{8}   : ARRAY OF CHAR;
  3958.                                           height{1}   : LONGINT;
  3959.                                           time{9}     : LONGINT): BOOLEAN;
  3960. PROCEDURE HelpControl       *{int,-033CH}(win{8}      : WindowPtr;
  3961.                                           flags{0}    : LONGSET);
  3962.  
  3963.  
  3964. (* === MACROS ============================================================ *)
  3965.  
  3966. (* $OvflChk- $RangeChk- $StackChk- $NilChk- $ReturnChk- $CaseChk- *)
  3967.  
  3968. PROCEDURE MenuNum * (n{0}: INTEGER): INTEGER;
  3969. BEGIN RETURN sys.VAL(INTEGER,      sys.VAL(SET,n)      * {0..4}) END MenuNum;
  3970.  
  3971. PROCEDURE ItemNum * (n{0}: INTEGER): INTEGER;
  3972. BEGIN RETURN sys.VAL(INTEGER,sys.LSH(sys.VAL(SET,n),- 5) * {0..5}) END ItemNum;
  3973.  
  3974. PROCEDURE SubNum  * (n{0}: INTEGER): INTEGER;
  3975. BEGIN RETURN sys.VAL(INTEGER,sys.LSH(sys.VAL(SET,n),-11) * {0..4}) END SubNum;
  3976.  
  3977.  
  3978. PROCEDURE ShiftMenu * (n{0}: INTEGER): INTEGER;
  3979. BEGIN RETURN sys.VAL(INTEGER,      sys.VAL(SET,n) * {0..4}    ) END ShiftMenu;
  3980.  
  3981. PROCEDURE ShiftItem * (n{0}: INTEGER): INTEGER;
  3982. BEGIN RETURN sys.VAL(INTEGER,sys.LSH(sys.VAL(SET,n) * {0..5}, 5)) END ShiftItem;
  3983.  
  3984. PROCEDURE ShiftSub  * (n{0}: INTEGER): INTEGER;
  3985. BEGIN RETURN sys.VAL(INTEGER,sys.LSH(sys.VAL(SET,n) * {0..4},11)) END ShiftSub;
  3986.  
  3987. PROCEDURE FullMenuNum * (menu, item, sub: INTEGER): INTEGER;
  3988. BEGIN RETURN ShiftMenu(menu) + ShiftItem(item) + ShiftSub(sub) END FullMenuNum;
  3989.  
  3990.  
  3991. (* Preferences.ser...: *)
  3992.  
  3993. PROCEDURE SRBNum * (n: e.BYTE): INTEGER;  BEGIN RETURN 8 - ORD(n) DIV 16 END SRBNum;
  3994. PROCEDURE SWBNum * (n: e.BYTE): INTEGER;  BEGIN RETURN 8 - ORD(n) MOD 16 END SWBNum;
  3995. PROCEDURE SSBNum * (n: e.BYTE): INTEGER;  BEGIN RETURN 1 + ORD(n) DIV 16 END SSBNum;
  3996. PROCEDURE SPARNum * (n: e.BYTE): INTEGER; BEGIN RETURN     ORD(n) DIV 16 END SPARNum;
  3997. PROCEDURE SHAKNum * (n: e.BYTE): INTEGER; BEGIN RETURN     ORD(n) MOD 16 END SHAKNum;
  3998.  
  3999.  
  4000. (* this casts MutualExclude for easy assignment of a hook
  4001.  * pointer to the unused MutualExclude field of a custom gadget
  4002.  *)
  4003. PROCEDURE CustomHook * (VAR g: Gadget): u.HookPtr;
  4004. BEGIN RETURN sys.VAL(u.HookPtr,g.mutualExclude) END CustomHook;
  4005.  
  4006.  
  4007. (* some convenient macros and casts *)
  4008. PROCEDURE GadgetBox * (VAR g: Gadget): IBoxPtr; BEGIN RETURN sys.ADR(g.leftEdge) END GadgetBox;
  4009. PROCEDURE IMBox     * (VAR i: Image ): IBoxPtr; BEGIN RETURN sys.ADR(i.leftEdge) END IMBox;
  4010. PROCEDURE FGPen     * (VAR i: Image ): SHORTINT; BEGIN RETURN sys.VAL(SHORTINT,i.planePick ) END FGPen;
  4011. PROCEDURE BGPen     * (VAR i: Image ): SHORTINT; BEGIN RETURN sys.VAL(SHORTINT,i.planeOnOff) END BGPen;
  4012.  
  4013. (*-----------------------------------------------------------------------*)
  4014.  
  4015.  
  4016. (*------  Special:  ------*)
  4017.  
  4018. (* convert BOOLEANs to LONGBOOLs: *)
  4019.  
  4020. PROCEDURE BoolToLong*(b: BOOLEAN): LONGBOOL;
  4021. BEGIN IF b THEN RETURN LTRUE
  4022.            ELSE RETURN LFALSE END
  4023. END BoolToLong;
  4024.  
  4025. (* Convert pseudo unsigned integers (like those within PropInfo) to
  4026.  * LONGINTs and vice versa:
  4027.  *)
  4028.  
  4029. PROCEDURE UIntToLong*(i: INTEGER): LONGINT;
  4030. BEGIN
  4031.   IF i<0 THEN RETURN i+10000H
  4032.          ELSE RETURN i        END;
  4033. END UIntToLong;
  4034.  
  4035.  
  4036. PROCEDURE LongToUInt*(l: LONGINT): INTEGER;
  4037. BEGIN
  4038. (* $RangeChk- Tricky: just return lower Word *)
  4039.   RETURN SHORT(l)
  4040. (* $RangeChk= *)
  4041. END LongToUInt;
  4042.  
  4043.  
  4044. (*-----------------------------------------------------------------------*)
  4045. (*
  4046.  * The following procedures are implemented for to avoid using SYSTEM within
  4047.  * Oberon programs.
  4048.  *)
  4049.  
  4050. PROCEDURE ScreenToRastPort*(s: ScreenPtr): g.RastPortPtr;
  4051. BEGIN RETURN sys.ADR(s.rastPort); END ScreenToRastPort;
  4052.  
  4053. PROCEDURE ScreenToViewPort*(s: ScreenPtr): g.ViewPortPtr;
  4054. BEGIN RETURN sys.ADR(s.viewPort); END ScreenToViewPort;
  4055.  
  4056. (*-----------------------------------------------------------------------*)
  4057.  
  4058. BEGIN
  4059.   int :=  e.OpenLibrary(intuitionName,33);
  4060.   IF int = NIL THEN HALT(0) END;
  4061.   base := int;
  4062.  
  4063. CLOSE
  4064.   IF int#NIL THEN e.CloseLibrary(int) END;
  4065.  
  4066. END Intuition.
  4067.  
  4068.