2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
6 Move a window around on the screen.
9 #include "intuition_intern.h"
10 #include "inputhandler_actions.h"
12 struct MoveWindowActionMsg
14 struct IntuiActionMsg msg
;
15 struct Window
*window
;
20 static VOID
int_movewindow(struct MoveWindowActionMsg
*msg
,
21 struct IntuitionBase
*IntuitionBase
);
24 /*****************************************************************************
27 #include <proto/intuition.h>
29 AROS_LH3(void, MoveWindow
,
32 AROS_LHA(struct Window
*, window
, A0
),
33 AROS_LHA(LONG
, dx
, D0
),
34 AROS_LHA(LONG
, dy
, D1
),
37 struct IntuitionBase
*, IntuitionBase
, 28, Intuition
)
40 Change the position of a window on the screen.
43 window - Move this window
44 dx, dy - Move it that many pixels along the axis (right, down)
47 The window will move when the next input event will be received.
60 *****************************************************************************/
67 if (window
&& (dx
|| dy
))
69 struct MoveWindowActionMsg msg
;
75 DoASyncAction((APTR
)int_movewindow
, &msg
.msg
, sizeof(msg
), IntuitionBase
);
76 //DoSyncAction((APTR)int_movewindow, &msg.msg, IntuitionBase);
82 static VOID
int_movewindow(struct MoveWindowActionMsg
*msg
,
83 struct IntuitionBase
*IntuitionBase
)
85 struct Window
*window
= msg
->window
;
87 if (!ResourceExisting(window
, RESOURCE_WINDOW
, IntuitionBase
)) return;
89 DoMoveSizeWindow(window
,
90 window
->LeftEdge
+ msg
->dx
, window
->TopEdge
+ msg
->dy
,
91 window
->Width
, window
->Height
, FALSE
, IntuitionBase
);