home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / languages / obrn-a_1.5_lib.lha / oberon-a / source1.lha / source / amiga / Intuition.mod < prev    next >
Encoding:
Text File  |  1995-01-26  |  173.5 KB  |  4,671 lines

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