muimaster.library: migrate handling of SelectChange and DoubleClick from Listview...
[AROS.git] / workbench / libs / muimaster / mui_addclipregion.c
blobe21226b094e2bd47c9544084f895b3e310f31304
1 /*
2 Copyright © 2002-2012, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <proto/graphics.h>
7 #include <proto/layers.h>
8 #include <proto/intuition.h>
9 #include <proto/muimaster.h>
11 #include "mui.h"
12 #include "muimaster_intern.h"
14 #include "debug.h"
16 /*****************************************************************************
18 NAME */
19 AROS_LH2(APTR, MUI_AddClipRegion,
21 /* SYNOPSIS */
22 AROS_LHA(struct MUI_RenderInfo *, mri, A0),
23 AROS_LHA(struct Region *, r, A1),
25 /* LOCATION */
26 struct Library *, MUIMasterBase, 30, MUIMaster)
28 /* FUNCTION
30 INPUTS
32 RESULT
34 NOTES
36 EXAMPLE
38 BUGS
40 SEE ALSO
42 INTERNALS
44 *****************************************************************************/
46 AROS_LIBFUNC_INIT
48 struct Window *w = mri->mri_Window;
49 struct Layer *l;
50 APTR result;
52 if (w != NULL)
53 l = w->WLayer;
54 else
55 l = mri->mri_RastPort->Layer;
57 // if (mri->mri_rCount == MRI_RARRAY_SIZE)
58 // kprintf(" --------- mui_addclipregion clip overflow ---------------------\n");
60 if ((l == NULL) || (r == NULL) || (mri->mri_rCount == MRI_RARRAY_SIZE))
62 if (r)
63 DisposeRegion(r);
64 return (APTR)-1;
67 if (mri->mri_rCount != 0)
68 /* NOTE: ignoring the result here... */
69 AndRegionRegion(mri->mri_rArray[mri->mri_rCount-1], r);
71 if ((w != NULL) && (mri->mri_Flags & MUIMRI_REFRESHMODE))
73 LockLayerInfo(&w->WScreen->LayerInfo);
74 EndRefresh(w, FALSE);
77 #if 1 /* stegerg: what's this good for? */
78 if ((w != NULL) && !(w->Flags & WFLG_SIMPLE_REFRESH))
79 LockLayerInfo(&w->WScreen->LayerInfo);
80 #endif
82 result = InstallClipRegion(l, r);
84 #if 1 /* stegerg: what's this good for? */
85 if ((w != NULL) && !(w->Flags & WFLG_SIMPLE_REFRESH))
86 UnlockLayerInfo(&w->WScreen->LayerInfo);
87 #endif
89 if ((w != NULL) && (mri->mri_Flags & MUIMRI_REFRESHMODE))
91 BeginRefresh(w);
92 UnlockLayerInfo(&w->WScreen->LayerInfo);
95 mri->mri_rArray[mri->mri_rCount++] = r;
97 return result;
99 AROS_LIBFUNC_EXIT
101 } /* MUIA_AddClipRegion */