Minor fixes to comments.
[AROS.git] / rom / intuition / setpointerbounds.c
blob16b07e43641e1ab6324eb0c1085a04952f901365
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
4 */
6 #include "intuition_intern.h"
7 #include "inputhandler.h"
9 AROS_LH4(ULONG, SetPointerBounds,
10 /* SYNOPSIS */
11 AROS_LHA(struct Screen *, screen , A0),
12 AROS_LHA(struct Rectangle *, rect , A1),
13 AROS_LHA(ULONG , reserved, D0),
14 AROS_LHA(struct TagItem *, tags , A2),
15 /* LOCATION */
16 struct IntuitionBase *, IntuitionBase, 160, Intuition)
19 AROS_LIBFUNC_INIT
21 struct IIHData *iihd = (struct IIHData *)GetPrivIBase(IntuitionBase)->InputHandler->is_Data;
23 (void)screen;
24 (void)reserved;
26 ObtainSemaphore(&GetPrivIBase(IntuitionBase)->InputHandlerLock);
27 if (!iihd->MouseBoundsActiveFlag)
29 if (rect)
31 iihd->MouseBoundsActiveFlag = TRUE;
32 iihd->MouseBoundsKillTimer = 5; /* 1 sec */
33 iihd->MouseBoundsLeft = rect->MinX;
34 iihd->MouseBoundsTop = rect->MinY;
35 iihd->MouseBoundsRight = rect->MaxX;
36 iihd->MouseBoundsBottom = rect->MaxY;
39 else if (iihd->MouseBoundsKillTimer)
41 if (rect)
43 /* Reset timer */
44 iihd->MouseBoundsKillTimer = 5; /* 1 sec */
45 iihd->MouseBoundsLeft = rect->MinX;
46 iihd->MouseBoundsTop = rect->MinY;
47 iihd->MouseBoundsRight = rect->MaxX;
48 iihd->MouseBoundsBottom = rect->MaxY;
50 else
52 iihd->MouseBoundsKillTimer = 0;
53 iihd->MouseBoundsActiveFlag = FALSE;
57 ReleaseSemaphore(&GetPrivIBase(IntuitionBase)->InputHandlerLock);
59 return 0;
61 AROS_LIBFUNC_EXIT