disable debug
[AROS.git] / rom / intuition / movewindowinfrontof.c
blobd2fcfaa91d51daf2753f53f5622b3846e1d81020
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
4 $Id$
5 */
7 #include <proto/layers.h>
8 #include "intuition_intern.h"
9 #include "inputhandler_actions.h"
11 struct MoveWindowInFrontOfActionMsg
13 struct IntuiActionMsg msg;
14 struct Window *window;
15 struct Window *behindwindow;
18 static VOID int_movewindowinfrontof(struct MoveWindowInFrontOfActionMsg *msg,
19 struct IntuitionBase *IntuitionBase);
21 /*****************************************************************************
23 NAME */
24 #include <proto/intuition.h>
26 AROS_LH2(void, MoveWindowInFrontOf,
28 /* SYNOPSIS */
29 AROS_LHA(struct Window *, window, A0),
30 AROS_LHA(struct Window *, behindwindow, A1),
32 /* LOCATION */
33 struct IntuitionBase *, IntuitionBase, 80, Intuition)
35 /* FUNCTION
36 Arrange the relative depth of a window.
38 INPUTS
39 window - the window to reposition
40 behindwindow - the window the other one will be brought in front of
42 RESULT
43 None.
45 NOTES
47 EXAMPLE
49 BUGS
51 SEE ALSO
52 WindowToFront(), WindowToBack(),
53 hyperlayers.library/MoveLayerInFrontOf()
55 INTERNALS
56 Uses layers.library/MoveLayerInFrontOf().
58 *****************************************************************************/
60 AROS_LIBFUNC_INIT
62 struct MoveWindowInFrontOfActionMsg msg;
64 SANITY_CHECK(window)
65 SANITY_CHECK(behindwindow)
67 msg.window = window;
68 msg.behindwindow = behindwindow;
69 DoASyncAction((APTR)int_movewindowinfrontof, &msg.msg, sizeof(msg), IntuitionBase);
71 AROS_LIBFUNC_EXIT
73 } /* MoveWindowInFrontOf */
76 static VOID int_movewindowinfrontof(struct MoveWindowInFrontOfActionMsg *msg,
77 struct IntuitionBase *IntuitionBase)
79 struct LayersBase *LayersBase = GetPrivIBase(IntuitionBase)->LayersBase;
80 struct Window *window = msg->window;
81 struct Window *behindwindow = msg->behindwindow;
82 struct Screen *screen = window->WScreen;
83 struct Requester *req;
84 struct Layer *layer = WLAYER(window);
86 if (!ResourceExisting(window, RESOURCE_WINDOW, IntuitionBase)) return;
87 if (!ResourceExisting(behindwindow, RESOURCE_WINDOW, IntuitionBase)) return;
89 LOCK_REFRESH(screen);
91 /* FIXXXXXXXXXXXXXXXXXXXXXXXXXXXX FIXME FIXXXXXXXXXXXXXXXXXX */
93 /* If GZZ window then also move outer window */
95 MoveLayerInFrontOf(layer, WLAYER(behindwindow));
97 if (BLAYER(window))
99 MoveLayerInFrontOf(BLAYER(window), BLAYER(behindwindow));
102 for (req = window->FirstRequest; req; req = req->OlderRequest)
104 if (req->ReqLayer)
106 MoveLayerInFrontOf(layer, req->ReqLayer);
110 CheckLayers(screen, IntuitionBase);
112 UNLOCK_REFRESH(screen);
114 NotifyDepthArrangement(window, IntuitionBase);