home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / gui / relative.lha / Relative / includes / gadgets / relbutton.h next >
Encoding:
C/C++ Source or Header  |  1997-02-10  |  6.7 KB  |  199 lines

  1. /**************************************************************************************************
  2. **
  3. ** relbutton.gadget
  4. ** © 1996-1997 Jeroen Massar
  5. **
  6. ** Main Header File
  7. **
  8. ** Requires AmigaOS v39+ (Kickstart 3.0+)
  9. **
  10. ***************************************************************************************************
  11. ** Group Class Tree
  12. ***************************************************************************************************
  13. **
  14. **   gadgetclass            (AmigaOS gadgetclass)
  15. **   +--relbutton.gadget        (relbutton.gadget)
  16. **
  17. ***************************************************************************************************
  18. ** Supported (SuperClass) Methods/Attributes
  19. ***************************************************************************************************
  20. ** (Methods not stated here are passed to the superclass.
  21. ** AttrMan    OM_ATTRSTART            v40 /* Should/Can be used as classlibrary method. */
  22. ** rootclass    OM_NEW                v40
  23. **        OM_DISPOSE            v40
  24. **        OM_SET                v40
  25. **        OM_GET                v40
  26. **        OM_UPDATE            v40 (Same as OM_SET)
  27. ** gadgetclass    GM_HITTEST            v40
  28. **        GM_RENDER            v40
  29. **        GM_GOACTIVE            v40
  30. **        GM_HANDLEINPUT            v40
  31. **        GM_GOINACTIVE            v40
  32. **        GM_HELPTEST            v40
  33. **        GM_LAYOUT            v40
  34. **        GM_DOMAIN            v40
  35. **        GA_Disabled            v40 isg BOOL Disabled(TRUE)/Enabled   (FALSE)-default.
  36. **        GA_Selected            v40 isg BOOL Selected(TRUE)/UnSelected(FALSE)-default.
  37. **        GA_ToggleSelect            v40 isg BOOL Toggled (TRUE)/HitSelect (FALSE)-default.
  38. **        GA_TabCycle            v40 When TRUE gets activated when tab-cycle reaches gad.
  39. **        GA_GadgetHelp            v40 When TRUE sends help messages when help is pressed
  40. **                            and the pointer is over the gadget.
  41. **        GA_TextAttr            v?? Font for Label.
  42. **        GA_ReadOnly            v40 ReadOnly(TRUE)/Selectable(FALSE)-default.
  43. **        GA_Bounds            v40 isg struct IBox *
  44. **        GA_RelSpecial            v40 Set to TRUE.
  45. **
  46. ***************************************************************************************************
  47. ** General Header File Information
  48. ***************************************************************************************************
  49. **
  50. ** All class, method, value, macro and structure definitions follow these rules:
  51. **
  52. ** Name                Meaning
  53. **
  54. ** RButM_<method>        Method.
  55. ** RButP_<method>        Methods parameter structure.
  56. ** RButV_<method>_<x>        Special method value.
  57. ** RButA_<attrib>        Attribute (add AttrMan's AttrStart to it!).
  58. ** RButV_<attrib>_<x>        Special attribute value.
  59. **
  60. ** All definitions are followed by a comment containing the version
  61. ** which introduced that definition.
  62. ** RButA_... attribute definitions are followed by a comment
  63. ** consisting of the three possible letters I, S and G.
  64. ** I: it's possible to specify this attribute at object creation (init) time.
  65. ** S: it's possible to change this attribute with SetAttrs().
  66. ** G: it's possible to get this attribute with GetAttr().
  67. **
  68. ** The BOOPSI relbutton.gadget library uses the following structure as its base for the
  69. ** library data.  This allows developers to obtain the class pointer for
  70. ** performing object-less inquiries (As specified in the v42 classes.h/i).
  71. **    struct ClassLibrary
  72. **    {
  73. **        struct Library     cl_Lib;    /* Embedded library */
  74. **        UWORD         cl_Pad;    /* Align the structure */
  75. **        Class        *cl_Class;    /* Class pointer */
  76. **        /* Private data, has changed, is changing and will continue to change. */
  77. **    };
  78. **
  79. **************************************************************************************************/
  80. #ifndef GADGETS_RELBUTTON_H
  81. #define GADGETS_RELBUTTON_H
  82.  
  83. /* Compiler specific stuff */
  84.  
  85. #ifdef _DCC
  86.  
  87. #define REG(x) __ ## x
  88. #define ASM
  89. #define SAVEDS __geta4
  90.  
  91. #else
  92.  
  93. #define REG(x) register __ ## x
  94.  
  95. #if defined __MAXON__ || defined __GNUC__
  96. #define ASM
  97. #define SAVEDS
  98. #else
  99. #define ASM    __asm
  100. #define SAVEDS __saveds
  101. #endif /* if defined ... */
  102.  
  103.  
  104. #ifdef __SASC
  105. #include <pragmas/exec_sysbase_pragmas.h>
  106. #else
  107. #ifndef __GNUC__
  108. #include <pragmas/exec_pragmas.h>
  109. #endif /* ifndef __GNUC__ */
  110. #endif /* ifdef SASC      */
  111.  
  112. #ifndef __GNUC__
  113.  
  114. #include <pragmas/dos_pragmas.h>
  115. #include <pragmas/icon_pragmas.h>
  116. #include <pragmas/graphics_pragmas.h>
  117. #include <pragmas/intuition_pragmas.h>
  118. #include <pragmas/gadtools_pragmas.h>
  119. #include <pragmas/utility_pragmas.h>
  120. #include <pragmas/asl_pragmas.h>
  121. #include <pragmas/reqtools.h>
  122. #include <pragmas/timer_pragmas.h>
  123. #include <pragmas/commodities_pragmas.h>
  124.  
  125. #endif /* ifndef __GNUC__ */
  126.  
  127. #endif /* ifdef _DCC */
  128.  
  129. /* System */
  130. #include <exec/types.h>
  131. #include <exec/memory.h>
  132. #include <exec/exec.h>
  133. #include <exec/devices.h>
  134. #include <exec/io.h>
  135. #include <dos/dos.h>
  136. #include <dos/dostags.h>
  137. #include <graphics/gfxmacros.h>
  138. #include <workbench/workbench.h>
  139. #include <intuition/intuition.h>
  140. #include <intuition/gadgetclass.h>
  141. #include <intuition/imageclass.h>
  142. #include <libraries/gadtools.h>
  143. #include <libraries/reqtools.h>
  144. #include <devices/timer.h>
  145. #include <libraries/commodities.h>
  146.  
  147. /* Prototypes */
  148. #include <clib/alib_protos.h>
  149. #include <clib/exec_protos.h>
  150. #include <clib/dos_protos.h>
  151. #include <clib/icon_protos.h>
  152. #include <clib/graphics_protos.h>
  153. #include <clib/intuition_protos.h>
  154. #include <clib/gadtools_protos.h>
  155. #include <clib/utility_protos.h>
  156. #include <clib/timer_protos.h>
  157. #include <clib/asl_protos.h>
  158. #include <clib/reqtools_protos.h>
  159. #include <clib/commodities_protos.h>
  160.  
  161. /* ANSI C */
  162. #include <stdlib.h>
  163. #include <stdio.h>
  164.  
  165. /* AttrMan */
  166. #include <AttrMan.h>
  167.  
  168. /**************************************************************************************************
  169. ** Library specification
  170. **************************************************************************************************/
  171. #define RELBUTTONGADGET_NAME    "relbutton.gadget"
  172. #define RELBUTTONGADGET_LIBPATH    "gadgets/"
  173. #define RELBUTTONGADGET_VLATEST    40
  174. #define RELBUTTONGADGET_VMIN    RELBUTTONGADGET_VLATEST
  175.  
  176. /**************************************************************************************************
  177. ** relbutton.gadget
  178. **************************************************************************************************/
  179. /* Methods - No special methods except OM_AttrStart for AttrMan support.*/
  180.  
  181. /* Attributes
  182. ** You should add AttrStart gotten from the OM_AttrStart method.
  183. ** You must set these values with SetGadgetAttrs() or there
  184. ** will be no visual refresh when an attribute needs refreshing.
  185. */
  186. enum {    RButA_Label=0,            /* V40 isg STRPTR    Label in the gadget. Defaults to NULL. */
  187.     RButA_LabelSel,            /* V40 isg STRPTR    Selected label in the gadget. Defaults to NULL. */
  188.     RButA_Frame,            /* V40 isg struct Image*(BOOPSI)Frame-image or specials.
  189.                                 Defaults to RButV_Frame_Default. */
  190.     RButA_LastAttr,            /* LastAttribute (this value is used for allocating AttrMan attributes). */
  191.     };
  192.  
  193. /* Special Values - Don't use AttrStart. */
  194. enum {    RButV_Frame_Default=-1,        /* V40 Use default frame (chosen by prefs program). */
  195.     RButV_Frame_None=0,        /* V40 Don't show a frame around the gadget. */
  196.     };
  197.  
  198. #endif /* GADGETS_RELBUTTON_H */
  199.