graphics.library: In INVERSVID mode, don't clobber the GC's pens
[AROS.git] / compiler / include / libraries / gadtools.h
blob5c2a390ce20afd68709c5fefb8f78326adcc12ad
1 #ifndef LIBRARIES_GADTOOLS_H
2 #define LIBRARIES_GADTOOLS_H
4 /*
5 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: Definitions and structures for gadtools.library.
9 Lang: english
12 #ifndef EXEC_TYPES_H
13 # include <exec/types.h>
14 #endif
15 #ifndef INTUITION_GADGETCLASS_H
16 # include <intuition/gadgetclass.h>
17 #endif
18 #ifndef INTUITION_INTUITION_H
19 # include <intuition/intuition.h>
20 #endif
21 #ifndef UTILITY_TAGITEM_H
22 # include <utility/tagitem.h>
23 #endif
26 /* Name of the gadtools.library as constant. This is an AROS extension. */
27 #define GADTOOLSNAME "gadtools.library"
29 /* Gadgets */
31 /* Kinds for CreateGadgetA() */
32 #define GENERIC_KIND 0
33 /* normal button */
34 #define BUTTON_KIND 1
35 /* boolean gadget */
36 #define CHECKBOX_KIND 2
37 /* to enter numbers */
38 #define INTEGER_KIND 3
39 /* to list a bunch of entries */
40 #define LISTVIEW_KIND 4
41 /* mutually exclusive entry gadget */
42 #define MX_KIND 5
43 /* to show numbers */
44 #define NUMBER_KIND 6
45 /* like MX_KIND, but rendered differently */
46 #define CYCLE_KIND 7
47 /* to choose a color */
48 #define PALETTE_KIND 8
49 /* to select a value of a range of values */
50 #define SCROLLER_KIND 9
51 /* like SCROLLER_KIND, but with a fixed range */
52 #define SLIDER_KIND 11
53 /* to enter texts */
54 #define STRING_KIND 12
55 /* to show texts */
56 #define TEXT_KIND 13
57 #define NUM_KINDS 14
59 struct NewGadget
61 WORD ng_LeftEdge;
62 WORD ng_TopEdge;
63 WORD ng_Width;
64 WORD ng_Height;
66 CONST_STRPTR ng_GadgetText;
67 struct TextAttr * ng_TextAttr;
69 UWORD ng_GadgetID;
70 ULONG ng_Flags; /* see below */
71 APTR ng_VisualInfo;
72 APTR ng_UserData;
75 /* ng_Flags
76 The PLACETEXT flags (specified in <intuition/gadgetclass.h>) specify where
77 to put the label(s) of the gadget
79 #define PLACETEXT_LEFT (1L<<0)
80 #define PLACETEXT_RIGHT (1L<<1)
81 #define PLACETEXT_ABOVE (1L<<2)
82 #define PLACETEXT_BELOW (1L<<3)
83 #define PLACETEXT_IN (1L<<4)
84 #define NG_HIGHLABEL (1L<<5)
86 /* IDCMP-Flags necessary for certain gadgets */
87 #define ARROWIDCMP (IDCMP_GADGETUP | \
88 IDCMP_GADGETDOWN | \
89 IDCMP_MOUSEBUTTONS | \
90 IDCMP_INTUITICKS)
91 #define BUTTONIDCMP (IDCMP_GADGETUP)
92 #define CHECKBOXIDCMP (IDCMP_GADGETUP)
93 #define INTEGERIDCMP (IDCMP_GADGETUP)
94 #define LISTVIEWIDCMP (ARROWIDCMP | \
95 IDCMP_GADGETUP | \
96 IDCMP_GADGETDOWN | \
97 IDCMP_MOUSEMOVE)
98 #define MXIDCMP (IDCMP_GADGETDOWN)
99 #define NUMBERIDCMP (0L)
100 #define CYCLEIDCMP (IDCMP_GADGETUP)
101 #define PALETTEIDCMP (IDCMP_GADGETUP)
102 #define SCROLLERIDCMP (IDCMP_GADGETUP | \
103 IDCMP_GADGETDOWN | \
104 IDCMP_MOUSEMOVE)
105 #define SLIDERIDCMP (IDCMP_GADGETUP | \
106 IDCMP_GADGETDOWN | \
107 IDCMP_MOUSEMOVE)
108 #define STRINGIDCMP (IDCMP_GADGETUP)
109 #define TEXTIDCMP (0L)
111 #define MX_WIDTH 17
112 #define MX_HEIGHT 9
113 #define CHECKBOX_WIDTH 26
114 #define CHECKBOX_HEIGHT 11
116 /* Indicate that gadget is a gadtools gadget (PRIVATE) */
117 #define GTYP_GADTOOLS 0x0100
119 /* Menus */
121 struct NewMenu
123 UBYTE nm_Type; /* see below */
124 // BYTE nm_Pad;
125 CONST_STRPTR nm_Label; /* may be a STRPTR or NM_BARLABEL (see below) */
126 CONST_STRPTR nm_CommKey;
127 UWORD nm_Flags; /* see below */
128 LONG nm_MutualExclude;
129 APTR nm_UserData;
132 /* nm_Type */
133 #define NM_END 0x0000
134 #define NM_TITLE 0x0001
135 #define NM_ITEM 0x0002
136 #define NM_SUB 0x0003
137 #define NM_IGNORE 0x0040
138 #define IM_ITEM 0x0082
139 #define IM_SUB 0x0083
141 /* nm_Label */
142 #define NM_BARLABEL ((STRPTR)-1)
144 /* nm_Flags */
145 #define NM_MENUDISABLED MENUENABLED
146 #define NM_ITEMDISABLED ITEMENABLED
147 #define NM_COMMANDSTRING COMMSEQ
149 #define NM_FLAGMASK (~(ITEMTEXT | HIGHFLAGS | COMMSEQ))
150 #define NM_FLAGMASK_V39 (~(ITEMTEXT | HIGHFLAGS))
152 /* Macros */
153 #define GTMENU_USERDATA(menu) (*((APTR *)(((struct Menu *)menu)+1)))
154 #define GTMENUITEM_USERDATA(item) (*((APTR *)(((struct MenuItem *)item)+1)))
156 #define GTMENU_TRIMMED 0x00000001
157 #define GTMENU_INVALID 0x00000002
158 #define GTMENU_NOMEM 0x00000003
160 /* Tags */
162 #define GT_TagBase TAG_USER+0x00080000
163 #define GTCB_Checked (GT_TagBase + 4)
164 #define GTLV_Top (GT_TagBase + 5)
165 #define GTLV_Labels (GT_TagBase + 6)
166 #define GTLV_ReadOnly (GT_TagBase + 7)
167 #define GTLV_ScrollWidth (GT_TagBase + 8)
168 #define GTMX_Labels (GT_TagBase + 9)
169 #define GTMX_Active (GT_TagBase + 10)
170 #define GTTX_Text (GT_TagBase + 11)
171 #define GTTX_CopyText (GT_TagBase + 12)
172 #define GTNM_Number (GT_TagBase + 13)
173 #define GTCY_Labels (GT_TagBase + 14)
174 #define GTCY_Active (GT_TagBase + 15)
175 #define GTPA_Depth (GT_TagBase + 16)
176 #define GTPA_Color (GT_TagBase + 17)
177 #define GTPA_ColorOffset (GT_TagBase + 18)
178 #define GTPA_IndicatorWidth (GT_TagBase + 19)
179 #define GTPA_IndicatorHeight (GT_TagBase + 20)
180 #define GTSC_Top (GT_TagBase + 21)
181 #define GTSC_Total (GT_TagBase + 22)
182 #define GTSC_Visible (GT_TagBase + 23)
183 #define GTSC_Overlap (GT_TagBase + 24)
184 #define GTSL_Min (GT_TagBase + 38)
185 #define GTSL_Max (GT_TagBase + 39)
186 #define GTSL_Level (GT_TagBase + 40)
187 #define GTSL_MaxLevelLen (GT_TagBase + 41)
188 #define GTSL_LevelFormat (GT_TagBase + 42)
189 #define GTSL_LevelPlace (GT_TagBase + 43)
190 #define GTSL_DispFunc (GT_TagBase + 44)
191 #define GTST_String (GT_TagBase + 45)
192 #define GTST_MaxChars (GT_TagBase + 46)
193 #define GTIN_Number (GT_TagBase + 47)
194 #define GTIN_MaxChars (GT_TagBase + 48)
195 #define GTMN_TextAttr (GT_TagBase + 49)
196 #define GTMN_FrontPen (GT_TagBase + 50)
197 #define GTBB_Recessed (GT_TagBase + 51)
198 #define GT_VisualInfo (GT_TagBase + 52)
199 #define GTLV_ShowSelected (GT_TagBase + 53)
200 #define GTLV_Selected (GT_TagBase + 54)
201 #define GTST_EditHook (GT_TagBase + 55)
202 #define GTIN_EditHook (GT_TagBase + 55)
203 #define GTTX_Border (GT_TagBase + 57)
204 #define GTNM_Border (GT_TagBase + 58)
205 #define GTSC_Arrows (GT_TagBase + 59)
206 #define GTMN_Menu (GT_TagBase + 60)
207 #define GTMX_Spacing (GT_TagBase + 61)
208 #define GTMN_FullMenu (GT_TagBase + 62)
209 #define GTMN_SecondaryError (GT_TagBase + 63)
210 #define GT_Underscore (GT_TagBase + 64)
211 #define GTMN_Checkmark (GT_TagBase + 65)
212 #define GTMN_AmigaKey (GT_TagBase + 66)
213 #define GTMN_NewLookMenus (GT_TagBase + 67)
214 #define GTCB_Scaled (GT_TagBase + 68)
215 #define GTMX_Scaled (GT_TagBase + 69)
216 #define GTPA_NumColors (GT_TagBase + 70)
217 #define GTMX_TitlePlace (GT_TagBase + 71)
218 #define GTTX_FrontPen (GT_TagBase + 72)
219 #define GTNM_FrontPen (GT_TagBase + 72)
220 #define GTTX_BackPen (GT_TagBase + 73)
221 #define GTNM_BackPen (GT_TagBase + 73)
222 #define GTTX_Justification (GT_TagBase + 74)
223 #define GTNM_Justification (GT_TagBase + 74)
224 #define GTNM_Format (GT_TagBase + 75)
225 #define GTNM_MaxNumberLen (GT_TagBase + 76)
226 #define GTBB_FrameType (GT_TagBase + 77)
227 #define GTLV_MakeVisible (GT_TagBase + 78)
228 #define GTLV_ItemHeight (GT_TagBase + 79)
229 #define GTSL_MaxPixelLen (GT_TagBase + 80)
230 #define GTSL_Justification (GT_TagBase + 81)
231 #define GTPA_ColorTable (GT_TagBase + 82)
232 #define GTLV_CallBack (GT_TagBase + 83)
233 #define GTLV_MaxPen (GT_TagBase + 84)
234 #define GTTX_Clipped (GT_TagBase + 85)
235 #define GTNM_Clipped (GT_TagBase + 85)
237 /* AROS Extensions */
238 #define GTLV_Total (GT_TagBase + 150) /* OM_GET */
239 #define GTLV_Visible (GT_TagBase + 151) /* OM_GET */
241 /* GTTX_Justification and GTNM_Justification */
242 #define GTJ_LEFT 0
243 #define GTJ_RIGHT 1
244 #define GTJ_CENTER 2
246 /* GTBB_FrameType */
247 #define BBFT_BUTTON 1
248 #define BBFT_RIDGE 2
249 #define BBFT_ICONDROPBOX 3
251 /* GTLV_CallBack */
252 #define LV_DRAW 0x202
253 /* return values from these hooks */
254 #define LVCB_OK 0
255 #define LVCB_UNKNOWN 1
257 #define INTERWIDTH 8
258 #define INTERHEIGHT 4
260 struct LVDrawMsg
262 ULONG lvdm_MethodID; /* LV_DRAW */
263 struct RastPort * lvdm_RastPort;
264 struct DrawInfo * lvdm_DrawInfo;
265 struct Rectangle lvdm_Bounds;
266 ULONG lvdm_State;
269 /* lvdm_State */
270 #define LVR_NORMAL 0
271 #define LVR_SELECTED 1
272 #define LVR_NORMALDISABLED 2
273 #define LVR_SELECTEDDISABLED 8
275 #endif /* LIBRARIES_GADTOOLS_H */