grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / keymap / keymap_intern.h
blob5c932484e570395f2cb2f3c66633594a2f6a47b3
1 #ifndef KEYMAP_INTERN_H
2 #define KEYMAP_INTERN_H
3 /*
4 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
5 $Id$
7 Desc: Keymaps internal structure
8 Lang: english
9 */
10 #ifndef AROS_LIBCALL_H
11 # include <aros/libcall.h>
12 #endif
13 #ifndef EXEC_EXECBASE_H
14 # include <exec/execbase.h>
15 #endif
16 #ifndef EXEC_TYPES_H
17 # include <exec/types.h>
18 #endif
19 #ifndef DEVICES_KEYMAP_H
20 # include <devices/keymap.h>
21 #endif
22 #include <dos/bptr.h>
24 #define KEYMAPNAME "keymap.library"
26 #define DEBUG 0 /* This must be set globally because of cpak */
28 struct KeymapBase;
29 extern const UBYTE keymaptype_table[8][8];
30 extern const UBYTE keymapstr_table[8][8];
32 /* Structures */
33 struct BufInfo
35 UBYTE *Buffer;
36 LONG BufLength;
37 LONG CharsWritten;
40 struct KeyInfo
42 UBYTE Key_MapType; /* KCF_xxx */
44 /* 4 character combo, pointer to string descr, or pointer to deadkey descr,
45 ** all ccording to Key_MapType
47 IPTR Key_Mapping;
49 UBYTE KCFQual; /* The qualifiers for the keycode, converted to KCF_xxx format */
53 /* Prototypes */
54 BOOL WriteToBuffer(struct BufInfo *bufinfo, UBYTE *string, LONG numchars);
55 WORD GetKeyInfo(struct KeyInfo *ki, UWORD code, UWORD qual, struct KeyMap *km);
56 WORD GetDeadKeyIndex(UWORD code, UWORD qual, struct KeyMap *km);
58 /* Macros */
59 #define GetBitProperty(ubytearray, idx) \
60 ( (ubytearray)[(idx) / 8] & ( 1 << ((idx) & 0x07) ))
62 /* Get one of the for characters in km_LoKeyMap or km_HiKeyMap addresses,
63 ** id can be 0, 1, 2, 3
65 #define GetMapChar(key_mapping, idx) \
66 ( (key_mapping >> ((3 - (idx)) * 8)) & 0x000000FF )
68 #define KMBase(x) ((struct KeymapBase *)x)
71 /* Librarybase struct */
72 struct KeymapBase
74 struct Library LibNode;
75 struct KeyMap *DefaultKeymap;
76 struct KeyMapResource KeymapResource;
80 #endif /* KEYMAP_INTERN_H */