2 Copyright © 1995-2001, 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 *****************************************************************************/
62 AROS_LIBBASE_EXT_DECL(struct LayersBase
*,LayersBase
)
70 LockLayers(l
->LayerInfo
);
76 * If they differ in priority then return TRUE.
77 * I did not meet another (elegible) sibling so
80 if (_l
->priority
!= l
->priority
)
83 * If the nesting counter of one layer in front
84 * of the layer l is equal (or less) then return FALSE.
86 if (_l
->nesting
<= l
->nesting
&&
87 ( IS_VISIBLE(_l
) || TRUE
== check_invisible
)) {
94 UnlockLayers(l
->LayerInfo
);
99 } /* IsFrontmostLayer */