2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
9 #include <proto/exec.h>
10 #include <exec/types.h>
11 #include <aros/libcall.h>
12 #include <proto/graphics.h>
14 #include "layers_intern.h"
15 #include "basicfuncs.h"
17 /*****************************************************************************
20 #include <proto/layers.h>
21 AROS_LH2(BOOL
, IsLayerHiddenBySibling
,
24 AROS_LHA(struct Layer
*, l
, A0
),
25 AROS_LHA(BOOL
, check_invisible
, D0
),
28 struct LayersBase
*, LayersBase
, 44, Layers
)
31 Checks whether this layer is hidden by any siblings
32 that are in front of it. All these siblings must have
33 the same priority as that layer.
34 It can be specified whether invisible siblings are to be
35 considered in the comparison.
39 check_invisible - whether invisible siblings are to be considered
42 TRUE - layer is hidden by one or more siblings
43 FALSE - layer is fully visible
57 *****************************************************************************/
66 NULL
== (r
= NewRegion()))
69 LockLayers(l
->LayerInfo
);
75 * If they differ in priority then return FALSE.
77 if (_l
->priority
!= l
->priority
) {
82 * Only need to check with those layers that
83 * have the same nesting count (are immediate
84 * siblings to the layer l).
86 if (l
->nesting
== _l
->nesting
&&
87 ( IS_VISIBLE(_l
) || TRUE
== check_invisible
) &&
88 TRUE
== overlap(_l
->visibleshape
->bounds
, l
->visibleshape
->bounds
))
90 /* The layers overlap if an AND operation on
91 * both layers' visible region does not
92 * leave an empty region.
94 SetRegion(l
->visibleshape
,r
);
95 AndRegionRegion(_l
->visibleshape
,r
);
96 if (NULL
!= r
->RegionRectangle
) {
104 UnlockLayers(l
->LayerInfo
);
111 } /* IsLayerHiddenBySibling */