Tabs to spaces, more consistent formatting.
[AROS.git] / workbench / libs / asl / layout.h
blob838d9189385d22cd7862726e6d643f360e835334
1 /*
2 Copyright © 1995-2011, 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)
130 #define ASLLV_DoSaveMode (ASLLV_Dummy + 17)
132 /* ButtonClass */
134 #define ASLBT_Dummy (PGA_Top + 300)
135 #define ASLBT_CoolImage (ASLBT_Dummy + 1)
137 /* CycleClass */
139 #define ASLCY_Dummy (PGA_Top + 400)
140 #define ASLCY_Labels (ASLCY_Dummy + 1)
141 #define ASLCY_Active (ASLCY_Dummy + 2)
142 #define ASLCY_Font (ASLCY_Dummy + 3)
144 /* ColorPickerClass */
146 #define ASLCP_Dummy (PGA_Top + 500)
147 #define ASLCP_NumColors (ASLCP_Dummy + 1)
148 #define ASLCP_ColorTable (ASLCP_Dummy + 2)
149 #define ASLCP_Color (ASLCP_Dummy + 3)
151 /* FontPreviewClass */
153 #define ASLFP_APen IA_FGPen
154 #define ASLFP_BPen IA_BGPen
155 #define ASLFP_Style IA_Mode
156 #define ASLFP_Font IA_Font
157 #define ASLFP_SampleText GA_Text
159 /* FontStyleClass */
161 #define ASLFS_Style SYSIA_Style
162 #define ASLFS_LabelArray GA_Text
164 /*****************************************************************************************/
166 /* methods */
168 #define ASLLV_DRAW 0x202
170 #define ASLLVCB_OK 0
171 #define ASLLVCB_UNKNOWN 1
173 #define ASLLVR_NORMAL 0
174 #define ASLLVR_SELECTED 1
176 #define ASLLV_MAXCOLUMNS 5
177 #define ASLLV_ALIGN_LEFT 0
178 #define ASLLV_ALIGN_RIGHT 1
180 /*****************************************************************************************/
182 struct ASLLVDrawMsg
184 STACKED ULONG lvdm_MethodID; /* LV_DRAW */
185 STACKED struct RastPort * lvdm_RastPort;
186 STACKED struct DrawInfo * lvdm_DrawInfo;
187 STACKED struct Rectangle lvdm_Bounds;
188 STACKED ULONG lvdm_State;
191 struct ASLLVFileReqNode
193 struct Node node;
194 char *text[ASLLV_MAXCOLUMNS];
195 struct DateStamp date;
196 APTR userdata;
197 ULONG filesize;
198 LONG type;
199 LONG subtype;
200 UWORD dontfreetext;
203 /*****************************************************************************************/
205 #define ASLLV_FRNTYPE_DIRECTORY 1
206 #define ASLLV_FRNTYPE_VOLUMES 2
208 #define NODEPRIF_SELECTED 1
209 #define NODEPRIF_MULTISEL 2
211 #define MARK_SELECTED(x) (((struct Node *)(x))->ln_Pri |= NODEPRIF_SELECTED)
212 #define MARK_UNSELECTED(x) (((struct Node *)(x))->ln_Pri &= ~NODEPRIF_SELECTED)
213 #define IS_SELECTED(x) (((struct Node *)(x))->ln_Pri & NODEPRIF_SELECTED)
215 #define MARK_DO_MULTISEL(x) (((struct Node *)(x))->ln_Pri |= NODEPRIF_MULTISEL)
216 #define MARK_NO_MULTISEL(x) (((struct Node *)(x))->ln_Pri &= ~NODEPRIF_MULTISEL)
217 #define IS_MULTISEL(x) (((struct Node *)(x))->ln_Pri & NODEPRIF_MULTISEL)
220 /*****************************************************************************************/
222 /* gadget ids */
224 #define ID_ARROWDEC 100
225 #define ID_ARROWINC 101
226 #define ID_MAINBUTTON_OK 102
227 #define ID_MAINBUTTON_MIDDLELEFT 103
228 #define ID_MAINBUTTON_MIDDLERIGHT 104
229 #define ID_MAINBUTTON_CANCEL 105
231 #define SCROLLTICKER 4 /* arrow gadget -> prop gadget scroll repeat delay in 1/10 sec */
233 /* This command should calculate window's min size
235 #define LDCMD_INIT 0
236 #define LDCMD_WINDOWOPENED 1
237 /* Layout the gadgets */
238 #define LDCMD_LAYOUT 2
240 #define LDCMD_HANDLEEVENTS 3
241 #define LDCMD_HANDLEAPPWINDOW 4
242 /* Cleanup anything requester specific allocated in INIT, LAYOUT or HANDLEEVENTS */
243 #define LDCMD_CLEANUP 5
245 /* Special retuen value for HANDLEEVENTS to express that the
246 user has successfully requested something and hit "OK" */
248 #define LDRET_FINISHED 2
250 /*****************************************************************************************/
252 /* Structure for storing data between LayoutGadgets and HandleEvents type hooks */
253 struct LayoutData
255 UWORD ld_Command;
256 APTR ld_UserData;
257 BOOL ld_ScreenLocked;
258 BOOL ld_TrueColor;
259 struct Gadget *ld_GList;
260 struct Window *ld_Window;
261 struct Window *ld_Window2;
262 struct Menu *ld_Menu;
263 struct Screen *ld_Screen;
264 struct DrawInfo *ld_Dri;
265 APTR ld_VisualInfo;
266 struct IntReq *ld_IntReq;
267 APTR ld_Req;
268 struct RastPort ld_DummyRP;
270 /* The font to use in the GUI */
271 struct TextFont *ld_Font;
273 /* Texattr describing the above font */
274 struct TextAttr ld_TextAttr;
276 WORD ld_WBorLeft;
277 WORD ld_WBorTop;
278 WORD ld_WBorRight;
279 WORD ld_WBorBottom;
281 /* Used for passing back info about minimum *inner* window size
282 * From LDCMD_INIT hook
284 UWORD ld_MinWidth;
285 UWORD ld_MinHeight;
286 UWORD ld_ButWidth;
287 UWORD ld_NumButtons;
289 /* Used for passing an inputevent to
290 * LDCMD_HANDLEEVENTS hooks
292 struct IntuiMessage *ld_Event;
294 /* Used for appwindow stuff
296 struct AppMessage *ld_AppMsg;
297 struct MsgPort *ld_AppMsgPort;
298 struct AppWindow *ld_AppWindow;
299 STRPTR ld_ForeignerFiles;
303 struct ScrollerGadget
305 Object *prop;
306 Object *arrow1;
307 Object *arrow2;
308 #if USE_SAFE_NOTIFYING
309 Object *prop_ic;
310 Object *listview_ic;
311 #endif
314 #endif /* LAYOUT_H */