home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / TRSICAT.LZX / CATS_CD2_TRSI / Inc&AD2.1 / includes / intuition / intuition.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-11  |  51.3 KB  |  1,363 lines

  1. #ifndef INTUITION_INTUITION_H
  2. #define INTUITION_INTUITION_H TRUE
  3. /*
  4. **  $VER: intuition.h 36.51 (28.03.91)
  5. **  Includes Release 38.56
  6. **
  7. **  Interface definitions for Intuition applications.
  8. **
  9. **  (C) Copyright 1985-1992 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. /* --- Gadget.Flags values    --- */
  264. /* combinations in these bits describe the highlight technique to be used */
  265. #define GFLG_GADGHIGHBITS 0x0003
  266. #define GFLG_GADGHCOMP      0x0000  /* Complement the select box */
  267. #define GFLG_GADGHBOX      0x0001  /* Draw a box around the image */
  268. #define GFLG_GADGHIMAGE      0x0002  /* Blast in this alternate image */
  269. #define GFLG_GADGHNONE      0x0003  /* don't highlight */
  270.  
  271. #define GFLG_GADGIMAGE          0x0004  /* set if GadgetRender and SelectRender
  272.                    * point to an Image structure, clear
  273.                    * if they point to Border structures
  274.                    */
  275.  
  276. /* combinations in these next two bits specify to which corner the gadget's
  277.  *  Left & Top coordinates are relative.  If relative to Top/Left,
  278.  *  these are "normal" coordinates (everything is relative to something in
  279.  *  this universe).
  280.  *
  281.  * Gadget positions and dimensions are relative to the window or
  282.  * requester which contains the gadget
  283.  */
  284. #define GFLG_RELBOTTOM      0x0008  /* vert. pos. is relative to bottom edge */
  285. #define GFLG_RELRIGHT      0x0010  /* horiz. pos. is relative to right edge */
  286. #define GFLG_RELWIDTH      0x0020  /* width is relative to req/window    */
  287. #define GFLG_RELHEIGHT      0x0040  /* height is relative to req/window    */
  288.  
  289. #define GFLG_SELECTED      0x0080  /* you may initialize and look at this    */
  290.  
  291. /* the GFLG_DISABLED flag is initialized by you and later set by Intuition
  292.  * according to your calls to On/OffGadget().  It specifies whether or not
  293.  * this Gadget is currently disabled from being selected
  294.  */
  295. #define GFLG_DISABLED      0x0100
  296.  
  297. /* These flags specify the type of text field that Gadget.GadgetText
  298.  * points to.  In all normal (pre-V36) gadgets which you initialize
  299.  * this field should always be zero.  Some types of gadget objects
  300.  * created from classes will use these fields to keep track of
  301.  * types of labels/contents that different from IntuiText, but are
  302.  * stashed in GadgetText.
  303.  */
  304.  
  305. #define GFLG_LABELMASK      0x3000
  306. #define GFLG_LABELITEXT      0x0000  /* GadgetText points to IntuiText    */
  307. #define    GFLG_LABELSTRING  0x1000  /* GadgetText points to (UBYTE *)    */
  308. #define GFLG_LABELIMAGE      0x2000  /* GadgetText points to Image (object)    */
  309.  
  310. /* New for V37: GFLG_TABCYCLE */
  311. #define GFLG_TABCYCLE      0x0200  /* (string or custom) gadget participates in
  312.                    * cycling activation with Tab or Shift-Tab
  313.                    */
  314. /* New for V37: GFLG_STRINGEXTEND.  We discovered that V34 doesn't properly
  315.  * ignore the value we had chosen for the Gadget->Activation flag
  316.  * GACT_STRINGEXTEND.  NEVER SET THAT FLAG WHEN RUNNING UNDER V34.
  317.  * The Gadget->Flags bit GFLG_STRINGEXTEND is provided as a synonym which is
  318.  * safe under V34, and equivalent to GACT_STRINGEXTEND under V37.
  319.  * (Note that the two flags are not numerically equal)
  320.  */
  321. #define GFLG_STRINGEXTEND 0x0400  /* this String Gadget has StringExtend    */
  322.  
  323. /* ---    Gadget.Activation flag values    --- */
  324. /* Set GACT_RELVERIFY if you want to verify that the pointer was still over
  325.  * the gadget when the select button was released.  Will cause
  326.  * an IDCMP_GADGETUP message to be sent if so.
  327.  */
  328. #define GACT_RELVERIFY      0x0001
  329.  
  330. /* the flag GACT_IMMEDIATE, when set, informs the caller that the gadget
  331.  *  was activated when it was activated.  This flag works in conjunction with
  332.  *  the GACT_RELVERIFY flag
  333.  */
  334. #define GACT_IMMEDIATE      0x0002
  335.  
  336. /* the flag GACT_ENDGADGET, when set, tells the system that this gadget,
  337.  * when selected, causes the Requester to be ended.  Requesters
  338.  * that are ended are erased and unlinked from the system.
  339.  */
  340. #define GACT_ENDGADGET      0x0004
  341.  
  342. /* the GACT_FOLLOWMOUSE flag, when set, specifies that you want to receive
  343.  * reports on mouse movements while this gadget is active.
  344.  * You probably want to set the GACT_IMMEDIATE flag when using
  345.  * GACT_FOLLOWMOUSE, since that's the only reasonable way you have of
  346.  * learning why Intuition is suddenly sending you a stream of mouse
  347.  * movement events.  If you don't set GACT_RELVERIFY, you'll get at
  348.  * least one Mouse Position event.
  349.  * Note: boolean FOLLOWMOUSE gadgets require GACT_RELVERIFY to get
  350.  * _any_ mouse movement events (this unusual behavior is a compatibility
  351.  * hold-over from the old days).
  352.  */
  353. #define GACT_FOLLOWMOUSE  0x0008
  354.  
  355. /* if any of the BORDER flags are set in a Gadget that's included in the
  356.  * Gadget list when a Window is opened, the corresponding Border will
  357.  * be adjusted to make room for the Gadget
  358.  */
  359. #define GACT_RIGHTBORDER  0x0010
  360. #define GACT_LEFTBORDER      0x0020
  361. #define GACT_TOPBORDER      0x0040
  362. #define GACT_BOTTOMBORDER 0x0080
  363. #define GACT_BORDERSNIFF  0x8000  /* neither set nor rely on this bit    */
  364.  
  365. #define GACT_TOGGLESELECT 0x0100  /* this bit for toggle-select mode */
  366. #define GACT_BOOLEXTEND      0x2000  /* this Boolean Gadget has a BoolInfo    */
  367.  
  368. /* should properly be in StringInfo, but aren't    */
  369. #define GACT_STRINGLEFT      0x0000  /* NOTE WELL: that this has value zero    */
  370. #define GACT_STRINGCENTER 0x0200
  371. #define GACT_STRINGRIGHT  0x0400
  372. #define GACT_LONGINT      0x0800  /* this String Gadget is for Long Ints    */
  373. #define GACT_ALTKEYMAP      0x1000  /* this String has an alternate keymap    */
  374. #define GACT_STRINGEXTEND 0x2000  /* this String Gadget has StringExtend    */
  375.                   /* NOTE: NEVER SET GACT_STRINGEXTEND IF YOU
  376.                    * ARE RUNNING ON LESS THAN V36!  SEE
  377.                    * GFLG_STRINGEXTEND (ABOVE) INSTEAD
  378.                    */
  379.  
  380. #define GACT_ACTIVEGADGET 0x4000  /* this gadget is "active".  This flag
  381.                    * is maintained by Intuition, and you
  382.                    * cannot count on its value persisting
  383.                    * while you do something on your program's
  384.                    * task.  It can only be trusted by
  385.                    * people implementing custom gadgets
  386.                    */
  387.  
  388. /* note 0x8000 is used above (GACT_BORDERSNIFF);
  389.  * all Activation flags defined */
  390.  
  391. /* --- GADGET TYPES ------------------------------------------------------- */
  392. /* These are the Gadget Type definitions for the variable GadgetType
  393.  * gadget number type MUST start from one.  NO TYPES OF ZERO ALLOWED.
  394.  * first comes the mask for Gadget flags reserved for Gadget typing
  395.  */
  396. #define GTYP_GADGETTYPE    0xFC00    /* all Gadget Global Type flags (padded) */
  397. #define GTYP_SYSGADGET    0x8000    /* 1 = Allocated by the system, 0 = by app. */
  398. #define GTYP_SCRGADGET    0x4000    /* 1 = ScreenGadget, 0 = WindowGadget */
  399. #define GTYP_GZZGADGET    0x2000    /* 1 = for WFLG_GIMMEZEROZERO borders */
  400. #define GTYP_REQGADGET    0x1000    /* 1 = this is a Requester Gadget */
  401. /* system gadgets */
  402. #define GTYP_SIZING    0x0010
  403. #define GTYP_WDRAGGING    0x0020
  404. #define GTYP_SDRAGGING    0x0030
  405. #define GTYP_WUPFRONT    0x0040
  406. #define GTYP_SUPFRONT    0x0050
  407. #define GTYP_WDOWNBACK    0x0060
  408. #define GTYP_SDOWNBACK    0x0070
  409. #define GTYP_CLOSE    0x0080
  410. /* application gadgets */
  411. #define GTYP_BOOLGADGET    0x0001
  412. #define GTYP_GADGET0002    0x0002
  413. #define GTYP_PROPGADGET    0x0003
  414. #define GTYP_STRGADGET    0x0004
  415. #define GTYP_CUSTOMGADGET    0x0005
  416. #define GTYP_GTYPEMASK    0x0007    /* masks out to gadget class    */
  417.  
  418. /* This bit in GadgetType is reserved for undocumented internal use
  419.  * by the Gadget Toolkit, and cannot be used nor relied on by
  420.  * applications:    0x0100
  421.  */
  422.  
  423. /* ======================================================================== */
  424. /* === BoolInfo======================================================= */
  425. /* ======================================================================== */
  426. /* This is the special data needed by an Extended Boolean Gadget
  427.  * Typically this structure will be pointed to by the Gadget field SpecialInfo
  428.  */
  429. struct BoolInfo
  430. {
  431.     UWORD  Flags;    /* defined below */
  432.     UWORD  *Mask;    /* bit mask for highlighting and selecting
  433.              * mask must follow the same rules as an Image
  434.              * plane.  Its width and height are determined
  435.              * by the width and height of the gadget's
  436.              * select box. (i.e. Gadget.Width and .Height).
  437.              */
  438.     ULONG  Reserved;    /* set to 0    */
  439. };
  440.  
  441. /* set BoolInfo.Flags to this flag bit.
  442.  * in the future, additional bits might mean more stuff hanging
  443.  * off of BoolInfo.Reserved.
  444.  */
  445. #define BOOLMASK    0x0001    /* extension is for masked gadget */
  446.  
  447. /* ======================================================================== */
  448. /* === PropInfo =========================================================== */
  449. /* ======================================================================== */
  450. /* this is the special data required by the proportional Gadget
  451.  * typically, this data will be pointed to by the Gadget variable SpecialInfo
  452.  */
  453. struct PropInfo
  454. {
  455.     UWORD Flags;    /* general purpose flag bits (see defines below) */
  456.  
  457.     /* You initialize the Pot variables before the Gadget is added to
  458.      * the system.  Then you can look here for the current settings
  459.      * any time, even while User is playing with this Gadget.  To
  460.      * adjust these after the Gadget is added to the System, use
  461.      * ModifyProp();  The Pots are the actual proportional settings,
  462.      * where a value of zero means zero and a value of MAXPOT means
  463.      * that the Gadget is set to its maximum setting.
  464.      */
  465.     UWORD HorizPot;    /* 16-bit FixedPoint horizontal quantity percentage */
  466.     UWORD VertPot;    /* 16-bit FixedPoint vertical quantity percentage */
  467.  
  468.     /* the 16-bit FixedPoint Body variables describe what percentage of
  469.      * the entire body of stuff referred to by this Gadget is actually
  470.      * shown at one time.  This is used with the AUTOKNOB routines,
  471.      * to adjust the size of the AUTOKNOB according to how much of
  472.      * the data can be seen.  This is also used to decide how far
  473.      * to advance the Pots when User hits the Container of the Gadget.
  474.      * For instance, if you were controlling the display of a 5-line
  475.      * Window of text with this Gadget, and there was a total of 15
  476.      * lines that could be displayed, you would set the VertBody value to
  477.      *       (MAXBODY / (TotalLines / DisplayLines)) = MAXBODY / 3.
  478.      * Therefore, the AUTOKNOB would fill 1/3 of the container, and
  479.      * if User hits the Cotainer outside of the knob, the pot would
  480.      * advance 1/3 (plus or minus) If there's no body to show, or
  481.      * the total amount of displayable info is less than the display area,
  482.      * set the Body variables to the MAX.  To adjust these after the
  483.      * Gadget is added to the System, use ModifyProp();
  484.      */
  485.     UWORD HorizBody;        /* horizontal Body */
  486.     UWORD VertBody;        /* vertical Body */
  487.  
  488.     /* these are the variables that Intuition sets and maintains */
  489.     UWORD CWidth;    /* Container width (with any relativity absoluted) */
  490.     UWORD CHeight;    /* Container height (with any relativity absoluted) */
  491.     UWORD HPotRes, VPotRes;    /* pot increments */
  492.     UWORD LeftBorder;        /* Container borders */
  493.     UWORD TopBorder;        /* Container borders */
  494. };
  495.  
  496.  
  497. /* --- FLAG BITS ---------------------------------------------------------- */
  498. #define AUTOKNOB    0x0001    /* this flag sez:  gimme that old auto-knob */
  499. /* NOTE: if you do not use an AUTOKNOB for a proportional gadget,
  500.  * you are currently limited to using a single Image of your own
  501.  * design: Intuition won't handle a linked list of images as
  502.  * a proportional gadget knob.
  503.  */
  504.  
  505. #define FREEHORIZ    0x0002    /* if set, the knob can move horizontally */
  506. #define FREEVERT    0x0004    /* if set, the knob can move vertically */
  507. #define PROPBORDERLESS    0x0008    /* if set, no border will be rendered */
  508. #define KNOBHIT        0x0100    /* set when this Knob is hit */
  509. #define PROPNEWLOOK    0x0010    /* set this if you want to get the new
  510.                  * V36 look
  511.                  */
  512.  
  513. #define KNOBHMIN    6    /* minimum horizontal size of the Knob */
  514. #define KNOBVMIN    4    /* minimum vertical size of the Knob */
  515. #define MAXBODY        0xFFFF    /* maximum body value */
  516. #define MAXPOT            0xFFFF    /* maximum pot value */
  517.  
  518.  
  519. /* ======================================================================== */
  520. /* === StringInfo ========================================================= */
  521. /* ======================================================================== */
  522. /* this is the special data required by the string Gadget
  523.  * typically, this data will be pointed to by the Gadget variable SpecialInfo
  524.  */
  525. struct StringInfo
  526. {
  527.     /* you initialize these variables, and then Intuition maintains them */
  528.     UBYTE *Buffer;    /* the buffer containing the start and final string */
  529.     UBYTE *UndoBuffer;    /* optional buffer for undoing current entry */
  530.     WORD BufferPos;    /* character position in Buffer */
  531.     WORD MaxChars;    /* max number of chars in Buffer (including NULL) */
  532.     WORD DispPos;    /* Buffer position of first displayed character */
  533.  
  534.     /* Intuition initializes and maintains these variables for you */
  535.     WORD UndoPos;    /* character position in the undo buffer */
  536.     WORD NumChars;    /* number of characters currently in Buffer */
  537.     WORD DispCount;    /* number of whole characters visible in Container */
  538.     WORD CLeft, CTop;    /* topleft offset of the container */
  539.  
  540.     /* This unused field is changed to allow extended specification
  541.      * of string gadget parameters.  It is ignored unless the flag
  542.      * GACT_STRINGEXTEND is set in the Gadget's Activation field
  543.      * or the GFLG_STRINGEXTEND flag is set in the Gadget Flags field.
  544.      * (See GFLG_STRINGEXTEND for an important note)
  545.      */
  546.     /* struct Layer *LayerPtr;    --- obsolete --- */
  547.     struct StringExtend *Extension;
  548.  
  549.     /* you can initialize this variable before the gadget is submitted to
  550.      * Intuition, and then examine it later to discover what integer
  551.      * the user has entered (if the user never plays with the gadget,
  552.      * the value will be unchanged from your initial setting)
  553.      */
  554.     LONG LongInt;
  555.  
  556.     /* If you want this Gadget to use your own Console keymapping, you
  557.      * set the GACT_ALTKEYMAP bit in the Activation flags of the Gadget,
  558.      * and then set this variable to point to your keymap.  If you don't
  559.      * set the GACT_ALTKEYMAP, you'll get the standard ASCII keymapping.
  560.      */
  561.     struct KeyMap *AltKeyMap;
  562. };
  563.  
  564. /* ======================================================================== */
  565. /* === IntuiText ========================================================== */
  566. /* ======================================================================== */
  567. /* IntuiText is a series of strings that start with a location
  568.  *  (always relative to the upper-left corner of something) and then the
  569.  *  text of the string.  The text is null-terminated.
  570.  */
  571. struct IntuiText
  572. {
  573.     UBYTE FrontPen, BackPen;    /* the pen numbers for the rendering */
  574.     UBYTE DrawMode;        /* the mode for rendering the text */
  575.     WORD LeftEdge;        /* relative start location for the text */
  576.     WORD TopEdge;        /* relative start location for the text */
  577.     struct TextAttr *ITextFont;    /* if NULL, you accept the default */
  578.     UBYTE *IText;        /* pointer to null-terminated text */
  579.     struct IntuiText *NextText; /* pointer to another IntuiText to render */
  580. };
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587. /* ======================================================================== */
  588. /* === Border ============================================================= */
  589. /* ======================================================================== */
  590. /* Data type Border, used for drawing a series of lines which is intended for
  591.  *  use as a border drawing, but which may, in fact, be used to render any
  592.  *  arbitrary vector shape.
  593.  *  The routine DrawBorder sets up the RastPort with the appropriate
  594.  *  variables, then does a Move to the first coordinate, then does Draws
  595.  *  to the subsequent coordinates.
  596.  *  After all the Draws are done, if NextBorder is non-zero we call DrawBorder
  597.  *  on NextBorder
  598.  */
  599. struct Border
  600. {
  601.     WORD LeftEdge, TopEdge;    /* initial offsets from the origin */
  602.     UBYTE FrontPen, BackPen;    /* pens numbers for rendering */
  603.     UBYTE DrawMode;        /* mode for rendering */
  604.     BYTE Count;            /* number of XY pairs */
  605.     WORD *XY;            /* vector coordinate pairs rel to LeftTop */
  606.     struct Border *NextBorder;    /* pointer to any other Border too */
  607. };
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614. /* ======================================================================== */
  615. /* === Image ============================================================== */
  616. /* ======================================================================== */
  617. /* This is a brief image structure for very simple transfers of
  618.  * image data to a RastPort
  619.  */
  620. struct Image
  621. {
  622.     WORD LeftEdge;        /* starting offset relative to some origin */
  623.     WORD TopEdge;        /* starting offsets relative to some origin */
  624.     WORD Width;            /* pixel size (though data is word-aligned) */
  625.     WORD Height;
  626.     WORD Depth;            /* >= 0, for images you create        */
  627.     UWORD *ImageData;        /* pointer to the actual word-aligned bits */
  628.  
  629.     /* the PlanePick and PlaneOnOff variables work much the same way as the
  630.      * equivalent GELS Bob variables.  It's a space-saving
  631.      * mechanism for image data.  Rather than defining the image data
  632.      * for every plane of the RastPort, you need define data only
  633.      * for the planes that are not entirely zero or one.  As you
  634.      * define your Imagery, you will often find that most of the planes
  635.      * ARE just as color selectors.  For instance, if you're designing
  636.      * a two-color Gadget to use colors one and three, and the Gadget
  637.      * will reside in a five-plane display, bit plane zero of your
  638.      * imagery would be all ones, bit plane one would have data that
  639.      * describes the imagery, and bit planes two through four would be
  640.      * all zeroes.  Using these flags avoids wasting all
  641.      * that memory in this way:  first, you specify which planes you
  642.      * want your data to appear in using the PlanePick variable.  For
  643.      * each bit set in the variable, the next "plane" of your image
  644.      * data is blitted to the display.    For each bit clear in this
  645.      * variable, the corresponding bit in PlaneOnOff is examined.
  646.      * If that bit is clear, a "plane" of zeroes will be used.
  647.      * If the bit is set, ones will go out instead.  So, for our example:
  648.      *     Gadget.PlanePick = 0x02;
  649.      *     Gadget.PlaneOnOff = 0x01;
  650.      * Note that this also allows for generic Gadgets, like the
  651.      * System Gadgets, which will work in any number of bit planes.
  652.      * Note also that if you want an Image that is only a filled
  653.      * rectangle, you can get this by setting PlanePick to zero
  654.      * (pick no planes of data) and set PlaneOnOff to describe the pen
  655.      * color of the rectangle.
  656.      *
  657.      * NOTE:  Intuition relies on PlanePick to know how many planes
  658.      * of data are found in ImageData.    There should be no more
  659.      * '1'-bits in PlanePick than there are planes in ImageData.
  660.      */
  661.     UBYTE PlanePick, PlaneOnOff;
  662.  
  663.     /* if the NextImage variable is not NULL, Intuition presumes that
  664.      * it points to another Image structure with another Image to be
  665.      * rendered
  666.      */
  667.     struct Image *NextImage;
  668. };
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675. /* ======================================================================== */
  676. /* === IntuiMessage ======================================================= */
  677. /* ======================================================================== */
  678. struct IntuiMessage
  679. {
  680.     struct Message ExecMessage;
  681.  
  682.     /* the Class bits correspond directly with the IDCMP Flags, except for the
  683.      * special bit IDCMP_LONELYMESSAGE (defined below)
  684.      */
  685.     ULONG Class;
  686.  
  687.     /* the Code field is for special values like MENU number */
  688.     UWORD Code;
  689.  
  690.     /* the Qualifier field is a copy of the current InputEvent's Qualifier */
  691.     UWORD Qualifier;
  692.  
  693.     /* IAddress contains particular addresses for Intuition functions, like
  694.      * the pointer to the Gadget or the Screen
  695.      */
  696.     APTR IAddress;
  697.  
  698.     /* when getting mouse movement reports, any event you get will have the
  699.      * the mouse coordinates in these variables.  the coordinates are relative
  700.      * to the upper-left corner of your Window (WFLG_GIMMEZEROZERO
  701.      * notwithstanding).  If IDCMP_DELTAMOVE is set, these values will
  702.      * be deltas from the last reported position.
  703.      */
  704.     WORD MouseX, MouseY;
  705.  
  706.     /* the time values are copies of the current system clock time.  Micros
  707.      * are in units of microseconds, Seconds in seconds.
  708.      */
  709.     ULONG Seconds, Micros;
  710.  
  711.     /* the IDCMPWindow variable will always have the address of the Window of
  712.      * this IDCMP
  713.      */
  714.     struct Window *IDCMPWindow;
  715.  
  716.     /* system-use variable */
  717.     struct IntuiMessage *SpecialLink;
  718. };
  719.  
  720.  
  721. /* --- IDCMP Classes ------------------------------------------------------ */
  722. /* Please refer to the Autodoc for OpenWindow() and to the Rom Kernel
  723.  * Manual for full details on the IDCMP classes.
  724.  */
  725. #define IDCMP_SIZEVERIFY    0x00000001
  726. #define IDCMP_NEWSIZE        0x00000002
  727. #define IDCMP_REFRESHWINDOW    0x00000004
  728. #define IDCMP_MOUSEBUTTONS    0x00000008
  729. #define IDCMP_MOUSEMOVE        0x00000010
  730. #define IDCMP_GADGETDOWN    0x00000020
  731. #define IDCMP_GADGETUP        0x00000040
  732. #define IDCMP_REQSET        0x00000080
  733. #define IDCMP_MENUPICK        0x00000100
  734. #define IDCMP_CLOSEWINDOW    0x00000200
  735. #define IDCMP_RAWKEY        0x00000400
  736. #define IDCMP_REQVERIFY        0x00000800
  737. #define IDCMP_REQCLEAR        0x00001000
  738. #define IDCMP_MENUVERIFY    0x00002000
  739. #define IDCMP_NEWPREFS        0x00004000
  740. #define IDCMP_DISKINSERTED    0x00008000
  741. #define IDCMP_DISKREMOVED    0x00010000
  742. #define IDCMP_WBENCHMESSAGE    0x00020000  /*    System use only        */
  743. #define IDCMP_ACTIVEWINDOW    0x00040000
  744. #define IDCMP_INACTIVEWINDOW    0x00080000
  745. #define IDCMP_DELTAMOVE        0x00100000
  746. #define IDCMP_VANILLAKEY    0x00200000
  747. #define IDCMP_INTUITICKS    0x00400000
  748. /*  for notifications from "boopsi" gadgets    */
  749. #define IDCMP_IDCMPUPDATE    0x00800000  /* new for V36    */
  750. /* for getting help key report during menu session    */
  751. #define IDCMP_MENUHELP        0x01000000  /* new for V36    */
  752. /* for notification of any move/size/zoom/change window        */
  753. #define IDCMP_CHANGEWINDOW    0x02000000  /* new for V36    */
  754.  
  755. /* NOTEZ-BIEN:                0x80000000 is reserved for internal use   */
  756.  
  757. /* the IDCMP Flags do not use this special bit, which is cleared when
  758.  * Intuition sends its special message to the Task, and set when Intuition
  759.  * gets its Message back from the Task.  Therefore, I can check here to
  760.  * find out fast whether or not this Message is available for me to send
  761.  */
  762. #define IDCMP_LONELYMESSAGE    0x80000000
  763.  
  764.  
  765. /* --- IDCMP Codes -------------------------------------------------------- */
  766. /* This group of codes is for the IDCMP_MENUVERIFY function */
  767. #define MENUHOT        0x0001    /* IntuiWants verification or MENUCANCEL    */
  768. #define MENUCANCEL    0x0002    /* HOT Reply of this cancels Menu operation */
  769. #define MENUWAITING    0x0003    /* Intuition simply wants a ReplyMsg() ASAP */
  770.  
  771. /* These are internal tokens to represent state of verification attempts
  772.  * shown here as a clue.
  773.  */
  774. #define OKOK        MENUHOT    /* guy didn't care            */
  775. #define OKABORT        0x0004    /* window rendered question moot    */
  776. #define OKCANCEL    MENUCANCEL /* window sent cancel reply        */
  777.  
  778. /* This group of codes is for the IDCMP_WBENCHMESSAGE messages */
  779. #define WBENCHOPEN    0x0001
  780. #define WBENCHCLOSE    0x0002
  781.  
  782.  
  783. /* A data structure common in V36 Intuition processing    */
  784. struct IBox {
  785.     WORD Left;
  786.     WORD Top;
  787.     WORD Width;
  788.     WORD Height;
  789.     };
  790.  
  791.  
  792.  
  793. /* ======================================================================== */
  794. /* === Window ============================================================= */
  795. /* ======================================================================== */
  796. struct Window
  797. {
  798.     struct Window *NextWindow;        /* for the linked list in a screen */
  799.  
  800.     WORD LeftEdge, TopEdge;        /* screen dimensions of window */
  801.     WORD Width, Height;            /* screen dimensions of window */
  802.  
  803.     WORD MouseY, MouseX;        /* relative to upper-left of window */
  804.  
  805.     WORD MinWidth, MinHeight;        /* minimum sizes */
  806.     UWORD MaxWidth, MaxHeight;        /* maximum sizes */
  807.  
  808.     ULONG Flags;            /* see below for defines */
  809.  
  810.     struct Menu *MenuStrip;        /* the strip of Menu headers */
  811.  
  812.     UBYTE *Title;            /* the title text for this window */
  813.  
  814.     struct Requester *FirstRequest;    /* all active Requesters */
  815.  
  816.     struct Requester *DMRequest;    /* double-click Requester */
  817.  
  818.     WORD ReqCount;            /* count of reqs blocking Window */
  819.  
  820.     struct Screen *WScreen;        /* this Window's Screen */
  821.     struct RastPort *RPort;        /* this Window's very own RastPort */
  822.  
  823.     /* the border variables describe the window border.  If you specify
  824.      * WFLG_GIMMEZEROZERO when you open the window, then the upper-left of
  825.      * the ClipRect for this window will be upper-left of the BitMap (with
  826.      * correct offsets when in SuperBitMap mode; you MUST select
  827.      * WFLG_GIMMEZEROZERO when using SuperBitMap).  If you don't specify
  828.      * ZeroZero, then you save memory (no allocation of RastPort, Layer,
  829.      * ClipRect and associated Bitmaps), but you also must offset all your
  830.      * writes by BorderTop, BorderLeft and do your own mini-clipping to
  831.      * prevent writing over the system gadgets
  832.      */
  833.     BYTE BorderLeft, BorderTop, BorderRight, BorderBottom;
  834.     struct RastPort *BorderRPort;
  835.  
  836.  
  837.     /* You supply a linked-list of Gadgets for your Window.
  838.      * This list DOES NOT include system gadgets.  You get the standard
  839.      * window system gadgets by setting flag-bits in the variable Flags (see
  840.      * the bit definitions below)
  841.      */
  842.     struct Gadget *FirstGadget;
  843.  
  844.     /* these are for opening/closing the windows */
  845.     struct Window *Parent, *Descendant;
  846.  
  847.     /* sprite data information for your own Pointer
  848.      * set these AFTER you Open the Window by calling SetPointer()
  849.      */
  850.     UWORD *Pointer;    /* sprite data */
  851.     BYTE PtrHeight;    /* sprite height (not including sprite padding) */
  852.     BYTE PtrWidth;    /* sprite width (must be less than or equal to 16) */
  853.     BYTE XOffset, YOffset;    /* sprite offsets */
  854.  
  855.     /* the IDCMP Flags and User's and Intuition's Message Ports */
  856.     ULONG IDCMPFlags;    /* User-selected flags */
  857.     struct MsgPort *UserPort, *WindowPort;
  858.     struct IntuiMessage *MessageKey;
  859.  
  860.     UBYTE DetailPen, BlockPen;    /* for bar/border/gadget rendering */
  861.  
  862.     /* the CheckMark is a pointer to the imagery that will be used when
  863.      * rendering MenuItems of this Window that want to be checkmarked
  864.      * if this is equal to NULL, you'll get the default imagery
  865.      */
  866.     struct Image *CheckMark;
  867.  
  868.     UBYTE *ScreenTitle;    /* if non-null, Screen title when Window is active */
  869.  
  870.     /* These variables have the mouse coordinates relative to the
  871.      * inner-Window of WFLG_GIMMEZEROZERO Windows.  This is compared with the
  872.      * MouseX and MouseY variables, which contain the mouse coordinates
  873.      * relative to the upper-left corner of the Window, WFLG_GIMMEZEROZERO
  874.      * notwithstanding
  875.      */
  876.     WORD GZZMouseX;
  877.     WORD GZZMouseY;
  878.     /* these variables contain the width and height of the inner-Window of
  879.      * WFLG_GIMMEZEROZERO Windows
  880.      */
  881.     WORD GZZWidth;
  882.     WORD GZZHeight;
  883.  
  884.     UBYTE *ExtData;
  885.  
  886.     BYTE *UserData;    /* general-purpose pointer to User data extension */
  887.  
  888.     /** 11/18/85: this pointer keeps a duplicate of what
  889.      * Window.RPort->Layer is _supposed_ to be pointing at
  890.      */
  891.     struct Layer *WLayer;
  892.  
  893.     /* NEW 1.2: need to keep track of the font that
  894.      * OpenWindow opened, in case user SetFont's into RastPort
  895.      */
  896.     struct TextFont *IFont;
  897.  
  898.     /* (V36) another flag word (the Flags field is used up).
  899.      * At present, all flag values are system private.
  900.      * Until further notice, you may not change nor use this field.
  901.      */
  902.     ULONG    MoreFlags;
  903.  
  904.     /**** Data beyond this point are Intuition Private.  DO NOT USE ****/
  905. };
  906.  
  907.  
  908. /* --- Flags requested at OpenWindow() time by the application --------- */
  909. #define WFLG_SIZEGADGET        0x00000001    /* include sizing system-gadget? */
  910. #define WFLG_DRAGBAR        0x00000002    /* include dragging system-gadget? */
  911. #define WFLG_DEPTHGADGET    0x00000004    /* include depth arrangement gadget? */
  912. #define WFLG_CLOSEGADGET    0x00000008    /* include close-box system-gadget? */
  913.  
  914. #define WFLG_SIZEBRIGHT        0x00000010    /* size gadget uses right border */
  915. #define WFLG_SIZEBBOTTOM    0x00000020    /* size gadget uses bottom border */
  916.  
  917. /* --- refresh modes ------------------------------------------------------ */
  918. /* combinations of the WFLG_REFRESHBITS select the refresh type */
  919. #define WFLG_REFRESHBITS    0x000000C0
  920. #define WFLG_SMART_REFRESH  0x00000000
  921. #define WFLG_SIMPLE_REFRESH 0x00000040
  922. #define WFLG_SUPER_BITMAP   0x00000080
  923. #define WFLG_OTHER_REFRESH  0x000000C0
  924.  
  925. #define WFLG_BACKDROP        0x00000100    /* this is a backdrop window */
  926.  
  927. #define WFLG_REPORTMOUSE    0x00000200    /* to hear about every mouse move */
  928.  
  929. #define WFLG_GIMMEZEROZERO  0x00000400    /* a GimmeZeroZero window    */
  930.  
  931. #define WFLG_BORDERLESS        0x00000800    /* to get a Window sans border */
  932.  
  933. #define WFLG_ACTIVATE        0x00001000    /* when Window opens, it's Active */
  934.  
  935.  
  936. /* FLAGS SET BY INTUITION */
  937. #define WFLG_WINDOWACTIVE   0x00002000    /* this window is the active one */
  938. #define WFLG_INREQUEST        0x00004000    /* this window is in request mode */
  939. #define WFLG_MENUSTATE        0x00008000    /* Window is active with Menus on */
  940.  
  941. /* --- Other User Flags --------------------------------------------------- */
  942. #define WFLG_RMBTRAP        0x00010000    /* Catch RMB events for your own */
  943. #define WFLG_NOCAREREFRESH  0x00020000    /* not to be bothered with REFRESH */
  944.  
  945. /* --- Other Intuition Flags ---------------------------------------------- */
  946. #define WFLG_WINDOWREFRESH  0x01000000    /* Window is currently refreshing */
  947. #define WFLG_WBENCHWINDOW   0x02000000    /* WorkBench tool ONLY Window */
  948. #define WFLG_WINDOWTICKED   0x04000000    /* only one timer tick at a time */
  949.  
  950.  
  951. /* - V36 new Flags which the programmer may specify in NewWindow.Flags    */
  952. #define WFLG_NW_EXTENDED    0x00040000    /* extension data provided    */
  953.                     /* see struct ExtNewWindow    */
  954.  
  955. /* --- V36 Flags to be set only by Intuition -------------------------    */
  956. #define WFLG_VISITOR        0x08000000    /* visitor window        */
  957. #define WFLG_ZOOMED        0x10000000    /* identifies "zoom state"    */
  958. #define WFLG_HASZOOM        0x20000000    /* windowhas a zoom gadget    */
  959.  
  960. /* --- Other Window Values ---------------------------------------------- */
  961. #define DEFAULTMOUSEQUEUE    (5)    /* no more mouse messages    */
  962.  
  963. /* --- see struct IntuiMessage for the IDCMP Flag definitions ------------- */
  964.  
  965.  
  966.  
  967.  
  968. /* ======================================================================== */
  969. /* === NewWindow ========================================================== */
  970. /* ======================================================================== */
  971. /*
  972.  * Note that the new extension fields have been removed.  Use ExtNewWindow
  973.  * structure below to make use of these fields
  974.  */
  975. struct NewWindow
  976. {
  977.     WORD LeftEdge, TopEdge;        /* screen dimensions of window */
  978.     WORD Width, Height;            /* screen dimensions of window */
  979.  
  980.     UBYTE DetailPen, BlockPen;        /* for bar/border/gadget rendering */
  981.  
  982.     ULONG IDCMPFlags;            /* User-selected IDCMP flags */
  983.  
  984.     ULONG Flags;            /* see Window struct for defines */
  985.  
  986.     /* You supply a linked-list of Gadgets for your Window.
  987.      *    This list DOES NOT include system Gadgets.  You get the standard
  988.      *    system Window Gadgets by setting flag-bits in the variable Flags (see
  989.      *    the bit definitions under the Window structure definition)
  990.      */
  991.     struct Gadget *FirstGadget;
  992.  
  993.     /* the CheckMark is a pointer to the imagery that will be used when
  994.      * rendering MenuItems of this Window that want to be checkmarked
  995.      * if this is equal to NULL, you'll get the default imagery
  996.      */
  997.     struct Image *CheckMark;
  998.  
  999.     UBYTE *Title;              /* the title text for this window */
  1000.  
  1001.     /* the Screen pointer is used only if you've defined a CUSTOMSCREEN and
  1002.      * want this Window to open in it.    If so, you pass the address of the
  1003.      * Custom Screen structure in this variable.  Otherwise, this variable
  1004.      * is ignored and doesn't have to be initialized.
  1005.      */
  1006.     struct Screen *Screen;
  1007.  
  1008.     /* WFLG_SUPER_BITMAP Window?  If so, put the address of your BitMap
  1009.      * structure in this variable.  If not, this variable is ignored and
  1010.      * doesn't have to be initialized
  1011.      */
  1012.     struct BitMap *BitMap;
  1013.  
  1014.     /* the values describe the minimum and maximum sizes of your Windows.
  1015.      * these matter only if you've chosen the WFLG_SIZEGADGET option,
  1016.      * which means that you want to let the User to change the size of
  1017.      * this Window.  You describe the minimum and maximum sizes that the
  1018.      * Window can grow by setting these variables.  You can initialize
  1019.      * any one these to zero, which will mean that you want to duplicate
  1020.      * the setting for that dimension (if MinWidth == 0, MinWidth will be
  1021.      * set to the opening Width of the Window).
  1022.      * You can change these settings later using SetWindowLimits().
  1023.      * If you haven't asked for a SIZING Gadget, you don't have to
  1024.      * initialize any of these variables.
  1025.      */
  1026.     WORD MinWidth, MinHeight;        /* minimums */
  1027.     UWORD MaxWidth, MaxHeight;         /* maximums */
  1028.  
  1029.     /* the type variable describes the Screen in which you want this Window to
  1030.      * open.  The type value can either be CUSTOMSCREEN or one of the
  1031.      * system standard Screen Types such as WBENCHSCREEN.  See the
  1032.      * type definitions under the Screen structure.
  1033.      */
  1034.     UWORD Type;
  1035.  
  1036. };
  1037.  
  1038. /* The following structure is the future NewWindow.  Compatibility
  1039.  * issues require that the size of NewWindow not change.
  1040.  * Data in the common part (NewWindow) indicates the the extension
  1041.  * fields are being used.
  1042.  * NOTE WELL: This structure may be subject to future extension.
  1043.  * Writing code depending on its size is not allowed.
  1044.  */
  1045. struct ExtNewWindow
  1046. {
  1047.     WORD LeftEdge, TopEdge;
  1048.     WORD Width, Height;
  1049.  
  1050.     UBYTE DetailPen, BlockPen;
  1051.     ULONG IDCMPFlags;
  1052.     ULONG Flags;
  1053.     struct Gadget *FirstGadget;
  1054.  
  1055.     struct Image *CheckMark;
  1056.  
  1057.     UBYTE *Title;
  1058.     struct Screen *Screen;
  1059.     struct BitMap *BitMap;
  1060.  
  1061.     WORD MinWidth, MinHeight;
  1062.     UWORD MaxWidth, MaxHeight;
  1063.  
  1064.     /* the type variable describes the Screen in which you want this Window to
  1065.      * open.  The type value can either be CUSTOMSCREEN or one of the
  1066.      * system standard Screen Types such as WBENCHSCREEN.  See the
  1067.      * type definitions under the Screen structure.
  1068.      * A new possible value for this field is PUBLICSCREEN, which
  1069.      * defines the window as a 'visitor' window.  See below for
  1070.      * additional information provided.
  1071.      */
  1072.     UWORD Type;
  1073.  
  1074.     /* ------------------------------------------------------- *
  1075.      * extensions for V36
  1076.      * if the NewWindow Flag value WFLG_NW_EXTENDED is set, then
  1077.      * this field is assumed to point to an array ( or chain of arrays)
  1078.      * of TagItem structures.  See also ExtNewScreen for another
  1079.      * use of TagItems to pass optional data.
  1080.      *
  1081.      * see below for tag values and the corresponding data.
  1082.      */
  1083.     struct TagItem    *Extension;
  1084. };
  1085.  
  1086. /*
  1087.  * The TagItem ID's (ti_Tag values) for OpenWindowTagList() follow.
  1088.  * They are values in a TagItem array passed as extension/replacement
  1089.  * values for the data in NewWindow.  OpenWindowTagList() can actually
  1090.  * work well with a NULL NewWindow pointer.
  1091.  */
  1092.  
  1093. #define WA_Dummy    (TAG_USER + 99)    /* 0x80000063    */
  1094.  
  1095. /* these tags simply override NewWindow parameters */
  1096. #define WA_Left            (WA_Dummy + 0x01)
  1097. #define WA_Top            (WA_Dummy + 0x02)
  1098. #define WA_Width        (WA_Dummy + 0x03)
  1099. #define WA_Height        (WA_Dummy + 0x04)
  1100. #define WA_DetailPen        (WA_Dummy + 0x05)
  1101. #define WA_BlockPen        (WA_Dummy + 0x06)
  1102. #define WA_IDCMP        (WA_Dummy + 0x07)
  1103.             /* "bulk" initialization of NewWindow.Flags */
  1104. #define WA_Flags        (WA_Dummy + 0x08)
  1105. #define WA_Gadgets        (WA_Dummy + 0x09)
  1106. #define WA_Checkmark        (WA_Dummy + 0x0A)
  1107. #define WA_Title        (WA_Dummy + 0x0B)
  1108.             /* means you don't have to call SetWindowTitles
  1109.              * after you open your window
  1110.              */
  1111. #define WA_ScreenTitle        (WA_Dummy + 0x0C)
  1112. #define WA_CustomScreen        (WA_Dummy + 0x0D)
  1113. #define WA_SuperBitMap        (WA_Dummy + 0x0E)
  1114.             /* also implies WFLG_SUPER_BITMAP property    */
  1115. #define WA_MinWidth        (WA_Dummy + 0x0F)
  1116. #define WA_MinHeight        (WA_Dummy + 0x10)
  1117. #define WA_MaxWidth        (WA_Dummy + 0x11)
  1118. #define WA_MaxHeight        (WA_Dummy + 0x12)
  1119.  
  1120. /* The following are specifications for new features    */
  1121.  
  1122. #define WA_InnerWidth        (WA_Dummy + 0x13)
  1123. #define WA_InnerHeight        (WA_Dummy + 0x14)
  1124.             /* You can specify the dimensions of the interior
  1125.              * region of your window, independent of what
  1126.              * the border widths will be.  You probably want
  1127.              * to also specify WA_AutoAdjust to allow
  1128.              * Intuition to move your window or even
  1129.              * shrink it so that it is completely on screen.
  1130.              */
  1131.  
  1132. #define WA_PubScreenName    (WA_Dummy + 0x15)
  1133.             /* declares that you want the window to open as
  1134.              * a visitor on the public screen whose name is
  1135.              * pointed to by (UBYTE *) ti_Data
  1136.              */
  1137. #define WA_PubScreen        (WA_Dummy + 0x16)
  1138.             /* open as a visitor window on the public screen
  1139.              * whose address is in (struct Screen *) ti_Data.
  1140.              * To ensure that this screen remains open, you
  1141.              * should either be the screen's owner, have a
  1142.              * window open on the screen, or use LockPubScreen().
  1143.              */
  1144. #define WA_PubScreenFallBack    (WA_Dummy + 0x17)
  1145.             /* A Boolean, specifies whether a visitor window
  1146.              * should "fall back" to the default public screen
  1147.              * (or Workbench) if the named public screen isn't
  1148.              * available
  1149.              */
  1150. #define WA_WindowName        (WA_Dummy + 0x18)
  1151.             /* not implemented    */
  1152. #define WA_Colors        (WA_Dummy + 0x19)
  1153.             /* a ColorSpec array for colors to be set
  1154.              * when this window is active.    This is not
  1155.              * implemented, and may not be, since the default
  1156.              * values to restore would be hard to track.
  1157.              * We'd like to at least support per-window colors
  1158.              * for the mouse pointer sprite.
  1159.              */
  1160. #define WA_Zoom        (WA_Dummy + 0x1A)
  1161.             /* ti_Data points to an array of four WORD's,
  1162.              * the initial Left/Top/Width/Height values of
  1163.              * the "alternate" zoom position/dimensions.
  1164.              * It also specifies that you want a Zoom gadget
  1165.              * for your window, whether or not you have a
  1166.              * sizing gadget.
  1167.              */
  1168. #define WA_MouseQueue        (WA_Dummy + 0x1B)
  1169.             /* ti_Data contains initial value for the mouse
  1170.              * message backlog limit for this window.
  1171.              */
  1172. #define WA_BackFill        (WA_Dummy + 0x1C)
  1173.             /* unimplemented at present: provides a "backfill
  1174.              * hook" for your window's layer.
  1175.              */
  1176. #define WA_RptQueue        (WA_Dummy + 0x1D)
  1177.             /* initial value of repeat key backlog limit    */
  1178.  
  1179.     /* These Boolean tag items are alternatives to the NewWindow.Flags
  1180.      * boolean flags with similar names.
  1181.      */
  1182. #define WA_SizeGadget        (WA_Dummy + 0x1E)
  1183. #define WA_DragBar        (WA_Dummy + 0x1F)
  1184. #define WA_DepthGadget        (WA_Dummy + 0x20)
  1185. #define WA_CloseGadget        (WA_Dummy + 0x21)
  1186. #define WA_Backdrop        (WA_Dummy + 0x22)
  1187. #define WA_ReportMouse        (WA_Dummy + 0x23)
  1188. #define WA_NoCareRefresh    (WA_Dummy + 0x24)
  1189. #define WA_Borderless        (WA_Dummy + 0x25)
  1190. #define WA_Activate        (WA_Dummy + 0x26)
  1191. #define WA_RMBTrap        (WA_Dummy + 0x27)
  1192. #define WA_WBenchWindow        (WA_Dummy + 0x28)    /* PRIVATE!! */
  1193. #define WA_SimpleRefresh    (WA_Dummy + 0x29)
  1194.             /* only specify if TRUE    */
  1195. #define WA_SmartRefresh        (WA_Dummy + 0x2A)
  1196.             /* only specify if TRUE    */
  1197. #define WA_SizeBRight        (WA_Dummy + 0x2B)
  1198. #define WA_SizeBBottom        (WA_Dummy + 0x2C)
  1199.  
  1200.     /* New Boolean properties    */
  1201. #define WA_AutoAdjust        (WA_Dummy + 0x2D)
  1202.             /* shift or squeeze the window's position and
  1203.              * dimensions to fit it on screen.
  1204.              */
  1205.  
  1206. #define WA_GimmeZeroZero    (WA_Dummy + 0x2E)
  1207.             /* equiv. to NewWindow.Flags WFLG_GIMMEZEROZERO    */
  1208.  
  1209. /* New for V37: WA_MenuHelp (ignored by V36) */
  1210. #define WA_MenuHelp        (WA_Dummy + 0x2F)
  1211.             /* Enables IDCMP_MENUHELP:  Pressing HELP during menus
  1212.              * will return IDCMP_MENUHELP message.
  1213.              */
  1214.  
  1215.  
  1216.  
  1217. #ifndef INTUITION_SCREENS_H
  1218. #include <intuition/screens.h>
  1219. #endif
  1220.  
  1221. #ifndef INTUITION_PREFERENCES_H
  1222. #include <intuition/preferences.h>
  1223. #endif
  1224.  
  1225. /* ======================================================================== */
  1226. /* === Remember =========================================================== */
  1227. /* ======================================================================== */
  1228. /* this structure is used for remembering what memory has been allocated to
  1229.  * date by a given routine, so that a premature abort or systematic exit
  1230.  * can deallocate memory cleanly, easily, and completely
  1231.  */
  1232. struct Remember
  1233. {
  1234.     struct Remember *NextRemember;
  1235.     ULONG RememberSize;
  1236.     UBYTE *Memory;
  1237. };
  1238.  
  1239.  
  1240. /* === Color Spec ====================================================== */
  1241. /* How to tell Intuition about RGB values for a color table entry. */
  1242. struct ColorSpec {
  1243.     WORD    ColorIndex;    /* -1 terminates an array of ColorSpec    */
  1244.     UWORD    Red;        /* only 6 bits recognized in V36    */
  1245.     UWORD    Green;        /* only 6 bits recognized in V36    */
  1246.     UWORD    Blue;        /* only 6 bits recognized in V36    */
  1247. };
  1248.  
  1249. /* === Easy Requester Specification ======================================= */
  1250. /* see also autodocs for EasyRequest and BuildEasyRequest    */
  1251. /* NOTE: This structure may grow in size in the future        */
  1252. struct EasyStruct {
  1253.     ULONG    es_StructSize;    /* should be sizeof (struct EasyStruct )*/
  1254.     ULONG    es_Flags;    /* should be 0 for now            */
  1255.     UBYTE    *es_Title;    /* title of requester window        */
  1256.     UBYTE    *es_TextFormat;    /* 'printf' style formatting string    */
  1257.     UBYTE    *es_GadgetFormat; /* 'printf' style formatting string    */
  1258. };
  1259.  
  1260.  
  1261.  
  1262. /* ======================================================================== */
  1263. /* === Miscellaneous ====================================================== */
  1264. /* ======================================================================== */
  1265.  
  1266. /* = MACROS ============================================================== */
  1267. #define MENUNUM(n) (n & 0x1F)
  1268. #define ITEMNUM(n) ((n >> 5) & 0x003F)
  1269. #define SUBNUM(n) ((n >> 11) & 0x001F)
  1270.  
  1271. #define SHIFTMENU(n) (n & 0x1F)
  1272. #define SHIFTITEM(n) ((n & 0x3F) << 5)
  1273. #define SHIFTSUB(n) ((n & 0x1F) << 11)
  1274.  
  1275. #define FULLMENUNUM( menu, item, sub )    \
  1276.     ( SHIFTSUB(sub) | SHIFTITEM(item) | SHIFTMENU(menu) )
  1277.  
  1278. #define SRBNUM(n)    (0x08 - (n >> 4))    /* SerRWBits -> read bits per char */
  1279. #define SWBNUM(n)    (0x08 - (n & 0x0F))/* SerRWBits -> write bits per chr */
  1280. #define SSBNUM(n)    (0x01 + (n >> 4))    /* SerStopBuf -> stop bits per chr */
  1281. #define SPARNUM(n)   (n >> 4)        /* SerParShk -> parity setting      */
  1282. #define SHAKNUM(n)   (n & 0x0F)    /* SerParShk -> handshake mode      */
  1283.  
  1284.  
  1285. /* = MENU STUFF =========================================================== */
  1286. #define NOMENU 0x001F
  1287. #define NOITEM 0x003F
  1288. #define NOSUB  0x001F
  1289. #define MENUNULL 0xFFFF
  1290.  
  1291.  
  1292. /* = =RJ='s peculiarities ================================================= */
  1293. #define FOREVER for(;;)
  1294. #define SIGN(x) ( ((x) > 0) - ((x) < 0) )
  1295. #define NOT !
  1296.  
  1297. /* these defines are for the COMMSEQ and CHECKIT menu stuff.  If CHECKIT,
  1298.  * I'll use a generic Width (for all resolutions) for the CheckMark.
  1299.  * If COMMSEQ, likewise I'll use this generic stuff
  1300.  */
  1301. #define CHECKWIDTH    19
  1302. #define COMMWIDTH    27
  1303. #define LOWCHECKWIDTH    13
  1304. #define LOWCOMMWIDTH    16
  1305.  
  1306.  
  1307. /* these are the AlertNumber defines.  if you are calling DisplayAlert()
  1308.  * the AlertNumber you supply must have the ALERT_TYPE bits set to one
  1309.  * of these patterns
  1310.  */
  1311. #define ALERT_TYPE    0x80000000
  1312. #define RECOVERY_ALERT    0x00000000    /* the system can recover from this */
  1313. #define DEADEND_ALERT    0x80000000    /* no recovery possible, this is it */
  1314.  
  1315.  
  1316. /* When you're defining IntuiText for the Positive and Negative Gadgets
  1317.  * created by a call to AutoRequest(), these defines will get you
  1318.  * reasonable-looking text.  The only field without a define is the IText
  1319.  * field; you decide what text goes with the Gadget
  1320.  */
  1321. #define AUTOFRONTPEN    0
  1322. #define AUTOBACKPEN    1
  1323. #define AUTODRAWMODE    JAM2
  1324. #define AUTOLEFTEDGE    6
  1325. #define AUTOTOPEDGE    3
  1326. #define AUTOITEXTFONT    NULL
  1327. #define AUTONEXTTEXT    NULL
  1328.  
  1329.  
  1330. /* --- RAWMOUSE Codes and Qualifiers (Console OR IDCMP) ------------------- */
  1331. #define SELECTUP    (IECODE_LBUTTON | IECODE_UP_PREFIX)
  1332. #define SELECTDOWN    (IECODE_LBUTTON)
  1333. #define MENUUP        (IECODE_RBUTTON | IECODE_UP_PREFIX)
  1334. #define MENUDOWN    (IECODE_RBUTTON)
  1335. #define MIDDLEDOWN    (IECODE_MBUTTON)
  1336. #define MIDDLEUP    (IECODE_MBUTTON | IECODE_UP_PREFIX)
  1337. #define ALTLEFT        (IEQUALIFIER_LALT)
  1338. #define ALTRIGHT    (IEQUALIFIER_RALT)
  1339. #define AMIGALEFT    (IEQUALIFIER_LCOMMAND)
  1340. #define AMIGARIGHT    (IEQUALIFIER_RCOMMAND)
  1341. #define AMIGAKEYS    (AMIGALEFT | AMIGARIGHT)
  1342.  
  1343. #define CURSORUP    0x4C
  1344. #define CURSORLEFT    0x4F
  1345. #define CURSORRIGHT    0x4E
  1346. #define CURSORDOWN    0x4D
  1347. #define KEYCODE_Q    0x10
  1348. #define KEYCODE_Z    0x31
  1349. #define KEYCODE_X    0x32
  1350. #define KEYCODE_V    0x34
  1351. #define KEYCODE_B    0x35
  1352. #define KEYCODE_N    0x36
  1353. #define KEYCODE_M    0x37
  1354. #define KEYCODE_LESS    0x38
  1355. #define KEYCODE_GREATER 0x39
  1356.  
  1357. /* Include obsolete identifiers: */
  1358. #ifndef INTUITION_IOBSOLETE_H
  1359. #include <intuition/iobsolete.h>
  1360. #endif
  1361.  
  1362. #endif
  1363.