home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 594a.lha / maker_v0.1 / maker.h < prev    next >
C/C++ Source or Header  |  1991-07-29  |  4KB  |  229 lines

  1. #ifndef MAKER_H
  2. #define MAKER_H
  3.  
  4. #include <exec/types.h>
  5. #include <intuition/intuition.h>
  6. #include <graphics/rastport.h>
  7. #include <libraries/gadtools.h>
  8.  
  9. typedef struct Screen            Screen;
  10. typedef struct Menu                Menu;
  11. typedef struct IntuiMessage    IntuiMessage;
  12. typedef struct RastPort            RastPort;
  13. typedef struct Gadget            Gadget;
  14. typedef struct Window            Window;
  15. typedef struct Message            Message;
  16. typedef struct IntuiText        IntuiText;
  17. typedef struct TextFont            TextFont;
  18. typedef struct TextAttr            TextAttr;
  19. typedef struct Remember            Remember;
  20. typedef struct List                List;
  21. typedef struct Node                Node;
  22.  
  23. #define    SOLID            0xffff
  24. #define    DASH            0xf0f0
  25.  
  26. #define    MAX_TEXT_LEN    80
  27. #define    FONT_NAME_LEN    50
  28.  
  29. #define KEYCODE_Delete            127
  30. #define KEYCODE_BackSpace        8
  31.  
  32.  
  33. enum { OTYPE_Rect, OTYPE_Line, OTYPE_Text, OTYPE_Button, OTYPE_String, OTYPE_Palette,
  34.             OTYPE_CheckBox, OTYPE_ListView, OTYPE_Cycle, OTYPE_MX, OTYPE_Scroller,
  35.             OTYPE_Slider, OTYPE_IText };
  36.  
  37. enum { grayPen, blackPen, whitePen, bluePen };
  38.  
  39. #define RectWidth(rect)        ((rect).maxX-(rect).minX+1)
  40. #define RectHeight(rect)    ((rect).maxY-(rect).minY+1)
  41.  
  42. typedef struct
  43. {
  44.     USHORT    minX,
  45.                 minY,
  46.                 maxX,
  47.                 maxY;
  48. }    Rect;
  49.  
  50. /*
  51. typedef struct
  52. {
  53.     USHORT    x,
  54.                 y;
  55. }    Point;
  56. */
  57.  
  58. /*        The common linked list    element        */
  59.  
  60. #define    LINK_NODE    struct LinkNode    *next;            \
  61.                             USHORT                type;                \
  62.                             USHORT                numBytes;        \
  63.                             Rect                    rect;
  64.  
  65. typedef    struct LinkNode
  66. {
  67.     LINK_NODE
  68. } LinkNode;
  69.  
  70.  
  71. /*
  72.         This structure is common to all gadget-type objects
  73.         It includes the standard LinkNode structure, plus some common gadget data
  74. */
  75.  
  76. #define    GADGET_OBJ        Gadget                *gadget;                            \
  77.                                 Gadget                *topGadget;                        \
  78.                                 Remember                *remKey;                            \
  79.                                 ULONG                    flags;                            \
  80.                                 char                    label[MAX_TEXT_LEN];            \
  81.                                 USHORT                numGadget;                        \
  82.                                 BOOL                    disable;
  83.     
  84. typedef    struct GadgetObj
  85. {
  86.     LINK_NODE
  87.     
  88.     GADGET_OBJ
  89. } GadgetObj;
  90.  
  91. /*        the rectangle is not a Gadtools gadget        */
  92.  
  93. typedef    struct RectObj
  94. {
  95.     LINK_NODE    
  96.     
  97.     USHORT                color;
  98. } RectObj;
  99.  
  100. typedef    struct TextObj
  101. {
  102.     LINK_NODE
  103.     GADGET_OBJ    
  104.     
  105.     BOOL                    copyText;
  106.     BOOL                    border;
  107. } TextObj;
  108.  
  109. typedef    struct ButtonObj
  110. {
  111.     LINK_NODE
  112.     GADGET_OBJ    
  113. } ButtonObj;
  114.  
  115. typedef    struct CycleObj
  116. {
  117.     LINK_NODE
  118.     GADGET_OBJ    
  119.     
  120.     UWORD                    activeItem;
  121.     char                    **textLabels;
  122.     
  123.     UWORD                    tempValue;
  124. } CycleObj;
  125.  
  126. typedef    struct MXObj
  127. {
  128.     LINK_NODE
  129.     GADGET_OBJ    
  130.     
  131.     UWORD                    activeItem;
  132.     UWORD                    extraSpacing;
  133.     char                    **textLabels;
  134. } MXObj;
  135.  
  136. typedef    struct CheckBoxObj
  137. {
  138.     LINK_NODE
  139.     GADGET_OBJ    
  140.     
  141.     BOOL                        checked;
  142. } CheckBoxObj;
  143.  
  144. typedef    struct ScrollerObj
  145. {
  146.     LINK_NODE
  147.     GADGET_OBJ    
  148.     
  149.     WORD                        topItem;
  150.     WORD                        totalItems;
  151.     WORD                        visibleItems;
  152.     UWORD                        arrowSize;
  153.     UWORD                        orientation;
  154.     BOOL                        immediateMsg;
  155.     BOOL                        releaseMsg;
  156. } ScrollerObj;
  157.  
  158. typedef    struct SliderObj
  159. {
  160.     LINK_NODE
  161.     GADGET_OBJ    
  162.     
  163.     WORD                        minLevel;
  164.     WORD                        maxLevel;
  165.     WORD                        currentLevel;
  166.     UWORD                        maxChars;
  167.     char                        format[MAX_TEXT_LEN];
  168.     UWORD                        levelPlace;
  169.     UWORD                        orientation;
  170.     BOOL                        immediateMsg;
  171.     BOOL                        releaseMsg;
  172. } SliderObj;
  173.  
  174. typedef    struct StringObj
  175. {
  176.     LINK_NODE
  177.     GADGET_OBJ    
  178.     
  179.     UWORD                    maxChars;
  180.     char                    theChars[MAX_TEXT_LEN];
  181. } StringObj;
  182.  
  183. typedef    struct PaletteObj
  184. {
  185.     LINK_NODE
  186.     GADGET_OBJ    
  187.     
  188.     UBYTE                    firstColor;
  189.     UBYTE                    colorOffset;
  190.     UWORD                    depth;
  191.     UWORD                    indicatorWidth;
  192.     UWORD                    indicatorHeight;
  193. } PaletteObj;
  194.  
  195. typedef    struct ListViewObj
  196. {
  197.     LINK_NODE
  198.     GADGET_OBJ    
  199.     
  200.     StringObj                *stringObj;
  201.     List                        itemList;
  202.     
  203.     UWORD                        topItem;
  204.     BOOL                        readOnly;
  205.     UWORD                        scrollWidth;
  206.     UWORD                        selectedItem;
  207.     UWORD                        extraSpacing;
  208.     UWORD                        tempStringID;
  209. } ListViewObj;
  210.  
  211. typedef    struct ITextObj
  212. {
  213.     LINK_NODE
  214.     
  215.     IntuiText            iText;
  216.     char                    label[MAX_TEXT_LEN];
  217.     TextAttr                textAttr;
  218.     char                    fontName[FONT_NAME_LEN];
  219. } ITextObj;
  220.  
  221. typedef struct
  222. {
  223.     ULONG        seconds,
  224.                 micros;
  225. } TimeStamp;
  226.  
  227. #endif     /*    MAKER_H    */
  228.  
  229.