xref: /reactos/sdk/tools/kbdtool/kbdtool.h (revision f47f45db)
1 /*
2  * PROJECT:         ReactOS Build Tools [Keyboard Layout Compiler]
3  * LICENSE:         BSD - See COPYING.BSD in the top level directory
4  * FILE:            tools/kbdtool/kbdtool.h
5  * PURPOSE:         Main Header File
6  * PROGRAMMERS:     ReactOS Foundation
7  */
8 
9 /* INCLUDES *******************************************************************/
10 
11 #include <ctype.h>
12 #include <string.h>
13 #include <stdarg.h>
14 #include <stdio.h>
15 #include <stdlib.h>
16 #include <time.h>
17 #include <typedefs.h>
18 
19 #define KEYWORD_COUNT 17
20 
21 #define CHAR_NORMAL_KEY   0
22 #define CHAR_DEAD_KEY     1
23 #define CHAR_OTHER_KEY    2
24 #define CHAR_INVALID_KEY  3
25 #define CHAR_LIGATURE_KEY 4
26 
27 typedef struct tagKEYNAME
28 {
29     ULONG Code;
30     PCHAR Name;
31     struct tagKEYNAME* Next;
32 } KEYNAME, *PKEYNAME;
33 
34 typedef struct tagSCVK
35 {
36     USHORT ScanCode;
37     UCHAR VirtualKey;
38     PCHAR Name;
39     BOOLEAN Processed;
40 } SCVK, *PSCVK;
41 
42 typedef struct tagVKNAME
43 {
44     ULONG VirtualKey;
45     PCHAR Name;
46 } VKNAME, *PVKNAME;
47 
48 typedef struct tagLAYOUTENTRY
49 {
50     USHORT ScanCode;
51     UCHAR VirtualKey;
52     UCHAR OriginalVirtualKey;
53     ULONG Cap;
54     ULONG StateCount;
55     ULONG CharData[8];
56     ULONG DeadCharData[8];
57     UCHAR LigatureCharData[8];
58     ULONG OtherCharData[8];
59     struct LAYOUTENTRY* CapData;
60     PCHAR Name;
61     ULONG Processed;
62     ULONG LineCount;
63 } LAYOUTENTRY, *PLAYOUTENTRY;
64 
65 typedef struct tagLAYOUT
66 {
67     LAYOUTENTRY Entry[110];
68 } LAYOUT, *PLAYOUT;
69 
70 ULONG
71 DoOutput(
72     IN ULONG StateCount,
73     IN PULONG ShiftStates,
74     IN PKEYNAME DescriptionData,
75     IN PKEYNAME LanguageData,
76     IN PVOID AttributeData,
77     IN PVOID DeadKeyData,
78     IN PVOID LigatureData,
79     IN PKEYNAME KeyNameData,
80     IN PKEYNAME KeyNameExtData,
81     IN PKEYNAME KeyNameDeadData
82 );
83 
84 PCHAR
85 getVKName(
86     IN ULONG VirtualKey,
87     IN BOOLEAN Prefix
88 );
89 
90 ULONG
91 DoParsing(
92     VOID
93 );
94 
95 extern BOOLEAN Verbose, UnicodeFile, SanityCheck, FallbackDriver;
96 extern PCHAR gpszFileName;
97 extern FILE* gfpInput;
98 extern VKNAME VKName[];
99 extern VKNAME Modifiers[];
100 extern SCVK ScVk[];
101 extern PCHAR StateLabel[];
102 extern PCHAR CapState[];
103 extern LAYOUT g_Layout;
104 extern CHAR gVKeyName[32];
105 extern CHAR gKBDName[10];
106 extern CHAR gCopyright[256];
107 extern CHAR gDescription[256];
108 extern CHAR gCompany[256];
109 extern CHAR gLocaleName[256];
110 extern ULONG gVersion, gSubVersion;
111 
112 /* EOF */
113