python-27: make tkinter-27 dependency actually conditional
[unleashed-userland.git] / components / x11 / libX11 / srcs / src / Suncompose.h
blob23e4597cb3a64c6c73b0959af224aacd3acff127
1 /*
2 * Copyright (c) 1986, 2013, Oracle and/or its affiliates. All rights reserved.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
24 #ifndef _SUNCOMPOSE_H
25 #define _SUNCOMPOSE_H
28 * Suncompose.h -- Compose Key Sequence Table
30 * The idea here is to create a simple index into a table of
31 * compose key sequences. The purpose is to provide a fast
32 * lookup mechanism using as little space as possible (while
33 * still using a table of triplets).
35 * For reference, here is the set of all composable characters:
36 * SP !\"\'*+,-./01234:<>?ACDEHILNOPRSTUXY\\^_`acdehilnoprstuxy|~
38 * if ascii_char[i] is not composable,
39 * compose_map[i] is -1
40 * else
41 * if ascii_char[i] appears as a first char in compose_table,
42 * compose_map[i] is the index of it's first appearance
43 * else
44 * compose_map[i] is 112 (end of table)
47 #define ASCII_SET_SIZE 128
49 const char compose_map[ASCII_SET_SIZE] = {
50 -1, /* 000 (^@) */
51 -1, /* 001 (^A) */
52 -1, /* 002 (^B) */
53 -1, /* 003 (^C) */
54 -1, /* 004 (^D) */
55 -1, /* 005 (^E) */
56 -1, /* 006 (^F) */
57 -1, /* 007 (^G) */
58 -1, /* 008 (^H) */
59 -1, /* 009 (^I) */
60 -1, /* 010 (^J) */
61 -1, /* 011 (^K) */
62 -1, /* 012 (^L) */
63 -1, /* 013 (^M) */
64 -1, /* 014 (^N) */
65 -1, /* 015 (^O) */
66 -1, /* 016 (^P) */
67 -1, /* 017 (^Q) */
68 -1, /* 018 (^R) */
69 -1, /* 019 (^S) */
70 -1, /* 020 (^T) */
71 -1, /* 021 (^U) */
72 -1, /* 022 (^V) */
73 -1, /* 023 (^W) */
74 -1, /* 024 (^X) */
75 -1, /* 025 (^Y) */
76 -1, /* 026 (^Z) */
77 -1, /* 027 (^[) */
78 -1, /* 028 (^\) */
79 -1, /* 029 (^]) */
80 -1, /* 030 (^^) */
81 -1, /* 031 (^_) */
82 0, /* 032 (SP) */
83 1, /* 033 (!) */
84 4, /* 034 (") */
85 -1, /* 035 (#) */
86 -1, /* 036 ($) */
87 -1, /* 037 (%) */
88 -1, /* 038 (&) */
89 16, /* 039 (') */
90 -1, /* 040 (() */
91 -1, /* 041 ()) */
92 28, /* 042 (*) */
93 31, /* 043 (+) */
94 32, /* 044 (,) */
95 36, /* 045 (-) */
96 48, /* 046 (.) */
97 49, /* 047 (/) */
98 54, /* 048 (0) */
99 57, /* 049 (1) */
100 60, /* 050 (2) */
101 61, /* 051 (3) */
102 112, /* 052 (4) */
103 -1, /* 053 (5) */
104 -1, /* 054 (6) */
105 -1, /* 055 (7) */
106 -1, /* 056 (8) */
107 -1, /* 057 (9) */
108 112, /* 058 (:) */
109 -1, /* 059 (;) */
110 63, /* 060 (<) */
111 -1, /* 061 (=) */
112 64, /* 062 (>) */
113 65, /* 063 (?) */
114 -1, /* 064 (@) */
115 66, /* 065 (A) */
116 -1, /* 066 (B) */
117 70, /* 067 (C) */
118 112, /* 068 (D) */
119 71, /* 069 (E) */
120 -1, /* 070 (F) */
121 -1, /* 071 (G) */
122 73, /* 072 (H) */
123 74, /* 073 (I) */
124 -1, /* 074 (J) */
125 -1, /* 075 (K) */
126 112, /* 076 (L) */
127 -1, /* 077 (M) */
128 76, /* 078 (N) */
129 77, /* 079 (O) */
130 84, /* 080 (P) */
131 -1, /* 081 (Q) */
132 112, /* 082 (R) */
133 112, /* 083 (S) */
134 112, /* 084 (T) */
135 85, /* 085 (U) */
136 -1, /* 086 (V) */
137 -1, /* 087 (W) */
138 112, /* 088 (X) */
139 112, /* 089 (Y) */
140 -1, /* 090 (Z) */
141 -1, /* 091 ([) */
142 87, /* 092 (\) */
143 -1, /* 093 (]) */
144 88, /* 094 (^) */
145 93, /* 095 (_) */
146 94, /* 096 (`) */
147 99, /* 097 (a) */
148 -1, /* 098 (b) */
149 101, /* 099 (c) */
150 112, /* 100 (d) */
151 112, /* 101 (e) */
152 -1, /* 102 (f) */
153 -1, /* 103 (g) */
154 102, /* 104 (h) */
155 112, /* 105 (i) */
156 -1, /* 106 (j) */
157 -1, /* 107 (k) */
158 112, /* 108 (l) */
159 -1, /* 109 (m) */
160 103, /* 110 (n) */
161 104, /* 111 (o) */
162 108, /* 112 (p) */
163 -1, /* 113 (q) */
164 112, /* 114 (r) */
165 109, /* 115 (s) */
166 112, /* 116 (t) */
167 112, /* 117 (u) */
168 -1, /* 118 (v) */
169 -1, /* 119 (w) */
170 110, /* 120 (x) */
171 112, /* 121 (y) */
172 -1, /* 122 (z) */
173 -1, /* 123 ({) */
174 111, /* 124 (|) */
175 -1, /* 125 (}) */
176 112, /* 126 (~) */
177 -1, /* 127 (DEL) */
180 typedef struct _ComposeTableEntry {
181 unsigned char first;
182 unsigned char second;
183 unsigned char result;
184 } ComposeTableEntry;
187 * IMPORTANT NOTE: This table MUST be kept in proper sorted order:
188 * The first and second characters in each entry must be in ASCII
189 * collating sequence (left to right).
190 * The table must be in ASCII collating sequence by first character
191 * (top to bottom).
194 /* COMPOSE + first character + second character => ISO character */
196 const ComposeTableEntry compose_table[] = {
198 {' ', ' ', 0xA0}, /* 000 */ /* NBSP (non-breaking space) */
199 {'!', '!', 0xA1}, /* 001 */ /* inverted ! */
200 {'!', 'P', 0xB6}, /* 002 */ /* paragraph mark */
201 {'!', 'p', 0xB6}, /* 003 */ /* paragraph mark */
202 {'"', '"', 0xA8}, /* 004 */ /* diaresis */
203 {'"', 'A', 0xC4}, /* 005 */ /* A with diaresis */
204 {'"', 'E', 0xCB}, /* 006 */ /* E with diaresis */
205 {'"', 'I', 0xCF}, /* 007 */ /* I with diaresis */
206 {'"', 'O', 0xD6}, /* 008 */ /* O with diaresis */
207 {'"', 'U', 0xDC}, /* 009 */ /* U with diaresis */
208 {'"', 'a', 0xE4}, /* 010 */ /* a with diaresis */
209 {'"', 'e', 0xEB}, /* 011 */ /* e with diaresis */
210 {'"', 'i', 0xEF}, /* 012 */ /* i with diaresis */
211 {'"', 'o', 0xF6}, /* 013 */ /* o with diaresis */
212 {'"', 'u', 0xFC}, /* 014 */ /* u with diaresis */
213 {'"', 'y', 0xFF}, /* 015 */ /* y with diaresis */
214 {'\'','A', 0xC1}, /* 016 */ /* A with acute accent */
215 {'\'','E', 0xC9}, /* 017 */ /* E with acute accent */
216 {'\'','I', 0xCD}, /* 018 */ /* I with acute accent */
217 {'\'','O', 0xD3}, /* 019 */ /* O with acute accent */
218 {'\'','U', 0xDA}, /* 020 */ /* U with acute accent */
219 {'\'','Y', 0xDD}, /* 021 */ /* Y with acute accent */
220 {'\'','a', 0xE1}, /* 022 */ /* a with acute accent */
221 {'\'','e', 0xE9}, /* 023 */ /* e with acute accent */
222 {'\'','i', 0xED}, /* 024 */ /* i with acute accent */
223 {'\'','o', 0xF3}, /* 025 */ /* o with acute accent */
224 {'\'','u', 0xFA}, /* 026 */ /* u with acute accent */
225 {'\'','y', 0xFD}, /* 027 */ /* y with acute accent */
226 {'*', 'A', 0xC5}, /* 028 */ /* A with ring */
227 {'*', '^', 0xB0}, /* 029 */ /* degree */
228 {'*', 'a', 0xE5}, /* 030 */ /* a with ring */
229 {'+', '-', 0xB1}, /* 031 */ /* plus/minus */
230 {',', ',', 0xB8}, /* 032 */ /* cedilla */
231 {',', '-', 0xAC}, /* 033 */ /* not sign */
232 {',', 'C', 0xC7}, /* 034 */ /* C with cedilla */
233 {',', 'c', 0xE7}, /* 035 */ /* c with cedilla */
234 {'-', '-', 0xAD}, /* 036 */ /* soft hyphen */
235 {'-', ':', 0xF7}, /* 037 */ /* division sign */
236 {'-', 'A', 0xAA}, /* 038 */ /* feminine superior numeral */
237 {'-', 'D', 0xD0}, /* 039 */ /* Upper-case eth */
238 {'-', 'L', 0xA3}, /* 040 */ /* pounds sterling */
239 {'-', 'Y', 0xA5}, /* 041 */ /* yen */
240 {'-', '^', 0xAF}, /* 042 */ /* macron */
241 {'-', 'a', 0xAA}, /* 043 */ /* feminine superior numeral */
242 {'-', 'd', 0xF0}, /* 044 */ /* Lower-case eth */
243 {'-', 'l', 0xA3}, /* 045 */ /* pounds sterling */
244 {'-', 'y', 0xA5}, /* 046 */ /* yen */
245 {'-', '|', 0xAC}, /* 047 */ /* not sign */
246 {'.', '^', 0xB7}, /* 048 */ /* centered dot */
247 {'/', 'C', 0xA2}, /* 049 */ /* cent sign */
248 {'/', 'O', 0xD8}, /* 050 */ /* O with slash */
249 {'/', 'c', 0xA2}, /* 051 */ /* cent sign */
250 {'/', 'o', 0xF8}, /* 052 */ /* o with slash */
251 {'/', 'u', 0xB5}, /* 053 */ /* mu */
252 {'0', 'X', 0xA4}, /* 054 */ /* currency symbol */
253 {'0', '^', 0xB0}, /* 055 */ /* degree */
254 {'0', 'x', 0xA4}, /* 056 */ /* currency symbol */
255 {'1', '2', 0xBD}, /* 057 */ /* 1/2 */
256 {'1', '4', 0xBC}, /* 058 */ /* 1/4 */
257 {'1', '^', 0xB9}, /* 059 */ /* superior '1' */
258 {'2', '^', 0xB2}, /* 060 */ /* superior '2' */
259 {'3', '4', 0xBE}, /* 061 */ /* 3/4 */
260 {'3', '^', 0xB3}, /* 062 */ /* superior '3' */
261 {'<', '<', 0xAB}, /* 063 */ /* left guillemot */
262 {'>', '>', 0xBB}, /* 064 */ /* right guillemot */
263 {'?', '?', 0xBF}, /* 065 */ /* inverted ? */
264 {'A', 'E', 0xC6}, /* 066 */ /* AE dipthong */
265 {'A', '^', 0xC2}, /* 067 */ /* A with circumflex accent */
266 {'A', '`', 0xC0}, /* 068 */ /* A with grave accent */
267 {'A', '~', 0xC3}, /* 069 */ /* A with tilde */
268 {'C', 'O', 0xA9}, /* 060 */ /* copyright */
269 {'E', '^', 0xCA}, /* 071 */ /* E with circumflex accent */
270 {'E', '`', 0xC8}, /* 072 */ /* E with grave accent */
271 {'H', 'T', 0xDE}, /* 073 */ /* Upper-case thorn */
272 {'I', '^', 0xCE}, /* 074 */ /* I with circumflex accent */
273 {'I', '`', 0xCC}, /* 075 */ /* I with grave accent */
274 {'N', '~', 0xD1}, /* 076 */ /* N with tilde */
275 {'O', 'R', 0xAE}, /* 077 */ /* registered */
276 {'O', 'S', 0xA7}, /* 078 */ /* section mark */
277 {'O', 'X', 0xA4}, /* 079 */ /* currency symbol */
278 {'O', '^', 0xD4}, /* 080 */ /* O with circumflex accent */
279 {'O', '_', 0xBA}, /* 081 */ /* masculine superior numeral */
280 {'O', '`', 0xD2}, /* 082 */ /* O with grave accent */
281 {'O', '~', 0xD5}, /* 083 */ /* O with tilde */
282 {'P', '|', 0xDE}, /* 084 */ /* Upper-case thorn */
283 {'U', '^', 0xDB}, /* 085 */ /* U with circumflex accent */
284 {'U', '`', 0xD9}, /* 086 */ /* U with grave accent */
285 {'\\','\\',0xB4}, /* 087 */ /* acute accent */
286 {'^', 'a', 0xE2}, /* 088 */ /* a with circumflex accent */
287 {'^', 'e', 0xEA}, /* 089 */ /* e with circumflex accent */
288 {'^', 'i', 0xEE}, /* 090 */ /* i with circumflex accent */
289 {'^', 'o', 0xF4}, /* 091 */ /* o with circumflex accent */
290 {'^', 'u', 0xFB}, /* 092 */ /* u with circumflex accent */
291 {'_', 'o', 0xBA}, /* 093 */ /* masculine superior numeral */
292 {'`', 'a', 0xE0}, /* 094 */ /* a with grave accent */
293 {'`', 'e', 0xE8}, /* 095 */ /* e with grave accent */
294 {'`', 'i', 0xEC}, /* 096 */ /* i with grave accent */
295 {'`', 'o', 0xF2}, /* 097 */ /* o with grave accent */
296 {'`', 'u', 0xF9}, /* 098 */ /* u with grave accent */
297 {'a', 'e', 0xE6}, /* 099 */ /* ae dipthong */
298 {'a', '~', 0xE3}, /* 100 */ /* a with tilde */
299 {'c', 'o', 0xA9}, /* 101 */ /* copyright */
300 {'h', 't', 0xFE}, /* 102 */ /* Lower-case thorn */
301 {'n', '~', 0xF1}, /* 103 */ /* n with tilde */
302 {'o', 'r', 0xAE}, /* 104 */ /* registered */
303 {'o', 's', 0xA7}, /* 105 */ /* section mark */
304 {'o', 'x', 0xA4}, /* 106 */ /* currency symbol */
305 {'o', '~', 0xF5}, /* 107 */ /* o with tilde */
306 {'p', '|', 0xFE}, /* 108 */ /* Lower-case thorn */
307 {'s', 's', 0xDF}, /* 109 */ /* German double-s */
308 {'x', 'x', 0xD7}, /* 110 */ /* multiplication sign */
309 {'|', '|', 0xA6}, /* 111 */ /* broken bar */
311 {0, 0, 0}, /* end of table */
314 #endif /* _SUNCOMPOSE_H */