home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / cbm / os-include.lha / os-include / intuition / gadgetclass.i < prev    next >
Text File  |  1993-10-15  |  10KB  |  320 lines

  1.     IFND INTUITION_GADGETCLASS_I
  2. INTUITION_GADGETCLASS_I SET 1
  3. **
  4. ** $VER: gadgetclass.i 38.9 (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.     IFND EXEC_TYPES_I
  14.     INCLUDE "exec/types.i"
  15.     ENDC
  16.  
  17.     IFND INTUITION_INTUITION_I
  18.     INCLUDE "intuition/intuition.i"
  19.     ENDC
  20.  
  21.     IFND UTILITY_TAGITEM_I
  22.     INCLUDE "utility/tagitem.i"
  23.     ENDC
  24.  
  25.  
  26. *
  27. * NOTE:  intuition/iobsolete.i is included at the END of this file!
  28. *
  29.  
  30. ; Gadget Class attributes
  31.  
  32. GA_Dummy        EQU    (TAG_USER+$30000)
  33. GA_Left            EQU    (GA_Dummy+$0001)
  34. GA_RelRight        EQU    (GA_Dummy+$0002)
  35. GA_Top            EQU    (GA_Dummy+$0003)
  36. GA_RelBottom        EQU    (GA_Dummy+$0004)
  37. GA_Width        EQU    (GA_Dummy+$0005)
  38. GA_RelWidth        EQU    (GA_Dummy+$0006)
  39. GA_Height        EQU    (GA_Dummy+$0007)
  40. GA_RelHeight        EQU    (GA_Dummy+$0008)
  41. GA_Text            EQU    (GA_Dummy+$0009)  ; ti_Data is (UBYTE *)
  42. GA_Image        EQU    (GA_Dummy+$000A)
  43. GA_Border        EQU    (GA_Dummy+$000B)
  44. GA_SelectRender        EQU    (GA_Dummy+$000C)
  45. GA_Highlight        EQU    (GA_Dummy+$000D)
  46. GA_Disabled        EQU    (GA_Dummy+$000E)
  47. GA_GZZGadget        EQU    (GA_Dummy+$000F)
  48. GA_ID            EQU    (GA_Dummy+$0010)
  49. GA_UserData        EQU    (GA_Dummy+$0011)
  50. GA_SpecialInfo        EQU    (GA_Dummy+$0012)
  51. GA_Selected        EQU    (GA_Dummy+$0013)
  52. GA_EndGadget        EQU    (GA_Dummy+$0014)
  53. GA_Immediate        EQU    (GA_Dummy+$0015)
  54. GA_RelVerify        EQU    (GA_Dummy+$0016)
  55. GA_FollowMouse        EQU    (GA_Dummy+$0017)
  56. GA_RightBorder        EQU    (GA_Dummy+$0018)
  57. GA_LeftBorder        EQU    (GA_Dummy+$0019)
  58. GA_TopBorder        EQU    (GA_Dummy+$001A)
  59. GA_BottomBorder        EQU    (GA_Dummy+$001B)
  60. GA_ToggleSelect        EQU    (GA_Dummy+$001C)
  61.  
  62. * internal use only, until further notice, please
  63. GA_SysGadget        EQU    (GA_Dummy+$001D)
  64. * bool, sets GTYP_SYSGADGET field in type
  65. GA_SysGType        EQU    (GA_Dummy+$001E)
  66. * e.g., GTYP_WUPFRONT, ...
  67.  
  68. GA_Previous        EQU    (GA_Dummy+$001F)
  69. * previous gadget (or (struct Gadget **)) in linked list
  70. * NOTE: This attribute CANNOT be used to link new gadgets
  71. * into the gadget list of an open window or requester.
  72. * You must use AddGList().
  73.  
  74. GA_Next            EQU    (GA_Dummy+$0020)
  75. * not implemented
  76.  
  77. GA_DrawInfo        EQU    (GA_Dummy+$0021)
  78. * some fancy gadgets need to see a DrawInfo
  79. * when created or for layout
  80.  
  81. * You should use at most ONE of GA_Text, GA_IntuiText, and GA_LabelImage
  82. GA_IntuiText        EQU    (GA_Dummy+$0022)
  83. * ti_Data is (struct IntuiText    *)
  84.  
  85. GA_LabelImage        EQU    (GA_Dummy+$0023)
  86. * ti_Data is an image (object), used in place of
  87. * GadgetText
  88.  
  89. GA_TabCycle        EQU    (GA_Dummy+$0024)
  90. * New for V37:
  91. * Boolean indicates that this gadget is to participate in
  92. * cycling activation with Tab or Shift-Tab.
  93.  
  94. GA_GadgetHelp        EQU    (GA_Dummy+$0025)
  95. * New for V39:
  96. * Boolean indicates that this gadget sends gadget-help
  97.  
  98. GA_Bounds        EQU    (GA_Dummy+$0026)
  99. * New for V39:
  100. * ti_Data is a pointer to an IBox structure which is
  101. * to be copied into the extended gadget's bounds.
  102.  
  103. GA_RelSpecial        EQU    (GA_Dummy+$0027)
  104. * New for V39:
  105. * Boolean indicates that this gadget has the "special relativity"
  106. * property, which is useful for certain fancy relativity
  107. * operations through the GM_LAYOUT method.
  108.  
  109. * PROPGCLASS attributes
  110.  
  111. PGA_Dummy        EQU    (TAG_USER+$31000)
  112. PGA_Freedom        EQU    (PGA_Dummy+$0001)
  113. * either or both of FREEVERT and FREEHORIZ
  114. PGA_Borderless        EQU    (PGA_Dummy+$0002)
  115. PGA_HorizPot        EQU    (PGA_Dummy+$0003)
  116. PGA_HorizBody        EQU    (PGA_Dummy+$0004)
  117. PGA_VertPot        EQU    (PGA_Dummy+$0005)
  118. PGA_VertBody        EQU    (PGA_Dummy+$0006)
  119. PGA_Total        EQU    (PGA_Dummy+$0007)
  120. PGA_Visible        EQU    (PGA_Dummy+$0008)
  121. PGA_Top            EQU    (PGA_Dummy+$0009)
  122. ; New for V37:
  123. PGA_NewLook        EQU    (PGA_Dummy+$000A)
  124.  
  125. * STRGCLASS attributes 
  126.  
  127. STRINGA_Dummy          EQU    (TAG_USER+$32000)
  128. STRINGA_MaxChars    EQU    (STRINGA_Dummy+$0001)
  129. * Note:  There is a minor problem with Intuition when using boopsi integer
  130. * gadgets (which are requested by using STRINGA_LongInt).  Such gadgets
  131. * must not have a STRINGA_MaxChars to be bigger than 15.  Setting
  132. * STRINGA_MaxChars for a boopsi integer gadget will cause a mismatched
  133. * FreeMem() to occur.
  134.  
  135. STRINGA_Buffer        EQU    (STRINGA_Dummy+$0002)
  136. STRINGA_UndoBuffer    EQU    (STRINGA_Dummy+$0003)
  137. STRINGA_WorkBuffer    EQU    (STRINGA_Dummy+$0004)
  138. STRINGA_BufferPos    EQU    (STRINGA_Dummy+$0005)
  139. STRINGA_DispPos        EQU    (STRINGA_Dummy+$0006)
  140. STRINGA_AltKeyMap    EQU    (STRINGA_Dummy+$0007)
  141. STRINGA_Font        EQU    (STRINGA_Dummy+$0008)
  142. STRINGA_Pens        EQU    (STRINGA_Dummy+$0009)
  143. STRINGA_ActivePens    EQU    (STRINGA_Dummy+$000A)
  144. STRINGA_EditHook    EQU    (STRINGA_Dummy+$000B)
  145. STRINGA_EditModes    EQU    (STRINGA_Dummy+$000C)
  146.  
  147. * booleans 
  148. STRINGA_ReplaceMode    EQU    (STRINGA_Dummy+$000D)
  149. STRINGA_FixedFieldMode    EQU    (STRINGA_Dummy+$000E)
  150. STRINGA_NoFilterMode    EQU    (STRINGA_Dummy+$000F)
  151.  
  152. STRINGA_Justification    EQU    (STRINGA_Dummy+$0010)
  153. * GACT_STRINGCENTER, GACT_STRINGLEFT, GACT_STRINGRIGHT
  154. STRINGA_LongVal        EQU    (STRINGA_Dummy+$0011)
  155. STRINGA_TextVal        EQU    (STRINGA_Dummy+$0012)
  156.  
  157. STRINGA_ExitHelp    EQU    (STRINGA_Dummy+$0013)
  158. * STRINGA_ExitHelp is new for V37, and ignored by V36.
  159. * Set this if you want the gadget to exit when Help is
  160. * pressed.  Look for a code of 0x5F, the rawkey code for Help
  161.  
  162. SG_DEFAULTMAXCHARS    EQU    (128)
  163.  
  164. * Gadget Layout related attributes
  165.  
  166. LAYOUTA_Dummy         EQU    (TAG_USER+$38000)
  167. LAYOUTA_LayoutObj    EQU    (LAYOUTA_Dummy+$0001)
  168. LAYOUTA_Spacing        EQU    (LAYOUTA_Dummy+$0002)
  169. LAYOUTA_Orientation    EQU    (LAYOUTA_Dummy+$0003)
  170.  
  171. * orientation values
  172. LORIENT_NONE        EQU    0
  173. LORIENT_HORIZ        EQU    1
  174. LORIENT_VERT        EQU    2
  175.  
  176. ; Custom gadget hook command ID's
  177. ; (gadget class method/message ID's)
  178.  
  179. GM_HITTEST EQU        0    ; return GMR_GADGETHIT if you are clicked
  180.                 ; (whether or not you are disabled)
  181. GM_RENDER EQU        1    ; draw yourself, in the appropriate state
  182. GM_GOACTIVE EQU        2    ; you are now going to be fed input
  183. GM_HANDLEINPUT EQU    3    ; handle that input
  184. GM_GOINACTIVE EQU    4    ; whether or not by choice, you are done
  185. GM_HELPTEST EQU        5    ; Will you send gadget help if the mouse is
  186.                 ; at the specified coordinates?  See below
  187.                 ; for possible GMR_ values.
  188. GM_LAYOUT EQU        6    ; re-evaluate your size based on the GadgetInfo
  189.                 ; Domain.  Do NOT re-render yourself yet, you
  190.                 ; will be called when it is time...
  191.  
  192. ; Parameter "Messages" passed to gadget class methods
  193.  
  194. ; All parameter structure begin with a MethodID field
  195. ; This definition of an abstract generic "message" is
  196. ; equivalent to a better one in intuition/classusr.i, but
  197. ; it's left here for historic reasons
  198.  STRUCTURE MsgHeader,0
  199.     ULONG    MethodID
  200.     LABEL    methodid_SIZEOF
  201.  
  202. ; GM_HITTEST and GM_HELPTEST send this message.
  203. ; For GM_HITTEST, gpht_Mouse are coordinates relative to the gadget
  204. ; select box.  For GM_HELPTEST, the coordinates are relative to
  205. ; the gadget bounding box (which defaults to the select box).
  206.  STRUCTURE    gpHitTest,methodid_SIZEOF
  207.     APTR    gpht_GInfo
  208.     WORD    gpht_MouseX
  209.     WORD    gpht_MouseY
  210.  
  211. ; For GM_HITTEST, return GMR_GADGETHIT if you were indeed hit,
  212. ; otherwise return zero.
  213. ;
  214. ; For GM_HELPTEST, return GMR_NOHELPHIT (zero) if you were not hit.
  215. ; Typically, return GMR_HELPHIT if you were hit.
  216. ; It is possible to pass a UWORD to the application via the Code field
  217. ; of the IDCMP_GADGETHELP message.  Return GMR_HELPCODE or'd with
  218. ; the UWORD-sized result you wish to return.
  219. ;
  220. ; GMR_HELPHIT yields a Code value of ((UWORD) ~0), which should
  221. ; mean "nothing particular" to the application.
  222.  
  223. GMR_GADGETHIT    EQU $00000004    ; GM_HITTEST hit
  224.  
  225. GMR_NOHELPHIT    EQU $00000000    ; GM_HELPTEST didn't hit
  226. GMR_HELPHIT    EQU $FFFFFFFF    ; GM_HELPTEST hit, return code = ~0
  227. GMR_HELPCODE    EQU $00010000    ; GM_HELPTEST hit, return low word as code
  228.  
  229. ; GM_RENDER
  230.  STRUCTURE    gpRender,methodid_SIZEOF
  231.     APTR    gpr_GInfo    ; gadget context
  232.     APTR    gpr_RPort    ; all ready for use
  233.     LONG    gpr_Redraw    ; might be a "highlight pass"
  234.  
  235. ; values of gpr_Redraw
  236. GREDRAW_UPDATE    EQU 2    ; update for change in attributesvalues
  237. GREDRAW_REDRAW    EQU 1    ; redraw gadget
  238. GREDRAW_TOGGLE    EQU 0    ; toggle highlight, if applicable
  239.  
  240. ; GM_GOACTIVE, GM_HANDLEINPUT
  241.  STRUCTURE    gpInput,methodid_SIZEOF
  242.     APTR    gpi_GInfo
  243.     APTR    gpi_IEvent
  244.     APTR    gpi_Termination
  245.     WORD    gpi_MouseX
  246.     WORD    gpi_MouseY
  247.  
  248.     ; (V39) Pointer to TabletData structure, if this event originated
  249.     ; from a tablet which sends IESUBCLASS_NEWTABLET events, or NULL if
  250.     ; not.
  251.     ;
  252.     ; DO NOT ATTEMPT TO READ THIS FIELD UNDER INTUITION PRIOR TO V39!
  253.     ; IT WILL BE INVALID!
  254.     APTR    gpi_TabletData
  255.  
  256. ; GM_HANDLEINPUT and GM_GOACTIVE  return code flags
  257. ; return GMR_MEACTIVE (0) alone if you want more input.
  258. ; Otherwise, return ONE of GMR_NOREUSE and GMR_REUSE, and optionally
  259. ; GMR_VERIFY.
  260.  
  261. ; here are the original constant "equates"
  262. GMR_MEACTIVE    EQU $0000    ; (bugfix: was $0001 during beta)
  263. GMR_NOREUSE    EQU $0002
  264. GMR_REUSE    EQU $0004
  265. GMR_VERIFY    EQU $0008    ; you MUST set gpi_Termination
  266.  
  267. * New for V37:
  268. * You can end activation with one of GMR_NEXTACTIVE and GMR_PREVACTIVE,
  269. * which instructs Intuition to activate the next or previous gadget
  270. * that has GFLG_TABCYCLE set.
  271. *
  272. GMR_NEXTACTIVE    EQU $0010
  273. GMR_PREVACTIVE    EQU $0020
  274.  
  275. ; here are standard bit/flag pairs
  276. GMRB_NOREUSE    EQU 1
  277. GMRB_REUSE    EQU 2
  278. GMRB_VERIFY    EQU 3
  279. GMRB_NEXTACTIVE    EQU 4
  280. GMRB_PREVACTIVE    EQU 5
  281.  
  282. GMRF_NOREUSE    EQU $0002
  283. GMRF_REUSE    EQU $0004
  284. GMRF_VERIFY    EQU $0008
  285. GMRF_NEXTACTIVE    EQU $0010
  286. GMRF_PREVACTIVE    EQU $0020
  287.  
  288. ; GM_GOINACTIVE
  289.  STRUCTURE    gpGoInactive,methodid_SIZEOF
  290.     APTR    gpgi_GInfo
  291.  
  292. * V37 field only!  DO NOT attempt to read under V36!
  293.     ULONG    gpgi_Abort    ; gpgi_Abort=1 if gadget was aborted
  294.                 ; by Intuition and 0 if gadget went
  295.                 ; inactive at its own request
  296.  
  297. * New for V39: Intuition sends GM_LAYOUT to any GREL_ gadget when
  298. * the gadget is added to the window (or when the window opens, if
  299. * the gadget was part of the NewWindow.FirstGadget or the WA_Gadgets
  300. * list), or when the window is resized.  Your gadget can set the
  301. * GA_RelSpecial property to get GM_LAYOUT events without Intuition
  302. * changing the interpretation of your gadget select box.  This
  303. * allows for completely arbitrary resizing/repositioning based on
  304. * window size.
  305.  
  306. ; GM_LAYOUT
  307.  STRUCTURE    gpLayout,methodid_SIZEOF
  308.     APTR    gpl_GInfo
  309.     APTR    gpl_Initial    ; non-zero if this method was invoked
  310.                 ; during AddGList() or OpenWindow()
  311.                 ; time.  zero if this method was invoked
  312.                 ; during window resizing.
  313.  
  314. * Include obsolete identifiers:
  315.     IFND    INTUITION_IOBSOLETE_I
  316.     INCLUDE "intuition/iobsolete.i"
  317.     ENDC
  318.  
  319.     ENDC
  320.