home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / at-inc-bin.lha / os-include / intuition / gadgetclass.h < prev    next >
C/C++ Source or Header  |  1993-10-15  |  11KB  |  337 lines

  1. #ifndef INTUITION_GADGETCLASS_H
  2. #define INTUITION_GADGETCLASS_H 1
  3. /*
  4. **  $VER: gadgetclass.h 38.10 (8.1.93)
  5. **  Includes Release 40.15
  6. **
  7. **  Custom and 'boopsi' gadget class interface
  8. **
  9. **  (C) Copyright 1989-1993 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. #ifndef EXEC_TYPES_H
  14. #include <exec/types.h>
  15. #endif
  16.  
  17. #ifndef INTUITION_INTUITION_H
  18. #include <intuition/intuition.h>
  19. #endif
  20.  
  21. #ifndef UTILITY_TAGITEM_H
  22. #include <utility/tagitem.h>
  23. #endif
  24.  
  25. /*
  26.  * NOTE:  <intuition/iobsolete.h> is included at the END of this file!
  27.  */
  28.  
  29. /* Gadget Class attributes    */
  30.  
  31. #define       GA_Dummy        (TAG_USER +0x30000)
  32. #define    GA_Left        (GA_Dummy + 0x0001)
  33. #define    GA_RelRight        (GA_Dummy + 0x0002)
  34. #define    GA_Top        (GA_Dummy + 0x0003)
  35. #define    GA_RelBottom        (GA_Dummy + 0x0004)
  36. #define    GA_Width        (GA_Dummy + 0x0005)
  37. #define    GA_RelWidth        (GA_Dummy + 0x0006)
  38. #define    GA_Height        (GA_Dummy + 0x0007)
  39. #define    GA_RelHeight        (GA_Dummy + 0x0008)
  40. #define    GA_Text        (GA_Dummy + 0x0009) /* ti_Data is (UBYTE *) */
  41. #define    GA_Image        (GA_Dummy + 0x000A)
  42. #define    GA_Border        (GA_Dummy + 0x000B)
  43. #define    GA_SelectRender    (GA_Dummy + 0x000C)
  44. #define    GA_Highlight        (GA_Dummy + 0x000D)
  45. #define    GA_Disabled        (GA_Dummy + 0x000E)
  46. #define    GA_GZZGadget        (GA_Dummy + 0x000F)
  47. #define    GA_ID        (GA_Dummy + 0x0010)
  48. #define    GA_UserData        (GA_Dummy + 0x0011)
  49. #define    GA_SpecialInfo    (GA_Dummy + 0x0012)
  50. #define    GA_Selected        (GA_Dummy + 0x0013)
  51. #define    GA_EndGadget        (GA_Dummy + 0x0014)
  52. #define    GA_Immediate        (GA_Dummy + 0x0015)
  53. #define    GA_RelVerify        (GA_Dummy + 0x0016)
  54. #define    GA_FollowMouse    (GA_Dummy + 0x0017)
  55. #define    GA_RightBorder    (GA_Dummy + 0x0018)
  56. #define    GA_LeftBorder    (GA_Dummy + 0x0019)
  57. #define    GA_TopBorder        (GA_Dummy + 0x001A)
  58. #define    GA_BottomBorder    (GA_Dummy + 0x001B)
  59. #define    GA_ToggleSelect    (GA_Dummy + 0x001C)
  60.  
  61.     /* internal use only, until further notice, please */
  62. #define    GA_SysGadget        (GA_Dummy + 0x001D)
  63.     /* bool, sets GTYP_SYSGADGET field in type    */
  64. #define    GA_SysGType        (GA_Dummy + 0x001E)
  65.     /* e.g., GTYP_WUPFRONT, ...    */
  66.  
  67. #define    GA_Previous        (GA_Dummy + 0x001F)
  68.     /* previous gadget (or (struct Gadget **)) in linked list
  69.      * NOTE: This attribute CANNOT be used to link new gadgets
  70.      * into the gadget list of an open window or requester.
  71.      * You must use AddGList().
  72.      */
  73.  
  74. #define    GA_Next        (GA_Dummy + 0x0020)
  75.      /* not implemented */
  76.  
  77. #define    GA_DrawInfo        (GA_Dummy + 0x0021)
  78.     /* some fancy gadgets need to see a DrawInfo
  79.      * when created or for layout
  80.      */
  81.  
  82. /* You should use at most ONE of GA_Text, GA_IntuiText, and GA_LabelImage */
  83. #define GA_IntuiText        (GA_Dummy + 0x0022)
  84.     /* ti_Data is (struct IntuiText    *) */
  85.  
  86. #define GA_LabelImage        (GA_Dummy + 0x0023)
  87.     /* ti_Data is an image (object), used in place of
  88.      * GadgetText
  89.      */
  90.  
  91. #define GA_TabCycle        (GA_Dummy + 0x0024)
  92.     /* New for V37:
  93.      * Boolean indicates that this gadget is to participate in
  94.      * cycling activation with Tab or Shift-Tab.
  95.      */
  96.  
  97. #define GA_GadgetHelp        (GA_Dummy + 0x0025)
  98.     /* New for V39:
  99.      * Boolean indicates that this gadget sends gadget-help
  100.      */
  101.  
  102. #define GA_Bounds        (GA_Dummy + 0x0026)
  103.     /* New for V39:
  104.      * ti_Data is a pointer to an IBox structure which is
  105.      * to be copied into the extended gadget's bounds.
  106.      */
  107.  
  108. #define GA_RelSpecial        (GA_Dummy + 0x0027)
  109.     /* New for V39:
  110.      * Boolean indicates that this gadget has the "special relativity"
  111.      * property, which is useful for certain fancy relativity
  112.      * operations through the GM_LAYOUT method.
  113.      */
  114.  
  115. /* PROPGCLASS attributes */
  116.  
  117. #define PGA_Dummy    (TAG_USER + 0x31000)
  118. #define PGA_Freedom    (PGA_Dummy + 0x0001)
  119.     /* only one of FREEVERT or FREEHORIZ */
  120. #define PGA_Borderless    (PGA_Dummy + 0x0002)
  121. #define PGA_HorizPot    (PGA_Dummy + 0x0003)
  122. #define PGA_HorizBody    (PGA_Dummy + 0x0004)
  123. #define PGA_VertPot    (PGA_Dummy + 0x0005)
  124. #define PGA_VertBody    (PGA_Dummy + 0x0006)
  125. #define PGA_Total    (PGA_Dummy + 0x0007)
  126. #define PGA_Visible    (PGA_Dummy + 0x0008)
  127. #define PGA_Top        (PGA_Dummy + 0x0009)
  128. /* New for V37: */
  129. #define PGA_NewLook    (PGA_Dummy + 0x000A)
  130.  
  131. /* STRGCLASS attributes    */
  132.  
  133. #define STRINGA_Dummy            (TAG_USER      +0x32000)
  134. #define STRINGA_MaxChars    (STRINGA_Dummy + 0x0001)
  135. /* Note:  There is a minor problem with Intuition when using boopsi integer
  136.  * gadgets (which are requested by using STRINGA_LongInt).  Such gadgets
  137.  * must not have a STRINGA_MaxChars to be bigger than 15.  Setting
  138.  * STRINGA_MaxChars for a boopsi integer gadget will cause a mismatched
  139.  * FreeMem() to occur.
  140.  */
  141.  
  142. #define STRINGA_Buffer        (STRINGA_Dummy + 0x0002)
  143. #define STRINGA_UndoBuffer    (STRINGA_Dummy + 0x0003)
  144. #define STRINGA_WorkBuffer    (STRINGA_Dummy + 0x0004)
  145. #define STRINGA_BufferPos    (STRINGA_Dummy + 0x0005)
  146. #define STRINGA_DispPos        (STRINGA_Dummy + 0x0006)
  147. #define STRINGA_AltKeyMap    (STRINGA_Dummy + 0x0007)
  148. #define STRINGA_Font        (STRINGA_Dummy + 0x0008)
  149. #define STRINGA_Pens        (STRINGA_Dummy + 0x0009)
  150. #define STRINGA_ActivePens    (STRINGA_Dummy + 0x000A)
  151. #define STRINGA_EditHook    (STRINGA_Dummy + 0x000B)
  152. #define STRINGA_EditModes    (STRINGA_Dummy + 0x000C)
  153.  
  154. /* booleans */
  155. #define STRINGA_ReplaceMode    (STRINGA_Dummy + 0x000D)
  156. #define STRINGA_FixedFieldMode    (STRINGA_Dummy + 0x000E)
  157. #define STRINGA_NoFilterMode    (STRINGA_Dummy + 0x000F)
  158.  
  159. #define STRINGA_Justification    (STRINGA_Dummy + 0x0010)
  160.     /* GACT_STRINGCENTER, GACT_STRINGLEFT, GACT_STRINGRIGHT */
  161. #define STRINGA_LongVal        (STRINGA_Dummy + 0x0011)
  162. #define STRINGA_TextVal        (STRINGA_Dummy + 0x0012)
  163.  
  164. #define STRINGA_ExitHelp    (STRINGA_Dummy + 0x0013)
  165.     /* STRINGA_ExitHelp is new for V37, and ignored by V36.
  166.      * Set this if you want the gadget to exit when Help is
  167.      * pressed.  Look for a code of 0x5F, the rawkey code for Help
  168.      */
  169.  
  170. #define SG_DEFAULTMAXCHARS    (128)
  171.  
  172. /* Gadget Layout related attributes    */
  173.  
  174. #define    LAYOUTA_Dummy        (TAG_USER  + 0x38000)
  175. #define LAYOUTA_LayoutObj    (LAYOUTA_Dummy + 0x0001)
  176. #define LAYOUTA_Spacing        (LAYOUTA_Dummy + 0x0002)
  177. #define LAYOUTA_Orientation    (LAYOUTA_Dummy + 0x0003)
  178.  
  179. /* orientation values    */
  180. #define LORIENT_NONE    0
  181. #define LORIENT_HORIZ    1
  182. #define LORIENT_VERT    2
  183.  
  184.  
  185. /* Gadget Method ID's    */
  186.  
  187. #define GM_Dummy    (-1)    /* not used for anything        */
  188. #define GM_HITTEST    (0)    /* return GMR_GADGETHIT if you are clicked on
  189.                  * (whether or not you are disabled).
  190.                  */
  191. #define GM_RENDER    (1)    /* draw yourself, in the appropriate state */
  192. #define GM_GOACTIVE    (2)    /* you are now going to be fed input    */
  193. #define GM_HANDLEINPUT    (3)    /* handle that input            */
  194. #define GM_GOINACTIVE    (4)    /* whether or not by choice, you are done  */
  195. #define GM_HELPTEST    (5)    /* Will you send gadget help if the mouse is
  196.                  * at the specified coordinates?  See below
  197.                  * for possible GMR_ values.
  198.                  */
  199. #define GM_LAYOUT    (6)    /* re-evaluate your size based on the GadgetInfo
  200.                  * Domain.  Do NOT re-render yourself yet, you
  201.                  * will be called when it is time...
  202.                  */
  203.  
  204. /* Parameter "Messages" passed to gadget class methods    */
  205.  
  206. /* GM_HITTEST and GM_HELPTEST send this message.
  207.  * For GM_HITTEST, gpht_Mouse are coordinates relative to the gadget
  208.  * select box.    For GM_HELPTEST, the coordinates are relative to
  209.  * the gadget bounding box (which defaults to the select box).
  210.  */
  211. struct gpHitTest
  212. {
  213.     ULONG        MethodID;
  214.     struct GadgetInfo    *gpht_GInfo;
  215.     struct
  216.     {
  217.     WORD    X;
  218.     WORD    Y;
  219.     }            gpht_Mouse;
  220. };
  221.  
  222. /* For GM_HITTEST, return GMR_GADGETHIT if you were indeed hit,
  223.  * otherwise return zero.
  224.  *
  225.  * For GM_HELPTEST, return GMR_NOHELPHIT (zero) if you were not hit.
  226.  * Typically, return GMR_HELPHIT if you were hit.
  227.  * It is possible to pass a UWORD to the application via the Code field
  228.  * of the IDCMP_GADGETHELP message.  Return GMR_HELPCODE or'd with
  229.  * the UWORD-sized result you wish to return.
  230.  *
  231.  * GMR_HELPHIT yields a Code value of ((UWORD) ~0), which should
  232.  * mean "nothing particular" to the application.
  233.  */
  234.  
  235. #define GMR_GADGETHIT    (0x00000004)    /* GM_HITTEST hit */
  236.  
  237. #define GMR_NOHELPHIT    (0x00000000)    /* GM_HELPTEST didn't hit */
  238. #define GMR_HELPHIT    (0xFFFFFFFF)    /* GM_HELPTEST hit, return code = ~0 */
  239. #define GMR_HELPCODE    (0x00010000)    /* GM_HELPTEST hit, return low word as code */
  240.  
  241. /* GM_RENDER    */
  242. struct gpRender
  243. {
  244.     ULONG        MethodID;
  245.     struct GadgetInfo    *gpr_GInfo;    /* gadget context        */
  246.     struct RastPort    *gpr_RPort;    /* all ready for use        */
  247.     LONG        gpr_Redraw;    /* might be a "highlight pass"    */
  248. };
  249.  
  250. /* values of gpr_Redraw    */
  251. #define GREDRAW_UPDATE    (2)    /* incremental update, e.g. prop slider    */
  252. #define GREDRAW_REDRAW    (1)    /* redraw gadget    */
  253. #define GREDRAW_TOGGLE    (0)    /* toggle highlight, if applicable    */
  254.  
  255. /* GM_GOACTIVE, GM_HANDLEINPUT    */
  256. struct gpInput
  257. {
  258.     ULONG        MethodID;
  259.     struct GadgetInfo    *gpi_GInfo;
  260.     struct InputEvent    *gpi_IEvent;
  261.     LONG        *gpi_Termination;
  262.     struct
  263.     {
  264.     WORD    X;
  265.     WORD    Y;
  266.     }            gpi_Mouse;
  267.  
  268.     /* (V39) Pointer to TabletData structure, if this event originated
  269.      * from a tablet which sends IESUBCLASS_NEWTABLET events, or NULL if
  270.      * not.
  271.      *
  272.      * DO NOT ATTEMPT TO READ THIS FIELD UNDER INTUITION PRIOR TO V39!
  273.      * IT WILL BE INVALID!
  274.      */
  275.     struct TabletData    *gpi_TabletData;
  276. };
  277.  
  278. /* GM_HANDLEINPUT and GM_GOACTIVE  return code flags    */
  279. /* return GMR_MEACTIVE (0) alone if you want more input.
  280.  * Otherwise, return ONE of GMR_NOREUSE and GMR_REUSE, and optionally
  281.  * GMR_VERIFY.
  282.  */
  283. #define GMR_MEACTIVE    (0)
  284. #define GMR_NOREUSE    (1 << 1)
  285. #define GMR_REUSE    (1 << 2)
  286. #define GMR_VERIFY    (1 << 3)    /* you MUST set gpi_Termination */
  287.  
  288. /* New for V37:
  289.  * You can end activation with one of GMR_NEXTACTIVE and GMR_PREVACTIVE,
  290.  * which instructs Intuition to activate the next or previous gadget
  291.  * that has GFLG_TABCYCLE set.
  292.  */
  293. #define GMR_NEXTACTIVE    (1 << 4)
  294. #define GMR_PREVACTIVE    (1 << 5)
  295.  
  296. /* GM_GOINACTIVE */
  297. struct gpGoInactive
  298. {
  299.     ULONG        MethodID;
  300.     struct GadgetInfo    *gpgi_GInfo;
  301.  
  302.     /* V37 field only!    DO NOT attempt to read under V36! */
  303.     ULONG        gpgi_Abort;    /* gpgi_Abort=1 if gadget was aborted
  304.                      * by Intuition and 0 if gadget went
  305.                      * inactive at its own request
  306.                      */
  307. };
  308.  
  309.  
  310. /* New for V39: Intuition sends GM_LAYOUT to any GREL_ gadget when
  311.  * the gadget is added to the window (or when the window opens, if
  312.  * the gadget was part of the NewWindow.FirstGadget or the WA_Gadgets
  313.  * list), or when the window is resized.  Your gadget can set the
  314.  * GA_RelSpecial property to get GM_LAYOUT events without Intuition
  315.  * changing the interpretation of your gadget select box.  This
  316.  * allows for completely arbitrary resizing/repositioning based on
  317.  * window size.
  318.  */
  319. /* GM_LAYOUT */
  320. struct gpLayout
  321. {
  322.     ULONG        MethodID;
  323.     struct GadgetInfo    *gpl_GInfo;
  324.     ULONG        gpl_Initial;    /* non-zero if this method was invoked
  325.                      * during AddGList() or OpenWindow()
  326.                      * time.  zero if this method was invoked
  327.                      * during window resizing.
  328.                      */
  329. };
  330.  
  331. /* Include obsolete identifiers: */
  332. #ifndef INTUITION_IOBSOLETE_H
  333. #include <intuition/iobsolete.h>
  334. #endif
  335.  
  336. #endif
  337.