Updated PCI IDs to latest snapshot.
[tangerine.git] / rom / hyperlayers / whichlayer.c
blobb3813362bf16169692f104b4fb8ab7dddb418b07
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
8 #include <aros/libcall.h>
9 #include <proto/graphics.h>
10 #include <proto/layers.h>
11 #include <graphics/clip.h>
12 #include <graphics/layers.h>
13 #include "layers_intern.h"
15 #define DEBUG 0
16 #include <aros/debug.h>
17 #undef kprintf
19 /*****************************************************************************
21 NAME */
23 AROS_LH3(struct Layer *, WhichLayer,
25 /* SYNOPSIS */
26 AROS_LHA(struct Layer_Info *, li, A0),
27 AROS_LHA(LONG , x, D0),
28 AROS_LHA(LONG , y, D1),
30 /* LOCATION */
31 struct LayersBase *, LayersBase, 22, Layers)
33 /* FUNCTION
34 Determines in which layer the point (x,y) is to be found.
35 Starts with the frontmost layer.
37 INPUTS
38 li - pointer to Layers_Info structure
39 x - x-coordinate
40 y - y-coordinate
42 RESULT
44 NOTES
46 EXAMPLE
48 BUGS
50 SEE ALSO
52 INTERNALS
54 HISTORY
55 27-11-96 digulla automatically created from
56 layers_lib.fd and clib/layers_protos.h
58 *****************************************************************************/
60 AROS_LIBFUNC_INIT
62 struct Layer *l;
64 D(bug("WhichLayer(li @ $%lx, x %ld, y %ld)\n", li, x, y));
66 LockLayerInfo(li);
68 for
70 l = li->top_layer;
71 l != NULL && !(IS_VISIBLE(l) && IsPointInRegion(l->visibleshape, x, y));
72 l = l->back
75 UnlockLayerInfo(li);
77 return l;
79 AROS_LIBFUNC_EXIT
80 } /* WhichLayer */