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 <aros/libcall.h>
12 #include <proto/graphics.h>
13 #include <proto/layers.h>
14 #include "layers_intern.h"
17 /*****************************************************************************
21 AROS_LH2(LONG
, UpfrontLayer
,
24 AROS_LHA(LONG
, dummy
, A0
),
25 AROS_LHA(struct Layer
*, l
, A1
),
28 struct LayersBase
*, LayersBase
, 8, Layers
)
31 Brings a layer to the front. If this layer is a backdrop layer
32 it is brought in front of all backdrop layers and behind the
33 last non-backdrop layer. By clearing the BACKDROP flag of a layer
34 a backdrop layer can be brought in front of all other layers.
35 Parts of a simple layer that become visible are added to the
36 damage list and the REFRESH flag is set.
43 TRUE - layer was moved
44 FALSE - layer could not be moved (probably out of memory)
53 CreateUpfrontLayer() CreateUpfrontHookLayer() BehindLayer()
54 CreateBehindLayer() CreateBehindHookLayer()
59 27-11-96 digulla automatically created from
60 layers_lib.fd and clib/layers_protos.h
62 *****************************************************************************/
65 AROS_LIBBASE_EXT_DECL(struct LayersBase
*,LayersBase
)
67 struct Layer
* first
, * _l
;
71 //kprintf("\t\t%s called!\n",__FUNCTION__);
72 LockLayers(l
->LayerInfo
);
75 * Move the layer in front of that layer with the same
77 * Also keep its children in front of itself.
79 first
= GetFirstFamilyMember(l
);
82 * If there is nobody in front of the first family member
83 * I don't have to do anything.
84 * first can also be l.
86 if (NULL
== first
->front
)
88 UnlockLayers(l
->LayerInfo
);
92 * Search for the new place
93 * search all layers that have the same priority.
94 * If I find another layer with the same nesting
95 * as the one to be moved I have a place to move.
96 * Stop at the frontmost layer
101 if (_l
-> priority
== l
->priority
)
105 if (_l
->nesting
== l
->nesting
)
107 if (NULL
== _l
->front
|| _l
->front
->priority
!= l
->priority
)
115 UnlockLayers(l
->LayerInfo
);
119 ret
= _MoveLayerToFront(l
,_l
, LayersBase
);
123 * Unlock all locked layers.
125 UnlockLayers(l
->LayerInfo
);