2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
8 #include <proto/exec.h>
9 #include <exec/types.h>
10 #include "layers_intern.h"
11 #include <aros/libcall.h>
12 #include <proto/graphics.h>
13 #include "basicfuncs.h"
14 #include "../graphics/intregions.h"
16 /*****************************************************************************
19 #include <proto/layers.h>
20 AROS_LH2(BOOL
, IsLayerHiddenBySibling
,
23 AROS_LHA(struct Layer
*, l
, A0
),
24 AROS_LHA(BOOL
, check_invisible
, D0
),
27 struct LayersBase
*, LayersBase
, 44, Layers
)
30 Checks whether this layer is hidden by any siblings
31 that are in front of it. All these siblings must have
32 the same priority as that layer.
33 It can be specified whether invisible siblings are to be
34 considered in the comparison.
38 check_invisible - whether invisible siblings are to be considered
41 TRUE - layer is hidden by one or more siblings
42 FALSE - layer is fully visible
56 *****************************************************************************/
65 NULL
== (r
= NewRegion()))
68 LockLayers(l
->LayerInfo
);
74 * If they differ in priority then return FALSE.
76 if (_l
->priority
!= l
->priority
) {
81 * Only need to check with those layers that
82 * have the same nesting count (are immediate
83 * siblings to the layer l).
85 if (l
->nesting
== _l
->nesting
&&
86 ( IS_VISIBLE(_l
) || TRUE
== check_invisible
) &&
87 TRUE
== overlap(_l
->visibleshape
->bounds
, l
->visibleshape
->bounds
))
89 /* The layers overlap if an AND operation on
90 * both layers' visible region does not
91 * leave an empty region.
93 SetRegion(l
->visibleshape
,r
);
94 AndRegionRegion(_l
->visibleshape
,r
);
95 if (NULL
!= r
->RegionRectangle
) {
103 UnlockLayers(l
->LayerInfo
);
110 } /* IsLayerHiddenBySibling */