grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / intuition / gadgetmouse.c
blobecae85d9fe79656c8ab4afe58d5c8235a698df6b
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 <intuition/gadgetclass.h>
8 #include "intuition_intern.h"
9 #include "inputhandler.h"
10 #include "inputhandler_support.h"
12 /*****************************************************************************
14 NAME */
15 #include <proto/intuition.h>
17 AROS_LH3(void, GadgetMouse,
19 /* SYNOPSIS */
20 AROS_LHA(struct Gadget *, gadget, A0),
21 AROS_LHA(struct GadgetInfo *, ginfo, A1),
22 AROS_LHA(WORD *, mousepoint, A2),
24 /* LOCATION */
25 struct IntuitionBase *, IntuitionBase, 95, Intuition)
27 /* FUNCTION
28 Determines the current mouse position relative to the upper-left
29 corner of a custom gadget. It is recommended not to call this
30 function!
32 INPUTS
33 gadget - The gadget to take as origin.
34 ginfo - The GadgetInfo structure as passed to the custom gadget hook
35 routine.
36 mousepoint - Pointer to an array of two WORDs or a structure of type
37 Point.
39 RESULT
40 None. Fills in the two WORDs pointed to by mousepoint.
42 NOTES
43 This function is useless, because programs which need this
44 information can get it in a cleaner way. It is recommended not to
45 call this function!
47 EXAMPLE
49 BUGS
51 SEE ALSO
53 INTERNALS
55 *****************************************************************************/
57 AROS_LIBFUNC_INIT
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;
70 SANITY_CHECK(gadget)
71 SANITY_CHECK(ginfo)
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;
80 AROS_LIBFUNC_EXIT
82 } /* GadgetMouse */