home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / jËzyki_programowania / ace_basic / ace / include / intuition / gadgetclass.h < prev    next >
C/C++ Source or Header  |  1977-12-31  |  12KB  |  376 lines

  1. #ifndef INTUITION_GADGETCLASS_H
  2. #define INTUITION_GADGETCLASS_H 1
  3. /*
  4. ** gadgetclass.h for ACE Basic
  5. **
  6. ** Note: Translated to ACE by ConvertC2ACE
  7. **       @ MapMeadow Software, Nils Sjoholm
  8. **
  9. **
  10. ** Date: 09/01/95
  11. **
  12. **
  13. */
  14.  
  15. /*
  16. ** This are the StructPointer defines for gadgetclass.h
  17. */
  18. #ifndef gpGoInactivePtr
  19. #define gpGoInactivePtr ADDRESS
  20. #endif
  21. #ifndef gpHitTestPtr
  22. #define gpHitTestPtr ADDRESS
  23. #endif
  24. #ifndef gpInputPtr
  25. #define gpInputPtr ADDRESS
  26. #endif
  27. #ifndef gpLayoutPtr
  28. #define gpLayoutPtr ADDRESS
  29. #endif
  30. #ifndef gpRenderPtr
  31. #define gpRenderPtr ADDRESS
  32. #endif
  33. #ifndef gpht_Mouse_StructPtr
  34. #define gpht_Mouse_StructPtr ADDRESS
  35. #endif
  36. #ifndef gpi_Mouse_StructPtr
  37. #define gpi_Mouse_StructPtr ADDRESS
  38. #endif
  39. /*
  40. ** End of StructPointer defines for gadgetclass.h
  41. */
  42.  
  43.  
  44. #ifndef EXEC_TYPES_H
  45. #include <exec/types.h>
  46. #endif
  47.  
  48. #ifndef INTUITION_INTUITION_H
  49. #include <intuition/intuition.h>
  50. #endif
  51.  
  52. #ifndef UTILITY_TAGITEM_H
  53. #include <utility/tagitem.h>
  54. #endif
  55.  
  56. #ifndef GadgetInfoPtr
  57. #define GadgetInfoPtr ADDRESS
  58. #endif
  59.  
  60. /*
  61.  * NOTE:  <intuition/iobsolete.h> is included at the END of this file!
  62.  */
  63.  
  64. /* Gadget Class attributes  */
  65.  
  66. #define    GA_Dummy     (TAG_USER +&H30000)
  67. #define    GA_Left      (GA_Dummy + &H0001)
  68. #define    GA_RelRight      (GA_Dummy + &H0002)
  69. #define    GA_Top       (GA_Dummy + &H0003)
  70. #define    GA_RelBottom     (GA_Dummy + &H0004)
  71. #define    GA_Width     (GA_Dummy + &H0005)
  72. #define    GA_RelWidth      (GA_Dummy + &H0006)
  73. #define    GA_Height        (GA_Dummy + &H0007)
  74. #define    GA_RelHeight     (GA_Dummy + &H0008)
  75. #define    GA_Text      (GA_Dummy + &H0009) /* ti_Data is (BYTE  *) */
  76. #define    GA_Image     (GA_Dummy + &H000A)
  77. #define    GA_Border        (GA_Dummy + &H000B)
  78. #define    GA_SelectRender  (GA_Dummy + &H000C)
  79. #define    GA_Highlight     (GA_Dummy + &H000D)
  80. #define    GA_Disabled      (GA_Dummy + &H000E)
  81. #define    GA_GZZGadget     (GA_Dummy + &H000F)
  82. #define    GA_ID        (GA_Dummy + &H0010)
  83. #define    GA_UserData      (GA_Dummy + &H0011)
  84. #define    GA_SpecialInfo   (GA_Dummy + &H0012)
  85. #define    GA_Selected      (GA_Dummy + &H0013)
  86. #define    GA_EndGadget     (GA_Dummy + &H0014)
  87. #define    GA_Immediate     (GA_Dummy + &H0015)
  88. #define    GA_RelVerify     (GA_Dummy + &H0016)
  89. #define    GA_FollowMouse   (GA_Dummy + &H0017)
  90. #define    GA_RightBorder   (GA_Dummy + &H0018)
  91. #define    GA_LeftBorder    (GA_Dummy + &H0019)
  92. #define    GA_TopBorder     (GA_Dummy + &H001A)
  93. #define    GA_BottomBorder  (GA_Dummy + &H001B)
  94. #define    GA_ToggleSelect  (GA_Dummy + &H001C)
  95.  
  96.     /* internal use only,  until further notice,  please */
  97. #define    GA_SysGadget     (GA_Dummy + &H001D)
  98.     /* SHORTINT,  sets GTYP_SYSGADGET field in type  */
  99. #define    GA_SysGType      (GA_Dummy + &H001E)
  100.     /* e.g.,  GTYP_WUPFRONT,  ... */
  101.  
  102. #define    GA_Previous      (GA_Dummy + &H001F)
  103.     /* previous gadget (or (STRUCT Gadget **)) in linked list
  104.      * NOTE: This attribute CANNOT be used to link new gadgets
  105.      * into the gadget list of an open window or requester.
  106.      * You must use AddGList().
  107.      */
  108.  
  109. #define    GA_Next      (GA_Dummy + &H0020)
  110.      /* not implemented */
  111.  
  112. #define    GA_DrawInfo      (GA_Dummy + &H0021)
  113.     /* some fancy gadgets need to see a DrawInfo
  114.      * when created or for layout
  115.      */
  116.  
  117. /* You should use at most ONE of GA_Text,  GA_IntuiText,  and GA_LabelImage */
  118. #define GA_IntuiText        (GA_Dummy + &H0022)
  119.     /* ti_Data is (STRUCT IntuiText *) */
  120.  
  121. #define GA_LabelImage       (GA_Dummy + &H0023)
  122.     /* ti_Data is an image (object),  used in place of
  123.      * GadgetText
  124.      */
  125.  
  126. #define GA_TabCycle     (GA_Dummy + &H0024)
  127.     /* New for V37:
  128.      * Boolean indicates that this gadget is to participate in
  129.      * cycling activation with Tab or Shift-Tab.
  130.      */
  131.  
  132. #define GA_GadgetHelp       (GA_Dummy + &H0025)
  133.     /* New for V39:
  134.      * Boolean indicates that this gadget sends gadget-help
  135.      */
  136.  
  137. #define GA_Bounds       (GA_Dummy + &H0026)
  138.     /* New for V39:
  139.      * ti_Data is a pointer to an IBox structure which is
  140.      * to be copied into the extended gadget's bounds.
  141.      */
  142.  
  143. #define GA_RelSpecial       (GA_Dummy + &H0027)
  144.     /* New for V39:
  145.      * Boolean indicates that this gadget has the "special relativity"
  146.      * property,  which is useful for certain fancy relativity
  147.      * operations through the GM_LAYOUT method.
  148.      */
  149.  
  150. /* PROPGCLASS attributes */
  151.  
  152. #define PGA_Dummy   (TAG_USER + &H31000)
  153. #define PGA_Freedom (PGA_Dummy + &H0001)
  154.     /* only one of FREEVERT or FREEHORIZ */
  155. #define PGA_Borderless  (PGA_Dummy + &H0002)
  156. #define PGA_HorizPot    (PGA_Dummy + &H0003)
  157. #define PGA_HorizBody   (PGA_Dummy + &H0004)
  158. #define PGA_VertPot (PGA_Dummy + &H0005)
  159. #define PGA_VertBody    (PGA_Dummy + &H0006)
  160. #define PGA_Total   (PGA_Dummy + &H0007)
  161. #define PGA_Visible (PGA_Dummy + &H0008)
  162. #define PGA_Top     (PGA_Dummy + &H0009)
  163. /* New for V37: */
  164. #define PGA_NewLook (PGA_Dummy + &H000A)
  165.  
  166. /* STRGCLASS attributes */
  167.  
  168. #define STRINGA_Dummy           (TAG_USER      +&H32000)
  169. #define STRINGA_MaxChars    (STRINGA_Dummy + &H0001)
  170. /* Note:  There is a minor problem with Intuition when using boopsi integer
  171.  * gadgets (which are requested by using STRINGA_LongInt).  Such gadgets
  172.  * must not have a STRINGA_MaxChars to be bigger than 15.  Setting
  173.  * STRINGA_MaxChars for a boopsi integer gadget will cause a mismatched
  174.  * FreeMem() to occur.
  175.  */
  176.  
  177. #define STRINGA_Buffer      (STRINGA_Dummy + &H0002)
  178. #define STRINGA_UndoBuffer  (STRINGA_Dummy + &H0003)
  179. #define STRINGA_WorkBuffer  (STRINGA_Dummy + &H0004)
  180. #define STRINGA_BufferPos   (STRINGA_Dummy + &H0005)
  181. #define STRINGA_DispPos     (STRINGA_Dummy + &H0006)
  182. #define STRINGA_AltKeyMap   (STRINGA_Dummy + &H0007)
  183. #define STRINGA_Font        (STRINGA_Dummy + &H0008)
  184. #define STRINGA_Pens        (STRINGA_Dummy + &H0009)
  185. #define STRINGA_ActivePens  (STRINGA_Dummy + &H000A)
  186. #define STRINGA_EditHook    (STRINGA_Dummy + &H000B)
  187. #define STRINGA_EditModes   (STRINGA_Dummy + &H000C)
  188.  
  189. /* booleans */
  190. #define STRINGA_ReplaceMode (STRINGA_Dummy + &H000D)
  191. #define STRINGA_FixedFieldMode  (STRINGA_Dummy + &H000E)
  192. #define STRINGA_NoFilterMode    (STRINGA_Dummy + &H000F)
  193.  
  194. #define STRINGA_Justification   (STRINGA_Dummy + &H0010)
  195.     /* GACT_STRINGCENTER,  GACT_STRINGLEFT,  GACT_STRINGRIGHT */
  196. #define STRINGA_LongVal     (STRINGA_Dummy + &H0011)
  197. #define STRINGA_TextVal     (STRINGA_Dummy + &H0012)
  198.  
  199. #define STRINGA_ExitHelp    (STRINGA_Dummy + &H0013)
  200.     /* STRINGA_ExitHelp is new for V37,  and ignored by V36.
  201.      * Set this if you want the gadget to exit when Help is
  202.      * pressed.  Look for a code of &H5F,  the rawkey code for Help
  203.      */
  204.  
  205. #define SG_DEFAULTMAXCHARS  (128)
  206.  
  207. /* Gadget Layout related attributes */
  208.  
  209. #define LAYOUTA_Dummy       (TAG_USER  + &H38000)
  210. #define LAYOUTA_LayoutObj   (LAYOUTA_Dummy + &H0001)
  211. #define LAYOUTA_Spacing     (LAYOUTA_Dummy + &H0002)
  212. #define LAYOUTA_Orientation (LAYOUTA_Dummy + &H0003)
  213.  
  214. /* orientation values   */
  215. #define LORIENT_NONE    0
  216. #define LORIENT_HORIZ   1
  217. #define LORIENT_VERT    2
  218.  
  219.  
  220. /* Gadget Method ID's   */
  221.  
  222. #define GM_Dummy    (-1)    /* not used for anything        */
  223. #define GM_HITTEST  (0) /* return GMR_GADGETHIT if you are clicked on
  224.                  * (whether or not you are disabled).
  225.                  */
  226. #define GM_RENDER   (1) /* draw yourself,  in the appropriate state */
  227. #define GM_GOACTIVE (2) /* you are now going to be fed input    */
  228. #define GM_HANDLEINPUT  (3) /* handle that input            */
  229. #define GM_GOINACTIVE   (4) /* whether or not by choice,  you are done  */
  230. #define GM_HELPTEST (5) /* Will you send gadget help if the mouse is
  231.                  * at the specified coordinates?  See below
  232.                  * for possible GMR_ values.
  233.                  */
  234. #define GM_LAYOUT   (6) /* re-evaluate your size based on the GadgetInfo
  235.                  * Domain.  Do NOT re-render yourself yet,  you
  236.                  * will be called when it is time...
  237.                  */
  238.  
  239. /* Parameter "Messages" passed to gadget class methods  */
  240.  
  241. /* GM_HITTEST and GM_HELPTEST send this message.
  242.  * For GM_HITTEST,  gpht_Mouse are coordinates relative to the gadget
  243.  * select box.  For GM_HELPTEST,  the coordinates are relative to
  244.  * the gadget bounding box (which defaults to the select box).
  245.  */
  246.  
  247. STRUCT gpht_Mouse_Struct  
  248.     SHORTINT    X 
  249.     SHORTINT    Y 
  250. END STRUCT 
  251.  
  252. STRUCT gpHitTest
  253.  
  254.     LONGINT       MethodID 
  255.     GadgetInfoPtr  gpht_GInfo 
  256.     gpht_Mouse_Struct gpht_Mouse 
  257. END STRUCT 
  258.  
  259. /* For GM_HITTEST,  return GMR_GADGETHIT if you were indeed hit, 
  260.  * otherwise return zero.
  261.  *
  262.  * For GM_HELPTEST,  return GMR_NOHELPHIT (zero) if you were not hit.
  263.  * Typically,  return GMR_HELPHIT if you were hit.
  264.  * It is possible to pass a SHORTINT to the application via the Code field
  265.  * of the IDCMP_GADGETHELP message.  Return GMR_HELPCODE or'd with
  266.  * the SHORTINT-sized result you wish to return.
  267.  *
  268.  * GMR_HELPHIT yields a Code value of ((SHORTINT) ~0),  which should
  269.  * mean "nothing particular" to the application.
  270.  */
  271.  
  272. #define GMR_GADGETHIT   (&H00000004)    /* GM_HITTEST hit */
  273.  
  274. #define GMR_NOHELPHIT   (&H00000000)    /* GM_HELPTEST didn't hit */
  275. #define GMR_HELPHIT (&HFFFFFFFF)    /* GM_HELPTEST hit,  return code = ~0 */
  276. #define GMR_HELPCODE    (&H00010000)    /* GM_HELPTEST hit,  return low SHORTINT as code */
  277.  
  278. /* GM_RENDER    */
  279. STRUCT gpRender
  280.  
  281.     LONGINT       MethodID 
  282.     GadgetInfoPtr  gpr_GInfo  /* gadget context       */
  283.     RastPortPtr  gpr_RPort  /* all ready for use        */
  284.     LONGINT        gpr_Redraw  /* might be a "highlight pass"  */
  285. END STRUCT 
  286.  
  287. /* values of gpr_Redraw */
  288. #define GREDRAW_UPDATE  (2) /* incremental update,  e.g. prop slider */
  289. #define GREDRAW_REDRAW  (1) /* redraw gadget    */
  290. #define GREDRAW_TOGGLE  (0) /* toggle highlight,  if applicable  */
  291.  
  292. /* GM_GOACTIVE,  GM_HANDLEINPUT  */
  293.  
  294. STRUCT gpi_Mouse_Struct  
  295.     SHORTINT    X 
  296.     SHORTINT    Y 
  297. END STRUCT 
  298.  
  299. STRUCT gpInput
  300.  
  301.     LONGINT       MethodID 
  302.     GadgetInfoPtr  gpi_GInfo 
  303.     InputEventPtr  gpi_IEvent 
  304.     ADDRESS   gpi_Termination 
  305.     gpi_Mouse_Struct gpi_Mouse 
  306.  
  307.     /* (V39) Pointer to TabletData structure,  if this event originated
  308.      * from a tablet which sends IESUBCLASS_NEWTABLET events,  or NULL if
  309.      * not.
  310.      *
  311.      * DO NOT ATTEMPT TO READ THIS FIELD UNDER INTUITION PRIOR TO V39!
  312.      * IT WILL BE INVALID!
  313.      */
  314.     TabletDataPtr  gpi_TabletData 
  315. END STRUCT 
  316.  
  317. /* GM_HANDLEINPUT and GM_GOACTIVE  return code flags    */
  318. /* return GMR_MEACTIVE (0) alone if you want more input.
  319.  * Otherwise,  return ONE of GMR_NOREUSE and GMR_REUSE,  and optionally
  320.  * GMR_VERIFY.
  321.  */
  322. #define GMR_MEACTIVE    (0)
  323. #define GMR_NOREUSE (&H2)
  324. #define GMR_REUSE   (&H4)
  325. #define GMR_VERIFY  (&H8)    /* you MUST set gpi_Termination */
  326.  
  327. /* New for V37:
  328.  * You can end activation with one of GMR_NEXTACTIVE and GMR_PREVACTIVE, 
  329.  * which instructs Intuition to activate the next or previous gadget
  330.  * that has GFLG_TABCYCLE set.
  331.  */
  332. #define GMR_NEXTACTIVE  (&H10)
  333. #define GMR_PREVACTIVE  (&H20)
  334.  
  335. /* GM_GOINACTIVE */
  336. STRUCT gpGoInactive
  337.  
  338.     LONGINT       MethodID 
  339.     GadgetInfoPtr  gpgi_GInfo 
  340.  
  341.     /* V37 field only!  DO NOT attempt to read under V36! */
  342.     LONGINT       gpgi_Abort  /* gpgi_Abort=1 if gadget was aborted
  343.                      * by Intuition and 0 if gadget went
  344.                      * inactive at its own request
  345.                      */
  346. END STRUCT 
  347.  
  348.  
  349. /* New for V39: Intuition sends GM_LAYOUT to any GREL_ gadget when
  350.  * the gadget is added to the window (or when the window opens,  if
  351.  * the gadget was part of the NewWindow.FirstGadget or the WA_Gadgets
  352.  * list),  or when the window is resized.  Your gadget can set the
  353.  * GA_RelSpecial property to get GM_LAYOUT events without Intuition
  354.  * changing the interpretation of your gadget select box.  This
  355.  * allows for completely arbitrary resizing/repositioning based on
  356.  * window size.
  357.  */
  358. /* GM_LAYOUT */
  359. STRUCT gpLayout
  360.  
  361.     LONGINT       MethodID 
  362.     GadgetInfoPtr  gpl_GInfo 
  363.     LONGINT       gpl_Initial     /* non-zero if this method was invoked
  364.                      * during AddGList() or OpenWindow()
  365.                      * time.  zero if this method was invoked
  366.                      * during window resizing.
  367.                      */
  368. END STRUCT 
  369.  
  370. /* Include obsolete identifiers: */
  371. #ifndef INTUITION_IOBSOLETE_H
  372. #include <intuition/iobsolete.h>
  373. #endif
  374.  
  375. #endif
  376.