home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / os-include / intuition / intuition.h < prev    next >
C/C++ Source or Header  |  1993-10-15  |  67KB  |  1,717 lines

  1.  
  2. #ifndef INTUITION_INTUITION_H
  3. #define INTUITION_INTUITION_H TRUE
  4. /*
  5. **  $VER: intuition.h 38.26 (15.2.93)
  6. **  Includes Release 40.15
  7. **
  8. **  Interface definitions for Intuition applications.
  9. **
  10. **  (C) Copyright 1985-1993 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.  
  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.  
  458. /* GTYP_SYSGADGET means that Intuition ALLOCATED the gadget.
  459.  * GTYP_SYSTYPEMASK is the mask you can apply to tell what type of
  460.  * system-gadget it is.  The possible types follow.
  461.  */
  462. #define GTYP_SYSGADGET        0x8000
  463. #define GTYP_SYSTYPEMASK    0x00F0
  464.  
  465. /* These definitions describe system gadgets in V36 and higher: */
  466. #define GTYP_SIZING        0x0010    /* Window sizing gadget */
  467. #define GTYP_WDRAGGING        0x0020    /* Window drag bar */
  468. #define GTYP_SDRAGGING        0x0030    /* Screen drag bar */
  469. #define GTYP_WDEPTH        0x0040    /* Window depth gadget */
  470. #define GTYP_SDEPTH        0x0050    /* Screen depth gadget */
  471. #define GTYP_WZOOM        0x0060    /* Window zoom gadget */
  472. #define GTYP_SUNUSED        0x0070    /* Unused screen gadget */
  473. #define GTYP_CLOSE        0x0080    /* Window close gadget */
  474.  
  475. /* These definitions describe system gadgets prior to V36: */
  476. #define GTYP_WUPFRONT        GTYP_WDEPTH    /* Window to-front gadget */
  477. #define GTYP_SUPFRONT        GTYP_SDEPTH    /* Screen to-front gadget */
  478. #define GTYP_WDOWNBACK        GTYP_WZOOM    /* Window to-back gadget */
  479. #define GTYP_SDOWNBACK        GTYP_SUNUSED    /* Screen to-back gadget */
  480.  
  481. /* GTYP_GTYPEMASK is a mask you can apply to tell what class
  482.  * of gadget this is.  The possible classes follow.
  483.  */
  484. #define GTYP_GTYPEMASK        0x0007
  485.  
  486. #define GTYP_BOOLGADGET        0x0001
  487. #define GTYP_GADGET0002        0x0002
  488. #define GTYP_PROPGADGET        0x0003
  489. #define GTYP_STRGADGET        0x0004
  490. #define GTYP_CUSTOMGADGET    0x0005
  491.  
  492. /* This bit in GadgetType is reserved for undocumented internal use
  493.  * by the Gadget Toolkit, and cannot be used nor relied on by
  494.  * applications:    0x0100
  495.  */
  496.  
  497. /* New for V39.  Gadgets which have the GFLG_EXTENDED flag set are
  498.  * actually ExtGadgets, which have more flags.    The GMORE_xxx
  499.  * identifiers describe those flags.  For GMORE_SCROLLRASTER, see
  500.  * important information in the ScrollWindowRaster() autodoc.
  501.  * NB: GMORE_SCROLLRASTER must be set before the gadget is
  502.  * added to a window.
  503.  */
  504. #define GMORE_BOUNDS       0x00000001 /* ExtGadget has valid Bounds */
  505. #define GMORE_GADGETHELP   0x00000002 /* This gadget responds to gadget help */
  506. #define GMORE_SCROLLRASTER 0x00000004 /* This (custom) gadget uses ScrollRaster */
  507.  
  508.  
  509. /* ======================================================================== */
  510. /* === BoolInfo======================================================= */
  511. /* ======================================================================== */
  512. /* This is the special data needed by an Extended Boolean Gadget
  513.  * Typically this structure will be pointed to by the Gadget field SpecialInfo
  514.  */
  515. struct BoolInfo
  516. {
  517.     UWORD  Flags;    /* defined below */
  518.     UWORD  *Mask;    /* bit mask for highlighting and selecting
  519.              * mask must follow the same rules as an Image
  520.              * plane.  Its width and height are determined
  521.              * by the width and height of the gadget's
  522.              * select box. (i.e. Gadget.Width and .Height).
  523.              */
  524.     ULONG  Reserved;    /* set to 0    */
  525. };
  526.  
  527. /* set BoolInfo.Flags to this flag bit.
  528.  * in the future, additional bits might mean more stuff hanging
  529.  * off of BoolInfo.Reserved.
  530.  */
  531. #define BOOLMASK    0x0001    /* extension is for masked gadget */
  532.  
  533. /* ======================================================================== */
  534. /* === PropInfo =========================================================== */
  535. /* ======================================================================== */
  536. /* this is the special data required by the proportional Gadget
  537.  * typically, this data will be pointed to by the Gadget variable SpecialInfo
  538.  */
  539. struct PropInfo
  540. {
  541.     UWORD Flags;    /* general purpose flag bits (see defines below) */
  542.  
  543.     /* You initialize the Pot variables before the Gadget is added to
  544.      * the system.  Then you can look here for the current settings
  545.      * any time, even while User is playing with this Gadget.  To
  546.      * adjust these after the Gadget is added to the System, use
  547.      * ModifyProp();  The Pots are the actual proportional settings,
  548.      * where a value of zero means zero and a value of MAXPOT means
  549.      * that the Gadget is set to its maximum setting.
  550.      */
  551.     UWORD HorizPot;    /* 16-bit FixedPoint horizontal quantity percentage */
  552.     UWORD VertPot;    /* 16-bit FixedPoint vertical quantity percentage */
  553.  
  554.     /* the 16-bit FixedPoint Body variables describe what percentage of
  555.      * the entire body of stuff referred to by this Gadget is actually
  556.      * shown at one time.  This is used with the AUTOKNOB routines,
  557.      * to adjust the size of the AUTOKNOB according to how much of
  558.      * the data can be seen.  This is also used to decide how far
  559.      * to advance the Pots when User hits the Container of the Gadget.
  560.      * For instance, if you were controlling the display of a 5-line
  561.      * Window of text with this Gadget, and there was a total of 15
  562.      * lines that could be displayed, you would set the VertBody value to
  563.      *       (MAXBODY / (TotalLines / DisplayLines)) = MAXBODY / 3.
  564.      * Therefore, the AUTOKNOB would fill 1/3 of the container, and
  565.      * if User hits the Cotainer outside of the knob, the pot would
  566.      * advance 1/3 (plus or minus) If there's no body to show, or
  567.      * the total amount of displayable info is less than the display area,
  568.      * set the Body variables to the MAX.  To adjust these after the
  569.      * Gadget is added to the System, use ModifyProp();
  570.      */
  571.     UWORD HorizBody;        /* horizontal Body */
  572.     UWORD VertBody;        /* vertical Body */
  573.  
  574.     /* these are the variables that Intuition sets and maintains */
  575.     UWORD CWidth;    /* Container width (with any relativity absoluted) */
  576.     UWORD CHeight;    /* Container height (with any relativity absoluted) */
  577.     UWORD HPotRes, VPotRes;    /* pot increments */
  578.     UWORD LeftBorder;        /* Container borders */
  579.     UWORD TopBorder;        /* Container borders */
  580. };
  581.  
  582.  
  583. /* --- FLAG BITS ---------------------------------------------------------- */
  584. #define AUTOKNOB    0x0001    /* this flag sez:  gimme that old auto-knob */
  585. /* NOTE: if you do not use an AUTOKNOB for a proportional gadget,
  586.  * you are currently limited to using a single Image of your own
  587.  * design: Intuition won't handle a linked list of images as
  588.  * a proportional gadget knob.
  589.  */
  590.  
  591. #define FREEHORIZ    0x0002    /* if set, the knob can move horizontally */
  592. #define FREEVERT    0x0004    /* if set, the knob can move vertically */
  593. #define PROPBORDERLESS    0x0008    /* if set, no border will be rendered */
  594. #define KNOBHIT        0x0100    /* set when this Knob is hit */
  595. #define PROPNEWLOOK    0x0010    /* set this if you want to get the new
  596.                  * V36 look
  597.                  */
  598.  
  599. #define KNOBHMIN    6    /* minimum horizontal size of the Knob */
  600. #define KNOBVMIN    4    /* minimum vertical size of the Knob */
  601. #define MAXBODY        0xFFFF    /* maximum body value */
  602. #define MAXPOT            0xFFFF    /* maximum pot value */
  603.  
  604.  
  605. /* ======================================================================== */
  606. /* === StringInfo ========================================================= */
  607. /* ======================================================================== */
  608. /* this is the special data required by the string Gadget
  609.  * typically, this data will be pointed to by the Gadget variable SpecialInfo
  610.  */
  611. struct StringInfo
  612. {
  613.     /* you initialize these variables, and then Intuition maintains them */
  614.     UBYTE *Buffer;    /* the buffer containing the start and final string */
  615.     UBYTE *UndoBuffer;    /* optional buffer for undoing current entry */
  616.     WORD BufferPos;    /* character position in Buffer */
  617.     WORD MaxChars;    /* max number of chars in Buffer (including NULL) */
  618.     WORD DispPos;    /* Buffer position of first displayed character */
  619.  
  620.     /* Intuition initializes and maintains these variables for you */
  621.     WORD UndoPos;    /* character position in the undo buffer */
  622.     WORD NumChars;    /* number of characters currently in Buffer */
  623.     WORD DispCount;    /* number of whole characters visible in Container */
  624.     WORD CLeft, CTop;    /* topleft offset of the container */
  625.  
  626.     /* This unused field is changed to allow extended specification
  627.      * of string gadget parameters.  It is ignored unless the flag
  628.      * GACT_STRINGEXTEND is set in the Gadget's Activation field
  629.      * or the GFLG_STRINGEXTEND flag is set in the Gadget Flags field.
  630.      * (See GFLG_STRINGEXTEND for an important note)
  631.      */
  632.     /* struct Layer *LayerPtr;    --- obsolete --- */
  633.     struct StringExtend *Extension;
  634.  
  635.     /* you can initialize this variable before the gadget is submitted to
  636.      * Intuition, and then examine it later to discover what integer
  637.      * the user has entered (if the user never plays with the gadget,
  638.      * the value will be unchanged from your initial setting)
  639.      */
  640.     LONG LongInt;
  641.  
  642.     /* If you want this Gadget to use your own Console keymapping, you
  643.      * set the GACT_ALTKEYMAP bit in the Activation flags of the Gadget,
  644.      * and then set this variable to point to your keymap.  If you don't
  645.      * set the GACT_ALTKEYMAP, you'll get the standard ASCII keymapping.
  646.      */
  647.     struct KeyMap *AltKeyMap;
  648. };
  649.  
  650. /* ======================================================================== */
  651. /* === IntuiText ========================================================== */
  652. /* ======================================================================== */
  653. /* IntuiText is a series of strings that start with a location
  654.  *  (always relative to the upper-left corner of something) and then the
  655.  *  text of the string.  The text is null-terminated.
  656.  */
  657. struct IntuiText
  658. {
  659.     UBYTE FrontPen, BackPen;    /* the pen numbers for the rendering */
  660.     UBYTE DrawMode;        /* the mode for rendering the text */
  661.     WORD LeftEdge;        /* relative start location for the text */
  662.     WORD TopEdge;        /* relative start location for the text */
  663.     struct TextAttr *ITextFont;    /* if NULL, you accept the default */
  664.     UBYTE *IText;        /* pointer to null-terminated text */
  665.     struct IntuiText *NextText; /* pointer to another IntuiText to render */
  666. };
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673. /* ======================================================================== */
  674. /* === Border ============================================================= */
  675. /* ======================================================================== */
  676. /* Data type Border, used for drawing a series of lines which is intended for
  677.  *  use as a border drawing, but which may, in fact, be used to render any
  678.  *  arbitrary vector shape.
  679.  *  The routine DrawBorder sets up the RastPort with the appropriate
  680.  *  variables, then does a Move to the first coordinate, then does Draws
  681.  *  to the subsequent coordinates.
  682.  *  After all the Draws are done, if NextBorder is non-zero we call DrawBorder
  683.  *  on NextBorder
  684.  */
  685. struct Border
  686. {
  687.     WORD LeftEdge, TopEdge;    /* initial offsets from the origin */
  688.     UBYTE FrontPen, BackPen;    /* pens numbers for rendering */
  689.     UBYTE DrawMode;        /* mode for rendering */
  690.     BYTE Count;            /* number of XY pairs */
  691.     WORD *XY;            /* vector coordinate pairs rel to LeftTop */
  692.     struct Border *NextBorder;    /* pointer to any other Border too */
  693. };
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700. /* ======================================================================== */
  701. /* === Image ============================================================== */
  702. /* ======================================================================== */
  703. /* This is a brief image structure for very simple transfers of
  704.  * image data to a RastPort
  705.  */
  706. struct Image
  707. {
  708.     WORD LeftEdge;        /* starting offset relative to some origin */
  709.     WORD TopEdge;        /* starting offsets relative to some origin */
  710.     WORD Width;            /* pixel size (though data is word-aligned) */
  711.     WORD Height;
  712.     WORD Depth;            /* >= 0, for images you create        */
  713.     UWORD *ImageData;        /* pointer to the actual word-aligned bits */
  714.  
  715.     /* the PlanePick and PlaneOnOff variables work much the same way as the
  716.      * equivalent GELS Bob variables.  It's a space-saving
  717.      * mechanism for image data.  Rather than defining the image data
  718.      * for every plane of the RastPort, you need define data only
  719.      * for the planes that are not entirely zero or one.  As you
  720.      * define your Imagery, you will often find that most of the planes
  721.      * ARE just as color selectors.  For instance, if you're designing
  722.      * a two-color Gadget to use colors one and three, and the Gadget
  723.      * will reside in a five-plane display, bit plane zero of your
  724.      * imagery would be all ones, bit plane one would have data that
  725.      * describes the imagery, and bit planes two through four would be
  726.      * all zeroes.  Using these flags avoids wasting all
  727.      * that memory in this way:  first, you specify which planes you
  728.      * want your data to appear in using the PlanePick variable.  For
  729.      * each bit set in the variable, the next "plane" of your image
  730.      * data is blitted to the display.    For each bit clear in this
  731.      * variable, the corresponding bit in PlaneOnOff is examined.
  732.      * If that bit is clear, a "plane" of zeroes will be used.
  733.      * If the bit is set, ones will go out instead.  So, for our example:
  734.      *     Gadget.PlanePick = 0x02;
  735.      *     Gadget.PlaneOnOff = 0x01;
  736.      * Note that this also allows for generic Gadgets, like the
  737.      * System Gadgets, which will work in any number of bit planes.
  738.      * Note also that if you want an Image that is only a filled
  739.      * rectangle, you can get this by setting PlanePick to zero
  740.      * (pick no planes of data) and set PlaneOnOff to describe the pen
  741.      * color of the rectangle.
  742.      *
  743.      * NOTE:  Intuition relies on PlanePick to know how many planes
  744.      * of data are found in ImageData.    There should be no more
  745.      * '1'-bits in PlanePick than there are planes in ImageData.
  746.      */
  747.     UBYTE PlanePick, PlaneOnOff;
  748.  
  749.     /* if the NextImage variable is not NULL, Intuition presumes that
  750.      * it points to another Image structure with another Image to be
  751.      * rendered
  752.      */
  753.     struct Image *NextImage;
  754. };
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761. /* ======================================================================== */
  762. /* === IntuiMessage ======================================================= */
  763. /* ======================================================================== */
  764. struct IntuiMessage
  765. {
  766.     struct Message ExecMessage;
  767.  
  768.     /* the Class bits correspond directly with the IDCMP Flags, except for the
  769.      * special bit IDCMP_LONELYMESSAGE (defined below)
  770.      */
  771.     ULONG Class;
  772.  
  773.     /* the Code field is for special values like MENU number */
  774.     UWORD Code;
  775.  
  776.     /* the Qualifier field is a copy of the current InputEvent's Qualifier */
  777.     UWORD Qualifier;
  778.  
  779.     /* IAddress contains particular addresses for Intuition functions, like
  780.      * the pointer to the Gadget or the Screen
  781.      */
  782.     APTR IAddress;
  783.  
  784.     /* when getting mouse movement reports, any event you get will have the
  785.      * the mouse coordinates in these variables.  the coordinates are relative
  786.      * to the upper-left corner of your Window (WFLG_GIMMEZEROZERO
  787.      * notwithstanding).  If IDCMP_DELTAMOVE is set, these values will
  788.      * be deltas from the last reported position.
  789.      */
  790.     WORD MouseX, MouseY;
  791.  
  792.     /* the time values are copies of the current system clock time.  Micros
  793.      * are in units of microseconds, Seconds in seconds.
  794.      */
  795.     ULONG Seconds, Micros;
  796.  
  797.     /* the IDCMPWindow variable will always have the address of the Window of
  798.      * this IDCMP
  799.      */
  800.     struct Window *IDCMPWindow;
  801.  
  802.     /* system-use variable */
  803.     struct IntuiMessage *SpecialLink;
  804. };
  805.  
  806. /* New for V39:
  807.  * All IntuiMessages are now slightly extended.  The ExtIntuiMessage
  808.  * structure has an additional field for tablet data, which is usually
  809.  * NULL.  If a tablet driver which is sending IESUBCLASS_NEWTABLET
  810.  * events is installed in the system, windows with the WA_TabletMessages
  811.  * property set will find that eim_TabletData points to the TabletData
  812.  * structure.  Applications must first check that this field is non-NULL;
  813.  * it will be NULL for certain kinds of message, including mouse activity
  814.  * generated from other than the tablet (i.e. the keyboard equivalents
  815.  * or the mouse itself).
  816.  *
  817.  * NEVER EVER examine any extended fields when running under pre-V39!
  818.  *
  819.  * NOTE: This structure is subject to grow in the future.  Making
  820.  * assumptions about its size is A BAD IDEA.
  821.  */
  822.  
  823. struct ExtIntuiMessage
  824. {
  825.     struct IntuiMessage eim_IntuiMessage;
  826.     struct TabletData *eim_TabletData;
  827. };
  828.  
  829. /* --- IDCMP Classes ------------------------------------------------------ */
  830. /* Please refer to the Autodoc for OpenWindow() and to the Rom Kernel
  831.  * Manual for full details on the IDCMP classes.
  832.  */
  833. #define IDCMP_SIZEVERIFY    0x00000001
  834. #define IDCMP_NEWSIZE        0x00000002
  835. #define IDCMP_REFRESHWINDOW    0x00000004
  836. #define IDCMP_MOUSEBUTTONS    0x00000008
  837. #define IDCMP_MOUSEMOVE        0x00000010
  838. #define IDCMP_GADGETDOWN    0x00000020
  839. #define IDCMP_GADGETUP        0x00000040
  840. #define IDCMP_REQSET        0x00000080
  841. #define IDCMP_MENUPICK        0x00000100
  842. #define IDCMP_CLOSEWINDOW    0x00000200
  843. #define IDCMP_RAWKEY        0x00000400
  844. #define IDCMP_REQVERIFY        0x00000800
  845. #define IDCMP_REQCLEAR        0x00001000
  846. #define IDCMP_MENUVERIFY    0x00002000
  847. #define IDCMP_NEWPREFS        0x00004000
  848. #define IDCMP_DISKINSERTED    0x00008000
  849. #define IDCMP_DISKREMOVED    0x00010000
  850. #define IDCMP_WBENCHMESSAGE    0x00020000  /*    System use only        */
  851. #define IDCMP_ACTIVEWINDOW    0x00040000
  852. #define IDCMP_INACTIVEWINDOW    0x00080000
  853. #define IDCMP_DELTAMOVE        0x00100000
  854. #define IDCMP_VANILLAKEY    0x00200000
  855. #define IDCMP_INTUITICKS    0x00400000
  856. /*  for notifications from "boopsi" gadgets    */
  857. #define IDCMP_IDCMPUPDATE    0x00800000  /* new for V36    */
  858. /* for getting help key report during menu session    */
  859. #define IDCMP_MENUHELP        0x01000000  /* new for V36    */
  860. /* for notification of any move/size/zoom/change window        */
  861. #define IDCMP_CHANGEWINDOW    0x02000000  /* new for V36    */
  862. #define IDCMP_GADGETHELP    0x04000000  /* new for V39    */
  863.  
  864. /* NOTEZ-BIEN:                0x80000000 is reserved for internal use   */
  865.  
  866. /* the IDCMP Flags do not use this special bit, which is cleared when
  867.  * Intuition sends its special message to the Task, and set when Intuition
  868.  * gets its Message back from the Task.  Therefore, I can check here to
  869.  * find out fast whether or not this Message is available for me to send
  870.  */
  871. #define IDCMP_LONELYMESSAGE    0x80000000
  872.  
  873.  
  874. /* --- IDCMP Codes -------------------------------------------------------- */
  875. /* This group of codes is for the IDCMP_CHANGEWINDOW message */
  876. #define CWCODE_MOVESIZE    0x0000    /* Window was moved and/or sized */
  877. #define CWCODE_DEPTH    0x0001    /* Window was depth-arranged (new for V39) */
  878.  
  879. /* This group of codes is for the IDCMP_MENUVERIFY message */
  880. #define MENUHOT        0x0001    /* IntuiWants verification or MENUCANCEL    */
  881. #define MENUCANCEL    0x0002    /* HOT Reply of this cancels Menu operation */
  882. #define MENUWAITING    0x0003    /* Intuition simply wants a ReplyMsg() ASAP */
  883.  
  884. /* These are internal tokens to represent state of verification attempts
  885.  * shown here as a clue.
  886.  */
  887. #define OKOK        MENUHOT    /* guy didn't care            */
  888. #define OKABORT        0x0004    /* window rendered question moot    */
  889. #define OKCANCEL    MENUCANCEL /* window sent cancel reply        */
  890.  
  891. /* This group of codes is for the IDCMP_WBENCHMESSAGE messages */
  892. #define WBENCHOPEN    0x0001
  893. #define WBENCHCLOSE    0x0002
  894.  
  895.  
  896. /* A data structure common in V36 Intuition processing    */
  897. struct IBox
  898. {
  899.     WORD Left;
  900.     WORD Top;
  901.     WORD Width;
  902.     WORD Height;
  903. };
  904.  
  905.  
  906.  
  907. /* ======================================================================== */
  908. /* === Window ============================================================= */
  909. /* ======================================================================== */
  910. struct Window
  911. {
  912.     struct Window *NextWindow;        /* for the linked list in a screen */
  913.  
  914.     WORD LeftEdge, TopEdge;        /* screen dimensions of window */
  915.     WORD Width, Height;            /* screen dimensions of window */
  916.  
  917.     WORD MouseY, MouseX;        /* relative to upper-left of window */
  918.  
  919.     WORD MinWidth, MinHeight;        /* minimum sizes */
  920.     UWORD MaxWidth, MaxHeight;        /* maximum sizes */
  921.  
  922.     ULONG Flags;            /* see below for defines */
  923.  
  924.     struct Menu *MenuStrip;        /* the strip of Menu headers */
  925.  
  926.     UBYTE *Title;            /* the title text for this window */
  927.  
  928.     struct Requester *FirstRequest;    /* all active Requesters */
  929.  
  930.     struct Requester *DMRequest;    /* double-click Requester */
  931.  
  932.     WORD ReqCount;            /* count of reqs blocking Window */
  933.  
  934.     struct Screen *WScreen;        /* this Window's Screen */
  935.     struct RastPort *RPort;        /* this Window's very own RastPort */
  936.  
  937.     /* the border variables describe the window border.  If you specify
  938.      * WFLG_GIMMEZEROZERO when you open the window, then the upper-left of
  939.      * the ClipRect for this window will be upper-left of the BitMap (with
  940.      * correct offsets when in SuperBitMap mode; you MUST select
  941.      * WFLG_GIMMEZEROZERO when using SuperBitMap).  If you don't specify
  942.      * ZeroZero, then you save memory (no allocation of RastPort, Layer,
  943.      * ClipRect and associated Bitmaps), but you also must offset all your
  944.      * writes by BorderTop, BorderLeft and do your own mini-clipping to
  945.      * prevent writing over the system gadgets
  946.      */
  947.     BYTE BorderLeft, BorderTop, BorderRight, BorderBottom;
  948.     struct RastPort *BorderRPort;
  949.  
  950.  
  951.     /* You supply a linked-list of Gadgets for your Window.
  952.      * This list DOES NOT include system gadgets.  You get the standard
  953.      * window system gadgets by setting flag-bits in the variable Flags (see
  954.      * the bit definitions below)
  955.      */
  956.     struct Gadget *FirstGadget;
  957.  
  958.     /* these are for opening/closing the windows */
  959.     struct Window *Parent, *Descendant;
  960.  
  961.     /* sprite data information for your own Pointer
  962.      * set these AFTER you Open the Window by calling SetPointer()
  963.      */
  964.     UWORD *Pointer;    /* sprite data */
  965.     BYTE PtrHeight;    /* sprite height (not including sprite padding) */
  966.     BYTE PtrWidth;    /* sprite width (must be less than or equal to 16) */
  967.     BYTE XOffset, YOffset;    /* sprite offsets */
  968.  
  969.     /* the IDCMP Flags and User's and Intuition's Message Ports */
  970.     ULONG IDCMPFlags;    /* User-selected flags */
  971.     struct MsgPort *UserPort, *WindowPort;
  972.     struct IntuiMessage *MessageKey;
  973.  
  974.     UBYTE DetailPen, BlockPen;    /* for bar/border/gadget rendering */
  975.  
  976.     /* the CheckMark is a pointer to the imagery that will be used when
  977.      * rendering MenuItems of this Window that want to be checkmarked
  978.      * if this is equal to NULL, you'll get the default imagery
  979.      */
  980.     struct Image *CheckMark;
  981.  
  982.     UBYTE *ScreenTitle;    /* if non-null, Screen title when Window is active */
  983.  
  984.     /* These variables have the mouse coordinates relative to the
  985.      * inner-Window of WFLG_GIMMEZEROZERO Windows.  This is compared with the
  986.      * MouseX and MouseY variables, which contain the mouse coordinates
  987.      * relative to the upper-left corner of the Window, WFLG_GIMMEZEROZERO
  988.      * notwithstanding
  989.      */
  990.     WORD GZZMouseX;
  991.     WORD GZZMouseY;
  992.     /* these variables contain the width and height of the inner-Window of
  993.      * WFLG_GIMMEZEROZERO Windows
  994.      */
  995.     WORD GZZWidth;
  996.     WORD GZZHeight;
  997.  
  998.     UBYTE *ExtData;
  999.  
  1000.     BYTE *UserData;    /* general-purpose pointer to User data extension */
  1001.  
  1002.     /** 11/18/85: this pointer keeps a duplicate of what
  1003.      * Window.RPort->Layer is _supposed_ to be pointing at
  1004.      */
  1005.     struct Layer *WLayer;
  1006.  
  1007.     /* NEW 1.2: need to keep track of the font that
  1008.      * OpenWindow opened, in case user SetFont's into RastPort
  1009.      */
  1010.     struct TextFont *IFont;
  1011.  
  1012.     /* (V36) another flag word (the Flags field is used up).
  1013.      * At present, all flag values are system private.
  1014.      * Until further notice, you may not change nor use this field.
  1015.      */
  1016.     ULONG    MoreFlags;
  1017.  
  1018.     /**** Data beyond this point are Intuition Private.  DO NOT USE ****/
  1019. };
  1020.  
  1021.  
  1022. /* --- Flags requested at OpenWindow() time by the application --------- */
  1023. #define WFLG_SIZEGADGET        0x00000001    /* include sizing system-gadget? */
  1024. #define WFLG_DRAGBAR        0x00000002    /* include dragging system-gadget? */
  1025. #define WFLG_DEPTHGADGET    0x00000004    /* include depth arrangement gadget? */
  1026. #define WFLG_CLOSEGADGET    0x00000008    /* include close-box system-gadget? */
  1027.  
  1028. #define WFLG_SIZEBRIGHT        0x00000010    /* size gadget uses right border */
  1029. #define WFLG_SIZEBBOTTOM    0x00000020    /* size gadget uses bottom border */
  1030.  
  1031. /* --- refresh modes ------------------------------------------------------ */
  1032. /* combinations of the WFLG_REFRESHBITS select the refresh type */
  1033. #define WFLG_REFRESHBITS    0x000000C0
  1034. #define WFLG_SMART_REFRESH  0x00000000
  1035. #define WFLG_SIMPLE_REFRESH 0x00000040
  1036. #define WFLG_SUPER_BITMAP   0x00000080
  1037. #define WFLG_OTHER_REFRESH  0x000000C0
  1038.  
  1039. #define WFLG_BACKDROP        0x00000100    /* this is a backdrop window */
  1040.  
  1041. #define WFLG_REPORTMOUSE    0x00000200    /* to hear about every mouse move */
  1042.  
  1043. #define WFLG_GIMMEZEROZERO  0x00000400    /* a GimmeZeroZero window    */
  1044.  
  1045. #define WFLG_BORDERLESS        0x00000800    /* to get a Window sans border */
  1046.  
  1047. #define WFLG_ACTIVATE        0x00001000    /* when Window opens, it's Active */
  1048.  
  1049. /* --- Other User Flags --------------------------------------------------- */
  1050. #define WFLG_RMBTRAP        0x00010000    /* Catch RMB events for your own */
  1051. #define WFLG_NOCAREREFRESH  0x00020000    /* not to be bothered with REFRESH */
  1052.  
  1053. /* - V36 new Flags which the programmer may specify in NewWindow.Flags    */
  1054. #define WFLG_NW_EXTENDED    0x00040000    /* extension data provided    */
  1055.                     /* see struct ExtNewWindow    */
  1056.  
  1057. /* - V39 new Flags which the programmer may specify in NewWindow.Flags    */
  1058. #define WFLG_NEWLOOKMENUS   0x00200000    /* window has NewLook menus    */
  1059.  
  1060.  
  1061. /* These flags are set only by Intuition.  YOU MAY NOT SET THEM YOURSELF! */
  1062. #define WFLG_WINDOWACTIVE   0x00002000    /* this window is the active one */
  1063. #define WFLG_INREQUEST        0x00004000    /* this window is in request mode */
  1064. #define WFLG_MENUSTATE        0x00008000    /* Window is active with Menus on */
  1065. #define WFLG_WINDOWREFRESH  0x01000000    /* Window is currently refreshing */
  1066. #define WFLG_WBENCHWINDOW   0x02000000    /* WorkBench tool ONLY Window */
  1067. #define WFLG_WINDOWTICKED   0x04000000    /* only one timer tick at a time */
  1068.  
  1069. /* V36 and higher flags to be set only by Intuition: */
  1070. #define WFLG_VISITOR        0x08000000    /* visitor window        */
  1071. #define WFLG_ZOOMED        0x10000000    /* identifies "zoom state"    */
  1072. #define WFLG_HASZOOM        0x20000000    /* window has a zoom gadget    */
  1073.  
  1074.  
  1075. /* --- Other Window Values ---------------------------------------------- */
  1076. #define DEFAULTMOUSEQUEUE    (5)    /* no more mouse messages    */
  1077.  
  1078. /* --- see struct IntuiMessage for the IDCMP Flag definitions ------------- */
  1079.  
  1080.  
  1081. /* ======================================================================== */
  1082. /* === NewWindow ========================================================== */
  1083. /* ======================================================================== */
  1084. /*
  1085.  * Note that the new extension fields have been removed.  Use ExtNewWindow
  1086.  * structure below to make use of these fields
  1087.  */
  1088. struct NewWindow
  1089. {
  1090.     WORD LeftEdge, TopEdge;        /* screen dimensions of window */
  1091.     WORD Width, Height;            /* screen dimensions of window */
  1092.  
  1093.     UBYTE DetailPen, BlockPen;        /* for bar/border/gadget rendering */
  1094.  
  1095.     ULONG IDCMPFlags;            /* User-selected IDCMP flags */
  1096.  
  1097.     ULONG Flags;            /* see Window struct for defines */
  1098.  
  1099.     /* You supply a linked-list of Gadgets for your Window.
  1100.      *    This list DOES NOT include system Gadgets.  You get the standard
  1101.      *    system Window Gadgets by setting flag-bits in the variable Flags (see
  1102.      *    the bit definitions under the Window structure definition)
  1103.      */
  1104.     struct Gadget *FirstGadget;
  1105.  
  1106.     /* the CheckMark is a pointer to the imagery that will be used when
  1107.      * rendering MenuItems of this Window that want to be checkmarked
  1108.      * if this is equal to NULL, you'll get the default imagery
  1109.      */
  1110.     struct Image *CheckMark;
  1111.  
  1112.     UBYTE *Title;              /* the title text for this window */
  1113.  
  1114.     /* the Screen pointer is used only if you've defined a CUSTOMSCREEN and
  1115.      * want this Window to open in it.    If so, you pass the address of the
  1116.      * Custom Screen structure in this variable.  Otherwise, this variable
  1117.      * is ignored and doesn't have to be initialized.
  1118.      */
  1119.     struct Screen *Screen;
  1120.  
  1121.     /* WFLG_SUPER_BITMAP Window?  If so, put the address of your BitMap
  1122.      * structure in this variable.  If not, this variable is ignored and
  1123.      * doesn't have to be initialized
  1124.      */
  1125.     struct BitMap *BitMap;
  1126.  
  1127.     /* the values describe the minimum and maximum sizes of your Windows.
  1128.      * these matter only if you've chosen the WFLG_SIZEGADGET option,
  1129.      * which means that you want to let the User to change the size of
  1130.      * this Window.  You describe the minimum and maximum sizes that the
  1131.      * Window can grow by setting these variables.  You can initialize
  1132.      * any one these to zero, which will mean that you want to duplicate
  1133.      * the setting for that dimension (if MinWidth == 0, MinWidth will be
  1134.      * set to the opening Width of the Window).
  1135.      * You can change these settings later using SetWindowLimits().
  1136.      * If you haven't asked for a SIZING Gadget, you don't have to
  1137.      * initialize any of these variables.
  1138.      */
  1139.     WORD MinWidth, MinHeight;        /* minimums */
  1140.     UWORD MaxWidth, MaxHeight;         /* maximums */
  1141.  
  1142.     /* the type variable describes the Screen in which you want this Window to
  1143.      * open.  The type value can either be CUSTOMSCREEN or one of the
  1144.      * system standard Screen Types such as WBENCHSCREEN.  See the
  1145.      * type definitions under the Screen structure.
  1146.      */
  1147.     UWORD Type;
  1148.  
  1149. };
  1150.  
  1151. /* The following structure is the future NewWindow.  Compatibility
  1152.  * issues require that the size of NewWindow not change.
  1153.  * Data in the common part (NewWindow) indicates the the extension
  1154.  * fields are being used.
  1155.  * NOTE WELL: This structure may be subject to future extension.
  1156.  * Writing code depending on its size is not allowed.
  1157.  */
  1158. struct ExtNewWindow
  1159. {
  1160.     WORD LeftEdge, TopEdge;
  1161.     WORD Width, Height;
  1162.  
  1163.     UBYTE DetailPen, BlockPen;
  1164.     ULONG IDCMPFlags;
  1165.     ULONG Flags;
  1166.     struct Gadget *FirstGadget;
  1167.  
  1168.     struct Image *CheckMark;
  1169.  
  1170.     UBYTE *Title;
  1171.     struct Screen *Screen;
  1172.     struct BitMap *BitMap;
  1173.  
  1174.     WORD MinWidth, MinHeight;
  1175.     UWORD MaxWidth, MaxHeight;
  1176.  
  1177.     /* the type variable describes the Screen in which you want this Window to
  1178.      * open.  The type value can either be CUSTOMSCREEN or one of the
  1179.      * system standard Screen Types such as WBENCHSCREEN.  See the
  1180.      * type definitions under the Screen structure.
  1181.      * A new possible value for this field is PUBLICSCREEN, which
  1182.      * defines the window as a 'visitor' window.  See below for
  1183.      * additional information provided.
  1184.      */
  1185.     UWORD Type;
  1186.  
  1187.     /* ------------------------------------------------------- *
  1188.      * extensions for V36
  1189.      * if the NewWindow Flag value WFLG_NW_EXTENDED is set, then
  1190.      * this field is assumed to point to an array ( or chain of arrays)
  1191.      * of TagItem structures.  See also ExtNewScreen for another
  1192.      * use of TagItems to pass optional data.
  1193.      *
  1194.      * see below for tag values and the corresponding data.
  1195.      */
  1196.     struct TagItem    *Extension;
  1197. };
  1198.  
  1199. /*
  1200.  * The TagItem ID's (ti_Tag values) for OpenWindowTagList() follow.
  1201.  * They are values in a TagItem array passed as extension/replacement
  1202.  * values for the data in NewWindow.  OpenWindowTagList() can actually
  1203.  * work well with a NULL NewWindow pointer.
  1204.  */
  1205.  
  1206. #define WA_Dummy    (TAG_USER + 99)    /* 0x80000063    */
  1207.  
  1208. /* these tags simply override NewWindow parameters */
  1209. #define WA_Left            (WA_Dummy + 0x01)
  1210. #define WA_Top            (WA_Dummy + 0x02)
  1211. #define WA_Width        (WA_Dummy + 0x03)
  1212. #define WA_Height        (WA_Dummy + 0x04)
  1213. #define WA_DetailPen        (WA_Dummy + 0x05)
  1214. #define WA_BlockPen        (WA_Dummy + 0x06)
  1215. #define WA_IDCMP        (WA_Dummy + 0x07)
  1216.             /* "bulk" initialization of NewWindow.Flags */
  1217. #define WA_Flags        (WA_Dummy + 0x08)
  1218. #define WA_Gadgets        (WA_Dummy + 0x09)
  1219. #define WA_Checkmark        (WA_Dummy + 0x0A)
  1220. #define WA_Title        (WA_Dummy + 0x0B)
  1221.             /* means you don't have to call SetWindowTitles
  1222.              * after you open your window
  1223.              */
  1224. #define WA_ScreenTitle        (WA_Dummy + 0x0C)
  1225. #define WA_CustomScreen        (WA_Dummy + 0x0D)
  1226. #define WA_SuperBitMap        (WA_Dummy + 0x0E)
  1227.             /* also implies WFLG_SUPER_BITMAP property    */
  1228. #define WA_MinWidth        (WA_Dummy + 0x0F)
  1229. #define WA_MinHeight        (WA_Dummy + 0x10)
  1230. #define WA_MaxWidth        (WA_Dummy + 0x11)
  1231. #define WA_MaxHeight        (WA_Dummy + 0x12)
  1232.  
  1233. /* The following are specifications for new features    */
  1234.  
  1235. #define WA_InnerWidth        (WA_Dummy + 0x13)
  1236. #define WA_InnerHeight        (WA_Dummy + 0x14)
  1237.             /* You can specify the dimensions of the interior
  1238.              * region of your window, independent of what
  1239.              * the border widths will be.  You probably want
  1240.              * to also specify WA_AutoAdjust to allow
  1241.              * Intuition to move your window or even
  1242.              * shrink it so that it is completely on screen.
  1243.              */
  1244.  
  1245. #define WA_PubScreenName    (WA_Dummy + 0x15)
  1246.             /* declares that you want the window to open as
  1247.              * a visitor on the public screen whose name is
  1248.              * pointed to by (UBYTE *) ti_Data
  1249.              */
  1250. #define WA_PubScreen        (WA_Dummy + 0x16)
  1251.             /* open as a visitor window on the public screen
  1252.              * whose address is in (struct Screen *) ti_Data.
  1253.              * To ensure that this screen remains open, you
  1254.              * should either be the screen's owner, have a
  1255.              * window open on the screen, or use LockPubScreen().
  1256.              */
  1257. #define WA_PubScreenFallBack    (WA_Dummy + 0x17)
  1258.             /* A Boolean, specifies whether a visitor window
  1259.              * should "fall back" to the default public screen
  1260.              * (or Workbench) if the named public screen isn't
  1261.              * available
  1262.              */
  1263. #define WA_WindowName        (WA_Dummy + 0x18)
  1264.             /* not implemented    */
  1265. #define WA_Colors        (WA_Dummy + 0x19)
  1266.             /* a ColorSpec array for colors to be set
  1267.              * when this window is active.    This is not
  1268.              * implemented, and may not be, since the default
  1269.              * values to restore would be hard to track.
  1270.              * We'd like to at least support per-window colors
  1271.              * for the mouse pointer sprite.
  1272.              */
  1273. #define WA_Zoom        (WA_Dummy + 0x1A)
  1274.             /* ti_Data points to an array of four WORD's,
  1275.              * the initial Left/Top/Width/Height values of
  1276.              * the "alternate" zoom position/dimensions.
  1277.              * It also specifies that you want a Zoom gadget
  1278.              * for your window, whether or not you have a
  1279.              * sizing gadget.
  1280.              */
  1281. #define WA_MouseQueue        (WA_Dummy + 0x1B)
  1282.             /* ti_Data contains initial value for the mouse
  1283.              * message backlog limit for this window.
  1284.              */
  1285. #define WA_BackFill        (WA_Dummy + 0x1C)
  1286.             /* provides a "backfill hook" for your window's Layer.
  1287.              * See layers.library/CreateUpfrontHookLayer().
  1288.              */
  1289. #define WA_RptQueue        (WA_Dummy + 0x1D)
  1290.             /* initial value of repeat key backlog limit    */
  1291.  
  1292.     /* These Boolean tag items are alternatives to the NewWindow.Flags
  1293.      * boolean flags with similar names.
  1294.      */
  1295. #define WA_SizeGadget        (WA_Dummy + 0x1E)
  1296. #define WA_DragBar        (WA_Dummy + 0x1F)
  1297. #define WA_DepthGadget        (WA_Dummy + 0x20)
  1298. #define WA_CloseGadget        (WA_Dummy + 0x21)
  1299. #define WA_Backdrop        (WA_Dummy + 0x22)
  1300. #define WA_ReportMouse        (WA_Dummy + 0x23)
  1301. #define WA_NoCareRefresh    (WA_Dummy + 0x24)
  1302. #define WA_Borderless        (WA_Dummy + 0x25)
  1303. #define WA_Activate        (WA_Dummy + 0x26)
  1304. #define WA_RMBTrap        (WA_Dummy + 0x27)
  1305. #define WA_WBenchWindow        (WA_Dummy + 0x28)    /* PRIVATE!! */
  1306. #define WA_SimpleRefresh    (WA_Dummy + 0x29)
  1307.             /* only specify if TRUE    */
  1308. #define WA_SmartRefresh        (WA_Dummy + 0x2A)
  1309.             /* only specify if TRUE    */
  1310. #define WA_SizeBRight        (WA_Dummy + 0x2B)
  1311. #define WA_SizeBBottom        (WA_Dummy + 0x2C)
  1312.  
  1313.     /* New Boolean properties    */
  1314. #define WA_AutoAdjust        (WA_Dummy + 0x2D)
  1315.             /* shift or squeeze the window's position and
  1316.              * dimensions to fit it on screen.
  1317.              */
  1318.  
  1319. #define WA_GimmeZeroZero    (WA_Dummy + 0x2E)
  1320.             /* equiv. to NewWindow.Flags WFLG_GIMMEZEROZERO    */
  1321.  
  1322. /* New for V37: WA_MenuHelp (ignored by V36) */
  1323. #define WA_MenuHelp        (WA_Dummy + 0x2F)
  1324.             /* Enables IDCMP_MENUHELP:  Pressing HELP during menus
  1325.              * will return IDCMP_MENUHELP message.
  1326.              */
  1327.  
  1328. /* New for V39:  (ignored by V37 and earlier) */
  1329. #define WA_NewLookMenus        (WA_Dummy + 0x30)
  1330.             /* Set to TRUE if you want NewLook menus */
  1331. #define WA_AmigaKey        (WA_Dummy + 0x31)
  1332.             /* Pointer to image for Amiga-key equiv in menus */
  1333. #define WA_NotifyDepth        (WA_Dummy + 0x32)
  1334.             /* Requests IDCMP_CHANGEWINDOW message when
  1335.              * window is depth arranged
  1336.              * (imsg->Code = CWCODE_DEPTH)
  1337.              */
  1338.  
  1339. /* WA_Dummy + 0x33 is obsolete */
  1340.  
  1341. #define WA_Pointer        (WA_Dummy + 0x34)
  1342.             /* Allows you to specify a custom pointer
  1343.              * for your window.  ti_Data points to a
  1344.              * pointer object you obtained via
  1345.              * "pointerclass". NULL signifies the
  1346.              * default pointer.
  1347.              * This tag may be passed to OpenWindowTags()
  1348.              * or SetWindowPointer().
  1349.              */
  1350.  
  1351. #define WA_BusyPointer        (WA_Dummy + 0x35)
  1352.             /* ti_Data is boolean.    Set to TRUE to
  1353.              * request the standard busy pointer.
  1354.              * This tag may be passed to OpenWindowTags()
  1355.              * or SetWindowPointer().
  1356.              */
  1357.  
  1358. #define WA_PointerDelay        (WA_Dummy + 0x36)
  1359.             /* ti_Data is boolean.    Set to TRUE to
  1360.              * request that the changing of the
  1361.              * pointer be slightly delayed.  The change
  1362.              * will be called off if you call NewSetPointer()
  1363.              * before the delay expires.  This allows
  1364.              * you to post a busy-pointer even if you think
  1365.              * the busy-time may be very short, without
  1366.              * fear of a flashing pointer.
  1367.              * This tag may be passed to OpenWindowTags()
  1368.              * or SetWindowPointer().
  1369.              */
  1370.  
  1371. #define WA_TabletMessages    (WA_Dummy + 0x37)
  1372.             /* ti_Data is a boolean.  Set to TRUE to
  1373.              * request that tablet information be included
  1374.              * in IntuiMessages sent to your window.
  1375.              * Requires that something (i.e. a tablet driver)
  1376.              * feed IESUBCLASS_NEWTABLET InputEvents into
  1377.              * the system.    For a pointer to the TabletData,
  1378.              * examine the ExtIntuiMessage->eim_TabletData
  1379.              * field.  It is UNSAFE to check this field
  1380.              * when running on pre-V39 systems.  It's always
  1381.              * safe to check this field under V39 and up,
  1382.              * though it may be NULL.
  1383.              */
  1384.  
  1385. #define WA_HelpGroup        (WA_Dummy + 0x38)
  1386.             /* When the active window has gadget help enabled,
  1387.              * other windows of the same HelpGroup number
  1388.              * will also get GadgetHelp.  This allows GadgetHelp
  1389.              * to work for multi-windowed applications.
  1390.              * Use GetGroupID() to get an ID number.  Pass
  1391.              * this number as ti_Data to all your windows.
  1392.              * See also the HelpControl() function.
  1393.              */
  1394.  
  1395. #define WA_HelpGroupWindow    (WA_Dummy + 0x39)
  1396.             /* When the active window has gadget help enabled,
  1397.              * other windows of the same HelpGroup will also get
  1398.              * GadgetHelp.    This allows GadgetHelp to work
  1399.              * for multi-windowed applications.  As an alternative
  1400.              * to WA_HelpGroup, you can pass a pointer to any
  1401.              * other window of the same group to join its help
  1402.              * group.  Defaults to NULL, which has no effect.
  1403.              * See also the HelpControl() function.
  1404.              */
  1405.  
  1406.  
  1407. /* HelpControl() flags:
  1408.  *
  1409.  * HC_GADGETHELP - Set this flag to enable Gadget-Help for one or more
  1410.  * windows.
  1411.  */
  1412.  
  1413. #define HC_GADGETHELP    (1)
  1414.  
  1415.  
  1416. #ifndef INTUITION_SCREENS_H
  1417. #include <intuition/screens.h>
  1418. #endif
  1419.  
  1420. #ifndef INTUITION_PREFERENCES_H
  1421. #include <intuition/preferences.h>
  1422. #endif
  1423.  
  1424. /* ======================================================================== */
  1425. /* === Remember =========================================================== */
  1426. /* ======================================================================== */
  1427. /* this structure is used for remembering what memory has been allocated to
  1428.  * date by a given routine, so that a premature abort or systematic exit
  1429.  * can deallocate memory cleanly, easily, and completely
  1430.  */
  1431. struct Remember
  1432. {
  1433.     struct Remember *NextRemember;
  1434.     ULONG RememberSize;
  1435.     UBYTE *Memory;
  1436. };
  1437.  
  1438.  
  1439. /* === Color Spec ====================================================== */
  1440. /* How to tell Intuition about RGB values for a color table entry.
  1441.  * NOTE:  The way the structure was defined, the color value was
  1442.  * right-justified within each UWORD.  This poses problems for
  1443.  * extensibility to more bits-per-gun.    The SA_Colors32 tag to
  1444.  * OpenScreenTags() provides an alternate way to specify colors
  1445.  * with greater precision.
  1446.  */
  1447. struct ColorSpec
  1448. {
  1449.     WORD    ColorIndex;    /* -1 terminates an array of ColorSpec    */
  1450.     UWORD    Red;    /* only the _bottom_ 4 bits recognized */
  1451.     UWORD    Green;    /* only the _bottom_ 4 bits recognized */
  1452.     UWORD    Blue;    /* only the _bottom_ 4 bits recognized */
  1453. };
  1454.  
  1455. /* === Easy Requester Specification ======================================= */
  1456. /* see also autodocs for EasyRequest and BuildEasyRequest    */
  1457. /* NOTE: This structure may grow in size in the future        */
  1458. struct EasyStruct {
  1459.     ULONG    es_StructSize;    /* should be sizeof (struct EasyStruct )*/
  1460.     ULONG    es_Flags;    /* should be 0 for now            */
  1461.     UBYTE    *es_Title;    /* title of requester window        */
  1462.     UBYTE    *es_TextFormat;    /* 'printf' style formatting string    */
  1463.     UBYTE    *es_GadgetFormat; /* 'printf' style formatting string    */
  1464. };
  1465.  
  1466.  
  1467.  
  1468. /* ======================================================================== */
  1469. /* === Miscellaneous ====================================================== */
  1470. /* ======================================================================== */
  1471.  
  1472. /* = MACROS ============================================================== */
  1473. #define MENUNUM(n) (n & 0x1F)
  1474. #define ITEMNUM(n) ((n >> 5) & 0x003F)
  1475. #define SUBNUM(n) ((n >> 11) & 0x001F)
  1476.  
  1477. #define SHIFTMENU(n) (n & 0x1F)
  1478. #define SHIFTITEM(n) ((n & 0x3F) << 5)
  1479. #define SHIFTSUB(n) ((n & 0x1F) << 11)
  1480.  
  1481. #define FULLMENUNUM( menu, item, sub )    \
  1482.     ( SHIFTSUB(sub) | SHIFTITEM(item) | SHIFTMENU(menu) )
  1483.  
  1484. #define SRBNUM(n)    (0x08 - (n >> 4))    /* SerRWBits -> read bits per char */
  1485. #define SWBNUM(n)    (0x08 - (n & 0x0F))/* SerRWBits -> write bits per chr */
  1486. #define SSBNUM(n)    (0x01 + (n >> 4))    /* SerStopBuf -> stop bits per chr */
  1487. #define SPARNUM(n)   (n >> 4)        /* SerParShk -> parity setting      */
  1488. #define SHAKNUM(n)   (n & 0x0F)    /* SerParShk -> handshake mode      */
  1489.  
  1490.  
  1491. /* = MENU STUFF =========================================================== */
  1492. #define NOMENU 0x001F
  1493. #define NOITEM 0x003F
  1494. #define NOSUB  0x001F
  1495. #define MENUNULL 0xFFFF
  1496.  
  1497.  
  1498. /* = =RJ='s peculiarities ================================================= */
  1499. #define FOREVER for(;;)
  1500. #define SIGN(x) ( ((x) > 0) - ((x) < 0) )
  1501. #define NOT !
  1502.  
  1503. /* these defines are for the COMMSEQ and CHECKIT menu stuff.  If CHECKIT,
  1504.  * I'll use a generic Width (for all resolutions) for the CheckMark.
  1505.  * If COMMSEQ, likewise I'll use this generic stuff
  1506.  */
  1507. #define CHECKWIDTH    19
  1508. #define COMMWIDTH    27
  1509. #define LOWCHECKWIDTH    13
  1510. #define LOWCOMMWIDTH    16
  1511.  
  1512.  
  1513. /* these are the AlertNumber defines.  if you are calling DisplayAlert()
  1514.  * the AlertNumber you supply must have the ALERT_TYPE bits set to one
  1515.  * of these patterns
  1516.  */
  1517. #define ALERT_TYPE    0x80000000
  1518. #define RECOVERY_ALERT    0x00000000    /* the system can recover from this */
  1519. #define DEADEND_ALERT    0x80000000    /* no recovery possible, this is it */
  1520.  
  1521.  
  1522. /* When you're defining IntuiText for the Positive and Negative Gadgets
  1523.  * created by a call to AutoRequest(), these defines will get you
  1524.  * reasonable-looking text.  The only field without a define is the IText
  1525.  * field; you decide what text goes with the Gadget
  1526.  */
  1527. #define AUTOFRONTPEN    0
  1528. #define AUTOBACKPEN    1
  1529. #define AUTODRAWMODE    JAM2
  1530. #define AUTOLEFTEDGE    6
  1531. #define AUTOTOPEDGE    3
  1532. #define AUTOITEXTFONT    NULL
  1533. #define AUTONEXTTEXT    NULL
  1534.  
  1535.  
  1536. /* --- RAWMOUSE Codes and Qualifiers (Console OR IDCMP) ------------------- */
  1537. #define SELECTUP    (IECODE_LBUTTON | IECODE_UP_PREFIX)
  1538. #define SELECTDOWN    (IECODE_LBUTTON)
  1539. #define MENUUP        (IECODE_RBUTTON | IECODE_UP_PREFIX)
  1540. #define MENUDOWN    (IECODE_RBUTTON)
  1541. #define MIDDLEUP    (IECODE_MBUTTON | IECODE_UP_PREFIX)
  1542. #define MIDDLEDOWN    (IECODE_MBUTTON)
  1543. #define ALTLEFT        (IEQUALIFIER_LALT)
  1544. #define ALTRIGHT    (IEQUALIFIER_RALT)
  1545. #define AMIGALEFT    (IEQUALIFIER_LCOMMAND)
  1546. #define AMIGARIGHT    (IEQUALIFIER_RCOMMAND)
  1547. #define AMIGAKEYS    (AMIGALEFT | AMIGARIGHT)
  1548.  
  1549. #define CURSORUP    0x4C
  1550. #define CURSORLEFT    0x4F
  1551. #define CURSORRIGHT    0x4E
  1552. #define CURSORDOWN    0x4D
  1553. #define KEYCODE_Q    0x10
  1554. #define KEYCODE_Z    0x31
  1555. #define KEYCODE_X    0x32
  1556. #define KEYCODE_V    0x34
  1557. #define KEYCODE_B    0x35
  1558. #define KEYCODE_N    0x36
  1559. #define KEYCODE_M    0x37
  1560. #define KEYCODE_LESS    0x38
  1561. #define KEYCODE_GREATER 0x39
  1562.  
  1563.  
  1564.  
  1565. /* New for V39, Intuition supports the IESUBCLASS_NEWTABLET subclass
  1566.  * of the IECLASS_NEWPOINTERPOS event.    The ie_EventAddress of such
  1567.  * an event points to a TabletData structure (see below).
  1568.  *
  1569.  * The TabletData structure contains certain elements including a taglist.
  1570.  * The taglist can be used for special tablet parameters.  A tablet driver
  1571.  * should include only those tag-items the tablet supports.  An application
  1572.  * can listen for any tag-items that interest it.  Note: an application
  1573.  * must set the WA_TabletMessages attribute to TRUE to receive this
  1574.  * extended information in its IntuiMessages.
  1575.  *
  1576.  * The definitions given here MUST be followed.  Pay careful attention
  1577.  * to normalization and the interpretation of signs.
  1578.  *
  1579.  * TABLETA_TabletZ:  the current value of the tablet in the Z direction.
  1580.  * This unsigned value should typically be in the natural units of the
  1581.  * tablet.  You should also provide TABLETA_RangeZ.
  1582.  *
  1583.  * TABLETA_RangeZ:  the maximum value of the tablet in the Z direction.
  1584.  * Normally specified along with TABLETA_TabletZ, this allows the
  1585.  * application to scale the actual Z value across its range.
  1586.  *
  1587.  * TABLETA_AngleX:  the angle of rotation or tilt about the X-axis.  This
  1588.  * number should be normalized to fill a signed long integer.  Positive
  1589.  * values imply a clockwise rotation about the X-axis when viewing
  1590.  * from +X towards the origin.
  1591.  *
  1592.  * TABLETA_AngleY:  the angle of rotation or tilt about the Y-axis.  This
  1593.  * number should be normalized to fill a signed long integer.  Positive
  1594.  * values imply a clockwise rotation about the Y-axis when viewing
  1595.  * from +Y towards the origin.
  1596.  *
  1597.  * TABLETA_AngleZ:  the angle of rotation or tilt about the Z axis.  This
  1598.  * number should be normalized to fill a signed long integer.  Positive
  1599.  * values imply a clockwise rotation about the Z-axis when viewing
  1600.  * from +Z towards the origin.
  1601.  *
  1602.  *    Note: a stylus that supports tilt should use the TABLETA_AngleX
  1603.  *    and TABLETA_AngleY attributes.    Tilting the stylus so the tip
  1604.  *    points towards increasing or decreasing X is actually a rotation
  1605.  *    around the Y-axis.  Thus, if the stylus tip points towards
  1606.  *    positive X, then that tilt is represented as a negative
  1607.  *    TABLETA_AngleY.  Likewise, if the stylus tip points towards
  1608.  *    positive Y, that tilt is represented by positive TABLETA_AngleX.
  1609.  *
  1610.  * TABLETA_Pressure:  the pressure reading of the stylus.  The pressure
  1611.  * should be normalized to fill a signed long integer.    Typical devices
  1612.  * won't generate negative pressure, but the possibility is not precluded.
  1613.  * The pressure threshold which is considered to cause a button-click is
  1614.  * expected to be set in a Preferences program supplied by the tablet
  1615.  * vendor.  The tablet driver would send IECODE_LBUTTON-type events as
  1616.  * the pressure crossed that threshold.
  1617.  *
  1618.  * TABLETA_ButtonBits:    ti_Data is a long integer whose bits are to
  1619.  * be interpreted at the state of the first 32 buttons of the tablet.
  1620.  *
  1621.  * TABLETA_InProximity:  ti_Data is a boolean.    For tablets that support
  1622.  * proximity, they should send the {TABLETA_InProximity,FALSE} tag item
  1623.  * when the stylus is out of proximity.  One possible use we can forsee
  1624.  * is a mouse-blanking commodity which keys off this to blank the
  1625.  * mouse.  When this tag is absent, the stylus is assumed to be
  1626.  * in proximity.
  1627.  *
  1628.  * TABLETA_ResolutionX:  ti_Data is an unsigned long integer which
  1629.  * is the x-axis resolution in dots per inch.
  1630.  *
  1631.  * TABLETA_ResolutionY:  ti_Data is an unsigned long integer which
  1632.  * is the y-axis resolution in dots per inch.
  1633.  */
  1634.  
  1635. #define TABLETA_Dummy        (TAG_USER + 0x3A000)
  1636. #define TABLETA_TabletZ        (TABLETA_Dummy + 0x01)
  1637. #define TABLETA_RangeZ        (TABLETA_Dummy + 0x02)
  1638. #define TABLETA_AngleX        (TABLETA_Dummy + 0x03)
  1639. #define TABLETA_AngleY        (TABLETA_Dummy + 0x04)
  1640. #define TABLETA_AngleZ        (TABLETA_Dummy + 0x05)
  1641. #define TABLETA_Pressure    (TABLETA_Dummy + 0x06)
  1642. #define TABLETA_ButtonBits    (TABLETA_Dummy + 0x07)
  1643. #define TABLETA_InProximity    (TABLETA_Dummy + 0x08)
  1644. #define TABLETA_ResolutionX    (TABLETA_Dummy + 0x09)
  1645. #define TABLETA_ResolutionY    (TABLETA_Dummy + 0x0A)
  1646.  
  1647. /* If your window sets WA_TabletMessages to TRUE, then it will receive
  1648.  * extended IntuiMessages (struct ExtIntuiMessage) whose eim_TabletData
  1649.  * field points at a TabletData structure.  This structure contains
  1650.  * additional information about the input event.
  1651.  */
  1652.  
  1653. struct TabletData
  1654. {
  1655.     /* Sub-pixel position of tablet, in screen coordinates,
  1656.      * scaled to fill a UWORD fraction:
  1657.      */
  1658.     UWORD td_XFraction, td_YFraction;
  1659.  
  1660.     /* Current tablet coordinates along each axis: */
  1661.     ULONG td_TabletX, td_TabletY;
  1662.  
  1663.     /* Tablet range along each axis.  For example, if td_TabletX
  1664.      * can take values 0-999, td_RangeX should be 1000.
  1665.      */
  1666.     ULONG td_RangeX, td_RangeY;
  1667.  
  1668.     /* Pointer to tag-list of additional tablet attributes.
  1669.      * See <intuition/intuition.h> for the tag values.
  1670.      */
  1671.     struct TagItem *td_TagList;
  1672. };
  1673.  
  1674. /* If a tablet driver supplies a hook for ient_CallBack, it will be
  1675.  * invoked in the standard hook manner.  A0 will point to the Hook
  1676.  * itself, A2 will point to the InputEvent that was sent, and
  1677.  * A1 will point to a TabletHookData structure.  The InputEvent's
  1678.  * ie_EventAddress field points at the IENewTablet structure that
  1679.  * the driver supplied.
  1680.  *
  1681.  * Based on the thd_Screen, thd_Width, and thd_Height fields, the driver
  1682.  * should scale the ient_TabletX and ient_TabletY fields and store the
  1683.  * result in ient_ScaledX, ient_ScaledY, ient_ScaledXFraction, and
  1684.  * ient_ScaledYFraction.
  1685.  *
  1686.  * The tablet hook must currently return NULL.    This is the only
  1687.  * acceptable return-value under V39.
  1688.  */
  1689.  
  1690. struct TabletHookData
  1691. {
  1692.     /* Pointer to the active screen:
  1693.      * Note: if there are no open screens, thd_Screen will be NULL.
  1694.      * thd_Width and thd_Height will then describe an NTSC 640x400
  1695.      * screen.    Please scale accordingly.
  1696.      */
  1697.     struct Screen *thd_Screen;
  1698.  
  1699.     /* The width and height (measured in pixels of the active screen)
  1700.      * that your are to scale to:
  1701.      */
  1702.     ULONG thd_Width;
  1703.     ULONG thd_Height;
  1704.  
  1705.     /* Non-zero if the screen or something about the screen
  1706.      * changed since the last time you were invoked:
  1707.      */
  1708.     LONG thd_ScreenChanged;
  1709. };
  1710.  
  1711. /* Include obsolete identifiers: */
  1712. #ifndef INTUITION_IOBSOLETE_H
  1713. #include <intuition/iobsolete.h>
  1714. #endif
  1715.  
  1716. #endif
  1717.