home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 10 / Fresh_Fish_10_2352.bin / useful / cbm / nduk / nduk-v39 / include / intuition / intuition.h < prev    next >
C/C++ Source or Header  |  1992-09-24  |  66KB  |  1,688 lines

  1.  
  2. #ifndef INTUITION_INTUITION_H
  3. #define INTUITION_INTUITION_H TRUE
  4. /*
  5. **  $VER: intuition.h 38.22 (16.09.92)
  6. **  Includes Release 39.108
  7. **
  8. **  Interface definitions for Intuition applications.
  9. **
  10. **  (C) Copyright 1985-1992 Commodore-Amiga, Inc.
  11. **        All Rights Reserved
  12. */
  13.  
  14. #ifndef EXEC_TYPES_H
  15. #include <exec/types.h>
  16. #endif
  17.  
  18. #ifndef GRAPHICS_GFX_H
  19. #include <graphics/gfx.h>
  20. #endif
  21.  
  22. #ifndef GRAPHICS_CLIP_H
  23. #include <graphics/clip.h>
  24. #endif
  25.  
  26. #ifndef GRAPHICS_VIEW_H
  27. #include <graphics/view.h>
  28. #endif
  29.  
  30. #ifndef GRAPHICS_RASTPORT_H
  31. #include <graphics/rastport.h>
  32. #endif
  33.  
  34. #ifndef GRAPHICS_LAYERS_H
  35. #include <graphics/layers.h>
  36. #endif
  37.  
  38. #ifndef GRAPHICS_TEXT_H
  39. #include <graphics/text.h>
  40. #endif
  41.  
  42. #ifndef EXEC_PORTS_H
  43. #include <exec/ports.h>
  44. #endif
  45.  
  46. #ifndef DEVICES_INPUTEVENT_H
  47. #include <devices/inputevent.h>
  48. #endif
  49.  
  50. #ifndef UTILITY_TAGITEM_H
  51. #include <utility/tagitem.h>
  52. #endif
  53.  
  54. /*
  55.  * NOTE:  intuition/iobsolete.h is included at the END of this file!
  56.  */
  57.  
  58. /* ======================================================================== */
  59. /* === Menu =============================================================== */
  60. /* ======================================================================== */
  61. struct Menu
  62. {
  63.     struct Menu *NextMenu;    /* same level */
  64.     WORD LeftEdge, TopEdge;    /* position of the select box */
  65.     WORD Width, Height;    /* dimensions of the select box */
  66.     UWORD Flags;        /* see flag definitions below */
  67.     BYTE *MenuName;        /* text for this Menu Header */
  68.     struct MenuItem *FirstItem; /* pointer to first in chain */
  69.  
  70.     /* these mysteriously-named variables are for internal use only */
  71.     WORD JazzX, JazzY, BeatX, BeatY;
  72. };
  73.  
  74.  
  75. /* FLAGS SET BY BOTH THE APPLIPROG AND INTUITION */
  76. #define MENUENABLED 0x0001    /* whether or not this menu is enabled */
  77.  
  78. /* FLAGS SET BY INTUITION */
  79. #define MIDRAWN 0x0100        /* this menu's items are currently drawn */
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86. /* ======================================================================== */
  87. /* === MenuItem =========================================================== */
  88. /* ======================================================================== */
  89. struct MenuItem
  90. {
  91.     struct MenuItem *NextItem;    /* pointer to next in chained list */
  92.     WORD LeftEdge, TopEdge;    /* position of the select box */
  93.     WORD Width, Height;        /* dimensions of the select box */
  94.     UWORD Flags;        /* see the defines below */
  95.  
  96.     LONG MutualExclude;        /* set bits mean this item excludes that */
  97.  
  98.     APTR ItemFill;        /* points to Image, IntuiText, or NULL */
  99.  
  100.     /* when this item is pointed to by the cursor and the items highlight
  101.      *    mode HIGHIMAGE is selected, this alternate image will be displayed
  102.      */
  103.     APTR SelectFill;        /* points to Image, IntuiText, or NULL */
  104.  
  105.     BYTE Command;        /* only if appliprog sets the COMMSEQ flag */
  106.  
  107.     struct MenuItem *SubItem;    /* if non-zero, points to MenuItem for submenu */
  108.  
  109.     /* The NextSelect field represents the menu number of next selected
  110.      *    item (when user has drag-selected several items)
  111.      */
  112.     UWORD NextSelect;
  113. };
  114.  
  115.  
  116. /* FLAGS SET BY THE APPLIPROG */
  117. #define CHECKIT        0x0001    /* set to indicate checkmarkable item */
  118. #define ITEMTEXT    0x0002    /* set if textual, clear if graphical item */
  119. #define COMMSEQ        0x0004    /* set if there's an command sequence */
  120. #define MENUTOGGLE    0x0008    /* set for toggling checks (else mut. exclude) */
  121. #define ITEMENABLED    0x0010    /* set if this item is enabled */
  122.  
  123. /* these are the SPECIAL HIGHLIGHT FLAG state meanings */
  124. #define HIGHFLAGS    0x00C0    /* see definitions below for these bits */
  125. #define HIGHIMAGE    0x0000    /* use the user's "select image" */
  126. #define HIGHCOMP    0x0040    /* highlight by complementing the selectbox */
  127. #define HIGHBOX        0x0080    /* highlight by "boxing" the selectbox */
  128. #define HIGHNONE    0x00C0    /* don't highlight */
  129.  
  130. /* FLAGS SET BY BOTH APPLIPROG AND INTUITION */
  131. #define CHECKED    0x0100    /* state of the checkmark */
  132.  
  133. /* FLAGS SET BY INTUITION */
  134. #define ISDRAWN        0x1000    /* this item's subs are currently drawn */
  135. #define HIGHITEM    0x2000    /* this item is currently highlighted */
  136. #define MENUTOGGLED    0x4000    /* this item was already toggled */
  137.  
  138.  
  139.  
  140.  
  141.  
  142. /* ======================================================================== */
  143. /* === Requester ========================================================== */
  144. /* ======================================================================== */
  145. struct Requester
  146. {
  147.     struct Requester *OlderRequest;
  148.     WORD LeftEdge, TopEdge;        /* dimensions of the entire box */
  149.     WORD Width, Height;            /* dimensions of the entire box */
  150.     WORD RelLeft, RelTop;        /* for Pointer relativity offsets */
  151.  
  152.     struct Gadget *ReqGadget;        /* pointer to a list of Gadgets */
  153.     struct Border *ReqBorder;        /* the box's border */
  154.     struct IntuiText *ReqText;        /* the box's text */
  155.     UWORD Flags;            /* see definitions below */
  156.  
  157.     /* pen number for back-plane fill before draws */
  158.     UBYTE BackFill;
  159.     /* Layer in place of clip rect    */
  160.     struct Layer *ReqLayer;
  161.  
  162.     UBYTE ReqPad1[32];
  163.  
  164.     /* If the BitMap plane pointers are non-zero, this tells the system
  165.      * that the image comes pre-drawn (if the appliprog wants to define
  166.      * its own box, in any shape or size it wants!);  this is OK by
  167.      * Intuition as long as there's a good correspondence between
  168.      * the image and the specified Gadgets
  169.      */
  170.     struct BitMap *ImageBMap;    /* points to the BitMap of PREDRAWN imagery */
  171.     struct Window *RWindow;    /* added.  points back to Window */
  172.  
  173.     struct Image  *ReqImage;    /* new for V36: drawn if USEREQIMAGE set */
  174.  
  175.     UBYTE ReqPad2[32];
  176. };
  177.  
  178.  
  179. /* FLAGS SET BY THE APPLIPROG */
  180. #define POINTREL    0x0001
  181.               /* if POINTREL set, TopLeft is relative to pointer
  182.                * for DMRequester, relative to window center
  183.                * for Request().
  184.                */
  185. #define PREDRAWN    0x0002
  186.     /* set if Requester.ImageBMap points to predrawn Requester imagery */
  187. #define NOISYREQ    0x0004
  188.     /* if you don't want requester to filter input       */
  189. #define SIMPLEREQ    0x0010
  190.     /* to use SIMPLEREFRESH layer (recommended)    */
  191.  
  192. /* New for V36        */
  193. #define USEREQIMAGE    0x0020
  194.     /*  render linked list ReqImage after BackFill
  195.      * but before gadgets and text
  196.      */
  197. #define NOREQBACKFILL    0x0040
  198.     /* don't bother filling requester with Requester.BackFill pen    */
  199.  
  200.  
  201. /* FLAGS SET BY INTUITION */
  202. #define REQOFFWINDOW    0x1000    /* part of one of the Gadgets was offwindow */
  203. #define REQACTIVE    0x2000    /* this requester is active */
  204. #define SYSREQUEST    0x4000    /* (unused) this requester caused by system */
  205. #define DEFERREFRESH    0x8000    /* this Requester stops a Refresh broadcast */
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212. /* ======================================================================== */
  213. /* === Gadget ============================================================= */
  214. /* ======================================================================== */
  215. struct Gadget
  216. {
  217.     struct Gadget *NextGadget;    /* next gadget in the list */
  218.  
  219.     WORD LeftEdge, TopEdge;    /* "hit box" of gadget */
  220.     WORD Width, Height;        /* "hit box" of gadget */
  221.  
  222.     UWORD Flags;        /* see below for list of defines */
  223.  
  224.     UWORD Activation;        /* see below for list of defines */
  225.  
  226.     UWORD GadgetType;        /* see below for defines */
  227.  
  228.     /* appliprog can specify that the Gadget be rendered as either as Border
  229.      * or an Image.  This variable points to which (or equals NULL if there's
  230.      * nothing to be rendered about this Gadget)
  231.      */
  232.     APTR GadgetRender;
  233.  
  234.     /* appliprog can specify "highlighted" imagery rather than algorithmic
  235.      * this can point to either Border or Image data
  236.      */
  237.     APTR SelectRender;
  238.  
  239.     struct IntuiText *GadgetText;   /* text for this gadget */
  240.  
  241.     /* MutualExclude, never implemented, is now declared obsolete.
  242.      * There are published examples of implementing a more general
  243.      * and practical exclusion in your applications.
  244.      *
  245.      * Starting with V36, this field is used to point to a hook
  246.      * for a custom gadget.
  247.      *
  248.      * Programs using this field for their own processing will
  249.      * continue to work, as long as they don't try the
  250.      * trick with custom gadgets.
  251.      */
  252.     LONG MutualExclude;  /* obsolete */
  253.  
  254.     /* pointer to a structure of special data required by Proportional,
  255.      * String and Integer Gadgets
  256.      */
  257.     APTR SpecialInfo;
  258.  
  259.     UWORD GadgetID;    /* user-definable ID field */
  260.     APTR UserData;    /* ptr to general purpose User data (ignored by In) */
  261. };
  262.  
  263.  
  264. struct ExtGadget
  265. {
  266.     /* The first fields match struct Gadget exactly */
  267.     struct ExtGadget *NextGadget; /* Matches struct Gadget */
  268.     WORD LeftEdge, TopEdge;      /* Matches struct Gadget */
  269.     WORD Width, Height;          /* Matches struct Gadget */
  270.     UWORD Flags;          /* Matches struct Gadget */
  271.     UWORD Activation;          /* Matches struct Gadget */
  272.     UWORD GadgetType;          /* Matches struct Gadget */
  273.     APTR GadgetRender;          /* Matches struct Gadget */
  274.     APTR SelectRender;          /* Matches struct Gadget */
  275.     struct IntuiText *GadgetText; /* Matches struct Gadget */
  276.     LONG MutualExclude;          /* Matches struct Gadget */
  277.     APTR SpecialInfo;          /* Matches struct Gadget */
  278.     UWORD GadgetID;          /* Matches struct Gadget */
  279.     APTR UserData;          /* Matches struct Gadget */
  280.  
  281.     /* These fields only exist under V39 and only if GFLG_EXTENDED is set */
  282.     ULONG MoreFlags;        /* see GMORE_ flags below */
  283.     WORD BoundsLeftEdge;    /* Bounding extent for gadget, valid   */
  284.     WORD BoundsTopEdge;        /* only if GMORE_BOUNDS is set.  The   */
  285.     WORD BoundsWidth;        /* GFLG_RELxxx flags affect these      */
  286.     WORD BoundsHeight;        /* coordinates as well.           */
  287. };
  288.  
  289.  
  290. /* --- Gadget.Flags values    --- */
  291. /* combinations in these bits describe the highlight technique to be used */
  292. #define GFLG_GADGHIGHBITS 0x0003
  293. #define GFLG_GADGHCOMP      0x0000  /* Complement the select box */
  294. #define GFLG_GADGHBOX      0x0001  /* Draw a box around the image */
  295. #define GFLG_GADGHIMAGE      0x0002  /* Blast in this alternate image */
  296. #define GFLG_GADGHNONE      0x0003  /* don't highlight */
  297.  
  298. #define GFLG_GADGIMAGE          0x0004  /* set if GadgetRender and SelectRender
  299.                    * point to an Image structure, clear
  300.                    * if they point to Border structures
  301.                    */
  302.  
  303. /* combinations in these next two bits specify to which corner the gadget's
  304.  *  Left & Top coordinates are relative.  If relative to Top/Left,
  305.  *  these are "normal" coordinates (everything is relative to something in
  306.  *  this universe).
  307.  *
  308.  * Gadget positions and dimensions are relative to the window or
  309.  * requester which contains the gadget
  310.  */
  311. #define GFLG_RELBOTTOM      0x0008  /* vert. pos. is relative to bottom edge */
  312. #define GFLG_RELRIGHT      0x0010  /* horiz. pos. is relative to right edge */
  313. #define GFLG_RELWIDTH      0x0020  /* width is relative to req/window    */
  314. #define GFLG_RELHEIGHT      0x0040  /* height is relative to req/window    */
  315.  
  316. /* New for V39: GFLG_RELSPECIAL allows custom gadget implementors to
  317.  * make gadgets whose position and size depend in an arbitrary way
  318.  * on their window's dimensions.  The GM_LAYOUT method will be invoked
  319.  * for such a gadget (or any other GREL_xxx gadget) at suitable times,
  320.  * such as when the window opens or the window's size changes.
  321.  */
  322. #define GFLG_RELSPECIAL      0x4000  /* custom gadget has special relativity.
  323.                    * Gadget box values are absolutes, but
  324.                    * can be changed via the GM_LAYOUT method.
  325.                    */
  326. #define GFLG_SELECTED      0x0080  /* you may initialize and look at this    */
  327.  
  328. /* the GFLG_DISABLED flag is initialized by you and later set by Intuition
  329.  * according to your calls to On/OffGadget().  It specifies whether or not
  330.  * this Gadget is currently disabled from being selected
  331.  */
  332. #define GFLG_DISABLED      0x0100
  333.  
  334. /* These flags specify the type of text field that Gadget.GadgetText
  335.  * points to.  In all normal (pre-V36) gadgets which you initialize
  336.  * this field should always be zero.  Some types of gadget objects
  337.  * created from classes will use these fields to keep track of
  338.  * types of labels/contents that different from IntuiText, but are
  339.  * stashed in GadgetText.
  340.  */
  341.  
  342. #define GFLG_LABELMASK      0x3000
  343. #define GFLG_LABELITEXT      0x0000  /* GadgetText points to IntuiText    */
  344. #define    GFLG_LABELSTRING  0x1000  /* GadgetText points to (UBYTE *)    */
  345. #define GFLG_LABELIMAGE      0x2000  /* GadgetText points to Image (object)    */
  346.  
  347. /* New for V37: GFLG_TABCYCLE */
  348. #define GFLG_TABCYCLE      0x0200  /* (string or custom) gadget participates in
  349.                    * cycling activation with Tab or Shift-Tab
  350.                    */
  351. /* New for V37: GFLG_STRINGEXTEND.  We discovered that V34 doesn't properly
  352.  * ignore the value we had chosen for the Gadget->Activation flag
  353.  * GACT_STRINGEXTEND.  NEVER SET THAT FLAG WHEN RUNNING UNDER V34.
  354.  * The Gadget->Flags bit GFLG_STRINGEXTEND is provided as a synonym which is
  355.  * safe under V34, and equivalent to GACT_STRINGEXTEND under V37.
  356.  * (Note that the two flags are not numerically equal)
  357.  */
  358. #define GFLG_STRINGEXTEND 0x0400  /* this String Gadget has StringExtend    */
  359.  
  360. /* New for V39: GFLG_IMAGEDISABLE.  This flag is automatically set if
  361.  * the custom image of this gadget knows how to do disabled rendering
  362.  * (more specifically, if its IA_SupportsDisable attribute is TRUE).
  363.  * Intuition uses this to defer the ghosting to the image-class,
  364.  * instead of doing it itself (the old compatible way).
  365.  * Do not set this flag yourself - Intuition will do it for you.
  366.  */
  367.  
  368. #define GFLG_IMAGEDISABLE 0x0800  /* Gadget's image knows how to do disabled
  369.                    * rendering
  370.                    */
  371.  
  372. /* New for V39:  If set, this bit means that the Gadget is actually
  373.  * a struct ExtGadget, with new fields and flags.  All V39 boopsi
  374.  * gadgets are ExtGadgets.  Never ever attempt to read the extended
  375.  * fields of a gadget if this flag is not set.
  376.  */
  377. #define GFLG_EXTENDED      0x8000  /* Gadget is extended */
  378.  
  379. /* ---    Gadget.Activation flag values    --- */
  380. /* Set GACT_RELVERIFY if you want to verify that the pointer was still over
  381.  * the gadget when the select button was released.  Will cause
  382.  * an IDCMP_GADGETUP message to be sent if so.
  383.  */
  384. #define GACT_RELVERIFY      0x0001
  385.  
  386. /* the flag GACT_IMMEDIATE, when set, informs the caller that the gadget
  387.  *  was activated when it was activated.  This flag works in conjunction with
  388.  *  the GACT_RELVERIFY flag
  389.  */
  390. #define GACT_IMMEDIATE      0x0002
  391.  
  392. /* the flag GACT_ENDGADGET, when set, tells the system that this gadget,
  393.  * when selected, causes the Requester to be ended.  Requesters
  394.  * that are ended are erased and unlinked from the system.
  395.  */
  396. #define GACT_ENDGADGET      0x0004
  397.  
  398. /* the GACT_FOLLOWMOUSE flag, when set, specifies that you want to receive
  399.  * reports on mouse movements while this gadget is active.
  400.  * You probably want to set the GACT_IMMEDIATE flag when using
  401.  * GACT_FOLLOWMOUSE, since that's the only reasonable way you have of
  402.  * learning why Intuition is suddenly sending you a stream of mouse
  403.  * movement events.  If you don't set GACT_RELVERIFY, you'll get at
  404.  * least one Mouse Position event.
  405.  * Note: boolean FOLLOWMOUSE gadgets require GACT_RELVERIFY to get
  406.  * _any_ mouse movement events (this unusual behavior is a compatibility
  407.  * hold-over from the old days).
  408.  */
  409. #define GACT_FOLLOWMOUSE  0x0008
  410.  
  411. /* if any of the BORDER flags are set in a Gadget that's included in the
  412.  * Gadget list when a Window is opened, the corresponding Border will
  413.  * be adjusted to make room for the Gadget
  414.  */
  415. #define GACT_RIGHTBORDER  0x0010
  416. #define GACT_LEFTBORDER      0x0020
  417. #define GACT_TOPBORDER      0x0040
  418. #define GACT_BOTTOMBORDER 0x0080
  419. #define GACT_BORDERSNIFF  0x8000  /* neither set nor rely on this bit    */
  420.  
  421. #define GACT_TOGGLESELECT 0x0100  /* this bit for toggle-select mode */
  422. #define GACT_BOOLEXTEND      0x2000  /* this Boolean Gadget has a BoolInfo    */
  423.  
  424. /* should properly be in StringInfo, but aren't    */
  425. #define GACT_STRINGLEFT      0x0000  /* NOTE WELL: that this has value zero    */
  426. #define GACT_STRINGCENTER 0x0200
  427. #define GACT_STRINGRIGHT  0x0400
  428. #define GACT_LONGINT      0x0800  /* this String Gadget is for Long Ints    */
  429. #define GACT_ALTKEYMAP      0x1000  /* this String has an alternate keymap    */
  430. #define GACT_STRINGEXTEND 0x2000  /* this String Gadget has StringExtend    */
  431.                   /* NOTE: NEVER SET GACT_STRINGEXTEND IF YOU
  432.                    * ARE RUNNING ON LESS THAN V36!  SEE
  433.                    * GFLG_STRINGEXTEND (ABOVE) INSTEAD
  434.                    */
  435.  
  436. #define GACT_ACTIVEGADGET 0x4000  /* this gadget is "active".  This flag
  437.                    * is maintained by Intuition, and you
  438.                    * cannot count on its value persisting
  439.                    * while you do something on your program's
  440.                    * task.  It can only be trusted by
  441.                    * people implementing custom gadgets
  442.                    */
  443.  
  444. /* note 0x8000 is used above (GACT_BORDERSNIFF);
  445.  * all Activation flags defined */
  446.  
  447. /* --- GADGET TYPES ------------------------------------------------------- */
  448. /* These are the Gadget Type definitions for the variable GadgetType
  449.  * gadget number type MUST start from one.  NO TYPES OF ZERO ALLOWED.
  450.  * first comes the mask for Gadget flags reserved for Gadget typing
  451.  */
  452. #define GTYP_GADGETTYPE    0xFC00    /* all Gadget Global Type flags (padded) */
  453. #define GTYP_SYSGADGET    0x8000    /* 1 = Allocated by the system, 0 = by app. */
  454. #define GTYP_SCRGADGET    0x4000    /* 1 = ScreenGadget, 0 = WindowGadget */
  455. #define GTYP_GZZGADGET    0x2000    /* 1 = for WFLG_GIMMEZEROZERO borders */
  456. #define GTYP_REQGADGET    0x1000    /* 1 = this is a Requester Gadget */
  457. /* system gadgets */
  458. #define GTYP_SIZING    0x0010
  459. #define GTYP_WDRAGGING    0x0020
  460. #define GTYP_SDRAGGING    0x0030
  461. #define GTYP_WUPFRONT    0x0040
  462. #define GTYP_SUPFRONT    0x0050
  463. #define GTYP_WDOWNBACK    0x0060
  464. #define GTYP_SDOWNBACK    0x0070
  465. #define GTYP_CLOSE    0x0080
  466. /* application gadgets */
  467. #define GTYP_BOOLGADGET    0x0001
  468. #define GTYP_GADGET0002    0x0002
  469. #define GTYP_PROPGADGET    0x0003
  470. #define GTYP_STRGADGET    0x0004
  471. #define GTYP_CUSTOMGADGET    0x0005
  472. #define GTYP_GTYPEMASK    0x0007    /* masks out to gadget class    */
  473.  
  474. /* This bit in GadgetType is reserved for undocumented internal use
  475.  * by the Gadget Toolkit, and cannot be used nor relied on by
  476.  * applications:    0x0100
  477.  */
  478.  
  479. /* New for V39.  Gadgets which have the GFLG_EXTENDED flag set are
  480.  * actually ExtGadgets, which have more flags.    The GMORE_xxx
  481.  * identifiers describe those flags:
  482.  */
  483. #define GMORE_BOUNDS       0x00000001 /* ExtGadget has valid Bounds */
  484. #define GMORE_GADGETHELP   0x00000002 /* This gadget responds to gadget help */
  485. #define GMORE_SCROLLRASTER 0x00000004 /* This (custom) gadget uses ScrollRaster */
  486.  
  487.  
  488. /* ======================================================================== */
  489. /* === BoolInfo======================================================= */
  490. /* ======================================================================== */
  491. /* This is the special data needed by an Extended Boolean Gadget
  492.  * Typically this structure will be pointed to by the Gadget field SpecialInfo
  493.  */
  494. struct BoolInfo
  495. {
  496.     UWORD  Flags;    /* defined below */
  497.     UWORD  *Mask;    /* bit mask for highlighting and selecting
  498.              * mask must follow the same rules as an Image
  499.              * plane.  Its width and height are determined
  500.              * by the width and height of the gadget's
  501.              * select box. (i.e. Gadget.Width and .Height).
  502.              */
  503.     ULONG  Reserved;    /* set to 0    */
  504. };
  505.  
  506. /* set BoolInfo.Flags to this flag bit.
  507.  * in the future, additional bits might mean more stuff hanging
  508.  * off of BoolInfo.Reserved.
  509.  */
  510. #define BOOLMASK    0x0001    /* extension is for masked gadget */
  511.  
  512. /* ======================================================================== */
  513. /* === PropInfo =========================================================== */
  514. /* ======================================================================== */
  515. /* this is the special data required by the proportional Gadget
  516.  * typically, this data will be pointed to by the Gadget variable SpecialInfo
  517.  */
  518. struct PropInfo
  519. {
  520.     UWORD Flags;    /* general purpose flag bits (see defines below) */
  521.  
  522.     /* You initialize the Pot variables before the Gadget is added to
  523.      * the system.  Then you can look here for the current settings
  524.      * any time, even while User is playing with this Gadget.  To
  525.      * adjust these after the Gadget is added to the System, use
  526.      * ModifyProp();  The Pots are the actual proportional settings,
  527.      * where a value of zero means zero and a value of MAXPOT means
  528.      * that the Gadget is set to its maximum setting.
  529.      */
  530.     UWORD HorizPot;    /* 16-bit FixedPoint horizontal quantity percentage */
  531.     UWORD VertPot;    /* 16-bit FixedPoint vertical quantity percentage */
  532.  
  533.     /* the 16-bit FixedPoint Body variables describe what percentage of
  534.      * the entire body of stuff referred to by this Gadget is actually
  535.      * shown at one time.  This is used with the AUTOKNOB routines,
  536.      * to adjust the size of the AUTOKNOB according to how much of
  537.      * the data can be seen.  This is also used to decide how far
  538.      * to advance the Pots when User hits the Container of the Gadget.
  539.      * For instance, if you were controlling the display of a 5-line
  540.      * Window of text with this Gadget, and there was a total of 15
  541.      * lines that could be displayed, you would set the VertBody value to
  542.      *       (MAXBODY / (TotalLines / DisplayLines)) = MAXBODY / 3.
  543.      * Therefore, the AUTOKNOB would fill 1/3 of the container, and
  544.      * if User hits the Cotainer outside of the knob, the pot would
  545.      * advance 1/3 (plus or minus) If there's no body to show, or
  546.      * the total amount of displayable info is less than the display area,
  547.      * set the Body variables to the MAX.  To adjust these after the
  548.      * Gadget is added to the System, use ModifyProp();
  549.      */
  550.     UWORD HorizBody;        /* horizontal Body */
  551.     UWORD VertBody;        /* vertical Body */
  552.  
  553.     /* these are the variables that Intuition sets and maintains */
  554.     UWORD CWidth;    /* Container width (with any relativity absoluted) */
  555.     UWORD CHeight;    /* Container height (with any relativity absoluted) */
  556.     UWORD HPotRes, VPotRes;    /* pot increments */
  557.     UWORD LeftBorder;        /* Container borders */
  558.     UWORD TopBorder;        /* Container borders */
  559. };
  560.  
  561.  
  562. /* --- FLAG BITS ---------------------------------------------------------- */
  563. #define AUTOKNOB    0x0001    /* this flag sez:  gimme that old auto-knob */
  564. /* NOTE: if you do not use an AUTOKNOB for a proportional gadget,
  565.  * you are currently limited to using a single Image of your own
  566.  * design: Intuition won't handle a linked list of images as
  567.  * a proportional gadget knob.
  568.  */
  569.  
  570. #define FREEHORIZ    0x0002    /* if set, the knob can move horizontally */
  571. #define FREEVERT    0x0004    /* if set, the knob can move vertically */
  572. #define PROPBORDERLESS    0x0008    /* if set, no border will be rendered */
  573. #define KNOBHIT        0x0100    /* set when this Knob is hit */
  574. #define PROPNEWLOOK    0x0010    /* set this if you want to get the new
  575.                  * V36 look
  576.                  */
  577.  
  578. #define KNOBHMIN    6    /* minimum horizontal size of the Knob */
  579. #define KNOBVMIN    4    /* minimum vertical size of the Knob */
  580. #define MAXBODY        0xFFFF    /* maximum body value */
  581. #define MAXPOT            0xFFFF    /* maximum pot value */
  582.  
  583.  
  584. /* ======================================================================== */
  585. /* === StringInfo ========================================================= */
  586. /* ======================================================================== */
  587. /* this is the special data required by the string Gadget
  588.  * typically, this data will be pointed to by the Gadget variable SpecialInfo
  589.  */
  590. struct StringInfo
  591. {
  592.     /* you initialize these variables, and then Intuition maintains them */
  593.     UBYTE *Buffer;    /* the buffer containing the start and final string */
  594.     UBYTE *UndoBuffer;    /* optional buffer for undoing current entry */
  595.     WORD BufferPos;    /* character position in Buffer */
  596.     WORD MaxChars;    /* max number of chars in Buffer (including NULL) */
  597.     WORD DispPos;    /* Buffer position of first displayed character */
  598.  
  599.     /* Intuition initializes and maintains these variables for you */
  600.     WORD UndoPos;    /* character position in the undo buffer */
  601.     WORD NumChars;    /* number of characters currently in Buffer */
  602.     WORD DispCount;    /* number of whole characters visible in Container */
  603.     WORD CLeft, CTop;    /* topleft offset of the container */
  604.  
  605.     /* This unused field is changed to allow extended specification
  606.      * of string gadget parameters.  It is ignored unless the flag
  607.      * GACT_STRINGEXTEND is set in the Gadget's Activation field
  608.      * or the GFLG_STRINGEXTEND flag is set in the Gadget Flags field.
  609.      * (See GFLG_STRINGEXTEND for an important note)
  610.      */
  611.     /* struct Layer *LayerPtr;    --- obsolete --- */
  612.     struct StringExtend *Extension;
  613.  
  614.     /* you can initialize this variable before the gadget is submitted to
  615.      * Intuition, and then examine it later to discover what integer
  616.      * the user has entered (if the user never plays with the gadget,
  617.      * the value will be unchanged from your initial setting)
  618.      */
  619.     LONG LongInt;
  620.  
  621.     /* If you want this Gadget to use your own Console keymapping, you
  622.      * set the GACT_ALTKEYMAP bit in the Activation flags of the Gadget,
  623.      * and then set this variable to point to your keymap.  If you don't
  624.      * set the GACT_ALTKEYMAP, you'll get the standard ASCII keymapping.
  625.      */
  626.     struct KeyMap *AltKeyMap;
  627. };
  628.  
  629. /* ======================================================================== */
  630. /* === IntuiText ========================================================== */
  631. /* ======================================================================== */
  632. /* IntuiText is a series of strings that start with a location
  633.  *  (always relative to the upper-left corner of something) and then the
  634.  *  text of the string.  The text is null-terminated.
  635.  */
  636. struct IntuiText
  637. {
  638.     UBYTE FrontPen, BackPen;    /* the pen numbers for the rendering */
  639.     UBYTE DrawMode;        /* the mode for rendering the text */
  640.     WORD LeftEdge;        /* relative start location for the text */
  641.     WORD TopEdge;        /* relative start location for the text */
  642.     struct TextAttr *ITextFont;    /* if NULL, you accept the default */
  643.     UBYTE *IText;        /* pointer to null-terminated text */
  644.     struct IntuiText *NextText; /* pointer to another IntuiText to render */
  645. };
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652. /* ======================================================================== */
  653. /* === Border ============================================================= */
  654. /* ======================================================================== */
  655. /* Data type Border, used for drawing a series of lines which is intended for
  656.  *  use as a border drawing, but which may, in fact, be used to render any
  657.  *  arbitrary vector shape.
  658.  *  The routine DrawBorder sets up the RastPort with the appropriate
  659.  *  variables, then does a Move to the first coordinate, then does Draws
  660.  *  to the subsequent coordinates.
  661.  *  After all the Draws are done, if NextBorder is non-zero we call DrawBorder
  662.  *  on NextBorder
  663.  */
  664. struct Border
  665. {
  666.     WORD LeftEdge, TopEdge;    /* initial offsets from the origin */
  667.     UBYTE FrontPen, BackPen;    /* pens numbers for rendering */
  668.     UBYTE DrawMode;        /* mode for rendering */
  669.     BYTE Count;            /* number of XY pairs */
  670.     WORD *XY;            /* vector coordinate pairs rel to LeftTop */
  671.     struct Border *NextBorder;    /* pointer to any other Border too */
  672. };
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679. /* ======================================================================== */
  680. /* === Image ============================================================== */
  681. /* ======================================================================== */
  682. /* This is a brief image structure for very simple transfers of
  683.  * image data to a RastPort
  684.  */
  685. struct Image
  686. {
  687.     WORD LeftEdge;        /* starting offset relative to some origin */
  688.     WORD TopEdge;        /* starting offsets relative to some origin */
  689.     WORD Width;            /* pixel size (though data is word-aligned) */
  690.     WORD Height;
  691.     WORD Depth;            /* >= 0, for images you create        */
  692.     UWORD *ImageData;        /* pointer to the actual word-aligned bits */
  693.  
  694.     /* the PlanePick and PlaneOnOff variables work much the same way as the
  695.      * equivalent GELS Bob variables.  It's a space-saving
  696.      * mechanism for image data.  Rather than defining the image data
  697.      * for every plane of the RastPort, you need define data only
  698.      * for the planes that are not entirely zero or one.  As you
  699.      * define your Imagery, you will often find that most of the planes
  700.      * ARE just as color selectors.  For instance, if you're designing
  701.      * a two-color Gadget to use colors one and three, and the Gadget
  702.      * will reside in a five-plane display, bit plane zero of your
  703.      * imagery would be all ones, bit plane one would have data that
  704.      * describes the imagery, and bit planes two through four would be
  705.      * all zeroes.  Using these flags avoids wasting all
  706.      * that memory in this way:  first, you specify which planes you
  707.      * want your data to appear in using the PlanePick variable.  For
  708.      * each bit set in the variable, the next "plane" of your image
  709.      * data is blitted to the display.    For each bit clear in this
  710.      * variable, the corresponding bit in PlaneOnOff is examined.
  711.      * If that bit is clear, a "plane" of zeroes will be used.
  712.      * If the bit is set, ones will go out instead.  So, for our example:
  713.      *     Gadget.PlanePick = 0x02;
  714.      *     Gadget.PlaneOnOff = 0x01;
  715.      * Note that this also allows for generic Gadgets, like the
  716.      * System Gadgets, which will work in any number of bit planes.
  717.      * Note also that if you want an Image that is only a filled
  718.      * rectangle, you can get this by setting PlanePick to zero
  719.      * (pick no planes of data) and set PlaneOnOff to describe the pen
  720.      * color of the rectangle.
  721.      *
  722.      * NOTE:  Intuition relies on PlanePick to know how many planes
  723.      * of data are found in ImageData.    There should be no more
  724.      * '1'-bits in PlanePick than there are planes in ImageData.
  725.      */
  726.     UBYTE PlanePick, PlaneOnOff;
  727.  
  728.     /* if the NextImage variable is not NULL, Intuition presumes that
  729.      * it points to another Image structure with another Image to be
  730.      * rendered
  731.      */
  732.     struct Image *NextImage;
  733. };
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740. /* ======================================================================== */
  741. /* === IntuiMessage ======================================================= */
  742. /* ======================================================================== */
  743. struct IntuiMessage
  744. {
  745.     struct Message ExecMessage;
  746.  
  747.     /* the Class bits correspond directly with the IDCMP Flags, except for the
  748.      * special bit IDCMP_LONELYMESSAGE (defined below)
  749.      */
  750.     ULONG Class;
  751.  
  752.     /* the Code field is for special values like MENU number */
  753.     UWORD Code;
  754.  
  755.     /* the Qualifier field is a copy of the current InputEvent's Qualifier */
  756.     UWORD Qualifier;
  757.  
  758.     /* IAddress contains particular addresses for Intuition functions, like
  759.      * the pointer to the Gadget or the Screen
  760.      */
  761.     APTR IAddress;
  762.  
  763.     /* when getting mouse movement reports, any event you get will have the
  764.      * the mouse coordinates in these variables.  the coordinates are relative
  765.      * to the upper-left corner of your Window (WFLG_GIMMEZEROZERO
  766.      * notwithstanding).  If IDCMP_DELTAMOVE is set, these values will
  767.      * be deltas from the last reported position.
  768.      */
  769.     WORD MouseX, MouseY;
  770.  
  771.     /* the time values are copies of the current system clock time.  Micros
  772.      * are in units of microseconds, Seconds in seconds.
  773.      */
  774.     ULONG Seconds, Micros;
  775.  
  776.     /* the IDCMPWindow variable will always have the address of the Window of
  777.      * this IDCMP
  778.      */
  779.     struct Window *IDCMPWindow;
  780.  
  781.     /* system-use variable */
  782.     struct IntuiMessage *SpecialLink;
  783. };
  784.  
  785. /* New for V39:
  786.  * All IntuiMessages are now slightly extended.  The ExtIntuiMessage
  787.  * structure has an additional field for tablet data, which is usually
  788.  * NULL.  If a tablet driver which is sending IESUBCLASS_NEWTABLET
  789.  * events is installed in the system, windows with the WA_TabletMessages
  790.  * property set will find that eim_TabletData points to the TabletData
  791.  * structure.  Applications must first check that this field is non-NULL;
  792.  * it will be NULL for certain kinds of message, including mouse activity
  793.  * generated from other than the tablet (i.e. the keyboard equivalents
  794.  * or the mouse itself).
  795.  *
  796.  * NEVER EVER examine any extended fields when running under pre-V39!
  797.  *
  798.  * NOTE: This structure is subject to grow in the future.  Making
  799.  * assumptions about its size is A BAD IDEA.
  800.  */
  801.  
  802. struct ExtIntuiMessage
  803. {
  804.     struct IntuiMessage eim_IntuiMessage;
  805.     struct TabletData *eim_TabletData;
  806. };
  807.  
  808. /* --- IDCMP Classes ------------------------------------------------------ */
  809. /* Please refer to the Autodoc for OpenWindow() and to the Rom Kernel
  810.  * Manual for full details on the IDCMP classes.
  811.  */
  812. #define IDCMP_SIZEVERIFY    0x00000001
  813. #define IDCMP_NEWSIZE        0x00000002
  814. #define IDCMP_REFRESHWINDOW    0x00000004
  815. #define IDCMP_MOUSEBUTTONS    0x00000008
  816. #define IDCMP_MOUSEMOVE        0x00000010
  817. #define IDCMP_GADGETDOWN    0x00000020
  818. #define IDCMP_GADGETUP        0x00000040
  819. #define IDCMP_REQSET        0x00000080
  820. #define IDCMP_MENUPICK        0x00000100
  821. #define IDCMP_CLOSEWINDOW    0x00000200
  822. #define IDCMP_RAWKEY        0x00000400
  823. #define IDCMP_REQVERIFY        0x00000800
  824. #define IDCMP_REQCLEAR        0x00001000
  825. #define IDCMP_MENUVERIFY    0x00002000
  826. #define IDCMP_NEWPREFS        0x00004000
  827. #define IDCMP_DISKINSERTED    0x00008000
  828. #define IDCMP_DISKREMOVED    0x00010000
  829. #define IDCMP_WBENCHMESSAGE    0x00020000  /*    System use only        */
  830. #define IDCMP_ACTIVEWINDOW    0x00040000
  831. #define IDCMP_INACTIVEWINDOW    0x00080000
  832. #define IDCMP_DELTAMOVE        0x00100000
  833. #define IDCMP_VANILLAKEY    0x00200000
  834. #define IDCMP_INTUITICKS    0x00400000
  835. /*  for notifications from "boopsi" gadgets    */
  836. #define IDCMP_IDCMPUPDATE    0x00800000  /* new for V36    */
  837. /* for getting help key report during menu session    */
  838. #define IDCMP_MENUHELP        0x01000000  /* new for V36    */
  839. /* for notification of any move/size/zoom/change window        */
  840. #define IDCMP_CHANGEWINDOW    0x02000000  /* new for V36    */
  841. #define IDCMP_GADGETHELP    0x04000000  /* new for V39    */
  842.  
  843. /* NOTEZ-BIEN:                0x80000000 is reserved for internal use   */
  844.  
  845. /* the IDCMP Flags do not use this special bit, which is cleared when
  846.  * Intuition sends its special message to the Task, and set when Intuition
  847.  * gets its Message back from the Task.  Therefore, I can check here to
  848.  * find out fast whether or not this Message is available for me to send
  849.  */
  850. #define IDCMP_LONELYMESSAGE    0x80000000
  851.  
  852.  
  853. /* --- IDCMP Codes -------------------------------------------------------- */
  854. /* This group of codes is for the IDCMP_CHANGEWINDOW message */
  855. #define CWCODE_MOVESIZE    0x0000    /* Window was moved and/or sized */
  856. #define CWCODE_DEPTH    0x0001    /* Window was depth-arranged (new for V39) */
  857.  
  858. /* This group of codes is for the IDCMP_MENUVERIFY message */
  859. #define MENUHOT        0x0001    /* IntuiWants verification or MENUCANCEL    */
  860. #define MENUCANCEL    0x0002    /* HOT Reply of this cancels Menu operation */
  861. #define MENUWAITING    0x0003    /* Intuition simply wants a ReplyMsg() ASAP */
  862.  
  863. /* These are internal tokens to represent state of verification attempts
  864.  * shown here as a clue.
  865.  */
  866. #define OKOK        MENUHOT    /* guy didn't care            */
  867. #define OKABORT        0x0004    /* window rendered question moot    */
  868. #define OKCANCEL    MENUCANCEL /* window sent cancel reply        */
  869.  
  870. /* This group of codes is for the IDCMP_WBENCHMESSAGE messages */
  871. #define WBENCHOPEN    0x0001
  872. #define WBENCHCLOSE    0x0002
  873.  
  874.  
  875. /* A data structure common in V36 Intuition processing    */
  876. struct IBox
  877. {
  878.     WORD Left;
  879.     WORD Top;
  880.     WORD Width;
  881.     WORD Height;
  882. };
  883.  
  884.  
  885.  
  886. /* ======================================================================== */
  887. /* === Window ============================================================= */
  888. /* ======================================================================== */
  889. struct Window
  890. {
  891.     struct Window *NextWindow;        /* for the linked list in a screen */
  892.  
  893.     WORD LeftEdge, TopEdge;        /* screen dimensions of window */
  894.     WORD Width, Height;            /* screen dimensions of window */
  895.  
  896.     WORD MouseY, MouseX;        /* relative to upper-left of window */
  897.  
  898.     WORD MinWidth, MinHeight;        /* minimum sizes */
  899.     UWORD MaxWidth, MaxHeight;        /* maximum sizes */
  900.  
  901.     ULONG Flags;            /* see below for defines */
  902.  
  903.     struct Menu *MenuStrip;        /* the strip of Menu headers */
  904.  
  905.     UBYTE *Title;            /* the title text for this window */
  906.  
  907.     struct Requester *FirstRequest;    /* all active Requesters */
  908.  
  909.     struct Requester *DMRequest;    /* double-click Requester */
  910.  
  911.     WORD ReqCount;            /* count of reqs blocking Window */
  912.  
  913.     struct Screen *WScreen;        /* this Window's Screen */
  914.     struct RastPort *RPort;        /* this Window's very own RastPort */
  915.  
  916.     /* the border variables describe the window border.  If you specify
  917.      * WFLG_GIMMEZEROZERO when you open the window, then the upper-left of
  918.      * the ClipRect for this window will be upper-left of the BitMap (with
  919.      * correct offsets when in SuperBitMap mode; you MUST select
  920.      * WFLG_GIMMEZEROZERO when using SuperBitMap).  If you don't specify
  921.      * ZeroZero, then you save memory (no allocation of RastPort, Layer,
  922.      * ClipRect and associated Bitmaps), but you also must offset all your
  923.      * writes by BorderTop, BorderLeft and do your own mini-clipping to
  924.      * prevent writing over the system gadgets
  925.      */
  926.     BYTE BorderLeft, BorderTop, BorderRight, BorderBottom;
  927.     struct RastPort *BorderRPort;
  928.  
  929.  
  930.     /* You supply a linked-list of Gadgets for your Window.
  931.      * This list DOES NOT include system gadgets.  You get the standard
  932.      * window system gadgets by setting flag-bits in the variable Flags (see
  933.      * the bit definitions below)
  934.      */
  935.     struct Gadget *FirstGadget;
  936.  
  937.     /* these are for opening/closing the windows */
  938.     struct Window *Parent, *Descendant;
  939.  
  940.     /* sprite data information for your own Pointer
  941.      * set these AFTER you Open the Window by calling SetPointer()
  942.      */
  943.     UWORD *Pointer;    /* sprite data */
  944.     BYTE PtrHeight;    /* sprite height (not including sprite padding) */
  945.     BYTE PtrWidth;    /* sprite width (must be less than or equal to 16) */
  946.     BYTE XOffset, YOffset;    /* sprite offsets */
  947.  
  948.     /* the IDCMP Flags and User's and Intuition's Message Ports */
  949.     ULONG IDCMPFlags;    /* User-selected flags */
  950.     struct MsgPort *UserPort, *WindowPort;
  951.     struct IntuiMessage *MessageKey;
  952.  
  953.     UBYTE DetailPen, BlockPen;    /* for bar/border/gadget rendering */
  954.  
  955.     /* the CheckMark is a pointer to the imagery that will be used when
  956.      * rendering MenuItems of this Window that want to be checkmarked
  957.      * if this is equal to NULL, you'll get the default imagery
  958.      */
  959.     struct Image *CheckMark;
  960.  
  961.     UBYTE *ScreenTitle;    /* if non-null, Screen title when Window is active */
  962.  
  963.     /* These variables have the mouse coordinates relative to the
  964.      * inner-Window of WFLG_GIMMEZEROZERO Windows.  This is compared with the
  965.      * MouseX and MouseY variables, which contain the mouse coordinates
  966.      * relative to the upper-left corner of the Window, WFLG_GIMMEZEROZERO
  967.      * notwithstanding
  968.      */
  969.     WORD GZZMouseX;
  970.     WORD GZZMouseY;
  971.     /* these variables contain the width and height of the inner-Window of
  972.      * WFLG_GIMMEZEROZERO Windows
  973.      */
  974.     WORD GZZWidth;
  975.     WORD GZZHeight;
  976.  
  977.     UBYTE *ExtData;
  978.  
  979.     BYTE *UserData;    /* general-purpose pointer to User data extension */
  980.  
  981.     /** 11/18/85: this pointer keeps a duplicate of what
  982.      * Window.RPort->Layer is _supposed_ to be pointing at
  983.      */
  984.     struct Layer *WLayer;
  985.  
  986.     /* NEW 1.2: need to keep track of the font that
  987.      * OpenWindow opened, in case user SetFont's into RastPort
  988.      */
  989.     struct TextFont *IFont;
  990.  
  991.     /* (V36) another flag word (the Flags field is used up).
  992.      * At present, all flag values are system private.
  993.      * Until further notice, you may not change nor use this field.
  994.      */
  995.     ULONG    MoreFlags;
  996.  
  997.     /**** Data beyond this point are Intuition Private.  DO NOT USE ****/
  998. };
  999.  
  1000.  
  1001. /* --- Flags requested at OpenWindow() time by the application --------- */
  1002. #define WFLG_SIZEGADGET        0x00000001    /* include sizing system-gadget? */
  1003. #define WFLG_DRAGBAR        0x00000002    /* include dragging system-gadget? */
  1004. #define WFLG_DEPTHGADGET    0x00000004    /* include depth arrangement gadget? */
  1005. #define WFLG_CLOSEGADGET    0x00000008    /* include close-box system-gadget? */
  1006.  
  1007. #define WFLG_SIZEBRIGHT        0x00000010    /* size gadget uses right border */
  1008. #define WFLG_SIZEBBOTTOM    0x00000020    /* size gadget uses bottom border */
  1009.  
  1010. /* --- refresh modes ------------------------------------------------------ */
  1011. /* combinations of the WFLG_REFRESHBITS select the refresh type */
  1012. #define WFLG_REFRESHBITS    0x000000C0
  1013. #define WFLG_SMART_REFRESH  0x00000000
  1014. #define WFLG_SIMPLE_REFRESH 0x00000040
  1015. #define WFLG_SUPER_BITMAP   0x00000080
  1016. #define WFLG_OTHER_REFRESH  0x000000C0
  1017.  
  1018. #define WFLG_BACKDROP        0x00000100    /* this is a backdrop window */
  1019.  
  1020. #define WFLG_REPORTMOUSE    0x00000200    /* to hear about every mouse move */
  1021.  
  1022. #define WFLG_GIMMEZEROZERO  0x00000400    /* a GimmeZeroZero window    */
  1023.  
  1024. #define WFLG_BORDERLESS        0x00000800    /* to get a Window sans border */
  1025.  
  1026. #define WFLG_ACTIVATE        0x00001000    /* when Window opens, it's Active */
  1027.  
  1028. /* --- Other User Flags --------------------------------------------------- */
  1029. #define WFLG_RMBTRAP        0x00010000    /* Catch RMB events for your own */
  1030. #define WFLG_NOCAREREFRESH  0x00020000    /* not to be bothered with REFRESH */
  1031.  
  1032. /* - V36 new Flags which the programmer may specify in NewWindow.Flags    */
  1033. #define WFLG_NW_EXTENDED    0x00040000    /* extension data provided    */
  1034.                     /* see struct ExtNewWindow    */
  1035.  
  1036. /* - V39 new Flags which the programmer may specify in NewWindow.Flags    */
  1037. #define WFLG_NEWLOOKMENUS   0x00200000    /* window has NewLook menus    */
  1038.  
  1039.  
  1040. /* These flags are set only by Intuition.  YOU MAY NOT SET THEM YOURSELF! */
  1041. #define WFLG_WINDOWACTIVE   0x00002000    /* this window is the active one */
  1042. #define WFLG_INREQUEST        0x00004000    /* this window is in request mode */
  1043. #define WFLG_MENUSTATE        0x00008000    /* Window is active with Menus on */
  1044. #define WFLG_WINDOWREFRESH  0x01000000    /* Window is currently refreshing */
  1045. #define WFLG_WBENCHWINDOW   0x02000000    /* WorkBench tool ONLY Window */
  1046. #define WFLG_WINDOWTICKED   0x04000000    /* only one timer tick at a time */
  1047.  
  1048. /* V36 and higher flags to be set only by Intuition: */
  1049. #define WFLG_VISITOR        0x08000000    /* visitor window        */
  1050. #define WFLG_ZOOMED        0x10000000    /* identifies "zoom state"    */
  1051. #define WFLG_HASZOOM        0x20000000    /* window has a zoom gadget    */
  1052.  
  1053.  
  1054. /* --- Other Window Values ---------------------------------------------- */
  1055. #define DEFAULTMOUSEQUEUE    (5)    /* no more mouse messages    */
  1056.  
  1057. /* --- see struct IntuiMessage for the IDCMP Flag definitions ------------- */
  1058.  
  1059.  
  1060. /* ======================================================================== */
  1061. /* === NewWindow ========================================================== */
  1062. /* ======================================================================== */
  1063. /*
  1064.  * Note that the new extension fields have been removed.  Use ExtNewWindow
  1065.  * structure below to make use of these fields
  1066.  */
  1067. struct NewWindow
  1068. {
  1069.     WORD LeftEdge, TopEdge;        /* screen dimensions of window */
  1070.     WORD Width, Height;            /* screen dimensions of window */
  1071.  
  1072.     UBYTE DetailPen, BlockPen;        /* for bar/border/gadget rendering */
  1073.  
  1074.     ULONG IDCMPFlags;            /* User-selected IDCMP flags */
  1075.  
  1076.     ULONG Flags;            /* see Window struct for defines */
  1077.  
  1078.     /* You supply a linked-list of Gadgets for your Window.
  1079.      *    This list DOES NOT include system Gadgets.  You get the standard
  1080.      *    system Window Gadgets by setting flag-bits in the variable Flags (see
  1081.      *    the bit definitions under the Window structure definition)
  1082.      */
  1083.     struct Gadget *FirstGadget;
  1084.  
  1085.     /* the CheckMark is a pointer to the imagery that will be used when
  1086.      * rendering MenuItems of this Window that want to be checkmarked
  1087.      * if this is equal to NULL, you'll get the default imagery
  1088.      */
  1089.     struct Image *CheckMark;
  1090.  
  1091.     UBYTE *Title;              /* the title text for this window */
  1092.  
  1093.     /* the Screen pointer is used only if you've defined a CUSTOMSCREEN and
  1094.      * want this Window to open in it.    If so, you pass the address of the
  1095.      * Custom Screen structure in this variable.  Otherwise, this variable
  1096.      * is ignored and doesn't have to be initialized.
  1097.      */
  1098.     struct Screen *Screen;
  1099.  
  1100.     /* WFLG_SUPER_BITMAP Window?  If so, put the address of your BitMap
  1101.      * structure in this variable.  If not, this variable is ignored and
  1102.      * doesn't have to be initialized
  1103.      */
  1104.     struct BitMap *BitMap;
  1105.  
  1106.     /* the values describe the minimum and maximum sizes of your Windows.
  1107.      * these matter only if you've chosen the WFLG_SIZEGADGET option,
  1108.      * which means that you want to let the User to change the size of
  1109.      * this Window.  You describe the minimum and maximum sizes that the
  1110.      * Window can grow by setting these variables.  You can initialize
  1111.      * any one these to zero, which will mean that you want to duplicate
  1112.      * the setting for that dimension (if MinWidth == 0, MinWidth will be
  1113.      * set to the opening Width of the Window).
  1114.      * You can change these settings later using SetWindowLimits().
  1115.      * If you haven't asked for a SIZING Gadget, you don't have to
  1116.      * initialize any of these variables.
  1117.      */
  1118.     WORD MinWidth, MinHeight;        /* minimums */
  1119.     UWORD MaxWidth, MaxHeight;         /* maximums */
  1120.  
  1121.     /* the type variable describes the Screen in which you want this Window to
  1122.      * open.  The type value can either be CUSTOMSCREEN or one of the
  1123.      * system standard Screen Types such as WBENCHSCREEN.  See the
  1124.      * type definitions under the Screen structure.
  1125.      */
  1126.     UWORD Type;
  1127.  
  1128. };
  1129.  
  1130. /* The following structure is the future NewWindow.  Compatibility
  1131.  * issues require that the size of NewWindow not change.
  1132.  * Data in the common part (NewWindow) indicates the the extension
  1133.  * fields are being used.
  1134.  * NOTE WELL: This structure may be subject to future extension.
  1135.  * Writing code depending on its size is not allowed.
  1136.  */
  1137. struct ExtNewWindow
  1138. {
  1139.     WORD LeftEdge, TopEdge;
  1140.     WORD Width, Height;
  1141.  
  1142.     UBYTE DetailPen, BlockPen;
  1143.     ULONG IDCMPFlags;
  1144.     ULONG Flags;
  1145.     struct Gadget *FirstGadget;
  1146.  
  1147.     struct Image *CheckMark;
  1148.  
  1149.     UBYTE *Title;
  1150.     struct Screen *Screen;
  1151.     struct BitMap *BitMap;
  1152.  
  1153.     WORD MinWidth, MinHeight;
  1154.     UWORD MaxWidth, MaxHeight;
  1155.  
  1156.     /* the type variable describes the Screen in which you want this Window to
  1157.      * open.  The type value can either be CUSTOMSCREEN or one of the
  1158.      * system standard Screen Types such as WBENCHSCREEN.  See the
  1159.      * type definitions under the Screen structure.
  1160.      * A new possible value for this field is PUBLICSCREEN, which
  1161.      * defines the window as a 'visitor' window.  See below for
  1162.      * additional information provided.
  1163.      */
  1164.     UWORD Type;
  1165.  
  1166.     /* ------------------------------------------------------- *
  1167.      * extensions for V36
  1168.      * if the NewWindow Flag value WFLG_NW_EXTENDED is set, then
  1169.      * this field is assumed to point to an array ( or chain of arrays)
  1170.      * of TagItem structures.  See also ExtNewScreen for another
  1171.      * use of TagItems to pass optional data.
  1172.      *
  1173.      * see below for tag values and the corresponding data.
  1174.      */
  1175.     struct TagItem    *Extension;
  1176. };
  1177.  
  1178. /*
  1179.  * The TagItem ID's (ti_Tag values) for OpenWindowTagList() follow.
  1180.  * They are values in a TagItem array passed as extension/replacement
  1181.  * values for the data in NewWindow.  OpenWindowTagList() can actually
  1182.  * work well with a NULL NewWindow pointer.
  1183.  */
  1184.  
  1185. #define WA_Dummy    (TAG_USER + 99)    /* 0x80000063    */
  1186.  
  1187. /* these tags simply override NewWindow parameters */
  1188. #define WA_Left            (WA_Dummy + 0x01)
  1189. #define WA_Top            (WA_Dummy + 0x02)
  1190. #define WA_Width        (WA_Dummy + 0x03)
  1191. #define WA_Height        (WA_Dummy + 0x04)
  1192. #define WA_DetailPen        (WA_Dummy + 0x05)
  1193. #define WA_BlockPen        (WA_Dummy + 0x06)
  1194. #define WA_IDCMP        (WA_Dummy + 0x07)
  1195.             /* "bulk" initialization of NewWindow.Flags */
  1196. #define WA_Flags        (WA_Dummy + 0x08)
  1197. #define WA_Gadgets        (WA_Dummy + 0x09)
  1198. #define WA_Checkmark        (WA_Dummy + 0x0A)
  1199. #define WA_Title        (WA_Dummy + 0x0B)
  1200.             /* means you don't have to call SetWindowTitles
  1201.              * after you open your window
  1202.              */
  1203. #define WA_ScreenTitle        (WA_Dummy + 0x0C)
  1204. #define WA_CustomScreen        (WA_Dummy + 0x0D)
  1205. #define WA_SuperBitMap        (WA_Dummy + 0x0E)
  1206.             /* also implies WFLG_SUPER_BITMAP property    */
  1207. #define WA_MinWidth        (WA_Dummy + 0x0F)
  1208. #define WA_MinHeight        (WA_Dummy + 0x10)
  1209. #define WA_MaxWidth        (WA_Dummy + 0x11)
  1210. #define WA_MaxHeight        (WA_Dummy + 0x12)
  1211.  
  1212. /* The following are specifications for new features    */
  1213.  
  1214. #define WA_InnerWidth        (WA_Dummy + 0x13)
  1215. #define WA_InnerHeight        (WA_Dummy + 0x14)
  1216.             /* You can specify the dimensions of the interior
  1217.              * region of your window, independent of what
  1218.              * the border widths will be.  You probably want
  1219.              * to also specify WA_AutoAdjust to allow
  1220.              * Intuition to move your window or even
  1221.              * shrink it so that it is completely on screen.
  1222.              */
  1223.  
  1224. #define WA_PubScreenName    (WA_Dummy + 0x15)
  1225.             /* declares that you want the window to open as
  1226.              * a visitor on the public screen whose name is
  1227.              * pointed to by (UBYTE *) ti_Data
  1228.              */
  1229. #define WA_PubScreen        (WA_Dummy + 0x16)
  1230.             /* open as a visitor window on the public screen
  1231.              * whose address is in (struct Screen *) ti_Data.
  1232.              * To ensure that this screen remains open, you
  1233.              * should either be the screen's owner, have a
  1234.              * window open on the screen, or use LockPubScreen().
  1235.              */
  1236. #define WA_PubScreenFallBack    (WA_Dummy + 0x17)
  1237.             /* A Boolean, specifies whether a visitor window
  1238.              * should "fall back" to the default public screen
  1239.              * (or Workbench) if the named public screen isn't
  1240.              * available
  1241.              */
  1242. #define WA_WindowName        (WA_Dummy + 0x18)
  1243.             /* not implemented    */
  1244. #define WA_Colors        (WA_Dummy + 0x19)
  1245.             /* a ColorSpec array for colors to be set
  1246.              * when this window is active.    This is not
  1247.              * implemented, and may not be, since the default
  1248.              * values to restore would be hard to track.
  1249.              * We'd like to at least support per-window colors
  1250.              * for the mouse pointer sprite.
  1251.              */
  1252. #define WA_Zoom        (WA_Dummy + 0x1A)
  1253.             /* ti_Data points to an array of four WORD's,
  1254.              * the initial Left/Top/Width/Height values of
  1255.              * the "alternate" zoom position/dimensions.
  1256.              * It also specifies that you want a Zoom gadget
  1257.              * for your window, whether or not you have a
  1258.              * sizing gadget.
  1259.              */
  1260. #define WA_MouseQueue        (WA_Dummy + 0x1B)
  1261.             /* ti_Data contains initial value for the mouse
  1262.              * message backlog limit for this window.
  1263.              */
  1264. #define WA_BackFill        (WA_Dummy + 0x1C)
  1265.             /* provides a "backfill hook" for your window's Layer.
  1266.              * See layers.library/CreateUpfrontHookLayer().
  1267.              */
  1268. #define WA_RptQueue        (WA_Dummy + 0x1D)
  1269.             /* initial value of repeat key backlog limit    */
  1270.  
  1271.     /* These Boolean tag items are alternatives to the NewWindow.Flags
  1272.      * boolean flags with similar names.
  1273.      */
  1274. #define WA_SizeGadget        (WA_Dummy + 0x1E)
  1275. #define WA_DragBar        (WA_Dummy + 0x1F)
  1276. #define WA_DepthGadget        (WA_Dummy + 0x20)
  1277. #define WA_CloseGadget        (WA_Dummy + 0x21)
  1278. #define WA_Backdrop        (WA_Dummy + 0x22)
  1279. #define WA_ReportMouse        (WA_Dummy + 0x23)
  1280. #define WA_NoCareRefresh    (WA_Dummy + 0x24)
  1281. #define WA_Borderless        (WA_Dummy + 0x25)
  1282. #define WA_Activate        (WA_Dummy + 0x26)
  1283. #define WA_RMBTrap        (WA_Dummy + 0x27)
  1284. #define WA_WBenchWindow        (WA_Dummy + 0x28)    /* PRIVATE!! */
  1285. #define WA_SimpleRefresh    (WA_Dummy + 0x29)
  1286.             /* only specify if TRUE    */
  1287. #define WA_SmartRefresh        (WA_Dummy + 0x2A)
  1288.             /* only specify if TRUE    */
  1289. #define WA_SizeBRight        (WA_Dummy + 0x2B)
  1290. #define WA_SizeBBottom        (WA_Dummy + 0x2C)
  1291.  
  1292.     /* New Boolean properties    */
  1293. #define WA_AutoAdjust        (WA_Dummy + 0x2D)
  1294.             /* shift or squeeze the window's position and
  1295.              * dimensions to fit it on screen.
  1296.              */
  1297.  
  1298. #define WA_GimmeZeroZero    (WA_Dummy + 0x2E)
  1299.             /* equiv. to NewWindow.Flags WFLG_GIMMEZEROZERO    */
  1300.  
  1301. /* New for V37: WA_MenuHelp (ignored by V36) */
  1302. #define WA_MenuHelp        (WA_Dummy + 0x2F)
  1303.             /* Enables IDCMP_MENUHELP:  Pressing HELP during menus
  1304.              * will return IDCMP_MENUHELP message.
  1305.              */
  1306.  
  1307. /* New for V39:  (ignored by V37 and earlier) */
  1308. #define WA_NewLookMenus        (WA_Dummy + 0x30)
  1309.             /* Set to TRUE if you want NewLook menus */
  1310. #define WA_AmigaKey        (WA_Dummy + 0x31)
  1311.             /* Pointer to image for Amiga-key equiv in menus */
  1312. #define WA_NotifyDepth        (WA_Dummy + 0x32)
  1313.             /* Requests IDCMP_CHANGEWINDOW message when
  1314.              * window is depth arranged
  1315.              * (imsg->Code = CWCODE_DEPTH)
  1316.              */
  1317.  
  1318. /* WA_Dummy + 0x33 is obsolete */
  1319.  
  1320. #define WA_Pointer        (WA_Dummy + 0x34)
  1321.             /* Allows you to specify a custom pointer
  1322.              * for your window.  ti_Data points to a
  1323.              * pointer object you obtained via
  1324.              * "pointerclass". NULL signifies the
  1325.              * default pointer.
  1326.              * This tag may be passed to OpenWindowTags()
  1327.              * or SetWindowPointer().
  1328.              */
  1329.  
  1330. #define WA_BusyPointer        (WA_Dummy + 0x35)
  1331.             /* ti_Data is boolean.    Set to TRUE to
  1332.              * request the standard busy pointer.
  1333.              * This tag may be passed to OpenWindowTags()
  1334.              * or SetWindowPointer().
  1335.              */
  1336.  
  1337. #define WA_PointerDelay        (WA_Dummy + 0x36)
  1338.             /* ti_Data is boolean.    Set to TRUE to
  1339.              * request that the changing of the
  1340.              * pointer be slightly delayed.  The change
  1341.              * will be called off if you call NewSetPointer()
  1342.              * before the delay expires.  This allows
  1343.              * you to post a busy-pointer even if you think
  1344.              * the busy-time may be very short, without
  1345.              * fear of a flashing pointer.
  1346.              * This tag may be passed to OpenWindowTags()
  1347.              * or SetWindowPointer().
  1348.              */
  1349.  
  1350. #define WA_TabletMessages    (WA_Dummy + 0x37)
  1351.             /* ti_Data is a boolean.  Set to TRUE to
  1352.              * request that tablet information be included
  1353.              * in IntuiMessages sent to your window.
  1354.              * Requires that something (i.e. a tablet driver)
  1355.              * feed IESUBCLASS_NEWTABLET InputEvents into
  1356.              * the system.    For a pointer to the TabletData,
  1357.              * examine the ExtIntuiMessage->eim_TabletData
  1358.              * field.  It is UNSAFE to check this field
  1359.              * when running on pre-V39 systems.  It's always
  1360.              * safe to check this field under V39 and up,
  1361.              * though it may be NULL.
  1362.              */
  1363.  
  1364. #define WA_HelpGroup        (WA_Dummy + 0x38)
  1365.             /* When the active window has gadget help enabled,
  1366.              * other windows of the same HelpGroup number
  1367.              * will also get GadgetHelp.  This allows GadgetHelp
  1368.              * to work for multi-windowed applications.
  1369.              * Use GetGroupID() to get an ID number.  Pass
  1370.              * this number as ti_Data to all your windows.
  1371.              * See also the HelpControl() function.
  1372.              */
  1373.  
  1374. #define WA_HelpGroupWindow    (WA_Dummy + 0x39)
  1375.             /* When the active window has gadget help enabled,
  1376.              * other windows of the same HelpGroup will also get
  1377.              * GadgetHelp.    This allows GadgetHelp to work
  1378.              * for multi-windowed applications.  As an alternative
  1379.              * to WA_HelpGroup, you can pass a pointer to any
  1380.              * other window of the same group to join its help
  1381.              * group.  Defaults to NULL, which has no effect.
  1382.              * See also the HelpControl() function.
  1383.              */
  1384.  
  1385.  
  1386. /* HelpControl() flags:
  1387.  *
  1388.  * HC_GADGETHELP - Set this flag to enable Gadget-Help for one or more
  1389.  * windows.
  1390.  */
  1391.  
  1392. #define HC_GADGETHELP    (1)
  1393.  
  1394.  
  1395. #ifndef INTUITION_SCREENS_H
  1396. #include <intuition/screens.h>
  1397. #endif
  1398.  
  1399. #ifndef INTUITION_PREFERENCES_H
  1400. #include <intuition/preferences.h>
  1401. #endif
  1402.  
  1403. /* ======================================================================== */
  1404. /* === Remember =========================================================== */
  1405. /* ======================================================================== */
  1406. /* this structure is used for remembering what memory has been allocated to
  1407.  * date by a given routine, so that a premature abort or systematic exit
  1408.  * can deallocate memory cleanly, easily, and completely
  1409.  */
  1410. struct Remember
  1411. {
  1412.     struct Remember *NextRemember;
  1413.     ULONG RememberSize;
  1414.     UBYTE *Memory;
  1415. };
  1416.  
  1417.  
  1418. /* === Color Spec ====================================================== */
  1419. /* How to tell Intuition about RGB values for a color table entry.
  1420.  * NOTE:  The way the structure was defined, the color value was
  1421.  * right-justified within each UWORD.  This poses problems for
  1422.  * extensibility to more bits-per-gun.    The SA_Colors32 tag to
  1423.  * OpenScreenTags() provides an alternate way to specify colors
  1424.  * with greater precision.
  1425.  */
  1426. struct ColorSpec
  1427. {
  1428.     WORD    ColorIndex;    /* -1 terminates an array of ColorSpec    */
  1429.     UWORD    Red;    /* only the _bottom_ 4 bits recognized */
  1430.     UWORD    Green;    /* only the _bottom_ 4 bits recognized */
  1431.     UWORD    Blue;    /* only the _bottom_ 4 bits recognized */
  1432. };
  1433.  
  1434. /* === Easy Requester Specification ======================================= */
  1435. /* see also autodocs for EasyRequest and BuildEasyRequest    */
  1436. /* NOTE: This structure may grow in size in the future        */
  1437. struct EasyStruct {
  1438.     ULONG    es_StructSize;    /* should be sizeof (struct EasyStruct )*/
  1439.     ULONG    es_Flags;    /* should be 0 for now            */
  1440.     UBYTE    *es_Title;    /* title of requester window        */
  1441.     UBYTE    *es_TextFormat;    /* 'printf' style formatting string    */
  1442.     UBYTE    *es_GadgetFormat; /* 'printf' style formatting string    */
  1443. };
  1444.  
  1445.  
  1446.  
  1447. /* ======================================================================== */
  1448. /* === Miscellaneous ====================================================== */
  1449. /* ======================================================================== */
  1450.  
  1451. /* = MACROS ============================================================== */
  1452. #define MENUNUM(n) (n & 0x1F)
  1453. #define ITEMNUM(n) ((n >> 5) & 0x003F)
  1454. #define SUBNUM(n) ((n >> 11) & 0x001F)
  1455.  
  1456. #define SHIFTMENU(n) (n & 0x1F)
  1457. #define SHIFTITEM(n) ((n & 0x3F) << 5)
  1458. #define SHIFTSUB(n) ((n & 0x1F) << 11)
  1459.  
  1460. #define FULLMENUNUM( menu, item, sub )    \
  1461.     ( SHIFTSUB(sub) | SHIFTITEM(item) | SHIFTMENU(menu) )
  1462.  
  1463. #define SRBNUM(n)    (0x08 - (n >> 4))    /* SerRWBits -> read bits per char */
  1464. #define SWBNUM(n)    (0x08 - (n & 0x0F))/* SerRWBits -> write bits per chr */
  1465. #define SSBNUM(n)    (0x01 + (n >> 4))    /* SerStopBuf -> stop bits per chr */
  1466. #define SPARNUM(n)   (n >> 4)        /* SerParShk -> parity setting      */
  1467. #define SHAKNUM(n)   (n & 0x0F)    /* SerParShk -> handshake mode      */
  1468.  
  1469.  
  1470. /* = MENU STUFF =========================================================== */
  1471. #define NOMENU 0x001F
  1472. #define NOITEM 0x003F
  1473. #define NOSUB  0x001F
  1474. #define MENUNULL 0xFFFF
  1475.  
  1476.  
  1477. /* = =RJ='s peculiarities ================================================= */
  1478. #define FOREVER for(;;)
  1479. #define SIGN(x) ( ((x) > 0) - ((x) < 0) )
  1480. #define NOT !
  1481.  
  1482. /* these defines are for the COMMSEQ and CHECKIT menu stuff.  If CHECKIT,
  1483.  * I'll use a generic Width (for all resolutions) for the CheckMark.
  1484.  * If COMMSEQ, likewise I'll use this generic stuff
  1485.  */
  1486. #define CHECKWIDTH    19
  1487. #define COMMWIDTH    27
  1488. #define LOWCHECKWIDTH    13
  1489. #define LOWCOMMWIDTH    16
  1490.  
  1491.  
  1492. /* these are the AlertNumber defines.  if you are calling DisplayAlert()
  1493.  * the AlertNumber you supply must have the ALERT_TYPE bits set to one
  1494.  * of these patterns
  1495.  */
  1496. #define ALERT_TYPE    0x80000000
  1497. #define RECOVERY_ALERT    0x00000000    /* the system can recover from this */
  1498. #define DEADEND_ALERT    0x80000000    /* no recovery possible, this is it */
  1499.  
  1500.  
  1501. /* When you're defining IntuiText for the Positive and Negative Gadgets
  1502.  * created by a call to AutoRequest(), these defines will get you
  1503.  * reasonable-looking text.  The only field without a define is the IText
  1504.  * field; you decide what text goes with the Gadget
  1505.  */
  1506. #define AUTOFRONTPEN    0
  1507. #define AUTOBACKPEN    1
  1508. #define AUTODRAWMODE    JAM2
  1509. #define AUTOLEFTEDGE    6
  1510. #define AUTOTOPEDGE    3
  1511. #define AUTOITEXTFONT    NULL
  1512. #define AUTONEXTTEXT    NULL
  1513.  
  1514.  
  1515. /* --- RAWMOUSE Codes and Qualifiers (Console OR IDCMP) ------------------- */
  1516. #define SELECTUP    (IECODE_LBUTTON | IECODE_UP_PREFIX)
  1517. #define SELECTDOWN    (IECODE_LBUTTON)
  1518. #define MENUUP        (IECODE_RBUTTON | IECODE_UP_PREFIX)
  1519. #define MENUDOWN    (IECODE_RBUTTON)
  1520. #define MIDDLEUP    (IECODE_MBUTTON | IECODE_UP_PREFIX)
  1521. #define MIDDLEDOWN    (IECODE_MBUTTON)
  1522. #define ALTLEFT        (IEQUALIFIER_LALT)
  1523. #define ALTRIGHT    (IEQUALIFIER_RALT)
  1524. #define AMIGALEFT    (IEQUALIFIER_LCOMMAND)
  1525. #define AMIGARIGHT    (IEQUALIFIER_RCOMMAND)
  1526. #define AMIGAKEYS    (AMIGALEFT | AMIGARIGHT)
  1527.  
  1528. #define CURSORUP    0x4C
  1529. #define CURSORLEFT    0x4F
  1530. #define CURSORRIGHT    0x4E
  1531. #define CURSORDOWN    0x4D
  1532. #define KEYCODE_Q    0x10
  1533. #define KEYCODE_Z    0x31
  1534. #define KEYCODE_X    0x32
  1535. #define KEYCODE_V    0x34
  1536. #define KEYCODE_B    0x35
  1537. #define KEYCODE_N    0x36
  1538. #define KEYCODE_M    0x37
  1539. #define KEYCODE_LESS    0x38
  1540. #define KEYCODE_GREATER 0x39
  1541.  
  1542.  
  1543.  
  1544. /* New for V39, Intuition supports the IESUBCLASS_NEWTABLET subclass
  1545.  * of the IECLASS_NEWPOINTERPOS event.    The ie_EventAddress of such
  1546.  * an event points to a TabletData structure (see below).
  1547.  *
  1548.  * The TabletData structure contains certain elements including a taglist.
  1549.  * The taglist can be used for special tablet parameters.  A tablet driver
  1550.  * should include only those tag-items the tablet supports.  An application
  1551.  * can listen for any tag-items that interest it.  Note: an application
  1552.  * must set the WA_TabletMessages attribute to TRUE to receive this
  1553.  * extended information in its IntuiMessages.
  1554.  *
  1555.  * The definitions given here MUST be followed.  Pay careful attention
  1556.  * to normalization and the interpretation of signs.
  1557.  *
  1558.  * TABLETA_TabletZ:  the current value of the tablet in the Z direction.
  1559.  * This unsigned value should typically be in the natural units of the
  1560.  * tablet.  You should also provide TABLETA_RangeZ.
  1561.  *
  1562.  * TABLETA_RangeZ:  the maximum value of the tablet in the Z direction.
  1563.  * Normally specified along with TABLETA_TabletZ, this allows the
  1564.  * application to scale the actual Z value across its range.
  1565.  *
  1566.  * TABLETA_AngleX:  the angle of rotation or tilt about the X-axis.  This
  1567.  * number should be normalized to fill a signed long integer.  Positive
  1568.  * values imply a clockwise rotation about the X-axis when viewing
  1569.  * from +X towards the origin.
  1570.  *
  1571.  * TABLETA_AngleY:  the angle of rotation or tilt about the Y-axis.  This
  1572.  * number should be normalized to fill a signed long integer.  Positive
  1573.  * values imply a clockwise rotation about the Y-axis when viewing
  1574.  * from +Y towards the origin.
  1575.  *
  1576.  * TABLETA_AngleZ:  the angle of rotation or tilt about the Z axis.  This
  1577.  * number should be normalized to fill a signed long integer.  Positive
  1578.  * values imply a clockwise rotation about the Z-axis when viewing
  1579.  * from +Z towards the origin.
  1580.  *
  1581.  *    Note: a stylus that supports tilt should use the TABLETA_AngleX
  1582.  *    and TABLETA_AngleY attributes.    Tilting the stylus so the tip
  1583.  *    points towards increasing or decreasing X is actually a rotation
  1584.  *    around the Y-axis.  Thus, if the stylus tip points towards
  1585.  *    positive X, then that tilt is represented as a negative
  1586.  *    TABLETA_AngleY.  Likewise, if the stylus tip points towards
  1587.  *    positive Y, that tilt is represented by positive TABLETA_AngleX.
  1588.  *
  1589.  * TABLETA_Pressure:  the pressure reading of the stylus.  The pressure
  1590.  * should be normalized to fill a signed long integer.    Typical devices
  1591.  * won't generate negative pressure, but the possibility is not precluded.
  1592.  * The pressure threshold which is considered to cause a button-click is
  1593.  * expected to be set in a Preferences program supplied by the tablet
  1594.  * vendor.  The tablet driver would send IECODE_LBUTTON-type events as
  1595.  * the pressure crossed that threshold.
  1596.  *
  1597.  * TABLETA_ButtonBits:    ti_Data is a long integer whose bits are to
  1598.  * be interpreted at the state of the first 32 buttons of the tablet.
  1599.  *
  1600.  * TABLETA_InProximity:  ti_Data is a boolean.    For tablets that support
  1601.  * proximity, they should send the {TABLETA_InProximity,FALSE} tag item
  1602.  * when the stylus is out of proximity.  One possible use we can forsee
  1603.  * is a mouse-blanking commodity which keys off this to blank the
  1604.  * mouse.  When this tag is absent, the stylus is assumed to be
  1605.  * in proximity.
  1606.  */
  1607.  
  1608. #define TABLETA_Dummy        (TAG_USER + 0x3A000)
  1609. #define TABLETA_TabletZ        (TABLETA_Dummy + 0x01)
  1610. #define TABLETA_RangeZ        (TABLETA_Dummy + 0x02)
  1611. #define TABLETA_AngleX        (TABLETA_Dummy + 0x03)
  1612. #define TABLETA_AngleY        (TABLETA_Dummy + 0x04)
  1613. #define TABLETA_AngleZ        (TABLETA_Dummy + 0x05)
  1614. #define TABLETA_Pressure    (TABLETA_Dummy + 0x06)
  1615. #define TABLETA_ButtonBits    (TABLETA_Dummy + 0x07)
  1616. #define TABLETA_InProximity    (TABLETA_Dummy + 0x08)
  1617.  
  1618. /* If your window sets WA_TabletMessages to TRUE, then it will receive
  1619.  * extended IntuiMessages (struct ExtIntuiMessage) whose eim_TabletData
  1620.  * field points at a TabletData structure.  This structure contains
  1621.  * additional information about the input event.
  1622.  */
  1623.  
  1624. struct TabletData
  1625. {
  1626.     /* Sub-pixel position of tablet, in screen coordinates,
  1627.      * scaled to fill a UWORD fraction:
  1628.      */
  1629.     UWORD td_XFraction, td_YFraction;
  1630.  
  1631.     /* Current tablet coordinates along each axis: */
  1632.     ULONG td_TabletX, td_TabletY;
  1633.  
  1634.     /* Tablet range along each axis.  For example, if td_TabletX
  1635.      * can take values 0-999, td_RangeX should be 1000.
  1636.      */
  1637.     ULONG td_RangeX, td_RangeY;
  1638.  
  1639.     /* Pointer to tag-list of additional tablet attributes.
  1640.      * See <intuition/intuition.h> for the tag values.
  1641.      */
  1642.     struct TagItem *td_TagList;
  1643. };
  1644.  
  1645. /* If a tablet driver supplies a hook for td_CallBack, it will be
  1646.  * invoked in the standard hook manner.  A0 will point to the Hook
  1647.  * itself, A2 will point to the InputEvent that was sent, and
  1648.  * A1 will point to a TabletHookData structure.  The InputEvent's
  1649.  * ie_EventAddress field points at the IENewTablet structure that
  1650.  * the driver supplied.
  1651.  *
  1652.  * Based on the thd_Screen, thd_Width, and thd_Height fields, the driver
  1653.  * should scale the ient_TabletX and ient_TabletY fields and store the
  1654.  * result in ient_ScaledX, ient_ScaledY, ient_ScaledXFraction, and
  1655.  * ient_ScaledYFraction.
  1656.  *
  1657.  * The tablet hook must currently return NULL.    This is the only
  1658.  * acceptable return-value under V39.
  1659.  */
  1660.  
  1661. struct TabletHookData
  1662. {
  1663.     /* Pointer to the active screen:
  1664.      * Note: if there are no open screens, thd_Screen will be NULL.
  1665.      * thd_Width and thd_Height will then describe an NTSC 640x400
  1666.      * screen.    Please scale accordingly.
  1667.      */
  1668.     struct Screen *thd_Screen;
  1669.  
  1670.     /* The width and height (measured in pixels of the active screen)
  1671.      * that your are to scale to:
  1672.      */
  1673.     ULONG thd_Width;
  1674.     ULONG thd_Height;
  1675.  
  1676.     /* Non-zero if the screen or something about the screen
  1677.      * changed since the last time you were invoked:
  1678.      */
  1679.     LONG thd_ScreenChanged;
  1680. };
  1681.  
  1682. /* Include obsolete identifiers: */
  1683. #ifndef INTUITION_IOBSOLETE_H
  1684. #include <intuition/iobsolete.h>
  1685. #endif
  1686.  
  1687. #endif
  1688.