2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
8 #include <proto/exec.h>
9 #include <exec/types.h>
10 #include <exec/memory.h>
11 #include "layers_intern.h"
12 #include <aros/libcall.h>
13 #include <proto/graphics.h>
14 #include "basicfuncs.h"
16 /*****************************************************************************
19 #include <proto/layers.h>
20 AROS_LH2(BOOL
, IsFrontmostLayer
,
23 AROS_LHA(struct Layer
*, l
, A0
),
24 AROS_LHA(BOOL
, check_invisible
, D0
),
27 struct LayersBase
*, LayersBase
, 43, Layers
)
30 Checks whether this layer is the frontmost layer within
31 its priority. If this layer has children then all of
32 its children will be disregarded. Comparisons are only
33 done with layers that have the same 'depth' of relation-
34 ship (=nesting counter) to the root layer.
35 It can be specified whether invisible siblings are to be
36 considered in the comparison.
40 check_invisible - whether invisible siblings are to be considered
44 TRUE - layer is frontmost layer within its priority
45 FALSE - layer is not frontmost layer within its priority
59 *****************************************************************************/
69 LockLayers(l
->LayerInfo
);
75 * If they differ in priority then return TRUE.
76 * I did not meet another (elegible) sibling so
79 if (_l
->priority
!= l
->priority
)
82 * If the nesting counter of one layer in front
83 * of the layer l is equal (or less) then return FALSE.
85 if (_l
->nesting
<= l
->nesting
&&
86 ( IS_VISIBLE(_l
) || TRUE
== check_invisible
)) {
93 UnlockLayers(l
->LayerInfo
);
98 } /* IsFrontmostLayer */