2 Copyright © 2002-2007, The AROS Development Team. All rights reserved.
6 #include <proto/graphics.h>
7 #include <proto/layers.h>
8 #include <proto/muimaster.h>
13 #include "muimaster_intern.h"
15 /*****************************************************************************
18 AROS_LH5(APTR
, MUI_AddClipping
,
21 AROS_LHA(struct MUI_RenderInfo
*, mri
, A0
),
22 AROS_LHA(WORD
, left
, D0
),
23 AROS_LHA(WORD
, top
, D1
),
24 AROS_LHA(WORD
, width
, D2
),
25 AROS_LHA(WORD
, height
, D3
),
28 struct Library
*, MUIMasterBase
, 28, MUIMaster
)
46 *****************************************************************************/
51 struct Rectangle rect
;
54 if ((width
>= MUI_MAXMAX
) || (height
>= MUI_MAXMAX
))
57 if (mri
->mri_rCount
> 0)
59 if (isRegionWithinBounds(mri
->mri_rArray
[mri
->mri_rCount
-1],
60 left
, top
, width
, height
))
64 if ((r
= NewRegion()) == NULL
)
69 rect
.MaxX
= left
+ width
- 1;
70 rect
.MaxY
= top
+ height
- 1;
71 OrRectRegion(r
, &rect
);
73 handle
= MUI_AddClipRegion(mri
, r
);
75 #if 0 /* MUI_AddClipRegion frees region itself upon failure */
76 if (handle
== (APTR
)-1)
85 } /* MUIA_AddClipping */