2 Copyright © 1995-2007, 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 *****************************************************************************/
66 struct Layer
* first
, * _l
;
70 //kprintf("\t\t%s called!\n",__FUNCTION__);
71 LockLayers(l
->LayerInfo
);
74 * Move the layer in front of that layer with the same
76 * Also keep its children in front of itself.
78 first
= GetFirstFamilyMember(l
);
81 * If there is nobody in front of the first family member
82 * I don't have to do anything.
83 * first can also be l.
85 if (NULL
== first
->front
)
87 UnlockLayers(l
->LayerInfo
);
91 * Search for the new place
92 * search all layers that have the same priority.
93 * If I find another layer with the same nesting
94 * as the one to be moved I have a place to move.
95 * Stop at the frontmost layer
100 if (_l
-> priority
== l
->priority
)
104 if (_l
->nesting
== l
->nesting
)
106 if (NULL
== _l
->front
|| _l
->front
->priority
!= l
->priority
)
114 UnlockLayers(l
->LayerInfo
);
118 ret
= _MoveLayerToFront(l
,_l
, LayersBase
);
122 * Unlock all locked layers.
124 UnlockLayers(l
->LayerInfo
);