New bitmap method SetRGBConversionFunction which can be used to
[tangerine.git] / rom / intuition / movewindowinfrontof.c
blob3c72dddde2b675e02064f70e98151535a783f486
1 /*
2 Copyright © 1995-2003, 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(), layers.library/MoveLayerInFrontOf()
54 INTERNALS
55 Uses layers.library/MoveLayerInFrontOf().
57 HISTORY
59 *****************************************************************************/
61 AROS_LIBFUNC_INIT
62 AROS_LIBBASE_EXT_DECL(struct IntuitionBase *,IntuitionBase)
64 struct MoveWindowInFrontOfActionMsg msg;
66 SANITY_CHECK(window)
67 SANITY_CHECK(behindwindow)
69 msg.window = window;
70 msg.behindwindow = behindwindow;
71 DoASyncAction((APTR)int_movewindowinfrontof, &msg.msg, sizeof(msg), IntuitionBase);
73 AROS_LIBFUNC_EXIT
75 } /* MoveWindowInFrontOf */
78 static VOID int_movewindowinfrontof(struct MoveWindowInFrontOfActionMsg *msg,
79 struct IntuitionBase *IntuitionBase)
81 struct Window *window = msg->window;
82 struct Window *behindwindow = msg->behindwindow;
83 struct Screen *screen = window->WScreen;
84 struct Requester *req;
85 struct Layer *layer = WLAYER(window);
86 struct Layer *lay;
87 BOOL movetoback = TRUE;
89 if (!ResourceExisting(window, RESOURCE_WINDOW, IntuitionBase)) return;
90 if (!ResourceExisting(behindwindow, RESOURCE_WINDOW, IntuitionBase)) return;
92 LOCK_REFRESH(screen);
94 for(lay = WLAYER(behindwindow); lay; lay = lay->back)
96 if (lay == layer)
98 movetoback = FALSE;
99 break;
103 /* FIXXXXXXXXXXXXXXXXXXXXXXXXXXXX FIXME FIXXXXXXXXXXXXXXXXXX */
105 /* If GZZ window then also move outer window */
107 MoveLayerInFrontOf(layer, WLAYER(behindwindow));
109 if (BLAYER(window))
111 MoveLayerInFrontOf(BLAYER(window), BLAYER(behindwindow));
114 for (req = window->FirstRequest; req; req = req->OlderRequest)
116 if (req->ReqLayer)
118 MoveLayerInFrontOf(layer, req->ReqLayer);
122 CheckLayers(screen, IntuitionBase);
124 UNLOCK_REFRESH(screen);
126 NotifyDepthArrangement(window, IntuitionBase);