2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
7 #include "intuition_intern.h"
8 #include <intuition/classusr.h>
9 #include <proto/alib.h>
11 /*****************************************************************************
14 #include <intuition/intuition.h>
15 #include <intuition/imageclass.h>
16 #include <proto/intuition.h>
18 AROS_LH2(BOOL
, PointInImage
,
21 AROS_LHA(ULONG
, point
, D0
),
22 AROS_LHA(struct Image
*, image
, A0
),
25 struct IntuitionBase
*, IntuitionBase
, 104, Intuition
)
28 Check whether a point is inside an image.
31 point - This are the packed point coordinates. The X coordinate
32 in in the upper 16 bits and the Y coordinate is in the
33 lower 16 bits. The coordinates are signed.
34 image - Check against this image.
37 TRUE if the point is inside the image, FALSE otherwise.
49 *****************************************************************************/
53 WORD X
= (point
>> 16L);
54 WORD Y
= point
& 0x0000FFFFL
;
55 struct impHitTest method
;
59 if (image
->Depth
== CUSTOMIMAGEDEPTH
)
61 method
.MethodID
= IM_HITTEST
;
62 method
.imp_Point
.X
= X
;
63 method
.imp_Point
.Y
= Y
;
65 result
= DoMethodA((Object
*)image
, (Msg
)&method
) != 0;
70 if ((X
>= image
->LeftEdge
&& X
<= image
->LeftEdge
+ image
->Width
) &&
71 (Y
>= image
->TopEdge
&& Y
<= image
->TopEdge
+ image
->Height
))
79 /* NULL image returns TRUE per intuition autodoc! */