grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / hidds / kbd / include / keyboard.h
blob2e99d9b97e4bf41429bb6824a579c655e675cbb4
1 #ifndef HIDD_KEYBOARD_H
2 #define HIDD_KEYBOARD_H
4 /*
5 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: Include for the keyboard hidd.
9 Lang: English.
12 #include <proto/oop.h>
13 #include <oop/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;
24 #endif
26 enum {
27 aoHidd_Kbd_IrqHandler,
28 aoHidd_Kbd_IrqHandlerData,
30 num_Hidd_Kbd_Attrs
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
41 * object instead.
43 enum
45 moHidd_Kbd_AddHardwareDriver = 0,
46 moHidd_Kbd_RemHardwareDriver,
48 NUM_Kbd_METHODS
51 struct pHidd_Kbd_AddHardwareDriver
53 OOP_MethodID mID;
54 OOP_Class *driverClass;
55 struct TagItem *tags;
58 struct pHidd_Kbd_RemHardwareDriver
60 OOP_MethodID mID;
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;
71 if (!KbdMethodBase)
73 struct Library *OOPBase = (struct Library *)OOP_OOPBASE(obj);
75 KbdMethodBase = OOP_GetMethodID(IID_Hidd_Kbd, 0);
78 return KbdMethodBase;
80 #endif
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;
92 p.tags = tags;
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 */