home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / guis / gadutil / include / libraries / gadutil.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-16  |  21.0 KB  |  588 lines

  1. #ifndef LIBRARIES_GADUTIL_H
  2. #define LIBRARIES_GADUTIL_H
  3. /*------------------------------------------------------------------------**
  4. **
  5. **    $VER: gadutil.h 37.7 (12.07.96)
  6. **
  7. **    Filename:    libraries/gadutil.h
  8. **    Version:    37.7
  9. **    Date:        12-Jul-96
  10. **
  11. **    GadUtil definitions, a dynamic gadget layout system.
  12. **
  13. **    © Copyright 1994-1996 by P-O Yliniemi and Staffan Hämälä.
  14. **
  15. **    All Rights Reserved.
  16. **
  17. **------------------------------------------------------------------------*/
  18.  
  19. #ifndef EXEC_TYPES_H
  20. #include <exec/types.h>
  21. #endif
  22.  
  23. #ifndef EXEC_LIBRARIES_H
  24. #include <exec/libraries.h>
  25. #endif
  26.  
  27. #ifndef UTILITY_TAGITEM_H
  28. #include <utility/tagitem.h>
  29. #endif
  30.  
  31. #ifndef INTUITION_INTUITION_H
  32. #include <intuition/intuition.h>
  33. #endif
  34.  
  35. /*------------------------------------------------------------------------**
  36. **
  37. ** Extended gadget types available in GadUtil.library.
  38. **
  39. */
  40.  
  41. #define IMAGE_KIND    50
  42. #define LABEL_KIND    51
  43. #define DRAWER_KIND    52
  44. #define FILE_KIND    53
  45. #define BEVELBOX_KIND    54
  46. #define PROGRESS_KIND    55
  47.  
  48. /*-------------------- Reserved GadgetID's - don't use! ------------------**
  49. **
  50. ** GadgetID's are really word sized, but two of these vaules are used by the
  51. ** GU_HelpGadget tag, so don't use -1 (65535), -2 (65534) or -3 (65533) as
  52. ** GadgetID!
  53. **
  54. */
  55.  
  56. #define GADID_RESERVED    0xFFFFFFFF
  57. #define WINTITLE_HELP    0xFFFFFFFE
  58. #define SCRTITLE_HELP    0xFFFFFFFD
  59.  
  60. /*--------------- Minimum recommended sizes for some gadgets -------------*/
  61. #define FILEKIND_WIDTH  20
  62. #define FILEKIND_HEIGHT 14
  63.  
  64. #define DRAWERKIND_WIDTH  20
  65. #define DRAWERKIND_HEIGHT 14
  66.  
  67. /*------------------ Text placement for LABEL_KIND -----------------------**
  68. **
  69. **    ___1_____2_____3___
  70. **    |_____|_____|_____| A    Nine different placements of the text is
  71. **    |_____|_____|_____| B    possible if the size of the box allows it.
  72. **    |_____|_____|_____| C    The flags are the same as for BEVELBOX_KIND
  73. */
  74.  
  75. #define LB_TEXT_TOP    0    /* Place text on line A of the box   */
  76.  
  77. #define LB_TEXT_MIDDLE    1    /* Place text on line B of the box   */
  78.  
  79. #define LB_TEXT_BOTTOM    2    /* Place text on line C of the box   */
  80.  
  81. #define LB_TEXT_CENTER    0    /* Place text in column 2 of the box */
  82.  
  83. #define LB_TEXT_LEFT    4    /* Place text in column 1 of the box */
  84.  
  85. #define LB_TEXT_RIGHT    8    /* Place text in column 3 of the box */
  86.  
  87. /*----------------- Alternatives for text placement flags ----------------*/
  88. #define LB_TEXT_TOP_CENTER    LB_TEXT_TOP|LB_TEXT_CENTER
  89. #define LB_TEXT_TOP_LEFT    LB_TEXT_TOP|LB_TEXT_LEFT
  90. #define LB_TEXT_TOP_RIGHT    LB_TEXT_TOP|LB_TEXT_RIGHT
  91.  
  92. #define LB_TEXT_MIDDLE_CENTER    LB_TEXT_MIDDLE|LB_TEXT_CENTER
  93. #define LB_TEXT_MIDDLE_LEFT    LB_TEXT_MIDDLE|LB_TEXT_LEFT
  94. #define LB_TEXT_MIDDLE_RIGHT    LB_TEXT_MIDDLE|LB_TEXT_RIGHT
  95.  
  96. #define LB_TEXT_BOTTOM_CENTER    LB_TEXT_BOTTOM|LB_TEXT_CENTER
  97. #define LB_TEXT_BOTTOM_LEFT    LB_TEXT_BOTTOM|LB_TEXT_LEFT
  98. #define LB_TEXT_BOTTOM_RIGHT    LB_TEXT_BOTTOM|LB_TEXT_RIGHT
  99.  
  100. /*---------------------- Text shadow placement flags ---------------------*/
  101. #define LB_SHADOW_DR    0    /* Place the shadow at x+1, y+1   */
  102. #define LB_SHADOW_UR    16    /* Place the shadow at x+1, y-1   */
  103. #define LB_SHADOW_DL    32    /* Place the shadow at x-1, y+1   */
  104. #define LB_SHADOW_UL    48    /* Place the shadow at x-1, y-1   */
  105.  
  106. /*------------ Alternatives for text shadow placement flags --------------*/
  107. #define LB_SUNAT_UL    0    /* Place the shadow at x+1, y+1   */
  108. #define LB_SUNAT_DL    16    /* Place the shadow at x+1, y-1   */
  109. #define LB_SUNAT_UR    32    /* Place the shadow at x-1, y+1   */
  110. #define LB_SUNAT_DR    48    /* Place the shadow at x-1, y-1   */
  111.  
  112. #define LB_3DTEXT    64    /* Alternative to GULB_3DText, TRUE   */
  113.  
  114. /*-------------------------- Bevel box frame types -----------------------*/
  115. #define BFT_BUTTON    0    /* Normal button bevel box border */
  116. #define BFT_RIDGE    1    /* STRING_KIND bevel box border   */
  117. #define BFT_DROPBOX    2    /* Icon dropbox type border      */
  118.  
  119. #define BFT_HORIZBAR    10    /* Horizontal shadowed line       */
  120. #define BFT_VERTBAR    11    /* Vertical shadowed line         */
  121.  
  122. /*------------------ Text placement for BEVELBOX_KIND --------------------*/
  123. #define BB_TEXT_ABOVE    0    /* Place bevel box text above the
  124.                  * upper border   ___ Example ___ */
  125.  
  126. #define BB_TEXT_IN    1    /* Place bevel box text centered at
  127.                  * the upper border --- Example --- */
  128.  
  129. #define BB_TEXT_BELOW    2    /* Place bevel box text below the
  130.                  * upper border   ___        ___
  131.                  *                    Example      */
  132.  
  133. #define BB_TEXT_CENTER    0    /* Place the text centered at the
  134.                  * upper border (default)         */
  135.  
  136. #define BB_TEXT_LEFT    4    /* Place the text left adjusted   */
  137.  
  138. #define BB_TEXT_RIGHT    8    /* Place the text right adjusted  */
  139.  
  140. /*--------------- Alternatives to text placement flags -------------------*/
  141. #define BB_TEXT_ABOVE_CENTER    BB_TEXT_ABOVE|BB_TEXT_CENTER
  142. #define BB_TEXT_ABOVE_LEFT    BB_TEXT_ABOVE|BB_TEXT_LEFT
  143. #define BB_TEXT_ABOVE_RIGHT    BB_TEXT_ABOVE|BB_TEXT_RIGHT
  144.  
  145. #define BB_TEXT_IN_CENTER    BB_TEXT_IN|BB_TEXT_CENTER
  146. #define BB_TEXT_IN_LEFT        BB_TEXT_IN|BB_TEXT_LEFT
  147. #define BB_TEXT_IN_RIGHT    BB_TEXT_IN|BB_TEXT_RIGHT
  148.  
  149. #define BB_TEXT_BELOW_CENTER    BB_TEXT_BELOW|BB_TEXT_CENTER
  150. #define BB_TEXT_BELOW_LEFT    BB_TEXT_BELOW|BB_TEXT_LEFT
  151. #define BB_TEXT_BELOW_RIGHT    BB_TEXT_BELOW|BB_TEXT_RIGHT
  152.  
  153. /*-----------------------Text Shadow placement ---------------------------*/
  154. #define BB_SHADOW_DR    0    /* Place the shadow at x+1, y+1   */
  155. #define BB_SHADOW_UR    16    /* Place the shadow at x+1, y-1   */
  156. #define BB_SHADOW_DL    32    /* Place the shadow at x-1, y+1   */
  157. #define BB_SHADOW_UL    48    /* Place the shadow at x-1, y-1   */
  158.  
  159. /*------------------ Alternatives for shadow placement -------------------*/
  160. #define BB_SUNAT_UL    0    /* Place the shadow at x+1, y+1   */
  161. #define BB_SUNAT_DL    16    /* Place the shadow at x+1, y-1   */
  162. #define BB_SUNAT_UR    32    /* Place the shadow at x-1, y+1   */
  163. #define BB_SUNAT_DR    48    /* Place the shadow at x-1, y-1   */
  164.  
  165. #define BB_3DTEXT    64    /* Alternative to GUBB_3DText, TRUE */
  166.  
  167. /*------------------------------------------------------------------------**
  168. **
  169. ** This is the structure that actually holds the definition of a single
  170. ** gadget.  It contains the new layout tags defined below, as well as the
  171. ** normal GadTools tags.  You setup all the gadgets in a window by
  172. ** making an array of this structure and passing it to GU_LayoutGadgetsA().
  173. **
  174. */
  175. struct LayoutGadget
  176. {
  177.     WORD    lg_GadgetID;
  178.     struct    TagItem *lg_LayoutTags;
  179.     struct    TagItem *lg_GadToolsTags;
  180.     struct    Gadget *lg_Gadget;
  181. };
  182.  
  183. /*------------------------------------------------------------------------**
  184. **
  185. ** Structure used to hold the built in strings of a localized program. These
  186. ** strings will be used if we couldn't get a string from the catalog.
  187. **
  188. */
  189. struct AppString
  190. {
  191.     ULONG    as_ID;            /* String ID              */
  192.     STRPTR    as_Str;            /* String pointer          */
  193. };
  194.  
  195. /*------------------------------------------------------------------------**
  196. **
  197. ** GadUtil.library is basically an extension to Gadtools.library.  It adds
  198. ** to GadTools the ability to dynamically layout gadgets according to the
  199. ** positions of other gadgets, font size, locale, etc. The goal in designing
  200. ** this was to create a system so that programmers could easily create a GUI
  201. ** that automatically adjusted to a user's environment.
  202. **
  203. ** Every gadget is now defined as a TagList, there is no more need to make
  204. ** use of the NewGadget structure as this taglist allows you to access all
  205. ** fields used in that structure. An array of the TagLists for all your
  206. ** window's gadgets is then passed to GU_LayoutGadgetsA() and your gadget
  207. ** list is created.
  208. */
  209.  
  210. #define GU_TagBase    TAG_USER + 0x60000
  211.  
  212. /*********** Define which kind of gadget we are going to have. ************/
  213.  
  214. #define GU_GadgetKind    GU_TagBase+1    /* Which kind of gadget to make.  */
  215.  
  216.  
  217. /************************ Gadget width control. ***************************/
  218.  
  219. #define GU_Width    GU_TagBase+20    /* Absolute gadget width.      */
  220.  
  221. #define GU_DupeWidth    GU_TagBase+21    /* Duplicate the width of another
  222.                      * gadget.              */
  223.  
  224. #define GU_AutoWidth    GU_TagBase+22    /* Set width according to length
  225.                      * of text label + ti_Data.       */
  226.  
  227. #define GU_Columns    GU_TagBase+23    /* Set width so that approximately
  228.                      * ti_Data columns will fit.      */
  229.  
  230. #define GU_AddWidth    GU_TagBase+24    /* Add some value to the total
  231.                      * width calculation.          */
  232.  
  233. #define GU_MinWidth    GU_TagBase+25    /* Make sure width is at least this */
  234.  
  235. #define GU_MaxWidth    GU_TagBase+26    /* Make sure width is at most this */
  236.  
  237. #define GU_AddWidChar    GU_TagBase+27    /* Add the width of ti_Data chars
  238.                      *  to the gadget width          */
  239.  
  240. #define GU_FractWidth    GU_TagBase+28    /* Divide / multiply gadget width
  241.                      *  with ti_Data          */
  242.  
  243. /************************* Gadget height control. *************************/
  244.  
  245. #define GU_Height    GU_TagBase+40    /* Absolute gadget height.       */
  246.  
  247. #define GU_DupeHeight    GU_TagBase+41    /* Duplicate the height of another
  248.                      * gadget.              */
  249.  
  250. #define GU_AutoHeight    GU_TagBase+42    /* Set height according to height
  251.                      * of text font + ti_Data.      */
  252.  
  253. #define GU_HeightFactor    GU_TagBase+43    /* Make the gadget height a
  254.                      * multiple of the font height.      */
  255.  
  256. #define GU_AddHeight    GU_TagBase+44    /* Add some value to the total
  257.                      * height calculation.          */
  258.  
  259. #define GU_MinHeight    GU_TagBase+45    /* Make sure height is at least this */
  260.  
  261. #define GU_MaxHeight    GU_TagBase+46    /* Make sure height is at most this */
  262.  
  263. #define GU_AddHeiLines    GU_TagBase+47    /* Add the height of ti_Data lines
  264.                      *  to the gadget height      */
  265.  
  266. #define GU_FractHeight    GU_TagBase+48    /* Divide / multiply gadget height
  267.                      *  with ti_Data          */
  268.  
  269. /************************* Gadget top edge control. ***********************/
  270.  
  271. #define GU_Top        GU_TagBase+60    /* Absolute top edge.          */
  272.  
  273. #define GU_TopRel    GU_TagBase+61    /* Top edge relative to bottom
  274.                      * edge of another gadget.      */
  275.  
  276. #define GU_AddTop    GU_TagBase+62    /* Add some value to the final
  277.                      * top edge calculation.      */
  278.  
  279. #define GU_AlignTop    GU_TagBase+63    /* Align top edge of gadget with
  280.                      * top edge of another gadget.      */
  281.  
  282. #define GU_AdjustTop    GU_TagBase+64    /* Add the height of the text font
  283.                      * + ti_Data to the top edge.      */
  284.  
  285. #define GU_AddTopLines    GU_TagBase+65    /* Add the height of ti_Data lines
  286.                      * to the top edge.          */
  287.  
  288. /*********************** Gadget bottom edge control. **********************/
  289.  
  290. #define GU_Bottom    GU_TagBase+80    /* Absolute bottom edge.      */
  291.  
  292. #define GU_BottomRel    GU_TagBase+81    /* Bottom edge relative to top
  293.                      * edge of another gadget.      */
  294.  
  295. #define GU_AddBottom    GU_TagBase+82    /* Add some value to the final
  296.                      * bottom edge calculation.      */
  297.  
  298. #define GU_AlignBottom    GU_TagBase+83    /* Align bottom edge of gadget with
  299.                      * bottom edge of another gadget. */
  300.  
  301. #define GU_AdjustBottom    GU_TagBase+84    /* Subtract the height of the text
  302.                      * font + ti_Data from the top edge */
  303.  
  304. /********************** Gadget left edge control. *************************/
  305.  
  306. #define GU_Left        GU_TagBase+100    /* Absolute left edge.          */
  307.  
  308. #define GU_LeftRel    GU_TagBase+101    /* Left edge relative to right
  309.                      * edge of another gadget.      */
  310.  
  311. #define GU_AddLeft    GU_TagBase+102    /* Add some value to the final
  312.                      * left edge calculation.      */
  313.  
  314. #define GU_AlignLeft    GU_TagBase+103    /* Align left edge of gadget with
  315.                      * left edge of another gadget.      */
  316.  
  317. #define GU_AdjustLeft    GU_TagBase+104    /* Add the width of the text label
  318.                      * + ti_Data to the left edge.      */
  319.  
  320. #define GU_AddLeftChar    GU_TagBase+105    /* Add length of ti_Data characters
  321.                      * to the left edge.          */
  322.  
  323. /********************** Gadget right edge control. ************************/
  324.  
  325. #define GU_Right    GU_TagBase+120    /* Absolute right edge.          */
  326.  
  327. #define GU_RightRel    GU_TagBase+121    /* Right edge relative to left
  328.                      * edge of another gadget.      */
  329.  
  330. #define GU_AddRight    GU_TagBase+122    /* Add some value to the final
  331.                      * right edge calculation.      */
  332.  
  333. #define GU_AlignRight    GU_TagBase+123    /* Align right edge of gadget with
  334.                      * right edge of another gadget.  */
  335.  
  336. #define GU_AdjustRight    GU_TagBase+124    /* Subtract the width of the text
  337.                      * label + ti_Data from the left edge */
  338.  
  339. /******************************* Other tags *******************************/
  340.  
  341. #define GU_ToggleSelect    GU_TagBase+150    /* Create a toggle-select gadget -
  342.                      * only BUTTON_KIND & IMAGE_KIND  */
  343.  
  344. #define GU_Selected    GU_TagBase+151    /* Set default state of toggle-
  345.                      * select gadget          */
  346.  
  347. #define GU_HelpGadget    GU_TagBase+152    /* Gadget ID of a TEXT_KIND gadget that
  348.                      * will show a short help text */
  349.  
  350. #define GU_HelpText    GU_TagBase+153    /* Pointer to the text to be shown in
  351.                      * the help gadget          */
  352.  
  353. #define GU_LocaleHelp    GU_TagBase+154    /* Localized version of GU_HelpText
  354.                      * ti_Data of this tag is the string ID */
  355.  
  356. /********* Access to the other fields of the NewGadget structure **********/
  357.  
  358. #define GU_GadgetText    GU_TagBase+160    /* Gadget label.          */
  359.  
  360. #define GU_TextAttr    GU_TagBase+161    /* Desired font for gadget label. */
  361.  
  362. #define GU_Flags    GU_TagBase+162    /* Gadget flags.          */
  363.  
  364. #define GU_UserData    GU_TagBase+163    /* Gadget UserData.          */
  365.  
  366. #define GU_LocaleText    GU_TagBase+164    /* Gadget label taken from a locale. */
  367.  
  368. /*************** Tags for GadUtil's extended gadget kinds. *****************/
  369.  
  370. /*---------------------------- IMAGE_KIND tags ---------------------------*/
  371. #define GUIM_Image    GU_TagBase+200    /* Image structure for an image
  372.                      * gadget.              */
  373.  
  374. #define GUIM_ReadOnly    GU_TagBase+201    /* TRUE if read-only.          */
  375.  
  376. #define GUIM_SelectImg    GU_TagBase+202    /* Selected image for IMAGE_KIND
  377.                      * gadgets              */
  378.  
  379. #define GUIM_BOOPSILook    GU_TagBase+203    /* Render selected image background
  380.                      * with the fillpen (default = TRUE) */
  381.                      
  382. /*------------------------- BEVELBOX_KIND tags ---------------------------*/
  383. #define GUBB_Recessed    GU_TagBase+220    /* TRUE for a recessed bevel box  */
  384.  
  385. #define GUBB_FrameType    GU_TagBase+221    /* Frame type for bevel box      */
  386.  
  387. #define GUBB_TextColor    GU_TagBase+222    /* Color of the title text      */
  388.  
  389. #define GUBB_TextPen    GU_TagBase+223    /* Pen to print title text with -
  390.                      *  overrides GUBB_TextColor      */
  391.  
  392. #define GUBB_Flags    GU_TagBase+224    /* Text placement flags          */
  393.  
  394. #define GUBB_3DText    GU_TagBase+225    /* Tag to enable 3D text (shadow)
  395.                      *  Not needed if GUBB_ShadowColor
  396.                      *  or GUBB_ShadowPen is used      */
  397.  
  398. #define GUBB_ShadowColor GU_TagBase+226 /* Color of the title text's shadow */
  399.  
  400. #define GUBB_ShadowPen    GU_TagBase+227    /* Pen to print the text's shadow
  401.                      *  with - overrides GUBB_ShadowColor */
  402.  
  403. /*-------------------------- LABEL_KIND tags -----------------------------*/
  404. #define GULB_TextColor    GU_TagBase+222    /* Color of the text          */
  405.  
  406. #define GULB_TextPen    GU_TagBase+223    /* Pen to print text with -
  407.                      *  overrides GULB_TextColor      */
  408.  
  409. #define GULB_Flags    GU_TagBase+224    /* Text placement flags          */
  410.  
  411. #define GULB_3DText    GU_TagBase+225    /* Tag to enable 3D text (shadow)
  412.                      *  Not needed if GULB_ShadowColor
  413.                      *  or GULB_ShadowPen is used      */
  414.  
  415. #define GULB_ShadowColor GU_TagBase+226    /* Color of the text's shadow      */
  416.  
  417. #define GULB_ShadowPen    GU_TagBase+227    /* Pen to print the text's shadow
  418.                      *  with - overrides GULB_ShadowColor */
  419.  
  420. /*------------------------- PROGRESS_KIND tags ---------------------------*/
  421. #define GUPR_FillColor    GU_TagBase+240    /* Color of filled part of indicator */
  422.  
  423. #define GUPR_FillPen    GU_TagBase+241    /* Pen to fill the indicator with
  424.                      *  - overrides GUPR_FillColor      */
  425.  
  426. #define GUPR_BackColor    GU_TagBase+242    /* Color of the background of the
  427.                      *  indicator              */
  428.  
  429. #define GUPR_BackPen    GU_TagBase+243    /* Pen to use for the indocator's
  430.                      *  background - overrides
  431.                      *  GUPR_BackColor          */
  432.  
  433. #define GUPR_Current    GU_TagBase+244    /* Current value of the indicator */
  434.  
  435. #define GUPR_Total    GU_TagBase+245    /* Total value for the indicator  */
  436.  
  437. /************** Tags passed directly to GU_LayoutGadgetsA(). **************/
  438.  
  439. #define GU_RightExtreme    GU_TagBase+500    /* ti_Data is a pointer to a LONG
  440.                      * that is used to store the right-
  441.                      * most point that a gadget
  442.                      * will exist in.          */
  443.  
  444. #define GU_LowerExtreme    GU_TagBase+501    /* ti_Data is a pointer to a LONG
  445.                      * that is used to store the lower-
  446.                      * most point that a gadget will
  447.                      * exist in.              */
  448.  
  449. #define GU_Catalog    GU_TagBase+502    /* Indicates locale for the gadgets. */
  450.  
  451.  
  452. #define GU_DefTextAttr    GU_TagBase+503    /* Specifies a default font for use
  453.                      * with all gadgets, can still be
  454.                      * over-ridden with GU_TextAttr.  */
  455.  
  456. #define GU_AppStrings    GU_TagBase+504    /* Application string table w/IDs. */
  457.  
  458. #define GU_BorderLeft    GU_TagBase+505    /* Size of window left border.      */
  459.  
  460. #define GU_BorderTop    GU_TagBase+506    /* Size of window top border.      */
  461.  
  462. #define GU_NoCreate     GU_TagBase+507    /* Don't actually create the gadgets. */
  463.  
  464. #define GU_MinimumIDCMP GU_TagBase+508    /* Minimum required IDCMP, so that
  465.                      *  all gadgets will work      */
  466.  
  467. /***************************** Hotkey tags ********************************/
  468.  
  469. #define GU_Hotkey    GU_TagBase+300    /* Hotkey for gadget (VANILLAKEY) */
  470.  
  471. /********************* Boolean flags for hotkey code **********************/
  472.  
  473. #define GU_HotkeyCase    GU_TagBase+301    /* TRUE for a case-sensitive hotkey */
  474. #define GU_LabelHotkey    GU_TagBase+302    /* TRUE = get hotkey code from label */
  475. #define GU_RawKey    GU_TagBase+303    /* TRUE if hotkey is a RAWKEY code */
  476.  
  477. /*********************** Constants for hotkey support *********************/
  478.  
  479. #define GADUSERMAGIC    0x1122        /* Identification for structure that
  480.                      * the gadgets UserData points to */
  481.  
  482. /******************* Public bit numbers for gu_Flags **********************/
  483.  
  484. #define GU_HOTKEYCASE    0        /* Hoykey is case-sensitive      */
  485. #define GU_RAWKEY    2        /* gu_Code is a RAWKEY code      */
  486.  
  487. #define GU_HOTKEYCASEMASK 1<<GU_HOTKEYCASE /* Mask for GU_HOTKEYCASE bit  */
  488. #define GU_RAWKEYMASK      1<<GU_RAWKEY       /* Mask for GU_RAWKEY bit      */
  489.  
  490. /************** Structure the gadget's UserData points to ******************
  491. *
  492. * This structure is the public part of the allocated data structure for
  493. * hotkeys and IMAGE_KIND gadgets (including FILE_KIND and DRAWER_KIND).
  494. *
  495. * This structure should be considered READ ONLY. The only fields you may
  496. * change is the gu_Code and gu_Flags fields.
  497. *
  498. * DO NOT WRITE ANYTHING BEYOND THIS STRUCTURE WITHOUT ALLOCATING MEMORY FIRST
  499. *
  500. */
  501.  
  502. struct GU_Public
  503. {
  504.     UWORD    gu_Magic;    /* Identification word for structure      */
  505.     ULONG    gu_GadFlags;    /* Flags for GENERIC kind GadUtil gadgets */
  506.     UBYTE    gu_Flags;    /* Flags for the hotkey type          */
  507.     UBYTE    gu_Code;    /* VANILLA or RAWKEY code to react on      */
  508.     WORD    gu_Active;    /* Active entry for some gadget kinds      */
  509.     WORD    gu_MaxVal;    /* Maximum value for some gadgets      */
  510.     WORD    gu_MinVal;    /* Minimum value for some gadgets      */
  511.     ULONG    gu_GadgetType;    /* Gadget type that was created          */
  512.     struct    Gadget *gu_HelpGadget;    /* Pointer to gadget for help text*/
  513.     STRPTR    gu_HelpText;    /* The help text for this gadget      */
  514. };
  515.  
  516. /*------------------------------------------------------------------------**
  517. **                  Library base                  **
  518. **------------------------------------------------------------------------*/
  519.  
  520. struct GadUtilBase
  521. {
  522.         struct    Library LibNode;
  523.         UBYTE   gub_Flags;        /* Private!              */
  524.     UBYTE    gub_Pad;        /* Private!              */
  525.  
  526.     struct    Library *GadToolsBase;    /* The following library bases      */
  527.     struct    GfxBase    *GfxBase;    /* may be read and used by your      */
  528.     struct    IntuitionBase *IntuitionBase;    /* program          */
  529.     struct    Library *LocaleBase;    /* LocaleBase may be NULL!      */
  530.     struct    Library *UtilityBase;
  531.     struct    Library *DiskFontBase;    /* DiskFontBase may be NULL!      */
  532.     LONG    gub_SegList;        /* Private!              */
  533. };
  534.  
  535. #define GADUTILNAME     "gadutil.library"
  536. #define GADUTIL_VER    37
  537. #define    GADUTIL_REV    5
  538.  
  539. /*------------------------------------------------------------------------**
  540. **                  BevelBox structure              **
  541. **------------------------------------------------------------------------*/
  542. struct BBoxData
  543. {
  544.     UWORD    bbd_XPos;         /* X position of box          */
  545.     UWORD    bbd_YPos;         /* Y position of box          */
  546.     UWORD    bbd_Width;        /* Width of box              */
  547.     UWORD    bbd_Height;        /* Height of box          */
  548.  
  549.     UWORD    bbd_LeftEdge;        /* Left edge of text          */
  550.     UWORD    bbd_TopEdge;        /* Top edge of text          */
  551.     UWORD    bbd_TextWidth;        /* Pixel width of text          */
  552.  
  553.     struct    TextAttr *bbd_TextFont; /* Font to print text with      */
  554.     STRPTR    bbd_Text;        /* Text to display          */
  555.         
  556.     UBYTE    bbd_FrontPen;        /* Text color              */
  557.     UBYTE    bbd_Flags;        /* Text placement flags          */
  558.     UBYTE    bbd_Recessed;        /* Recessed frame          */
  559.     UBYTE    bbd_FrameType;        /* Type of box frame          */
  560.     UBYTE    bbd_ShadowPen;             /* Shadow color              */
  561.     UBYTE    bbd_Reserved1;        /* No use in v36.53 - reserved!      */
  562.     struct    Gadget *bbd_HelpGadget;    /* Pointer to gadget for help text*/
  563.     STRPTR    bbd_HelpText;        /* The help text for this gadget  */
  564. };
  565.  
  566. /*------------------------------------------------------------------------**
  567. **              ProgressIndicator structure              **
  568. **------------------------------------------------------------------------*/
  569.  
  570. struct ProgressGad
  571. {
  572.     UWORD    pg_XPos;        /* X pos of box around gadget      */
  573.     UWORD    pg_YPos;        /* Y pos of box around gadget      */
  574.     UWORD    pg_Width;        /* Width of box around gadget      */
  575.     UWORD    pg_Height;        /* Height of box around gadget      */
  576.     ULONG    pg_Current;        /* Current value of indicator      */
  577.     ULONG    pg_Total;        /* Total value of indicator      */
  578.     UBYTE    pg_FillColor;        /* Color of upto current value      */
  579.     UBYTE    pg_BackColor;        /* Color from current to end      */
  580.     UBYTE    pg_Flags;        /* Flags              */
  581.     UBYTE    pg_reserved1;
  582.     UWORD    pg_XFilledTo;        /* Initialized to pg_XPos + 4      */
  583.     struct    Gadget *pg_HelpGadget;    /* Pointer to gadget for help text*/
  584.     STRPTR    pg_HelpText;        /* The help text for this gadget  */
  585. };
  586.  
  587. #endif /* LIBRARIES_GADUTIL_H */
  588.