Safer handling of Booleans.
[AROS.git] / workbench / libs / muimaster / support.h
blob9b76c6595c0cd83274691b8c5262f02aafb308af
1 /*
2 Copyright 2002-2003, The AROS Development Team.
3 All rights reserved.
5 $Id$
6 */
8 #ifndef _MUIMASTER_SUPPORT_H
9 #define _MUIMASTER_SUPPORT_H
11 #ifndef EXEC_TYPES_H
12 # include <exec/types.h>
13 #endif
14 #ifndef INTUITION_CLASSUSR_H
15 # include <intuition/classusr.h>
16 #endif
17 #ifndef INTUITION_CLASSES_H
18 # include <intuition/classes.h>
19 #endif
20 #ifndef CLIB_MACROS_H
21 # include <clib/macros.h>
22 #endif
24 #ifdef __AROS__
25 # ifndef AROS_ASMCALL_H
26 # include <aros/asmcall.h>
27 # endif
28 # include <aros/macros.h>
29 # define IMSPEC_EXTERNAL_PREFIX "IMAGES:Zune/"
30 # include "support_aros.h"
31 #else
32 # include "support_amigaos.h"
33 #endif
35 struct MUI_RenderInfo;
36 struct IntuiMessage;
37 struct Region;
38 struct Rectangle;
39 struct Object;
40 struct Library;
42 #define mui_alloc(x) AllocVec(x,MEMF_CLEAR)
43 #define mui_alloc_struct(x) ((x *)AllocVec(sizeof(x),MEMF_CLEAR))
44 #define mui_free(x) FreeVec(x)
47 int isRegionWithinBounds(struct Region *r, int left, int top, int width,
48 int height);
49 ULONG ConvertKey(struct IntuiMessage *imsg);
51 #define _between(a,x,b) ((x)>=(a) && (x)<=(b))
52 #define _isinobject(x,y) (_between(_mleft(obj),(x),_mright (obj)) \
53 && _between(_mtop(obj) ,(y),_mbottom(obj)))
55 /* add mask in flags if tag is true, else sub mask */
56 #define _handle_bool_tag(flags, tag, mask) \
57 ((tag != 0) ? ((flags) |= (mask)) : ((flags) &= ~(mask)))
59 #define CLAMP(x, low, high) \
60 (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
62 #ifndef __GNUC__
63 IPTR XGET(Object * obj, Tag attr);
64 #endif
66 IPTR DoSetupMethod(Object * obj, struct MUI_RenderInfo *info);
67 IPTR DoShowMethod(Object * obj);
68 IPTR DoHideMethod(Object * obj);
70 /* returns next node of this node */
71 void *Node_Next(APTR node);
72 /* returns first node of this list */
73 void *List_First(APTR list);
75 WORD SubtractRectFromRect(struct Rectangle *a, struct Rectangle *b,
76 struct Rectangle *destrectarray);
77 ULONG IsObjectVisible(Object * child, struct Library *MUIMasterBase);
79 #endif /* _MUIMASTER_SUPPORT_H */