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

  1.     IFND LIBRARIES_GADTOOLS_I
  2. LIBRARIES_GADTOOLS_I    SET    1
  3. **
  4. **    $VER: gadtools.i 39.12 (24.8.93)
  5. **    Includes Release 40.15
  6. **
  7. **    gadtools.library definitions
  8. **
  9. **    (C) Copyright 1989-1993 Commodore-Amiga, Inc.
  10. **    All Rights Reserved.
  11. **
  12.  
  13. *------------------------------------------------------------------------*
  14.  
  15.     IFND EXEC_TYPES_I
  16.     INCLUDE "exec/types.i"
  17.     ENDC
  18.  
  19.     IFND UTILITY_TAGITEM_I
  20.     INCLUDE "utility/tagitem.i"
  21.     ENDC
  22.  
  23.     IFND INTUITION_INTUITION_I
  24.     INCLUDE "intuition/intuition.i"
  25.     ENDC
  26.  
  27. *------------------------------------------------------------------------*
  28.  
  29. * The kinds (almost classes) of gadgets that GadTools supports.
  30. * Use these identifiers when calling CreateGadgetA()
  31.  
  32. GENERIC_KIND    EQU    0
  33. BUTTON_KIND    EQU    1
  34. CHECKBOX_KIND    EQU    2
  35. INTEGER_KIND    EQU    3
  36. LISTVIEW_KIND    EQU    4
  37. MX_KIND        EQU    5
  38. NUMBER_KIND    EQU    6
  39. CYCLE_KIND    EQU    7
  40. PALETTE_KIND    EQU    8
  41. SCROLLER_KIND    EQU    9
  42. * Kind number 10 is reserved
  43. SLIDER_KIND    EQU    11
  44. STRING_KIND    EQU    12
  45. TEXT_KIND    EQU    13
  46.  
  47. NUM_KINDS    EQU    14
  48.  
  49. *------------------------------------------------------------------------*
  50.  
  51. * 'Or' the appropriate set together for your Window IDCMPFlags: *
  52.  
  53. ARROWIDCMP    EQU    GADGETUP!GADGETDOWN!INTUITICKS!MOUSEBUTTONS
  54.  
  55. BUTTONIDCMP    EQU    GADGETUP
  56. CHECKBOXIDCMP    EQU    GADGETUP
  57. INTEGERIDCMP    EQU    GADGETUP
  58. LISTVIEWIDCMP    EQU    GADGETUP!GADGETDOWN!MOUSEMOVE!ARROWIDCMP
  59.  
  60. MXIDCMP        EQU    GADGETDOWN
  61. NUMBERIDCMP    EQU    0
  62. CYCLEIDCMP    EQU    GADGETUP
  63. PALETTEIDCMP    EQU    GADGETUP
  64.  
  65. * Use ARROWIDCMP!SCROLLERIDCMP if your scrollers have arrows: *
  66. SCROLLERIDCMP    EQU    GADGETUP!GADGETDOWN!MOUSEMOVE
  67. SLIDERIDCMP    EQU    GADGETUP!GADGETDOWN!MOUSEMOVE
  68. STRINGIDCMP    EQU    GADGETUP
  69.  
  70. TEXTIDCMP    EQU    0
  71.  
  72. *------------------------------------------------------------------------*
  73.  
  74. * Generic NewGadget used by several of the gadget classes: *
  75.  
  76.     STRUCTURE NewGadget,0
  77.  
  78.     WORD    gng_LeftEdge
  79.     WORD    gng_TopEdge    ; gadget position
  80.     WORD    gng_Width
  81.     WORD    gng_Height    ; gadget size
  82.     APTR    gng_GadgetText    ; gadget label
  83.     APTR    gng_TextAttr    ; desired font for gadget label
  84.     UWORD    gng_GadgetID    ; gadget ID
  85.     ULONG    gng_Flags    ; see below
  86.     APTR    gng_VisualInfo    ; Set to retval of GetVisualInfo()
  87.     APTR    gng_UserData    ; gadget UserData
  88.  
  89.     LABEL    gng_SIZEOF
  90.  
  91. * ng_Flags control certain aspects of the gadget.  The first five control
  92. * the placement of the descriptive text.  Each gadget kind has its default,
  93. * which is usually PLACETEXT_LEFT.  Consult the autodocs for details.
  94.  
  95. PLACETEXT_LEFT    EQU    $0001    * Right-align text on left side
  96. PLACETEXT_RIGHT    EQU    $0002    * Left-align text on right side
  97. PLACETEXT_ABOVE    EQU    $0004    * Center text above
  98. PLACETEXT_BELOW    EQU    $0008    * Center text below
  99. PLACETEXT_IN    EQU    $0010    * Center text on
  100.  
  101. NG_HIGHLABEL    EQU    $0020    * Highlight the label
  102.  
  103. *------------------------------------------------------------------------*
  104.  
  105. * Fill out an array of these and pass that to CreateMenus():
  106.  
  107.     STRUCTURE NewMenu,0
  108.  
  109.     UBYTE    gnm_Type        ; See below
  110.     UBYTE    gnm_Pad            ; alignment padding
  111.     APTR    gnm_Label        ; Menu's label
  112.     APTR    gnm_CommKey        ; MenuItem Command Key Equiv
  113.     UWORD    gnm_Flags        ; Menu or MenuItem flags (see note)
  114.     LONG    gnm_MutualExclude    ; MenuItem MutualExclude word
  115.     APTR    gnm_UserData        ; For your own use, see note
  116.  
  117.     LABEL    gnm_SIZEOF
  118.  
  119. * Needed only by inside IM_ definitions below */
  120. MENU_IMAGE    EQU    128
  121.  
  122. * nm_Type determines what each NewMenu structure corresponds to.
  123. * for the NM_TITLE, NM_ITEM, and NM_SUB values, nm_Label should
  124. * be a text string to use for that menu title, item, or sub-item.
  125. * For IM_ITEM or IM_SUB, set nm_Label to point at the Image structure
  126. * you wish to use for this item or sub-item.
  127. * NOTE: At present, you may only use conventional images.
  128. * Custom images created from Intuition image-classes do not work.
  129. NM_TITLE    EQU    1    * Menu header
  130. NM_ITEM        EQU    2    * Textual menu item
  131. NM_SUB        EQU    3    * Textual menu sub-item
  132.  
  133. IM_ITEM        EQU    NM_ITEM!MENU_IMAGE    * Graphical menu item
  134. IM_SUB        EQU    NM_SUB!MENU_IMAGE    * Graphical menu sub-item
  135.  
  136. * The NewMenu array should be terminated with a NewMenu whose
  137. * nm_Type equals NM_END.
  138. NM_END        EQU    0    * End of NewMenu array
  139.  
  140. * Starting with V39, GadTools will skip any NewMenu entries whose
  141. * nm_Type field has the NM_IGNORE bit set.
  142. NM_IGNORE    EQU    64
  143.  
  144.  
  145. * nm_Label should be a text string for textual items, a pointer
  146. * to an Image structure for graphical menu items, or the special
  147. * constant NM_BARLABEL, to get a separator bar.
  148. NM_BARLABEL    EQU    -1
  149.  
  150.  
  151. * The nm_Flags field is used to fill out either the Menu->Flags or
  152. * MenuItem->Flags field.  Note that the sense of the MENUENABLED or
  153. * ITEMENABLED bit is inverted between this use and Intuition's use,
  154. * in other words, NewMenus are enabled by default.  The following
  155. * labels are provided to disable them:
  156. NM_MENUDISABLED        EQU    MENUENABLED
  157. NM_ITEMDISABLED        EQU    ITEMENABLED
  158.  
  159. * New for V39:    NM_COMMANDSTRING.  For a textual MenuItem or SubItem,
  160. * point nm_CommKey at an arbitrary string, and set the NM_COMMANDSTRING
  161. * flag.
  162. NM_COMMANDSTRING    EQU    COMMSEQ
  163.  
  164. * The following are pre-cleared (COMMSEQ, ITEMTEXT, and HIGHxxx are set
  165. * later as appropriate):
  166. * Under V39, the COMMSEQ flag bit is not cleared, since it now has
  167. * meaning.
  168. NM_FLAGMASK        EQU    ~(COMMSEQ!ITEMTEXT!HIGHFLAGS)
  169. NM_FLAGMASK_V39        EQU    ~(ITEMTEXT!HIGHFLAGS)
  170.  
  171. * You may choose among CHECKIT, MENUTOGGLE, and CHECKED.
  172. * Toggle-select menuitems are of type CHECKIT!MENUTOGGLE, along
  173. * with CHECKED if currently selected.  Mutually exclusive ones
  174. * are of type CHECKIT, and possibly CHECKED too.  The nm_MutualExclude
  175. * is a bit-wise representation of the items excluded by this one,
  176. * so in the simplest case (choose 1 among n), these flags would be
  177. * ~1, ~2, ~4, ~8, ~16, etc.  See the Intuition Menus chapter.
  178.  
  179. * A UserData pointer can be associated with each Menu and MenuItem structure.
  180. * The CreateMenus() call allocates space for a UserData after each
  181. * Menu or MenuItem (header, item or sub-item).    You should use the
  182. * GTMENU_USERDATA or GTMENUITEM_USERDATA macro to extract it. */
  183.  
  184. GTMENU_USERDATA    MACRO
  185.         move.l    mu_SIZEOF(\1),\2
  186.         ENDM
  187.  
  188. GTMENUITEM_USERDATA    MACRO
  189.         move.l    mi_SIZEOF(\1),\2
  190.         ENDM
  191.  
  192. * Here is an old one for compatibility.  Do not use in new code!
  193. MENU_USERDATA    MACRO
  194.         move.l    mi_SIZEOF(\1),\2
  195.         ENDM
  196.  
  197.  
  198. * These return codes can be obtained through the GTMN_SecondaryError tag:
  199. GTMENU_TRIMMED    EQU    $00000001    ; Too many menus, items, or subitems,
  200.                     ; menu has been trimmed down
  201. GTMENU_INVALID    EQU    $00000002    ; Invalid NewMenu array
  202. GTMENU_NOMEM    EQU    $00000003    ; Out of memory
  203.  
  204.  
  205. *------------------------------------------------------------------------*
  206.  
  207. * Starting with V39, checkboxes and mx gadgets can be scaled to your
  208. * specified gadget width/height.  Use the new GTCB_Scaled or GTMX_Scaled
  209. * tags, respectively.  Under V37, and by default in V39, the imagery
  210. * is of the following fixed size:
  211.  
  212. * MX gadget default dimensions:
  213. MX_WIDTH    EQU    17
  214. MX_HEIGHT    EQU    9
  215.  
  216. * Checkbox default dimensions:
  217. CHECKBOX_WIDTH    EQU    26
  218. CHECKBOX_HEIGHT    EQU    11
  219.  
  220. *------------------------------------------------------------------------*
  221.  
  222. * Tags for GadTools functions:
  223.  
  224. GT_TagBase    EQU    TAG_USER+$80000 ; Begin counting tags
  225.  
  226. GTVI_NewWindow    EQU    GT_TagBase+1    ; NewWindow struct for GetVisualInfo
  227. GTVI_NWTags    EQU    GT_TagBase+2    ; NWTags for GetVisualInfo
  228.  
  229. GT_Private0    EQU    GT_TagBase+3    ; (private)
  230.  
  231. GTCB_Checked    EQU    GT_TagBase+4    ; State of checkbox
  232.  
  233. GTLV_Top    EQU    GT_TagBase+5    ; Top visible one in listview
  234. GTLV_Labels    EQU    GT_TagBase+6    ; List to display in listview
  235. GTLV_ReadOnly    EQU    GT_TagBase+7    ; TRUE if listview is to be read-only
  236. GTLV_ScrollWidth    EQU    GT_TagBase+8    ; Width of scrollbar
  237.  
  238. GTMX_Labels    EQU    GT_TagBase+9    ; NULL-terminated array of labels
  239. GTMX_Active    EQU    GT_TagBase+10    ; Active one in mx gadget
  240.  
  241. GTTX_Text    EQU    GT_TagBase+11    ; Text to display
  242. GTTX_CopyText    EQU    GT_TagBase+12    ; Copy text label instead of referencing it
  243.  
  244. GTNM_Number    EQU    GT_TagBase+13    ; Number to display
  245.  
  246. GTCY_Labels    EQU    GT_TagBase+14    ; NULL-terminated array of labels
  247. GTCY_Active    EQU    GT_TagBase+15    ; The active one in the cycle gad
  248.  
  249. GTPA_Depth    EQU    GT_TagBase+16    ; Number of bitplanes in palette
  250. GTPA_Color    EQU    GT_TagBase+17    ; Palette color
  251. GTPA_ColorOffset    EQU    GT_TagBase+18    ; First color to use in palette
  252. GTPA_IndicatorWidth    EQU    GT_TagBase+19    ; Width of current-color indicator
  253. GTPA_IndicatorHeight    EQU    GT_TagBase+20    ; Height of current-color indicator
  254.  
  255. GTSC_Top    EQU    GT_TagBase+21    ; Top visible in scroller
  256. GTSC_Total    EQU    GT_TagBase+22    ; Total in scroller area
  257. GTSC_Visible    EQU    GT_TagBase+23    ; Number visible in scroller
  258. GTSC_Overlap    EQU    GT_TagBase+24    ; Unused
  259.  
  260. * GT_TagBase+25 through GT_TagBase+37 are reserved
  261.  
  262. GTSL_Min    EQU    GT_TagBase+38    ; Slider min value
  263. GTSL_Max    EQU    GT_TagBase+39    ; Slider max value
  264. GTSL_Level    EQU    GT_TagBase+40    ; Slider level
  265. GTSL_MaxLevelLen    EQU    GT_TagBase+41    ; Max length of printed level
  266. GTSL_LevelFormat    EQU    GT_TagBase+42    ; Format string for level
  267. GTSL_LevelPlace    EQU    GT_TagBase+43    ; Where level should be placed
  268. GTSL_DispFunc    EQU    GT_TagBase+44    ; Callback for number calculation before display
  269.  
  270. GTST_String    EQU    GT_TagBase+45    ; String gadget's displayed string
  271. GTST_MaxChars    EQU    GT_TagBase+46    ; Max length of string
  272.  
  273. GTIN_Number    EQU    GT_TagBase+47    ; Number in integer gadget
  274. GTIN_MaxChars    EQU    GT_TagBase+48    ; Max number of digits
  275.  
  276. GTMN_TextAttr    EQU    GT_TagBase+49    ; MenuItem font TextAttr
  277. GTMN_FrontPen    EQU    GT_TagBase+50    ; MenuItem text pen color
  278.  
  279. GTBB_Recessed    EQU    GT_TagBase+51    ; Make BevelBox recessed
  280.  
  281. GT_VisualInfo    EQU    GT_TagBase+52    ; result of VisualInfo call
  282.  
  283. GTLV_ShowSelected    EQU    GT_TagBase+53    ; show selected entry beneath listview,
  284.              ; set tag data = NULL for display-only, or pointer
  285.             ; to a string gadget you've created
  286. GTLV_Selected    EQU    GT_TagBase+54    ; Set ordinal number of selected entry in the list
  287. GT_Reserved1    EQU    GT_TagBase+56    ; Reserved for future use
  288.  
  289. GTTX_Border    EQU    GT_TagBase+57    ; Put a border around Text-display gadgets
  290. GTNM_Border    EQU    GT_TagBase+58    ; Put a border around Number-display gadgets
  291.  
  292. GTSC_Arrows    EQU    GT_TagBase+59    ; Specify size of arrows for scroller
  293. GTMN_Menu    EQU    GT_TagBase+60    ; Pointer to Menu for use by
  294.             ; LayoutMenuItems()
  295. GTMX_Spacing    EQU    GT_TagBase+61    ; Added to font height to
  296.             ; figure spacing between mx choices.  Use this
  297.             ; instead of LAYOUTA_SPACING for mx gadgets.
  298.  
  299. * New to V37 GadTools.    Ignored by GadTools V36.
  300. GTMN_FullMenu    EQU    GT_TagBase+62  ; Asks CreateMenus() to
  301.         ; validate that this is a complete menu structure
  302. GTMN_SecondaryError    EQU    GT_TagBase+63  ; ti_Data is a pointer
  303.         ; to a ULONG to receive error reports from CreateMenus()
  304. GT_Underscore    EQU    GT_TagBase+64    ; ti_Data points to the symbol
  305.         ; that preceeds the character you'd like to underline in a
  306.         ; gadget label
  307. GTST_EditHook    EQU    GT_TagBase+55    ; String EditHook
  308. GTIN_EditHook    EQU    GTST_EditHook    ; Same thing, different name,
  309.         ; just to round out INTEGER_KIND gadgets
  310.  
  311.  
  312. * New to V39 GadTools.  Ignored by GadTools V36 and V37
  313. GTMN_Checkmark    EQU    GT_TagBase+65    ; ti_Data is checkmark img to use
  314. GTMN_AmigaKey    EQU    GT_TagBase+66    ; ti_Data is Amiga-key img to use
  315. GTMN_NewLookMenus    EQU    GT_TagBase+67 ; ti_Data is boolean
  316.  
  317. * New to V39 GadTools.  Ignored by GadTools V36 and V37.
  318. * Set to TRUE if you want the checkbox or mx image scaled to
  319. * the gadget width/height you specify.  Defaults to FALSE,
  320. * for compatibility.
  321. GTCB_Scaled    EQU    GT_TagBase+68    ; ti_Data is boolean
  322. GTMX_Scaled    EQU    GT_TagBase+69    ; ti_Data is boolean
  323.  
  324. GTPA_NumColors    EQU    GT_TagBase+70    ; Number of colors in palette
  325.  
  326. GTMX_TitlePlace      EQU GT_TagBase+71      ; Where to put the title
  327.  
  328. GTTX_FrontPen        EQU GT_TagBase+72      ; Text color in TEXT_KIND gad
  329. GTTX_BackPen         EQU GT_TagBase+73      ; Bgrnd color in TEXT_KIND gad
  330. GTTX_Justification   EQU GT_TagBase+74      ; See GTJ_#? constants
  331.  
  332. GTNM_FrontPen        EQU GT_TagBase+72      ; Text color in NUMBER_KIND gad
  333. GTNM_BackPen         EQU GT_TagBase+73      ; Bgrnd color in NUMBER_KIND gad
  334. GTNM_Justification   EQU GT_TagBase+74      ; See GTJ_#? constants
  335. GTNM_Format          EQU GT_TagBase+75      ; Formatting string for number
  336. GTNM_MaxNumberLen    EQU GT_TagBase+76      ; Maximum length of number
  337.  
  338. GTBB_FrameType       EQU GT_TagBase+77      ; defines what kind of boxes
  339.                                             ; DrawBevelBox() renders. See
  340.                                             ; the BBFT_#? constants for
  341.                                             ; possible values
  342.  
  343. GTLV_MakeVisible     EQU GT_TagBase+78      ; Make this item visible
  344.  
  345. GTSL_MaxPixelLen     EQU GT_TagBase+80      ; Max pixel size of level display
  346. GTSL_Justification   EQU GT_TagBase+81      ; how should the level be displayed
  347.  
  348. GTPA_ColorTable      EQU GT_TagBase+82      ; colors to use in palette
  349.  
  350. GTTX_Clipped         EQU GT_TagBase+85         ; make a TEXT_KIND clip text
  351. GTNM_Clipped         EQU GT_TagBase+85         ; make a NUMBER_KIND clip text
  352.  
  353. * Old definition, now obsolete:
  354. GT_Reserved0    EQU    GTST_EditHook
  355.  
  356. *------------------------------------------------------------------------*
  357.  
  358. * Justification types for GTTX_Justification and GTNM_Justification tags *
  359. GTJ_LEFT   EQU 0
  360. GTJ_RIGHT  EQU 1
  361. GTJ_CENTER EQU 2
  362.  
  363. *------------------------------------------------------------------------*
  364.  
  365. * Bevel box frame types for GTBB_FrameType tag
  366. BBFT_BUTTON     EQU 1  * Standard button gadget box
  367. BBFT_RIDGE     EQU 2  * Standard string gadget box
  368. BBFT_ICONDROPBOX EQU 3  * Standard icon drop box
  369.  
  370. *------------------------------------------------------------------------*
  371.  
  372. * Typical suggested spacing between "elements": *
  373. INTERWIDTH    EQU    8
  374. INTERHEIGHT    EQU    4
  375.  
  376. *------------------------------------------------------------------------*
  377.  
  378. * "NWay" is an old synonym for cycle gadgets
  379.  
  380. NWAY_KIND    EQU    CYCLE_KIND
  381. NWAYIDCMP    EQU    CYCLEIDCMP
  382.  
  383. GTNW_Labels    EQU    GTCY_Labels
  384. GTNW_Active    EQU    GTCY_Active
  385.  
  386. *------------------------------------------------------------------------*
  387.  
  388. * These two definitions are obsolete, but are here for backwards
  389. * compatibility.  You never need to worry about these:
  390. GADTOOLBIT    EQU    $8000
  391.  
  392. * Use this mask to isolate the user part: *
  393. GADTOOLMASK    EQU    ~GADTOOLBIT
  394.  
  395. *------------------------------------------------------------------------*
  396.  
  397. * These definitions are for the GTLV_CallBack tag
  398.  
  399. * The different types of messages that a listview callback hook can see
  400. LV_DRAW             equ $202    ; draw yourself, with state
  401.  
  402. * Possible return values from a callback hook
  403. LVCB_OK              equ 0    ; callback understands this message type
  404. LVCB_UNKNOWN         equ 1    ; callback does not understand this message
  405.  
  406. * states for LVDrawMsg.lvdm_State
  407. LVR_NORMAL         equ 0      ; the usual
  408. LVR_SELECTED         equ 1    ; for selected gadgets
  409. LVR_NORMALDISABLED   equ 2    ; for disabled gadgets
  410. LVR_SELECTEDDISABLED equ 8    ; disabled and selected
  411.  
  412. * structure of LV_DRAW messages, object is a (struct Node *)
  413.    STRUCTURE LVDrawMsg,0
  414.     ULONG    lvdm_MethodID        ; LV_DRAW
  415.     APTR    lvdm_RastPort        ; where to render to
  416.     APTR    lvdm_DrawInfo        ; useful to have around
  417.     STRUCT  lvdm_Bounds,ra_SIZEOF   ; limits of where to render
  418.     ULONG    lvdm_State        ; how to render
  419.  
  420. *------------------------------------------------------------------------*
  421.  
  422.     ENDC
  423.