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

  1. /**************************************************************************************************
  2. **
  3. ** virtual.gadget
  4. ** © 1996-1997 Jeroen Massar
  5. **
  6. ** Main Header File
  7. **
  8. ***************************************************************************************************
  9. ** virtual.gadget Class Tree
  10. ***************************************************************************************************
  11. **
  12. **   gadgetclass            (AmigaOS gadgetclass)
  13. **   +--virtual.gadget            (virtual.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 Asks the child it domain and calcs it.
  27. **        GA_Disabled            V40 Disables(TRUE)/Enables(FALSE:default) virtual gadget.
  28. **        GA_Highlight            V40 ... GFLG_GADGHNONE.
  29. **        GA_RelSpecial            V40 ... TRUE.
  30. **
  31. ***************************************************************************************************
  32. ** General Header File Information
  33. ***************************************************************************************************
  34. **
  35. ** All class, method, value, macro and structure definitions follow these rules:
  36. **
  37. ** Name                Meaning
  38. **
  39. ** VirtM_<method>        Method.
  40. ** VirtP_<method>        Methods parameter structure.
  41. ** VirtV_<method>_<x>        Special method value.
  42. ** VirtA_<attrib>        Attribute.
  43. ** VirtV_<attrib>_<x>        Special attribute value.
  44. **
  45. ** All definitions are followed by a comment containing the version
  46. ** which introduced that definition.
  47. ** Attribute definitions are followed by a comment
  48. ** consisting of the three possible letters I, S and G.
  49. ** I: it's possible to specify this attribute at object creation (init) time.
  50. ** S: it's possible to change this attribute with SetAttrs().
  51. ** G: it's possible to get this attribute with GetAttr().
  52. **
  53. ** The BOOPSI virtual.gadget library uses the following structure as its base for the
  54. ** library data.  This allows developers to obtain the class pointer for
  55. ** performing object-less inquiries (As specified in the v42 classes.h/i).
  56. **    struct ClassLibrary
  57. **    {
  58. **        struct Library     cl_Lib;    /* Embedded library */
  59. **        UWORD         cl_Pad;    /* Align the structure */
  60. **        Class        *cl_Class;    /* Class pointer */
  61. **        /* Private data, has changed, is changing and will continue to change. */
  62. **    };
  63. **
  64. **************************************************************************************************/
  65. #ifndef GADGETS_VIRTUAL_H
  66. #define GADGETS_VIRTUAL_H
  67.  
  68. /* Compiler specific stuff */
  69.  
  70. #ifdef _DCC
  71.  
  72. #define REG(x) __ ## x
  73. #define ASM
  74. #define SAVEDS __geta4
  75.  
  76. #else
  77.  
  78. #define REG(x) register __ ## x
  79.  
  80. #if defined __MAXON__ || defined __GNUC__
  81. #define ASM
  82. #define SAVEDS
  83. #else
  84. #define ASM    __asm
  85. #define SAVEDS __saveds
  86. #endif /* if defined ... */
  87.  
  88.  
  89. #ifdef __SASC
  90. #include <pragmas/exec_sysbase_pragmas.h>
  91. #else
  92. #ifndef __GNUC__
  93. #include <pragmas/exec_pragmas.h>
  94. #endif /* ifndef __GNUC__ */
  95. #endif /* ifdef SASC      */
  96.  
  97. #ifndef __GNUC__
  98.  
  99. #include <pragmas/dos_pragmas.h>
  100. #include <pragmas/icon_pragmas.h>
  101. #include <pragmas/graphics_pragmas.h>
  102. #include <pragmas/intuition_pragmas.h>
  103. #include <pragmas/gadtools_pragmas.h>
  104. #include <pragmas/utility_pragmas.h>
  105. #include <pragmas/asl_pragmas.h>
  106. #include <pragmas/reqtools.h>
  107. #include <pragmas/timer_pragmas.h>
  108. #include <pragmas/commodities_pragmas.h>
  109.  
  110. #endif /* ifndef __GNUC__ */
  111.  
  112. #endif /* ifdef _DCC */
  113.  
  114. /* System */
  115. #include <exec/types.h>
  116. #include <exec/memory.h>
  117. #include <exec/exec.h>
  118. #include <exec/devices.h>
  119. #include <exec/io.h>
  120. #include <dos/dos.h>
  121. #include <dos/dostags.h>
  122. #include <graphics/gfxmacros.h>
  123. #include <workbench/workbench.h>
  124. #include <intuition/intuition.h>
  125. #include <intuition/gadgetclass.h>
  126. #include <intuition/imageclass.h>
  127. #include <libraries/gadtools.h>
  128. #include <libraries/reqtools.h>
  129. #include <devices/timer.h>
  130. #include <libraries/commodities.h>
  131.  
  132. /* Prototypes */
  133. #include <clib/alib_protos.h>
  134. #include <clib/exec_protos.h>
  135. #include <clib/dos_protos.h>
  136. #include <clib/icon_protos.h>
  137. #include <clib/graphics_protos.h>
  138. #include <clib/intuition_protos.h>
  139. #include <clib/gadtools_protos.h>
  140. #include <clib/utility_protos.h>
  141. #include <clib/timer_protos.h>
  142. #include <clib/asl_protos.h>
  143. #include <clib/reqtools_protos.h>
  144. #include <clib/commodities_protos.h>
  145.  
  146. /* ANSI C */
  147. #include <stdlib.h>
  148. #include <stdio.h>
  149.  
  150. /* AttrMan */
  151. #include <AttrMan.h>
  152.  
  153. /**************************************************************************************************
  154. ** Library specification
  155. **************************************************************************************************/
  156. #define VIRTUALGADGET_NAME    "virtual.gadget"
  157. #define VIRTUALGADGET_LIBPATH    "gadgets/"
  158. #define VIRTUALGADGET_VLATEST    40
  159. #define VIRTUALGADGET_VMIN    VIRTUALGADGET_VLATEST
  160.  
  161. /**************************************************************************************************
  162. ** virtual.gadget
  163. **************************************************************************************************/
  164. /* Methods - No special methods except OM_AttrStart for AttrMan support (see AttrMan.h).*/
  165.  
  166. /* Attributes
  167. ** You should add AttrStart gotten from the OM_AttrStart method.
  168. ** You must set these values with SetGadgetAttrs() otherwise there
  169. ** will be no visual refresh when you set something which needs refreshing.
  170. */
  171. enum {    VirtA_ChildGadget=0,        /* V40 i.g struct Gadget *ChildGadget.*/
  172.     VirtA_ChildImage,        /* V40 i.g struct Image *ChildImage. */
  173.     VirtA_Virtual,            /* V40 i.g ULONG    VirtV_Virtual_On/Off/Always */
  174.     /* Virtual.gadget requires one ChildGadget _OR_ one ChildImage.
  175.        If you want more than one child use relgroup.gadget as the
  176.        child and give it the children you want!
  177.  
  178.        The following works just like an propgclass object
  179.        but with horizontal&vertical freedom and a child.
  180.         PGA_Total    -> VirtA_TotalWidth & VirtA_TotalHeight
  181.         PGA_Visible    -> VirtA_VisibleWidth & VirtA_VisibleWidth
  182.         PGA_Top        -> VirtA_Left & VirtA_Top */
  183.     VirtA_TotalWidth,        /* V40 ..g ULONG    Total Width   (in pixels). */
  184.     VirtA_TotalHeight,        /* V40 ..g ULONG    Total Height  (in pixels). */
  185.     VirtA_VisualWidth,        /* V40 ..g ULONG    Visual Width  (in pixels). */
  186.     VirtA_VisualHeight,        /* V40 ..g ULONG    Visual Height (in pixels). */
  187.     VirtA_Left,            /* V40 .sg ULONG    Left          (in pixels). */
  188.     VirtA_Top,            /* V40 .sg ULONG    Top           (in pixels). */
  189.     VirtA_Frame,            /* V40 isg struct Image*(BOOPSI)Frame-image or special value.
  190.                                 Defaults to VirtV_Frame_Default. */
  191.     VirtA_LastAttr,            /* LastAttribute (this value is used for allocating AttrMan attributes). */
  192.     };
  193.  
  194. /* Special Values - Don't use AttrStart. */
  195. enum {    VirtV_Frame_Default=-1,        /* V40 Use default frame (IA_FrameType,FRAME_??? copied from
  196.                        Taglist or defaults to FRAME_RIDGE. */
  197.     VirtV_Frame_None=0,        /* V40 Don't show a frame around the group. */
  198.     };
  199.  
  200. enum {    VirtV_Virtual_Off=0,        /* V40 Group is in normal mode. */
  201.     VirtV_Virtual_On,        /* V40 Group is in Virtual mode. */
  202.     VirtV_Virtual_Always,        /* V40 Group is always in Virtual mode. */
  203.     /* 1) Needless to say that VirtV_Virtual_Never isn't defined/required
  204.           as you wouldn't need this class then.
  205.        2) The VirtV_Virtual_Off/On automaticaly switches when being layed out
  206.           and little or enough space is available.
  207.        3) It's possible to compare with TRUE (On/Always) and FALSE (Off). */
  208.     };
  209.  
  210. #endif /* GADGETS_VIRTUAL_H */
  211.