- Give PCI controllers lower unit numbers than legacy controllers.
[cake.git] / rom / intuition / movewindow.c
blob9fd30aa5cad5f4ba57d15b34a7b02be022deb9f2
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
4 $Id$
6 Move a window around on the screen.
7 */
9 #include "intuition_intern.h"
10 #include "inputhandler_actions.h"
12 struct MoveWindowActionMsg
14 struct IntuiActionMsg msg;
15 struct Window *window;
16 LONG dx;
17 LONG dy;
20 static VOID int_movewindow(struct MoveWindowActionMsg *msg,
21 struct IntuitionBase *IntuitionBase);
24 /*****************************************************************************
26 NAME */
27 #include <proto/intuition.h>
29 AROS_LH3(void, MoveWindow,
31 /* SYNOPSIS */
32 AROS_LHA(struct Window *, window, A0),
33 AROS_LHA(LONG , dx, D0),
34 AROS_LHA(LONG , dy, D1),
36 /* LOCATION */
37 struct IntuitionBase *, IntuitionBase, 28, Intuition)
39 /* FUNCTION
40 Change the position of a window on the screen.
42 INPUTS
43 window - Move this window
44 dx, dy - Move it that many pixels along the axis (right, down)
46 RESULT
47 The window will move when the next input event will be received.
49 NOTES
51 EXAMPLE
53 BUGS
55 SEE ALSO
56 SizeWindow()
58 INTERNALS
60 HISTORY
62 *****************************************************************************/
64 AROS_LIBFUNC_INIT
66 EXTENDWORD(dx);
67 EXTENDWORD(dy);
69 if (window && (dx || dy))
71 struct MoveWindowActionMsg msg;
73 msg.window = window;
74 msg.dx = dx;
75 msg.dy = dy;
77 DoASyncAction((APTR)int_movewindow, &msg.msg, sizeof(msg), IntuitionBase);
78 //DoSyncAction((APTR)int_movewindow, &msg.msg, IntuitionBase);
81 AROS_LIBFUNC_EXIT
82 } /* MoveWindow */
84 static VOID int_movewindow(struct MoveWindowActionMsg *msg,
85 struct IntuitionBase *IntuitionBase)
87 struct Window *window = msg->window;
89 if (!ResourceExisting(window, RESOURCE_WINDOW, IntuitionBase)) return;
91 DoMoveSizeWindow(window,
92 window->LeftEdge + msg->dx, window->TopEdge + msg->dy,
93 window->Width, window->Height, FALSE, IntuitionBase);