2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
7 #include <clib/macros.h>
8 #include "intuition_intern.h"
11 #define DEBUG_DOUBLECLICK(x) ;
13 /*****************************************************************************
16 #include <intuition/intuition.h>
17 #include <proto/intuition.h>
19 AROS_LH4(BOOL
, DoubleClick
,
22 AROS_LHA(ULONG
, sSeconds
, D0
),
23 AROS_LHA(ULONG
, sMicros
, D1
),
24 AROS_LHA(ULONG
, cSeconds
, D2
),
25 AROS_LHA(ULONG
, cMicros
, D3
),
28 struct IntuitionBase
*, IntuitionBase
, 17, Intuition
)
31 Check if two times are within the doubleclick intervall.
34 sSeconds, sMicros - Seconds and microseconds of the first event.
35 cSeconds, cMicros - Seconds and microseconds of the second event.
38 TRUE if the times are within the doubleclick intervall, FALSE
53 *****************************************************************************/
56 AROS_LIBBASE_EXT_DECL(struct IntuitionBase
*,IntuitionBase
)
60 DEBUG_DOUBLECLICK(dprintf("DoubleClick: t1 %lu/%lu t2 %lu/%lu\n",
61 cSeconds
, cMicros
, sSeconds
, sMicros
));
63 if (ABS(cSeconds
- sSeconds
) <= 4)
67 base
= MIN(cSeconds
, sSeconds
);
69 sMicros
+= 1000000 * (sSeconds
- base
);
70 cMicros
+= 1000000 * (cSeconds
- base
);
72 base
= ABS((LONG
)(sMicros
- cMicros
));
74 ret
= (base
<= GetPrivIBase(IntuitionBase
)->ActivePreferences
->DoubleClick
.tv_micro
+
75 1000000 * GetPrivIBase(IntuitionBase
)->ActivePreferences
->DoubleClick
.tv_secs
);
78 DEBUG_DOUBLECLICK(dprintf("DoubleClick: return %d\n", ret
));