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

  1. #ifndef INTUITION_GADGETCLASS_H
  2. #define INTUITION_GADGETCLASS_H 1
  3. /*
  4. **  $VER: gadgetclass.h 36.6 (08.11.91)
  5. **  Includes Release 38.56
  6. **
  7. **  Custom and 'boopsi' gadget class interface
  8. **
  9. **  (C) Copyright 1989-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 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. /* PROPGCLASS attributes */
  98.  
  99. #define PGA_Dummy    (TAG_USER + 0x31000)
  100. #define PGA_Freedom    (PGA_Dummy + 0x0001)
  101.     /* only one of FREEVERT or FREEHORIZ */
  102. #define PGA_Borderless    (PGA_Dummy + 0x0002)
  103. #define PGA_HorizPot    (PGA_Dummy + 0x0003)
  104. #define PGA_HorizBody    (PGA_Dummy + 0x0004)
  105. #define PGA_VertPot    (PGA_Dummy + 0x0005)
  106. #define PGA_VertBody    (PGA_Dummy + 0x0006)
  107. #define PGA_Total    (PGA_Dummy + 0x0007)
  108. #define PGA_Visible    (PGA_Dummy + 0x0008)
  109. #define PGA_Top        (PGA_Dummy + 0x0009)
  110. /* New for V37: */
  111. #define PGA_NewLook    (PGA_Dummy + 0x000A)
  112.  
  113. /* STRGCLASS attributes    */
  114.  
  115. #define STRINGA_Dummy            (TAG_USER      +0x32000)
  116. #define STRINGA_MaxChars    (STRINGA_Dummy + 0x0001)
  117. #define STRINGA_Buffer        (STRINGA_Dummy + 0x0002)
  118. #define STRINGA_UndoBuffer    (STRINGA_Dummy + 0x0003)
  119. #define STRINGA_WorkBuffer    (STRINGA_Dummy + 0x0004)
  120. #define STRINGA_BufferPos    (STRINGA_Dummy + 0x0005)
  121. #define STRINGA_DispPos        (STRINGA_Dummy + 0x0006)
  122. #define STRINGA_AltKeyMap    (STRINGA_Dummy + 0x0007)
  123. #define STRINGA_Font        (STRINGA_Dummy + 0x0008)
  124. #define STRINGA_Pens        (STRINGA_Dummy + 0x0009)
  125. #define STRINGA_ActivePens    (STRINGA_Dummy + 0x000A)
  126. #define STRINGA_EditHook    (STRINGA_Dummy + 0x000B)
  127. #define STRINGA_EditModes    (STRINGA_Dummy + 0x000C)
  128.  
  129. /* booleans */
  130. #define STRINGA_ReplaceMode    (STRINGA_Dummy + 0x000D)
  131. #define STRINGA_FixedFieldMode    (STRINGA_Dummy + 0x000E)
  132. #define STRINGA_NoFilterMode    (STRINGA_Dummy + 0x000F)
  133.  
  134. #define STRINGA_Justification    (STRINGA_Dummy + 0x0010)
  135.     /* GACT_STRINGCENTER, GACT_STRINGLEFT, GACT_STRINGRIGHT */
  136. #define STRINGA_LongVal        (STRINGA_Dummy + 0x0011)
  137. #define STRINGA_TextVal        (STRINGA_Dummy + 0x0012)
  138.  
  139. #define STRINGA_ExitHelp    (STRINGA_Dummy + 0x0013)
  140.     /* STRINGA_ExitHelp is new for V37, and ignored by V36.
  141.      * Set this if you want the gadget to exit when Help is
  142.      * pressed.  Look for a code of 0x5F, the rawkey code for Help
  143.      */
  144.  
  145. #define SG_DEFAULTMAXCHARS    (128)
  146.  
  147. /* Gadget Layout related attributes    */
  148.  
  149. #define    LAYOUTA_Dummy        (TAG_USER  + 0x38000)
  150. #define LAYOUTA_LayoutObj    (LAYOUTA_Dummy + 0x0001)
  151. #define LAYOUTA_Spacing        (LAYOUTA_Dummy + 0x0002)
  152. #define LAYOUTA_Orientation    (LAYOUTA_Dummy + 0x0003)
  153.  
  154. /* orientation values    */
  155. #define LORIENT_NONE    0
  156. #define LORIENT_HORIZ    1
  157. #define LORIENT_VERT    2
  158.  
  159.  
  160. /* Gadget Method ID's    */
  161.  
  162. #define GM_Dummy    (-1)    /* not used for anything        */
  163. #define GM_HITTEST    (0)    /* return GMR_GADGETHIT if you are clicked on
  164.                  * (whether or not you are disabled).
  165.                  */
  166. #define GM_RENDER    (1)    /* draw yourself, in the appropriate state */
  167. #define GM_GOACTIVE    (2)    /* you are now going to be fed input    */
  168. #define GM_HANDLEINPUT    (3)    /* handle that input            */
  169. #define GM_GOINACTIVE    (4)    /* whether or not by choice, you are done  */
  170.  
  171. /* Parameter "Messages" passed to gadget class methods    */
  172.  
  173. /* GM_HITTEST    */
  174. struct gpHitTest {
  175.     ULONG        MethodID;
  176.     struct GadgetInfo    *gpht_GInfo;
  177.     struct {
  178.     WORD    X;
  179.     WORD    Y;
  180.     }            gpht_Mouse;
  181. };
  182. /* GM_HITTEST return value */
  183. #define GMR_GADGETHIT    (0x00000004)    /* if no hit, return 0 */
  184.  
  185. /* GM_RENDER    */
  186. struct gpRender {
  187.     ULONG        MethodID;
  188.     struct GadgetInfo    *gpr_GInfo;    /* gadget context        */
  189.     struct RastPort    *gpr_RPort;    /* all ready for use        */
  190.     LONG        gpr_Redraw;    /* might be a "highlight pass"    */
  191. };
  192.  
  193. /* values of gpr_Redraw    */
  194. #define GREDRAW_UPDATE    (2)    /* incremental update, e.g. prop slider    */
  195. #define GREDRAW_REDRAW    (1)    /* redraw gadget    */
  196. #define GREDRAW_TOGGLE    (0)    /* toggle highlight, if applicable    */
  197.  
  198. /* GM_GOACTIVE, GM_HANDLEINPUT    */
  199. struct gpInput {
  200.     ULONG        MethodID;
  201.     struct GadgetInfo    *gpi_GInfo;
  202.     struct InputEvent    *gpi_IEvent;
  203.     LONG        *gpi_Termination;
  204.     struct {
  205.     WORD    X;
  206.     WORD    Y;
  207.     }            gpi_Mouse;
  208. };
  209.  
  210. /* GM_HANDLEINPUT and GM_GOACTIVE  return code flags    */
  211. /* return GMR_MEACTIVE (0) alone if you want more input.
  212.  * Otherwise, return ONE of GMR_NOREUSE and GMR_REUSE, and optionally
  213.  * GMR_VERIFY.
  214.  */
  215. #define GMR_MEACTIVE    (0)
  216. #define GMR_NOREUSE    (1 << 1)
  217. #define GMR_REUSE    (1 << 2)
  218. #define GMR_VERIFY    (1 << 3)    /* you MUST set cgp_Termination */
  219.  
  220. /* New for V37:
  221.  * You can end activation with one of GMR_NEXTACTIVE and GMR_PREVACTIVE,
  222.  * which instructs Intuition to activate the next or previous gadget
  223.  * that has GFLG_TABCYCLE set.
  224.  */
  225. #define GMR_NEXTACTIVE    (1 << 4)
  226. #define GMR_PREVACTIVE    (1 << 5)
  227.  
  228. /* GM_GOINACTIVE */
  229. struct gpGoInactive {
  230.     ULONG        MethodID;
  231.     struct GadgetInfo    *gpgi_GInfo;
  232.  
  233.     /* V37 field only!    DO NOT attempt to read under V36! */
  234.     ULONG        gpgi_Abort;    /* gpgi_Abort=1 if gadget was aborted
  235.                      * by Intuition and 0 if gadget went
  236.                      * inactive at its own request
  237.                      */
  238. };
  239.  
  240.  
  241. /* Include obsolete identifiers: */
  242. #ifndef INTUITION_IOBSOLETE_H
  243. #include <intuition/iobsolete.h>
  244. #endif
  245.  
  246. #endif
  247.