Don't call InvertPixelArray with negative width and/or height.
[tangerine.git] / workbench / libs / muimaster / support.h
bloba9cca75858f238954d31e62887b9fe00cc05fa96
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;
38 #define mui_alloc(x) AllocVec(x,MEMF_CLEAR)
39 #define mui_alloc_struct(x) ((x *)AllocVec(sizeof(x),MEMF_CLEAR))
40 #define mui_free(x) FreeVec(x)
43 int isRegionWithinBounds(struct Region *r, int left, int top, int width, int height);
44 ULONG ConvertKey(struct IntuiMessage *imsg);
46 #define _between(a,x,b) ((x)>=(a) && (x)<=(b))
47 #define _isinobject(x,y) (_between(_mleft(obj),(x),_mright (obj)) \
48 && _between(_mtop(obj) ,(y),_mbottom(obj)))
50 /* add mask in flags if tag is true, else sub mask */
51 #define _handle_bool_tag(flags, tag, mask) \
52 ((tag != 0) ? ((flags) |= (mask)) : ((flags) &= ~(mask)))
54 #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
56 #ifndef __GNUC__
57 IPTR XGET(Object *obj, Tag attr);
58 #endif
60 IPTR DoSetupMethod(Object *obj, struct MUI_RenderInfo *info);
61 IPTR DoShowMethod(Object *obj);
62 IPTR DoHideMethod(Object *obj);
64 /* returns next node of this node */
65 void *Node_Next(APTR node);
66 /* returns first node of this list */
67 void *List_First(APTR list);
69 WORD SubtractRectFromRect(struct Rectangle *a, struct Rectangle *b, struct Rectangle *destrectarray);
70 ULONG IsObjectVisible(Object *child, struct Library *MUIMasterBase);
72 #endif /* _MUIMASTER_SUPPORT_H */