1 #ifndef HIDD_KEYBOARD_H
2 #define HIDD_KEYBOARD_H
5 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
8 Desc: Include for the keyboard hidd.
12 #include <proto/oop.h>
14 #include <utility/tagitem.h>
16 #define CLID_Hidd_Kbd "hidd.kbd"
17 #define CLID_HW_Kbd "hw.kbd"
18 #define IID_Hidd_Kbd "hidd.kbd"
20 #define HiddKbdAB __abHidd_Kbd
22 #ifndef __OOP_NOATTRBASES__
23 extern OOP_AttrBase HiddKbdAB
;
27 aoHidd_Kbd_IrqHandler
,
28 aoHidd_Kbd_IrqHandlerData
,
33 #define aHidd_Kbd_IrqHandler (aoHidd_Kbd_IrqHandler + HiddKbdAB)
34 #define aHidd_Kbd_IrqHandlerData (aoHidd_Kbd_IrqHandlerData + HiddKbdAB)
36 #define IS_HIDDKBD_ATTR(attr, idx) IS_IF_ATTR(attr, idx, HiddKbdAB, num_Hidd_Kbd_Attrs)
39 * The following methods are legacy and deprecated. Do not use them.
40 * Use HW_AddDriver() and HW_RemoveDriver() methods on CLID_HW_Kbd
45 moHidd_Kbd_AddHardwareDriver
= 0,
46 moHidd_Kbd_RemHardwareDriver
,
51 struct pHidd_Kbd_AddHardwareDriver
54 OOP_Class
*driverClass
;
58 struct pHidd_Kbd_RemHardwareDriver
61 OOP_Object
*driverObject
;
64 #if !defined(HiddKbdBase) && !defined(__OOP_NOMETHODBASES__)
65 #define HiddKbdBase HIDD_Kbd_GetMethodBase(__obj)
67 static inline OOP_MethodID
HIDD_Kbd_GetMethodBase(OOP_Object
*obj
)
69 static OOP_MethodID KbdMethodBase
;
73 struct Library
*OOPBase
= (struct Library
*)OOP_OOPBASE(obj
);
75 KbdMethodBase
= OOP_GetMethodID(IID_Hidd_Kbd
, 0);
82 #define HIDD_Kbd_AddHardwareDriver(obj, driverClass, tags) \
83 ({OOP_Object *__obj = obj;\
84 HIDD_Kbd_AddHardwareDriver_(HiddKbdBase, __obj, driverClass, tags); })
86 static inline OOP_Object
*HIDD_Kbd_AddHardwareDriver_(OOP_MethodID KbdMethodBase
, OOP_Object
*obj
, OOP_Class
*driverClass
, struct TagItem
*tags
)
88 struct pHidd_Kbd_AddHardwareDriver p
;
90 p
.mID
= KbdMethodBase
+ moHidd_Kbd_AddHardwareDriver
;
91 p
.driverClass
= driverClass
;
94 return (OOP_Object
*)OOP_DoMethod(obj
, (OOP_Msg
) &p
);
97 #define HIDD_Kbd_RemHardwareDriver(obj, driverObject) \
98 ({OOP_Object *__obj = obj;\
99 HIDD_Kbd_RemHardwareDriver_(HiddKbdBase, __obj, driverObject); })
101 static inline OOP_Object
*HIDD_Kbd_RemHardwareDriver_(OOP_MethodID KbdMethodBase
, OOP_Object
*obj
, OOP_Object
*driverObject
)
103 struct pHidd_Kbd_RemHardwareDriver p
;
105 p
.mID
= KbdMethodBase
+ moHidd_Kbd_RemHardwareDriver
;
106 p
.driverObject
= driverObject
;
108 return (OOP_Object
*)OOP_DoMethod(obj
, (OOP_Msg
) &p
);
111 #endif /* HIDD_KEYBOARD_H */