New bitmap method SetRGBConversionFunction which can be used to
[tangerine.git] / rom / hyperlayers / whichlayer.c
blob5dfc9ce89ae36aebad74ddef2913be560e7f89c9
1 /*
2 Copyright © 1995-2001, 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
61 AROS_LIBBASE_EXT_DECL(struct LayersBase *,LayersBase)
63 struct Layer *l;
65 D(bug("WhichLayer(li @ $%lx, x %ld, y %ld)\n", li, x, y));
67 LockLayerInfo(li);
69 for
71 l = li->top_layer;
72 l != NULL && !(IS_VISIBLE(l) && IsPointInRegion(l->visibleshape, x, y));
73 l = l->back
76 UnlockLayerInfo(li);
78 return l;
80 AROS_LIBFUNC_EXIT
81 } /* WhichLayer */