Fixed binary search: no more infinite loops when vendor is unknown.
[tangerine.git] / workbench / libs / asl / layout.h
blobf4943d43e7b406f64e97391bd9e862a05a67d37e
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
9 #ifndef LAYOUT_H
10 #define LAYOUT_H
12 #ifndef EXEC_TYPES_H
13 # include <exec/types.h>
14 #endif
16 #ifndef DOS_DOS_H
17 # include <dos/dos.h>
18 #endif
20 #ifndef DOS_EXALL_H
21 # include <dos/exall.h>
22 #endif
24 #ifndef GRAPHICS_RASTPORT_H
25 # include <graphics/rastport.h>
26 #endif
28 #ifndef GRAPHICS_TEXT_H
29 # include <graphics/text.h>
30 #endif
32 #ifndef LIBRARIES_GADTOOLS_H
33 # include <libraries/gadtools.h>
34 #endif
36 /*****************************************************************************************/
38 struct AslBase_intern;
40 /*****************************************************************************************/
42 /* Options */
44 /* AROS gadgetclass checks notification loops, while AmigaOS gadgetclass does not.
45 By setting USE_SAFE_NOTIFYING to 1, icclass objects will be used for connection
46 between listview gadget and scrollergadget (instead of direct connection through
47 gadget objects only), which is always safe, as icclass in both AmigaOS and AROS
48 checks for notification loops */
50 #define USE_SAFE_NOTIFYING 1
52 /*****************************************************************************************/
54 /* spacing and sizes for layout */
56 #define BORDERPROPSPACINGX 4
57 #define BORDERPROPSPACINGY 4
59 #define BORDERSTRINGSPACINGX 6
60 #define BORDERSTRINGSPACINGY 4
62 #define BORDERLVSPACINGX 4
63 #define BORDERLVSPACINGY 4
65 #define BORDERCYCLESPACINGX 4
67 #define GADGETSPACINGX 4
68 #define GADGETSPACINGY 4
70 #define OUTERSPACINGX 4
71 #define OUTERSPACINGY 4
73 #define LABELSPACINGX 8
75 #define BUTTONEXTRAWIDTH 16
76 #define BUTTONEXTRAHEIGHT 8
78 #define CYCLEEXTRAWIDTH 32
80 #define IMAGEBUTTONEXTRAHEIGHT 4
81 #define IMAGEBUTTONEXTRAWIDTH 4
82 #define BORDERIMAGESPACINGX 4
84 #define BORDERLVITEMSPACINGX 2
85 #define BORDERLVITEMSPACINGY 1
87 #define PROPSIZE 16
89 #define MIN_SPACING 10
91 /*****************************************************************************************/
93 /* defines for string edit hook */
95 #define STRINGCODE_CURSORUP 1
96 #define STRINGCODE_CURSORDOWN 2
97 #define STRINGCODE_NOP 3
99 /*****************************************************************************************/
101 /* tags */
103 /* ScrollerClass */
104 #define ASLSC_Dummy (PGA_Top + 100)
106 #define ASLSC_Inc (ASLSC_Dummy + 1)
107 #define ASLSC_Dec (ASLSC_Dummy + 2)
108 #define ASLSC_DeltaFactor (ASLSC_Dummy + 3)
110 /* ListviewClass */
112 #define ASLLV_Dummy (PGA_Top + 200)
114 #define ASLLV_ItemHeight (ASLLV_Dummy + 1)
115 #define ASLLV_Spacing (ASLLV_Dummy + 2)
116 #define ASLLV_Labels (ASLLV_Dummy + 3)
117 #define ASLLV_Top (ASLLV_Dummy + 4)
118 #define ASLLV_Active (ASLLV_Dummy + 5)
119 #define ASLLV_CallBack (ASLLV_Dummy + 6)
120 #define ASLLV_Visible (ASLLV_Dummy + 7)
121 #define ASLLV_Total (ASLLV_Dummy + 8)
122 #define ASLLV_DoMultiSelect (ASLLV_Dummy + 9)
123 #define ASLLV_MakeVisible (ASLLV_Dummy + 10)
124 #define ASLLV_ReadOnly (ASLLV_Dummy + 11)
125 #define ASLLV_Font (ASLLV_Dummy + 12)
126 #define ASLLV_TopPixel (ASLLV_Dummy + 13)
127 #define ASLLV_TotalPixels (ASLLV_Dummy + 14)
128 #define ASLLV_VisiblePixels (ASLLV_Dummy + 15)
129 #define ASLLV_DeltaFactor (ASLLV_Dummy + 16)
131 /* ButtonClass */
133 #define ASLBT_Dummy (PGA_Top + 300)
134 #define ASLBT_CoolImage (ASLBT_Dummy + 1)
136 /* CycleClass */
138 #define ASLCY_Dummy (PGA_Top + 400)
139 #define ASLCY_Labels (ASLCY_Dummy + 1)
140 #define ASLCY_Active (ASLCY_Dummy + 2)
141 #define ASLCY_Font (ASLCY_Dummy + 3)
143 /* ColorPickerClass */
145 #define ASLCP_Dummy (PGA_Top + 500)
146 #define ASLCP_NumColors (ASLCP_Dummy + 1)
147 #define ASLCP_ColorTable (ASLCP_Dummy + 2)
148 #define ASLCP_Color (ASLCP_Dummy + 3)
150 /* FontPreviewClass */
152 #define ASLFP_APen IA_FGPen
153 #define ASLFP_BPen IA_BGPen
154 #define ASLFP_Style IA_Mode
155 #define ASLFP_Font IA_Font
156 #define ASLFP_SampleText GA_Text
158 /* FontStyleClass */
160 #define ASLFS_Style SYSIA_Style
161 #define ASLFS_LabelArray GA_Text
163 /*****************************************************************************************/
165 /* methods */
167 #define ASLLV_DRAW 0x202
169 #define ASLLVCB_OK 0
170 #define ASLLVCB_UNKNOWN 1
172 #define ASLLVR_NORMAL 0
173 #define ASLLVR_SELECTED 1
175 #define ASLLV_MAXCOLUMNS 5
176 #define ASLLV_ALIGN_LEFT 0
177 #define ASLLV_ALIGN_RIGHT 1
179 /*****************************************************************************************/
181 struct ASLLVDrawMsg
183 STACKED ULONG lvdm_MethodID; /* LV_DRAW */
184 STACKED struct RastPort * lvdm_RastPort;
185 STACKED struct DrawInfo * lvdm_DrawInfo;
186 STACKED struct Rectangle lvdm_Bounds;
187 STACKED ULONG lvdm_State;
190 struct ASLLVFileReqNode
192 struct Node node;
193 char *text[ASLLV_MAXCOLUMNS];
194 struct DateStamp date;
195 APTR userdata;
196 ULONG filesize;
197 LONG type;
198 LONG subtype;
199 UWORD dontfreetext;
202 /*****************************************************************************************/
204 #define ASLLV_FRNTYPE_DIRECTORY 1
205 #define ASLLV_FRNTYPE_VOLUMES 2
207 #define NODEPRIF_SELECTED 1
208 #define NODEPRIF_MULTISEL 2
210 #define MARK_SELECTED(x) (((struct Node *)(x))->ln_Pri |= NODEPRIF_SELECTED)
211 #define MARK_UNSELECTED(x) (((struct Node *)(x))->ln_Pri &= ~NODEPRIF_SELECTED)
212 #define IS_SELECTED(x) (((struct Node *)(x))->ln_Pri & NODEPRIF_SELECTED)
214 #define MARK_DO_MULTISEL(x) (((struct Node *)(x))->ln_Pri |= NODEPRIF_MULTISEL)
215 #define MARK_NO_MULTISEL(x) (((struct Node *)(x))->ln_Pri &= ~NODEPRIF_MULTISEL)
216 #define IS_MULTISEL(x) (((struct Node *)(x))->ln_Pri & NODEPRIF_MULTISEL)
219 /*****************************************************************************************/
221 /* gadget ids */
223 #define ID_ARROWDEC 100
224 #define ID_ARROWINC 101
225 #define ID_MAINBUTTON_OK 102
226 #define ID_MAINBUTTON_MIDDLELEFT 103
227 #define ID_MAINBUTTON_MIDDLERIGHT 104
228 #define ID_MAINBUTTON_CANCEL 105
230 #define SCROLLTICKER 4 /* arrow gadget -> prop gadget scroll repeat delay in 1/10 sec */
232 /* This command should calculate window's min size
234 #define LDCMD_INIT 0
235 #define LDCMD_WINDOWOPENED 1
236 /* Layout the gadgets */
237 #define LDCMD_LAYOUT 2
239 #define LDCMD_HANDLEEVENTS 3
240 /* Cleanup anything requester specific allocated in INIT, LAYOUT or HANDLEEVENTS */
241 #define LDCMD_CLEANUP 4
243 /* Special retuen value for HANDLEEVENTS to express that the
244 user has successfully requested something and hit "OK" */
246 #define LDRET_FINISHED 2
248 /*****************************************************************************************/
250 /* Structure for storing data between LayoutGadgets and HandleEvents type hooks */
251 struct LayoutData
253 UWORD ld_Command;
254 APTR ld_UserData;
255 BOOL ld_ScreenLocked;
256 BOOL ld_TrueColor;
257 struct Gadget *ld_GList;
258 struct Window *ld_Window;
259 struct Window *ld_Window2;
260 struct Menu *ld_Menu;
261 struct Screen *ld_Screen;
262 struct DrawInfo *ld_Dri;
263 APTR ld_VisualInfo;
264 struct IntReq *ld_IntReq;
265 APTR ld_Req;
266 struct RastPort ld_DummyRP;
268 /* The font to use in the GUI */
269 struct TextFont *ld_Font;
271 /* Texattr describing the above font */
272 struct TextAttr ld_TextAttr;
274 WORD ld_WBorLeft;
275 WORD ld_WBorTop;
276 WORD ld_WBorRight;
277 WORD ld_WBorBottom;
279 /* Used for passing back info about minimum *inner* window size
280 * From LDCMD_INIT hook
282 UWORD ld_MinWidth;
283 UWORD ld_MinHeight;
284 UWORD ld_ButWidth;
285 UWORD ld_NumButtons;
287 /* Used for passing an inputevent to
288 * LDCMD_HANDLEEVENTS hooks
290 struct IntuiMessage *ld_Event;
294 struct ScrollerGadget
296 Object *prop;
297 Object *arrow1;
298 Object *arrow2;
299 #if USE_SAFE_NOTIFYING
300 Object *prop_ic;
301 Object *listview_ic;
302 #endif
305 #endif /* LAYOUT_H */