Include <X11/Xlib.h> even if USE_VIDMODE is
[tangerine.git] / rom / hyperlayers / behindlayer.c
blobd7b0f7b6a363dd9fbce658930e7fe8edc37c0a60
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
8 #include <proto/exec.h>
9 #include <exec/types.h>
10 #include <exec/memory.h>
11 #include <aros/libcall.h>
12 #include <proto/graphics.h>
13 #include "basicfuncs.h"
14 #include "layers_intern.h"
16 /*****************************************************************************
18 NAME */
19 #include <proto/layers.h>
20 AROS_LH2(LONG, BehindLayer,
22 /* SYNOPSIS */
23 AROS_LHA(LONG , dummy, A0),
24 AROS_LHA(struct Layer *, l , A1),
26 /* LOCATION */
27 struct LayersBase *, LayersBase, 9, Layers)
29 /* FUNCTION
30 If the layer is a backdrop layer it will be moved to the most
31 behind position. If it is a non-backdrop layer it will be moved
32 in front of the first backdrop layer.
33 The areas of simple layers, that become visible by moving this
34 layer, are added to the damagelist and the LAYERREFRESH flag
35 is set.
37 INPUTS
38 dummy - nothing
39 L - pointer to layer
41 RESULT
42 TRUE - layer was successfully moved
43 FALSE - layer could not be moved (probably out of memory)
45 NOTES
47 EXAMPLE
49 BUGS
51 SEE ALSO
53 INTERNALS
55 HISTORY
56 27-11-96 digulla automatically created from
57 layers_lib.fd and clib/layers_protos.h
59 *****************************************************************************/
61 AROS_LIBFUNC_INIT
62 AROS_LIBBASE_EXT_DECL(struct LayersBase *,LayersBase)
64 struct Layer * _l;
65 LONG ret;
67 //kprintf("\t\t%s called!\n",__FUNCTION__);
68 LockLayers(l->LayerInfo);
71 * The layer in front of the family is the layer in
72 * front of the parent of my layer
74 if (!l->parent)
76 UnlockLayers(l->LayerInfo);
77 return FALSE;
79 _l = l->parent->front;
81 while (_l->priority < l->priority)
82 _l = _l->front;
84 if (_l == l)
86 UnlockLayers(l->LayerInfo);
87 return TRUE;
89 ret = _MoveLayerBehind(l,_l,LayersBase);
91 UnlockLayers(l->LayerInfo);
93 return ret;
95 AROS_LIBFUNC_EXIT
96 } /* BehindLayer */