Tabs to spaces, more consistent formatting.
[AROS.git] / workbench / libs / muimaster / mui_removeclipregion.c
blobdcf0b4e8f5a983e76e19e1aff63dc4b0a506e43f
1 /*
2 Copyright © 2002-2012, The AROS Development Team.
3 All rights reserved.
5 $Id$
6 */
8 #include <proto/layers.h>
9 #include <proto/intuition.h>
10 #include <proto/graphics.h>
11 #include <proto/muimaster.h>
13 #include "mui.h"
14 #include "muimaster_intern.h"
16 /*****************************************************************************
18 NAME */
19 AROS_LH2(VOID, MUI_RemoveClipRegion,
21 /* SYNOPSIS */
22 AROS_LHA(struct MUI_RenderInfo *, mri, A0),
23 AROS_LHA(APTR, handle, A1),
25 /* LOCATION */
26 struct Library *, MUIMasterBase, 31, MUIMaster)
28 /* FUNCTION
30 INPUTS
32 RESULT
34 NOTES
36 sba: This function frees the region given in MUI_AddClipRegion, but this seems wrong to me.
37 MUI_AddClipRegion should better duplicate the region.
39 EXAMPLE
41 BUGS
43 SEE ALSO
45 INTERNALS
47 *****************************************************************************/
49 AROS_LIBFUNC_INIT
51 struct Window *w = mri->mri_Window;
52 struct Layer *l;
54 if (handle == (APTR)-1)
55 return;
57 if (w != NULL)
58 l = w->WLayer;
59 else
60 l = mri->mri_RastPort->Layer;
62 if (l == NULL)
63 return;
65 mri->mri_rCount--;
67 if ((w != NULL) && (mri->mri_Flags & MUIMRI_REFRESHMODE))
69 LockLayerInfo(&w->WScreen->LayerInfo);
70 EndRefresh(w, FALSE);
73 #if 1 /* stegerg: what's this good for */
74 if ((w != NULL) && !(w->Flags & WFLG_SIMPLE_REFRESH))
75 LockLayerInfo(&w->WScreen->LayerInfo);
76 #endif
78 InstallClipRegion(l, (mri->mri_rCount > 0)
79 ? mri->mri_rArray[mri->mri_rCount-1] : NULL);
81 #if 1 /* stegerg: what's this good for */
82 if ((w != NULL) && !(w->Flags & WFLG_SIMPLE_REFRESH))
83 UnlockLayerInfo(&w->WScreen->LayerInfo);
84 #endif
86 if ((w != NULL) && (mri->mri_Flags & MUIMRI_REFRESHMODE))
88 BeginRefresh(w);
89 UnlockLayerInfo(&w->WScreen->LayerInfo);
92 DisposeRegion(mri->mri_rArray[mri->mri_rCount]);
93 mri->mri_rArray[mri->mri_rCount] = NULL;
95 AROS_LIBFUNC_EXIT
97 } /* MUIA_RemoveClipRegion */