define __KERNEL_STRICT_NAMES to avoid inclusion of kernel types on systems that carry...
[cake.git] / rom / intuition / gadgetmouse.c
blobff2b6e49ff236ae6b85ca8b00580dc9d04834c41
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$
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.
30 It is recommended not to call this function!
32 INPUTS
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
37 RESULT
38 None. Fills in the two WORDs pointed to by mousepoint.
40 NOTES
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!
45 EXAMPLE
47 BUGS
49 SEE ALSO
51 INTERNALS
53 HISTORY
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 */