home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / BK-SC1_3.DMS / in.adf / C-Incl.Lha / intuition / intuition.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-30  |  65.6 KB  |  1,716 lines

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