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_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 is the point is inside the image, FALSE otherwise.
50 29-10-95 digulla automatically created from
51 intuition_lib.fd and clib/intuition_protos.h
53 *****************************************************************************/
57 WORD X
= (point
>> 16L);
58 WORD Y
= point
& 0x0000FFFFL
;
59 struct impHitTest method
;
63 if (image
->Depth
== CUSTOMIMAGEDEPTH
)
65 method
.MethodID
= IM_HITTEST
;
66 method
.imp_Point
.X
= X
;
67 method
.imp_Point
.Y
= Y
;
69 result
= DoMethodA((Object
*)image
, (Msg
)&method
) != 0;
74 if ((X
>= image
->LeftEdge
&& X
<= image
->LeftEdge
+ image
->Width
) &&
75 (Y
>= image
->TopEdge
&& Y
<= image
->TopEdge
+ image
->Height
))
83 /* NULL image returns TRUE per intuition autodoc! */