5 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
8 Desc: Include for the mouse hidd.
17 # include <proto/oop.h>
20 #define CLID_Hidd_Mouse "hidd.mouse"
21 #define CLID_HW_Mouse "hw.mouse"
23 #define IID_Hidd_Mouse "hidd.mouse"
25 #define HiddMouseAB __abHidd_Mouse
27 #ifndef __OOP_NOATTRBASES__
28 extern OOP_AttrBase HiddMouseAB
;
35 aoHidd_Mouse_IrqHandler
,
36 aoHidd_Mouse_IrqHandlerData
,
38 aoHidd_Mouse_RelativeCoords
,
39 aoHidd_Mouse_Extended
,
45 #define aHidd_Mouse_IrqHandler (aoHidd_Mouse_IrqHandler + HiddMouseAB)
46 #define aHidd_Mouse_IrqHandlerData (aoHidd_Mouse_IrqHandlerData + HiddMouseAB)
47 #define aHidd_Mouse_State (aoHidd_Mouse_State + HiddMouseAB)
48 #define aHidd_Mouse_RelativeCoords (aoHidd_Mouse_RelativeCoords + HiddMouseAB)
49 #define aHidd_Mouse_Extended (aoHidd_Mouse_Extended + HiddMouseAB)
51 #define IS_HIDDMOUSE_ATTR(attr, idx) IS_IF_ATTR(attr, idx, HiddMouseAB, num_Hidd_Mouse_Attrs)
53 /* Parameter values for the IRQ handler */
55 struct pHidd_Mouse_Event
60 UWORD type
; /* See below */
63 struct pHidd_Mouse_ExtEvent
69 UWORD flags
; /* See below */
77 vHidd_Mouse_WheelMotion
89 #define vHidd_Mouse_Relative 0x0001
93 moHidd_Mouse_AddHardwareDriver
= 0,
94 moHidd_Mouse_RemHardwareDriver
,
99 struct pHidd_Mouse_AddHardwareDriver
102 OOP_Class
*driverClass
;
103 struct TagItem
*tags
;
106 struct pHidd_Mouse_RemHardwareDriver
109 OOP_Object
*driverObject
;
112 #if !defined(HiddMouseBase) && !defined(__OOP_NOMETHODBASES__)
113 #define HiddMouseBase HIDD_Mouse_GetMethodBase(__obj)
115 static inline OOP_MethodID
HIDD_Mouse_GetMethodBase(OOP_Object
*obj
)
117 static OOP_MethodID MouseMethodBase
;
119 if (!MouseMethodBase
)
121 struct Library
*OOPBase
= (struct Library
*)OOP_OOPBASE(obj
);
123 MouseMethodBase
= OOP_GetMethodID(IID_Hidd_Mouse
, 0);
126 return MouseMethodBase
;
130 #define HIDD_Mouse_AddHardwareDriver(obj, driverClass, tags) \
131 ({OOP_Object *__obj = obj;\
132 HIDD_Mouse_AddHardwareDriver_(HiddMouseBase, __obj, driverClass, tags); })
134 static inline OOP_Object
*HIDD_Mouse_AddHardwareDriver_(OOP_MethodID MouseMethodBase
, OOP_Object
*obj
, OOP_Class
*driverClass
, struct TagItem
*tags
)
136 struct pHidd_Mouse_AddHardwareDriver p
;
138 p
.mID
= MouseMethodBase
+ moHidd_Mouse_AddHardwareDriver
;
139 p
.driverClass
= driverClass
;
142 return (OOP_Object
*)OOP_DoMethod(obj
, (OOP_Msg
) &p
);
145 #define HIDD_Mouse_RemHardwareDriver(obj, driverObject) \
146 ({OOP_Object *__obj = obj; \
147 HIDD_Mouse_RemHardwareDriver_(HiddMouseBase, __obj, driverObject); })
149 static inline void HIDD_Mouse_RemHardwareDriver_(OOP_MethodID MouseMethodBase
, OOP_Object
*obj
, OOP_Object
*driver
)
151 struct pHidd_Mouse_RemHardwareDriver p
;
153 p
.mID
= MouseMethodBase
+ moHidd_Mouse_RemHardwareDriver
;
154 p
.driverObject
= driver
;
156 OOP_DoMethod(obj
, (OOP_Msg
) &p
);
158 #endif /* HIDD_MOUSE_H */