2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
7 #include <intuition/gadgetclass.h>
8 #include "intuition_intern.h"
9 #include "inputhandler.h"
10 #include "inputhandler_support.h"
12 /*****************************************************************************
15 #include <proto/intuition.h>
17 AROS_LH3(void, GadgetMouse
,
20 AROS_LHA(struct Gadget
*, gadget
, A0
),
21 AROS_LHA(struct GadgetInfo
*, ginfo
, A1
),
22 AROS_LHA(WORD
*, mousepoint
, A2
),
25 struct IntuitionBase
*, IntuitionBase
, 95, Intuition
)
28 Determines the current mouse position relative to the upper-left
29 corner of a custom gadget.
30 It is recommended not to call this function!
33 gadget - The gadget to take as origin
34 ginfo - The GadgetInfo structure as passed to the custom gadget hook routine
35 mousepoint - Pointer to an array of two WORDs or a structure of type Point
38 None. Fills in the two WORDs pointed to by mousepoint.
41 This function is useless, because programs which need this information
42 can get it in a cleaner way.
43 It is recommended not to call this function!
55 *****************************************************************************/
59 struct gpInput dummy_gpi
;
61 DEBUG_GADGETMOUSE(dprintf("GadgetMouse: gadget 0x%lx ginfo 0x%lx\n", gadget
, ginfo
));
63 ASSERT_VALID_PTR(gadget
);
64 ASSERT_VALID_PTR(ginfo
);
65 ASSERT_VALID_PTR(mousepoint
);
67 /* shut up the compiler */
68 IntuitionBase
= IntuitionBase
;
72 SANITY_CHECK(mousepoint
)
74 dummy_gpi
.gpi_GInfo
= ginfo
;
75 SetGPIMouseCoords(&dummy_gpi
, gadget
);
77 mousepoint
[0] = dummy_gpi
.gpi_Mouse
.X
;
78 mousepoint
[1] = dummy_gpi
.gpi_Mouse
.Y
;