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

  1. /**************************************************************************************************
  2. **
  3. ** relgroup.gadget
  4. ** © 1996-1997 Jeroen Massar
  5. **
  6. ** Main Header File
  7. **
  8. ***************************************************************************************************
  9. ** relgroup.gadget Class Tree
  10. ***************************************************************************************************
  11. **
  12. **   gadgetclass            (AmigaOS gadgetclass)
  13. **   +--relgroup.gadget            (relgroup.gadget)
  14. **
  15. ***************************************************************************************************
  16. ** Supported SuperClass Methods/Attributes
  17. ***************************************************************************************************
  18. ** Methods not stated here are passed to the superclass.
  19. ** AttrMan    OM_ATTRSTART
  20. ** rootclass    OM_NEW
  21. **        OM_DISPOSE
  22. **        OM_SET
  23. **        OM_GET
  24. ** gadgetclass    GM_RENDER            V40 Renders self and then passes it to the superclass.
  25. **        GM_LAYOUT            V40 Lays out self and then lays out the children.
  26. **        GM_DOMAIN            V40 For all which's Top=Height=0,
  27. **                            MINIMUM==NOMINAL Calculated size of all children but
  28. **                                             needs to exist or when
  29. **                                             Disappear==TRUE Width=Height=0.
  30. **                            MAXIMUM          Width=Height=~0.
  31. **        GA_Disabled            V40 Disables(TRUE)/Enables(FALSE:default) group.
  32. **        GA_Highlight            V40 ... GFLG_GADGHNONE.
  33. **        GA_RelSpecial            V40 ... TRUE.
  34. **
  35. ***************************************************************************************************
  36. ** General Header File Information
  37. ***************************************************************************************************
  38. **
  39. ** All class, method, value, macro and structure definitions follow these rules:
  40. **
  41. ** Name                Meaning
  42. **
  43. ** RGrpM_<method>        Method.
  44. ** RGrpP_<method>        Methods parameter structure.
  45. ** RGrpV_<method>_<x>        Special method value.
  46. ** RGrpA_<attrib>        Attribute.
  47. ** RGrpV_<attrib>_<x>        Special attribute value.
  48. **
  49. ** All definitions are followed by a comment containing the version
  50. ** which introduced that definition.
  51. ** Attribute definitions are followed by a comment
  52. ** consisting of the three possible letters I, S and G.
  53. ** I: it's possible to specify this attribute at object creation (init) time.
  54. ** S: it's possible to change this attribute with SetAttrs().
  55. ** G: it's possible to get this attribute with GetAttr().
  56. **
  57. ** The BOOPSI relgroup.gadget library uses the following structure as its base for the
  58. ** library data.  This allows developers to obtain the class pointer for
  59. ** performing object-less inquiries (As specified in the v42 classes.h/i).
  60. **    struct ClassLibrary
  61. **    {
  62. **        struct Library     cl_Lib;    /* Embedded library */
  63. **        UWORD         cl_Pad;    /* Align the structure */
  64. **        Class        *cl_Class;    /* Class pointer */
  65. **        /* Private data, has changed, is changing and will continue to change. */
  66. **    };
  67. **
  68. **************************************************************************************************/
  69. #ifndef GADGETS_RELGROUP_H
  70. #define GADGETS_RELGROUP_H
  71.  
  72. /* Compiler specific stuff */
  73.  
  74. #ifdef _DCC
  75.  
  76. #define REG(x) __ ## x
  77. #define ASM
  78. #define SAVEDS __geta4
  79.  
  80. #else
  81.  
  82. #define REG(x) register __ ## x
  83.  
  84. #if defined __MAXON__ || defined __GNUC__
  85. #define ASM
  86. #define SAVEDS
  87. #else
  88. #define ASM    __asm
  89. #define SAVEDS __saveds
  90. #endif /* if defined ... */
  91.  
  92.  
  93. #ifdef __SASC
  94. #include <pragmas/exec_sysbase_pragmas.h>
  95. #else
  96. #ifndef __GNUC__
  97. #include <pragmas/exec_pragmas.h>
  98. #endif /* ifndef __GNUC__ */
  99. #endif /* ifdef SASC      */
  100.  
  101. #ifndef __GNUC__
  102.  
  103. #include <pragmas/dos_pragmas.h>
  104. #include <pragmas/icon_pragmas.h>
  105. #include <pragmas/graphics_pragmas.h>
  106. #include <pragmas/intuition_pragmas.h>
  107. #include <pragmas/gadtools_pragmas.h>
  108. #include <pragmas/utility_pragmas.h>
  109. #include <pragmas/asl_pragmas.h>
  110. #include <pragmas/reqtools.h>
  111. #include <pragmas/timer_pragmas.h>
  112. #include <pragmas/commodities_pragmas.h>
  113.  
  114. #endif /* ifndef __GNUC__ */
  115.  
  116. #endif /* ifdef _DCC */
  117.  
  118. /* System */
  119. #include <exec/types.h>
  120. #include <exec/memory.h>
  121. #include <exec/exec.h>
  122. #include <exec/devices.h>
  123. #include <exec/io.h>
  124. #include <dos/dos.h>
  125. #include <dos/dostags.h>
  126. #include <graphics/gfxmacros.h>
  127. #include <workbench/workbench.h>
  128. #include <intuition/intuition.h>
  129. #include <intuition/gadgetclass.h>
  130. #include <intuition/imageclass.h>
  131. #include <libraries/gadtools.h>
  132. #include <libraries/reqtools.h>
  133. #include <devices/timer.h>
  134. #include <libraries/commodities.h>
  135.  
  136. /* Prototypes */
  137. #include <clib/alib_protos.h>
  138. #include <clib/exec_protos.h>
  139. #include <clib/dos_protos.h>
  140. #include <clib/icon_protos.h>
  141. #include <clib/graphics_protos.h>
  142. #include <clib/intuition_protos.h>
  143. #include <clib/gadtools_protos.h>
  144. #include <clib/utility_protos.h>
  145. #include <clib/timer_protos.h>
  146. #include <clib/asl_protos.h>
  147. #include <clib/reqtools_protos.h>
  148. #include <clib/commodities_protos.h>
  149.  
  150. /* ANSI C */
  151. #include <stdlib.h>
  152. #include <stdio.h>
  153.  
  154. /* AttrMan */
  155. #include <AttrMan.h>
  156.  
  157. /**************************************************************************************************
  158. ** Library specification
  159. **************************************************************************************************/
  160. #define RELGROUPGADGET_NAME    "relgroup.gadget"
  161. #define RELGROUPGADGET_LIBPATH    "gadgets/"
  162. #define RELGROUPGADGET_VLATEST    40
  163. #define RELGROUPGADGET_VMIN    RELGROUPGADGET_VLATEST
  164.  
  165. /**************************************************************************************************
  166. ** relgroup.gadget
  167. **************************************************************************************************/
  168. /* Methods - No special methods except OM_AttrStart for AttrMan support (see AttrMan.h).*/
  169.  
  170. /* Attributes
  171. ** You should add AttrStart gotten from the OM_AttrStart method.
  172. ** You must set these values with SetGadgetAttrs() otherwise there
  173. ** will be no visual refresh when you set something which needs refreshing.
  174. */
  175. enum {    RGrpA_Child=0,            /* V40 i.. struct Gadget *ChildGadget.
  176.                                 There should be at least one child. */
  177.     RGrpA_Orientation,        /* V40 isg ULONG    Orientation of the gadgets.
  178.                                 See specials below.
  179.                                 Defaults to RGrpV_Orientation_Default. */
  180.     RGrpA_Columns,            /* V40 i.g ULONG    Number of columns in the group. */
  181.     RGrpA_Rows,            /* V40 i.g ULONG    Number of rows in the group. */
  182.     RGrpA_Disappear,        /* V40 i.g BOOL        This group may disappear when domain
  183.                                 is to small. Defaults to FALSE. */
  184.     RGrpA_Frame,            /* V40 isg struct Image*(BOOPSI)Frame-image or special value.
  185.                                 Defaults to RGrpV_Frame_Default. */
  186.     RGrpA_Weight,            /* V40 i.. ULONG    Weight Factor or a special value.
  187.                                 Defaults to RGrpV_Weight_Average. */
  188.  
  189.     RGrpA_LastAttr,            /* LastAttribute (this value is used for allocating AttrMan attributes). */
  190.     };
  191.  
  192. /* Special Values - Don't use AttrStart. */
  193. /* Orientation is only used when nor Columns nor Rows is set at init. */
  194. enum {    RGrpV_Orientation_Default=0,    /* V40 Gadgets are placed in a block. (eg. 9 gads => 3 by 3) */
  195.     RGrpV_Orientation_Horizontal,    /* V40 Gadgets are placed horizontaly (side by side). */
  196.     RGrpV_Orientation_Vertical,    /* V40 Gadgets are placed verticaly (above each other). */
  197.     RGrpV_Orientation_User,        /* V40 Gadgets are placed in a block sized columns by rows.
  198.                            You must set the RGrpA_Columns and RGrpA_Rows to 1+
  199.                            or this will default to RGrpV_Orientation_Default! */
  200.     };
  201.  
  202. enum {    RGrpV_Frame_Default=-1,        /* V40 Use default frame (chosen by prefs program). */
  203.     RGrpV_Frame_None=0,        /* V40 Don't show a frame around the group. */
  204.     };
  205.  
  206. /*
  207. ** When a weight is set it is used for all children succeeding
  208. ** that weight until a new weight is set.
  209. */
  210. enum {    RGrpV_Weight_NoReSize=-3,    /* V40 Don't resize. */
  211.     RGrpV_Weight_NoYReSize,        /* V40 Don't Y-resize (handy for stringgadgets etc). */
  212.     RGrpV_Weight_NoXReSize,        /* V40 Don't X-resize. */
  213.     RGrpV_Weight_Average,        /* V40 Use a avarage weight calculated from the other weights. */
  214.     };
  215.  
  216. #endif /* GADGETS_RELGROUP_H */
  217.