revert between 56095 -> 55830 in arch
[AROS.git] / workbench / libs / muimaster / macros.h
blob89e5ad36ce4cdc95a5ed1e2f8ee1d8fe4995c098
1 #ifndef _MUI_MACROS_H
2 #define _MUI_MACROS_H
4 /*
5 Copyright © 2002-2014, The AROS Development Team. All rights reserved.
6 $Id$
8 Macros available in original MUI and also some additional ones.
9 */
11 /* Some nice macrodefinitions for creating your object tree */
12 #define MenustripObject MUIOBJMACRO_START(MUIC_Menustrip)
13 #define MenuObject MUIOBJMACRO_START(MUIC_Menu)
14 #define MenuObjectT(name) MUIOBJMACRO_START(MUIC_Menu), MUIA_Menu_Title, name
15 #define MenuitemObject MUIOBJMACRO_START(MUIC_Menuitem)
16 #define WindowObject MUIOBJMACRO_START(MUIC_Window)
17 #define ImageObject MUIOBJMACRO_START(MUIC_Image)
18 #define ImagedisplayObject MUIOBJMACRO_START(MUIC_Imagedisplay)
19 #define BitmapObject MUIOBJMACRO_START(MUIC_Bitmap)
20 #define BodychunkObject MUIOBJMACRO_START(MUIC_Bodychunk)
21 #define ChunkyImageObject MUIOBJMACRO_START(MUIC_ChunkyImage)
22 #define NotifyObject MUIOBJMACRO_START(MUIC_Notify)
23 #define ApplicationObject MUIOBJMACRO_START(MUIC_Application)
24 #define TextObject MUIOBJMACRO_START(MUIC_Text)
25 #define RectangleObject MUIOBJMACRO_START(MUIC_Rectangle)
26 #define BalanceObject MUIOBJMACRO_START(MUIC_Balance)
27 #define ListObject MUIOBJMACRO_START(MUIC_List)
28 #define PropObject MUIOBJMACRO_START(MUIC_Prop)
29 #define StringObject MUIOBJMACRO_START(MUIC_String)
30 #define ScrollbarObject MUIOBJMACRO_START(MUIC_Scrollbar)
31 #define ListviewObject MUIOBJMACRO_START(MUIC_Listview)
32 #define RadioObject MUIOBJMACRO_START(MUIC_Radio)
33 #define VolumelistObject MUIOBJMACRO_START(MUIC_Volumelist)
34 #define FloattextObject MUIOBJMACRO_START(MUIC_Floattext)
35 #define DirlistObject MUIOBJMACRO_START(MUIC_Dirlist)
36 #define CycleObject MUIOBJMACRO_START(MUIC_Cycle)
37 #define GaugeObject MUIOBJMACRO_START(MUIC_Gauge)
38 #define ScaleObject MUIOBJMACRO_START(MUIC_Scale)
39 #define NumericObject MUIOBJMACRO_START(MUIC_Numeric)
40 #define SliderObject MUIOBJMACRO_START(MUIC_Slider)
41 #define NumericbuttonObject MUIOBJMACRO_START(MUIC_Numericbutton)
42 #define KnobObject MUIOBJMACRO_START(MUIC_Knob)
43 #define LevelmeterObject MUIOBJMACRO_START(MUIC_Levelmeter)
44 #define BoopsiObject MUIOBJMACRO_START(MUIC_Boopsi)
45 #define ColorfieldObject MUIOBJMACRO_START(MUIC_Colorfield)
46 #define PenadjustObject MUIOBJMACRO_START(MUIC_Penadjust)
47 #define ColoradjustObject MUIOBJMACRO_START(MUIC_Coloradjust)
48 #define PaletteObject MUIOBJMACRO_START(MUIC_Palette)
49 #define GroupObject MUIOBJMACRO_START(MUIC_Group)
50 #define RegisterObject MUIOBJMACRO_START(MUIC_Register)
51 #define VirtgroupObject MUIOBJMACRO_START(MUIC_Virtgroup)
52 #define ScrollgroupObject MUIOBJMACRO_START(MUIC_Scrollgroup)
53 #define PopstringObject MUIOBJMACRO_START(MUIC_Popstring)
54 #define PopobjectObject MUIOBJMACRO_START(MUIC_Popobject)
55 #define PoplistObject MUIOBJMACRO_START(MUIC_Poplist)
56 #define PopscreenObject MUIOBJMACRO_START(MUIC_Popscreen)
57 #define PopaslObject MUIOBJMACRO_START(MUIC_Popasl)
58 #define PendisplayObject MUIOBJMACRO_START(MUIC_Pendisplay)
59 #define PoppenObject MUIOBJMACRO_START(MUIC_Poppen)
60 #define CrawlingObject MUIOBJMACRO_START(MUIC_Crawling)
61 #define DtpicObject MUIOBJMACRO_START(MUIC_Dtpic)
62 /* The following in zune only */
63 #define PopimageObject MUIOBJMACRO_START(MUIC_Popimage)
64 #define PopframeObject MUIOBJMACRO_START(MUIC_Popframe)
65 #define AboutmuiObject MUIOBJMACRO_START(MUIC_Aboutmui)
66 #define ScrmodelistObject MUIOBJMACRO_START(MUIC_Scrmodelist)
67 #define KeyentryObject MUIOBJMACRO_START(MUIC_Keyentry)
68 #define VGroup MUIOBJMACRO_START(MUIC_Group)
69 #define HGroup \
70 MUIOBJMACRO_START(MUIC_Group), MUIA_Group_Horiz, TRUE
71 #define ColGroup(columns) \
72 MUIOBJMACRO_START(MUIC_Group), MUIA_Group_Columns, (columns)
73 #define RowGroup(rows) \
74 MUIOBJMACRO_START(MUIC_Group), MUIA_Group_Rows , (rows)
75 #define PageGroup \
76 MUIOBJMACRO_START(MUIC_Group), MUIA_Group_PageMode, TRUE
77 #define VGroupV MUIOBJMACRO_START(MUIC_Virtgroup)
78 #define HGroupV \
79 MUIOBJMACRO_START(MUIC_Virtgroup), MUIA_Group_Horiz, TRUE
80 #define ColGroupV(columns) \
81 MUIOBJMACRO_START(MUIC_Virtgroup), MUIA_Group_Columns, (columns)
82 #define RowGroupV(rows) \
83 MUIOBJMACRO_START(MUIC_Virtgroup), MUIA_Group_Rows , (rows)
84 #define PageGroupV \
85 MUIOBJMACRO_START(MUIC_Virtgroup), MUIA_Group_PageMode, TRUE
86 #define RegisterGroup(ts) \
87 MUIOBJMACRO_START(MUIC_Register), MUIA_Register_Titles, ((IPTR) (ts))
89 #define End OBJMACRO_END
91 #define Child MUIA_Group_Child
92 #define SubWindow MUIA_Application_Window
93 #define WindowContents MUIA_Window_RootObject
96 /**************************************************************************
97 Zune/MUI's different frame types. Use one per object
98 **************************************************************************/
99 #define NoFrame MUIA_Frame, MUIV_Frame_None
100 #define ButtonFrame MUIA_Frame, MUIV_Frame_Button
101 #define ImageButtonFrame MUIA_Frame, MUIV_Frame_ImageButton
102 #define TextFrame MUIA_Frame, MUIV_Frame_Text
103 #define StringFrame MUIA_Frame, MUIV_Frame_String
104 #define ReadListFrame MUIA_Frame, MUIV_Frame_ReadList
105 #define InputListFrame MUIA_Frame, MUIV_Frame_InputList
106 #define PropFrame MUIA_Frame, MUIV_Frame_Prop
107 #define SliderFrame MUIA_Frame, MUIV_Frame_Slider
108 #define GaugeFrame MUIA_Frame, MUIV_Frame_Gauge
109 #define VirtualFrame MUIA_Frame, MUIV_Frame_Virtual
110 #define GroupFrame MUIA_Frame, MUIV_Frame_Group
111 #define GroupFrameT(t) MUIA_Frame, MUIV_Frame_Group, MUIA_FrameTitle, \
112 ((IPTR) (t)), MUIA_Background, MUII_GroupBack
115 /**************************************************************************
116 Space objects
117 **************************************************************************/
118 #define HVSpace MUI_NewObject(MUIC_Rectangle,TAG_DONE)
119 #define HSpace(x) MUI_MakeObject(MUIO_HSpace,x)
120 #define VSpace(x) MUI_MakeObject(MUIO_VSpace,x)
121 #define HBar(x) MUI_MakeObject(MUIO_HBar,x)
122 #define VBar(x) MUI_MakeObject(MUIO_VBar,x)
123 #define HCenter(obj) (HGroup, GroupSpacing(0), Child, (IPTR)HSpace(0), \
124 Child, (IPTR)(obj), Child, (IPTR)HSpace(0), End)
125 #define VCenter(obj) (VGroup, GroupSpacing(0), Child, (IPTR)VSpace(0), \
126 Child, (IPTR)(obj), Child, (IPTR)VSpace(0), End)
127 #define InnerSpacing(h, v) MUIA_InnerLeft, (h) ,MUIA_InnerRight, (h), \
128 MUIA_InnerTop, (v), MUIA_InnerBottom, (v)
129 #define GroupSpacing(x) MUIA_Group_Spacing, x
131 #ifdef MUI_OBSOLETE
132 /**************************************************************************
133 These macros will create a simple string gadget. Don't use this in
134 new code. Use MUI_MakeObject() instead.
135 **************************************************************************/
136 #define String(contents,maxlen)\
137 StringObject,\
138 StringFrame,\
139 MUIA_String_MaxLen , maxlen,\
140 MUIA_String_Contents, contents,\
143 #define KeyString(contents,maxlen,controlchar)\
144 StringObject,\
145 StringFrame,\
146 MUIA_ControlChar , controlchar,\
147 MUIA_String_MaxLen , maxlen,\
148 MUIA_String_Contents, contents,\
151 #endif
153 #ifdef MUI_OBSOLETE
154 /**************************************************************************
155 These macros will create a simple checkmark gadget. Don't use this in
156 new code. Use MUI_MakeObject() instead.
157 **************************************************************************/
158 #define CheckMark(sel) ImageObject, ImageButtonFrame, MUIA_InputMode, \
159 MUIV_InputMode_Toggle, MUIA_Image_Spec, MUII_CheckMark, \
160 MUIA_Image_FreeVert, TRUE, MUIA_Background, MUII_ButtonBack, \
161 MUIA_ShowSelState, FALSE, MUIA_Selected, sel, End
162 #define KeyCheckMark(sel,ctrl) ImageObject, ImageButtonFrame, \
163 MUIA_InputMode, MUIV_InputMode_Toggle, MUIA_Image_Spec, MUII_CheckMark, \
164 MUIA_Image_FreeVert, TRUE, MUIA_Background, MUII_ButtonBack, \
165 MUIA_ShowSelState, FALSE, MUIA_Selected, sel, MUIA_ControlChar, ctrl, End
166 #endif
169 /**************************************************************************
170 These macros will create a simple button. It's simply calling
171 MUI_MakeObject()
172 **************************************************************************/
173 #define SimpleButton(label) MUI_MakeObject(MUIO_Button,(IPTR)(label))
174 #define ImageButton(label, imagePath) MUI_MakeObject(MUIO_ImageButton, \
175 (IPTR) (label), (IPTR) (imagePath))
177 #define CoolImageButton(label,image) MUI_MakeObject(MUIO_CoolButton, \
178 (IPTR)(label), (IPTR)(image), 0)
179 #define CoolImageIDButton(label,imageid) MUI_MakeObject(MUIO_CoolButton, \
180 (IPTR)(label), imageid, MUIO_CoolButton_CoolImageID)
182 #ifdef MUI_OBSOLETE
183 /**************************************************************************
184 A Keybutton macro. The key should be in lower case.
185 Don't use this in new code. Use MUI_MakeObject() instead.
186 **************************************************************************/
187 #define KeyButton(name,key) TextObject, ButtonFrame, \
188 MUIA_Font, MUIV_Font_Button, MUIA_Text_Contents, (IPTR)(name), \
189 MUIA_Text_PreParse, "\33c", MUIA_Text_HiChar, (IPTR)(key), \
190 MUIA_ControlChar, key, MUIA_InputMode, MUIV_InputMode_RelVerify, \
191 MUIA_Background, MUII_ButtonBack, End
192 #endif
195 #ifdef MUI_OBSOLETE
196 /**************************************************************************
197 Obsolete Cycle macros
198 **************************************************************************/
199 #define Cycle(ent) CycleObject, MUIA_Font, MUIV_Font_Button, \
200 MUIA_Cycle_Entries, ent, End
201 #define KeyCycle(ent,key) CycleObject, MUIA_Font, MUIV_Font_Button, \
202 MUIA_Cycle_Entries, ent, MUIA_ControlChar, key, End
204 /**************************************************************************
205 Obsolete Radios macros
206 **************************************************************************/
207 #define Radio(name,array) RadioObject, GroupFrameT(name), \
208 MUIA_Radio_Entries, (IPTR)(array), End
209 #define KeyRadio(name,array,key) RadioObject, GroupFrameT(name), \
210 MUIA_Radio_Entries, (IPTR)(array), MUIA_ControlChar, (IPTR)(key), End
212 /**************************************************************************
213 Obsolete Slider macros
214 **************************************************************************/
215 #define Slider(min,max,level) SliderObject, MUIA_Numeric_Min, min, \
216 MUIA_Numeric_Max, max, MUIA_Numeric_Value, level, End
217 #define KeySlider(min,max,level,key) SliderObject, MUIA_Numeric_Min, min, \
218 MUIA_Numeric_Max, max, MUIA_Numeric_Value, level, MUIA_ControlChar, key, \
220 #endif
224 /**************************************************************************
225 Use this for getting a pop button
226 **************************************************************************/
227 #define PopButton(img) MUI_MakeObject(MUIO_PopButton, img)
230 /**************************************************************************
231 Macros for Labelobjects
232 Use them for example in a group containing 2 columns, in the first
233 columns the label and in the second columns the object.
235 These objects should be used because the user might have set strange
236 values.
238 xxxLabel() is suited for Objects without frame
239 xxxLabel1() is suited for objects with a single frame, like buttons
240 xxxLabel2() is suited for objects with double frames, like string gadgets
241 **************************************************************************/
243 /* Right aligned */
244 #define Label(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), 0)
245 #define Label1(label) \
246 MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_SingleFrame)
247 #define Label2(label) \
248 MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_DoubleFrame)
250 /* Left aligned */
251 #define LLabel(label) \
252 MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_LeftAligned)
253 #define LLabel1(label) \
254 MUI_MakeObject(MUIO_Label, (IPTR)(label), \
255 MUIO_Label_LeftAligned | MUIO_Label_SingleFrame)
256 #define LLabel2(label) \
257 MUI_MakeObject(MUIO_Label, (IPTR)(label), \
258 MUIO_Label_LeftAligned | MUIO_Label_DoubleFrame)
260 /* Centered */
261 #define CLabel(label) \
262 MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_Centered)
263 #define CLabel1(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
264 MUIO_Label_Centered | MUIO_Label_SingleFrame)
265 #define CLabel2(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
266 MUIO_Label_Centered | MUIO_Label_DoubleFrame)
268 /* Freevert - Right aligned */
269 #define FreeLabel(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
270 MUIO_Label_FreeVert)
271 #define FreeLabel1(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
272 MUIO_Label_FreeVert | MUIO_Label_SingleFrame)
273 #define FreeLabel2(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
274 MUIO_Label_FreeVert | MUIO_Label_DoubleFrame)
276 /* Freevert - Left aligned */
277 #define FreeLLabel(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
278 MUIO_Label_FreeVert | MUIO_Label_LeftAligned)
279 #define FreeLLabel1(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
280 MUIO_Label_FreeVert | MUIO_Label_LeftAligned | MUIO_Label_SingleFrame)
281 #define FreeLLabel2(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
282 MUIO_Label_FreeVert | MUIO_Label_LeftAligned | MUIO_Label_DoubleFrame)
284 /* Freevert - Centered */
285 #define FreeCLabel(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
286 MUIO_Label_FreeVert | MUIO_Label_Centered)
287 #define FreeCLabel1(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
288 MUIO_Label_FreeVert | MUIO_Label_Centered | MUIO_Label_SingleFrame)
289 #define FreeCLabel2(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
290 MUIO_Label_FreeVert | MUIO_Label_Centered | MUIO_Label_DoubleFrame)
292 /* The same as above + keys */
293 #define KeyLabel(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), key)
294 #define KeyLabel1(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
295 MUIO_Label_SingleFrame | (key))
296 #define KeyLabel2(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
297 MUIO_Label_DoubleFrame | (key))
298 #define KeyLLabel(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
299 MUIO_Label_LeftAligned | (key))
300 #define KeyLLabel1(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
301 MUIO_Label_LeftAligned | MUIO_Label_SingleFrame|(key))
302 #define KeyLLabel2(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
303 MUIO_Label_LeftAligned | MUIO_Label_DoubleFrame|(key))
304 #define KeyCLabel(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
305 MUIO_Label_Centered | (key))
306 #define KeyCLabel1(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
307 MUIO_Label_Centered | MUIO_Label_SingleFrame|(key))
308 #define KeyCLabel2(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
309 MUIO_Label_Centered | MUIO_Label_DoubleFrame|(key))
311 #define FreeKeyLabel(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
312 MUIO_Label_FreeVert | (key))
313 #define FreeKeyLabel1(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
314 MUIO_Label_FreeVert | MUIO_Label_SingleFrame | (key))
315 #define FreeKeyLabel2(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
316 MUIO_Label_FreeVert | MUIO_Label_DoubleFrame | (key))
317 #define FreeKeyLLabel(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
318 MUIO_Label_FreeVert | MUIO_Label_LeftAligned | (key))
319 #define FreeKeyLLabel1(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
320 MUIO_Label_FreeVert | MUIO_Label_LeftAligned | MUIO_Label_SingleFrame | (key))
321 #define FreeKeyLLabel2(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
322 MUIO_Label_FreeVert | MUIO_Label_LeftAligned | MUIO_Label_DoubleFrame | (key))
323 #define FreeKeyCLabel(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
324 MUIO_Label_FreeVert | MUIO_Label_Centered | (key))
325 #define FreeKeyCLabel1(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
326 MUIO_Label_FreeVert | MUIO_Label_Centered | MUIO_Label_SingleFrame | (key))
327 #define FreeKeyCLabel2(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), \
328 MUIO_Label_FreeVert | MUIO_Label_Centered | MUIO_Label_DoubleFrame | (key))
331 /* Some macros */
332 #ifndef __cplusplus
334 #ifdef __GNUC__
335 #define get(obj, attr, storage) \
336 ({ \
337 union { \
338 IPTR __zune_get_storage; \
339 typeof(*storage) __zune_val_storage; \
340 } __tmp; \
341 ULONG __zune_get_ret = GetAttr((attr), (obj), &__tmp.__zune_get_storage); \
342 if (__zune_get_ret) \
343 *(storage) = __tmp.__zune_val_storage; \
344 __zune_get_ret; \
346 #else /* !__GNUC__ */
347 #define get(obj,attr,store) GetAttr(attr,obj,(IPTR *)store)
348 #endif /* !__GNUC__ */
350 #ifdef __GNUC__
351 #define XGET(object, attribute) \
352 ({ \
353 IPTR __storage = 0; \
354 GetAttr((attribute), (object), &__storage); \
355 __storage; \
357 #endif /* __GNUC__ */
359 #define set(obj, attr, value) SetAttrs(obj, attr, (IPTR)(value), TAG_DONE)
360 #define nnset(obj, attr, value) SetAttrs(obj, MUIA_NoNotify, TRUE, attr, \
361 (IPTR)(value), TAG_DONE)
363 /* Zune */
364 #define nfset(obj, attr, value) SetAttrs(obj, MUIA_Group_Forward, FALSE, \
365 attr, (IPTR)(value), TAG_DONE)
366 #define nnfset(obj, attr, value) SetAttrs(obj, MUIA_Group_Forward, FALSE, \
367 MUIA_NoNotify, TRUE, attr, (IPTR)(value), TAG_DONE)
368 #define superset(cl, obj, attr, value) SetSuperAttrs(cl, obj, \
369 attr, (IPTR)(value), TAG_DONE)
371 /* Some aliases... */
372 #define GET(obj, attr, store) get(obj, attr, store)
373 #define SET(obj, attr, value) set(obj, attr, value)
374 #define NNSET(obj, attr, value) nnset(obj, attr, value)
375 #define NFSET(obj, attr, value) nfset(obj, attr, value)
376 #define NNFSET(obj, attr, value) nnfset(obj, attr, value)
378 #define setmutex(obj, n) set(obj, MUIA_Radio_Active, n)
379 #define setcycle(obj, n) set(obj, MUIA_Cycle_Active, n)
380 #define setstring(obj, s) set(obj, MUIA_String_Contents, (IPTR)(s))
381 #define setcheckmark(obj, b) set(obj, MUIA_Selected, b)
382 #define setslider(obj, l) set(obj, MUIA_Numeric_Value, l)
384 #endif /* __cplusplus */
387 /* We need the notify and area Instance Data at least here, but this stuff
388 * should be placed at the button anyway */
389 #ifndef _MUI_CLASSES_NOTIFY_H
390 #include "classes/notify.h"
391 #endif
393 #ifndef _MUI_CLASSES_AREA_H
394 #include "classes/area.h"
395 #endif
397 struct __dummyAreaData__
399 struct MUI_NotifyData mnd;
400 struct MUI_AreaData mad;
403 #define muiNotifyData(obj) (&(((struct __dummyAreaData__ *)(obj))->mnd))
404 #define muiAreaData(obj) (&(((struct __dummyAreaData__ *)(obj))->mad))
406 #define muiGlobalInfo(obj) \
407 (((struct __dummyAreaData__ *)(obj))->mnd.mnd_GlobalInfo)
408 #define muiUserData(obj) \
409 (((struct __dummyAreaData__ *)(obj))->mnd.mnd_UserData)
410 #define muiRenderInfo(obj) \
411 (((struct __dummyAreaData__ *)(obj))->mad.mad_RenderInfo)
414 /* the following macros are only valid inbetween MUIM_Setup and MUIM_Cleanup */
415 #define _app(obj) (muiGlobalInfo(obj)->mgi_ApplicationObject)
416 #define _win(obj) (muiRenderInfo(obj)->mri_WindowObject)
417 #define _dri(obj) (muiRenderInfo(obj)->mri_DrawInfo)
418 #define _screen(obj) (muiRenderInfo(obj)->mri_Screen)
419 #define _pens(obj) (muiRenderInfo(obj)->mri_Pens)
420 #define _font(obj) (muiAreaData(obj)->mad_Font)
422 /* the following macros are only valid during MUIM_Draw */
423 #define _left(obj) (muiAreaData(obj)->mad_Box.Left)
424 #define _top(obj) (muiAreaData(obj)->mad_Box.Top)
425 #define _width(obj) (muiAreaData(obj)->mad_Box.Width)
426 #define _height(obj) (muiAreaData(obj)->mad_Box.Height)
427 #define _right(obj) (_left(obj) + _width(obj) - 1)
428 #define _bottom(obj) (_top(obj) + _height(obj) - 1)
429 #define _addleft(obj) (muiAreaData(obj)->mad_addleft )
430 #define _addtop(obj) (muiAreaData(obj)->mad_addtop )
431 #define _subwidth(obj) (muiAreaData(obj)->mad_subwidth )
432 #define _subheight(obj) (muiAreaData(obj)->mad_subheight)
433 #define _mleft(obj) (_left(obj) + _addleft(obj))
434 #define _mtop(obj) (_top(obj) + _addtop(obj))
435 #define _mwidth(obj) (_width(obj) - _subwidth(obj))
436 #define _mheight(obj) (_height(obj) - _subheight(obj))
437 #define _mright(obj) (_mleft(obj) + _mwidth(obj) - 1)
438 #define _mbottom(obj) (_mtop(obj) + _mheight(obj) - 1)
440 /* the following macros are only valid inbetween MUIM_Show and MUIM_Hide */
441 #define _window(obj) (muiRenderInfo(obj)->mri_Window)
442 #define _rp(obj) (muiRenderInfo(obj)->mri_RastPort)
443 #define _minwidth(obj) (muiAreaData(obj)->mad_MinMax.MinWidth)
444 #define _minheight(obj) (muiAreaData(obj)->mad_MinMax.MinHeight)
445 #define _maxwidth(obj) (muiAreaData(obj)->mad_MinMax.MaxWidth)
446 #define _maxheight(obj) (muiAreaData(obj)->mad_MinMax.MaxHeight)
447 #define _defwidth(obj) (muiAreaData(obj)->mad_MinMax.DefWidth)
448 #define _defheight(obj) (muiAreaData(obj)->mad_MinMax.DefHeight)
449 #define _flags(obj) (muiAreaData(obj)->mad_Flags)
453 #endif /* _MUI_MACROS_H */