2 Copyright © 1995-2011, 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>
15 #include "basicfuncs.h"
16 #include "layers_intern.h"
19 /*****************************************************************************
23 AROS_LH2(LONG
, UpfrontLayer
,
26 AROS_LHA(LONG
, dummy
, A0
),
27 AROS_LHA(struct Layer
*, l
, A1
),
30 struct LayersBase
*, LayersBase
, 8, Layers
)
33 Brings a layer to the front. If this layer is a backdrop layer
34 it is brought in front of all backdrop layers and behind the
35 last non-backdrop layer. By clearing the BACKDROP flag of a layer
36 a backdrop layer can be brought in front of all other layers.
37 Parts of a simple layer that become visible are added to the
38 damage list and the REFRESH flag is set.
45 TRUE - layer was moved
46 FALSE - layer could not be moved (probably out of memory)
55 CreateUpfrontLayer(), CreateUpfrontHookLayer(), BehindLayer()
56 CreateBehindLayer(), CreateBehindHookLayer()
61 27-11-96 digulla automatically created from
62 layers_lib.fd and clib/layers_protos.h
64 *****************************************************************************/
68 struct Layer
* first
, * _l
;
72 //kprintf("\t\t%s called!\n",__FUNCTION__);
73 LockLayers(l
->LayerInfo
);
76 * Move the layer in front of that layer with the same
78 * Also keep its children in front of itself.
80 first
= GetFirstFamilyMember(l
);
83 * If there is nobody in front of the first family member
84 * I don't have to do anything.
85 * first can also be l.
87 if (NULL
== first
->front
)
89 UnlockLayers(l
->LayerInfo
);
93 * Search for the new place
94 * search all layers that have the same priority.
95 * If I find another layer with the same nesting
96 * as the one to be moved I have a place to move.
97 * Stop at the frontmost layer
102 if (_l
-> priority
== l
->priority
)
106 if (_l
->nesting
== l
->nesting
)
108 if (NULL
== _l
->front
|| _l
->front
->priority
!= l
->priority
)
116 UnlockLayers(l
->LayerInfo
);
120 ret
= _MoveLayerToFront(l
,_l
, LayersBase
);
124 * Unlock all locked layers.
126 UnlockLayers(l
->LayerInfo
);