summaryrefslogtreecommitdiff
path: root/src/bin/termptydbl.c
blob: 691c0621da5c20df0f0e772069cf97c2335bba54 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
/* XXX: Code generated by tool unicode_dbl_width.py */
#include "private.h"

#include <Elementary.h>
#include "termpty.h"
#include "termptydbl.h"

__attribute__((const))
Eina_Bool
_termpty_is_ambigous_wide(Eina_Unicode g)
{
    switch (g)
      {
       case 0xA1: EINA_FALLTHROUGH;
       case 0xA4: EINA_FALLTHROUGH;
       case 0xA7 ... 0xAA: EINA_FALLTHROUGH;
       case 0xAD ... 0xAE: EINA_FALLTHROUGH;
       case 0xB0 ... 0xB4: EINA_FALLTHROUGH;
       case 0xB6 ... 0xBA: EINA_FALLTHROUGH;
       case 0xBC ... 0xBF: EINA_FALLTHROUGH;
       case 0xC6: EINA_FALLTHROUGH;
       case 0xD0: EINA_FALLTHROUGH;
       case 0xD7 ... 0xD8: EINA_FALLTHROUGH;
       case 0xDE ... 0xE1: EINA_FALLTHROUGH;
       case 0xE6: EINA_FALLTHROUGH;
       case 0xE8 ... 0xEA: EINA_FALLTHROUGH;
       case 0xEC ... 0xED: EINA_FALLTHROUGH;
       case 0xF0: EINA_FALLTHROUGH;
       case 0xF2 ... 0xF3: EINA_FALLTHROUGH;
       case 0xF7 ... 0xFA: EINA_FALLTHROUGH;
       case 0xFC: EINA_FALLTHROUGH;
       case 0xFE: EINA_FALLTHROUGH;
       case 0x101: EINA_FALLTHROUGH;
       case 0x111: EINA_FALLTHROUGH;
       case 0x113: EINA_FALLTHROUGH;
       case 0x11B: EINA_FALLTHROUGH;
       case 0x126 ... 0x127: EINA_FALLTHROUGH;
       case 0x12B: EINA_FALLTHROUGH;
       case 0x131 ... 0x133: EINA_FALLTHROUGH;
       case 0x138: EINA_FALLTHROUGH;
       case 0x13F ... 0x142: EINA_FALLTHROUGH;
       case 0x144: EINA_FALLTHROUGH;
       case 0x148 ... 0x14B: EINA_FALLTHROUGH;
       case 0x14D: EINA_FALLTHROUGH;
       case 0x152 ... 0x153: EINA_FALLTHROUGH;
       case 0x166 ... 0x167: EINA_FALLTHROUGH;
       case 0x16B: EINA_FALLTHROUGH;
       case 0x1CE: EINA_FALLTHROUGH;
       case 0x1D0: EINA_FALLTHROUGH;
       case 0x1D2: EINA_FALLTHROUGH;
       case 0x1D4: EINA_FALLTHROUGH;
       case 0x1D6: EINA_FALLTHROUGH;
       case 0x1D8: EINA_FALLTHROUGH;
       case 0x1DA: EINA_FALLTHROUGH;
       case 0x1DC: EINA_FALLTHROUGH;
       case 0x251: EINA_FALLTHROUGH;
       case 0x261: EINA_FALLTHROUGH;
       case 0x2C4: EINA_FALLTHROUGH;
       case 0x2C7: EINA_FALLTHROUGH;
       case 0x2C9 ... 0x2CB: EINA_FALLTHROUGH;
       case 0x2CD: EINA_FALLTHROUGH;
       case 0x2D0: EINA_FALLTHROUGH;
       case 0x2D8 ... 0x2DB: EINA_FALLTHROUGH;
       case 0x2DD: EINA_FALLTHROUGH;
       case 0x2DF: EINA_FALLTHROUGH;
       case 0x300 ... 0x36F: EINA_FALLTHROUGH;
       case 0x391 ... 0x3A9: EINA_FALLTHROUGH;
       case 0x3B1 ... 0x3C1: EINA_FALLTHROUGH;
       case 0x3C3 ... 0x3C9: EINA_FALLTHROUGH;
       case 0x401: EINA_FALLTHROUGH;
       case 0x410 ... 0x44F: EINA_FALLTHROUGH;
       case 0x451: EINA_FALLTHROUGH;
       case 0x1100 ... 0x115F: EINA_FALLTHROUGH;
       case 0x2010: EINA_FALLTHROUGH;
       case 0x2013 ... 0x2016: EINA_FALLTHROUGH;
       case 0x2018 ... 0x2019: EINA_FALLTHROUGH;
       case 0x201C ... 0x201D: EINA_FALLTHROUGH;
       case 0x2020 ... 0x2022: EINA_FALLTHROUGH;
       case 0x2024 ... 0x2027: EINA_FALLTHROUGH;
       case 0x2030: EINA_FALLTHROUGH;
       case 0x2032 ... 0x2033: EINA_FALLTHROUGH;
       case 0x2035: EINA_FALLTHROUGH;
       case 0x203B ... 0x203C: EINA_FALLTHROUGH;
       case 0x203E: EINA_FALLTHROUGH;
       case 0x2049: EINA_FALLTHROUGH;
       case 0x2074: EINA_FALLTHROUGH;
       case 0x207F: EINA_FALLTHROUGH;
       case 0x2081 ... 0x2084: EINA_FALLTHROUGH;
       case 0x20AC: EINA_FALLTHROUGH;
       case 0x2103: EINA_FALLTHROUGH;
       case 0x2105: EINA_FALLTHROUGH;
       case 0x2109: EINA_FALLTHROUGH;
       case 0x2113: EINA_FALLTHROUGH;
       case 0x2116: EINA_FALLTHROUGH;
       case 0x2121 ... 0x2122: EINA_FALLTHROUGH;
       case 0x2126: EINA_FALLTHROUGH;
       case 0x212B: EINA_FALLTHROUGH;
       case 0x2139: EINA_FALLTHROUGH;
       case 0x2153 ... 0x2154: EINA_FALLTHROUGH;
       case 0x215B ... 0x215E: EINA_FALLTHROUGH;
       case 0x2160 ... 0x216B: EINA_FALLTHROUGH;
       case 0x2170 ... 0x2179: EINA_FALLTHROUGH;
       case 0x2189: EINA_FALLTHROUGH;
       case 0x2190 ... 0x2199: EINA_FALLTHROUGH;
       case 0x21A9 ... 0x21AA: EINA_FALLTHROUGH;
       case 0x21B8 ... 0x21B9: EINA_FALLTHROUGH;
       case 0x21D2: EINA_FALLTHROUGH;
       case 0x21D4: EINA_FALLTHROUGH;
       case 0x21E7: EINA_FALLTHROUGH;
       case 0x2200: EINA_FALLTHROUGH;
       case 0x2202 ... 0x2203: EINA_FALLTHROUGH;
       case 0x2207 ... 0x2208: EINA_FALLTHROUGH;
       case 0x220B: EINA_FALLTHROUGH;
       case 0x220F: EINA_FALLTHROUGH;
       case 0x2211: EINA_FALLTHROUGH;
       case 0x2215: EINA_FALLTHROUGH;
       case 0x221A: EINA_FALLTHROUGH;
       case 0x221D ... 0x2220: EINA_FALLTHROUGH;
       case 0x2223: EINA_FALLTHROUGH;
       case 0x2225: EINA_FALLTHROUGH;
       case 0x2227 ... 0x222C: EINA_FALLTHROUGH;
       case 0x222E: EINA_FALLTHROUGH;
       case 0x2234 ... 0x2237: EINA_FALLTHROUGH;
       case 0x223C ... 0x223D: EINA_FALLTHROUGH;
       case 0x2248: EINA_FALLTHROUGH;
       case 0x224C: EINA_FALLTHROUGH;
       case 0x2252: EINA_FALLTHROUGH;
       case 0x2260 ... 0x2261: EINA_FALLTHROUGH;
       case 0x2264 ... 0x2267: EINA_FALLTHROUGH;
       case 0x226A ... 0x226B: EINA_FALLTHROUGH;
       case 0x226E ... 0x226F: EINA_FALLTHROUGH;
       case 0x2282 ... 0x2283: EINA_FALLTHROUGH;
       case 0x2286 ... 0x2287: EINA_FALLTHROUGH;
       case 0x2295: EINA_FALLTHROUGH;
       case 0x2299: EINA_FALLTHROUGH;
       case 0x22A5: EINA_FALLTHROUGH;
       case 0x22BF: EINA_FALLTHROUGH;
       case 0x2312: EINA_FALLTHROUGH;
       case 0x231A ... 0x231B: EINA_FALLTHROUGH;
       case 0x2328 ... 0x232A: EINA_FALLTHROUGH;
       case 0x2388: EINA_FALLTHROUGH;
       case 0x23CF: EINA_FALLTHROUGH;
       case 0x23E9 ... 0x23F3: EINA_FALLTHROUGH;
       case 0x23F8 ... 0x23FA: EINA_FALLTHROUGH;
       case 0x2460 ... 0x24E9: EINA_FALLTHROUGH;
       case 0x24EB ... 0x254B: EINA_FALLTHROUGH;
       case 0x2550 ... 0x2573: EINA_FALLTHROUGH;
       case 0x2580 ... 0x258F: EINA_FALLTHROUGH;
       case 0x2592 ... 0x2595: EINA_FALLTHROUGH;
       case 0x25A0 ... 0x25A1: EINA_FALLTHROUGH;
       case 0x25A3 ... 0x25AB: EINA_FALLTHROUGH;
       case 0x25B2 ... 0x25B3: EINA_FALLTHROUGH;
       case 0x25B6 ... 0x25B7: EINA_FALLTHROUGH;
       case 0x25BC ... 0x25BD: EINA_FALLTHROUGH;
       case 0x25C0 ... 0x25C1: EINA_FALLTHROUGH;
       case 0x25C6 ... 0x25C8: EINA_FALLTHROUGH;
       case 0x25CB: EINA_FALLTHROUGH;
       case 0x25CE ... 0x25D1: EINA_FALLTHROUGH;
       case 0x25E2 ... 0x25E5: EINA_FALLTHROUGH;
       case 0x25EF: EINA_FALLTHROUGH;
       case 0x25FB ... 0x25FE: EINA_FALLTHROUGH;
       case 0x2600 ... 0x2612: EINA_FALLTHROUGH;
       case 0x2614 ... 0x2685: EINA_FALLTHROUGH;
       case 0x2690 ... 0x2705: EINA_FALLTHROUGH;
       case 0x2708 ... 0x2712: EINA_FALLTHROUGH;
       case 0x2714: EINA_FALLTHROUGH;
       case 0x2716: EINA_FALLTHROUGH;
       case 0x271D: EINA_FALLTHROUGH;
       case 0x2721: EINA_FALLTHROUGH;
       case 0x2728: EINA_FALLTHROUGH;
       case 0x2733 ... 0x2734: EINA_FALLTHROUGH;
       case 0x273D: EINA_FALLTHROUGH;
       case 0x2744: EINA_FALLTHROUGH;
       case 0x2747: EINA_FALLTHROUGH;
       case 0x274C: EINA_FALLTHROUGH;
       case 0x274E: EINA_FALLTHROUGH;
       case 0x2753 ... 0x2755: EINA_FALLTHROUGH;
       case 0x2757: EINA_FALLTHROUGH;
       case 0x2763 ... 0x2767: EINA_FALLTHROUGH;
       case 0x2776 ... 0x277F: EINA_FALLTHROUGH;
       case 0x2795 ... 0x2797: EINA_FALLTHROUGH;
       case 0x27A1: EINA_FALLTHROUGH;
       case 0x27B0: EINA_FALLTHROUGH;
       case 0x27BF: EINA_FALLTHROUGH;
       case 0x2934 ... 0x2935: EINA_FALLTHROUGH;
       case 0x2B05 ... 0x2B07: EINA_FALLTHROUGH;
       case 0x2B1B ... 0x2B1C: EINA_FALLTHROUGH;
       case 0x2B50: EINA_FALLTHROUGH;
       case 0x2B55 ... 0x2B59: EINA_FALLTHROUGH;
       case 0x2E80 ... 0x303E: EINA_FALLTHROUGH;
       case 0x3041 ... 0x4DBF: EINA_FALLTHROUGH;
       case 0x4E00 ... 0xA4C6: EINA_FALLTHROUGH;
       case 0xA960 ... 0xA97C: EINA_FALLTHROUGH;
       case 0xAC00 ... 0xD7A3: EINA_FALLTHROUGH;
       case 0xF900 ... 0xFAD9: EINA_FALLTHROUGH;
       case 0xFE00 ... 0xFE19: EINA_FALLTHROUGH;
       case 0xFE30 ... 0xFE6B: EINA_FALLTHROUGH;
       case 0xFF01 ... 0xFF60: EINA_FALLTHROUGH;
       case 0xFFE0 ... 0xFFE6: EINA_FALLTHROUGH;
       case 0xFFFD: EINA_FALLTHROUGH;
       case 0x16FE0 ... 0x1B2FB: EINA_FALLTHROUGH;
       case 0x1F000 ... 0x1F10A: EINA_FALLTHROUGH;
       case 0x1F10D ... 0x1F12D: EINA_FALLTHROUGH;
       case 0x1F12F ... 0x1F169: EINA_FALLTHROUGH;
       case 0x1F16C ... 0x1F1AD: EINA_FALLTHROUGH;
       case 0x1F200 ... 0x1F53D: EINA_FALLTHROUGH;
       case 0x1F546 ... 0x1F64F: EINA_FALLTHROUGH;
       case 0x1F680 ... 0x1F6FC: EINA_FALLTHROUGH;
       case 0x1F7D5 ... 0x1F7EB: EINA_FALLTHROUGH;
       case 0x1F8B0 ... 0x1F8B1: EINA_FALLTHROUGH;
       case 0x1F90C ... 0x1F93A: EINA_FALLTHROUGH;
       case 0x1F93C ... 0x1F945: EINA_FALLTHROUGH;
       case 0x1F947 ... 0x1FAD6: EINA_FALLTHROUGH;
       case 0x20000 ... 0x3134A: EINA_FALLTHROUGH;
       case 0xE0100 ... 0xE01EF:

        return EINA_TRUE;
    }
   return EINA_FALSE;
}

__attribute__((const))
Eina_Bool
_termpty_is_wide(Eina_Unicode g)
{
    switch (g)
      {
       case 0xA9: EINA_FALLTHROUGH;
       case 0xAE: EINA_FALLTHROUGH;
       case 0x1100 ... 0x115F: EINA_FALLTHROUGH;
       case 0x203C: EINA_FALLTHROUGH;
       case 0x2049: EINA_FALLTHROUGH;
       case 0x2122: EINA_FALLTHROUGH;
       case 0x2139: EINA_FALLTHROUGH;
       case 0x2194 ... 0x2199: EINA_FALLTHROUGH;
       case 0x21A9 ... 0x21AA: EINA_FALLTHROUGH;
       case 0x231A ... 0x231B: EINA_FALLTHROUGH;
       case 0x2328 ... 0x232A: EINA_FALLTHROUGH;
       case 0x2388: EINA_FALLTHROUGH;
       case 0x23CF: EINA_FALLTHROUGH;
       case 0x23E9 ... 0x23F3: EINA_FALLTHROUGH;
       case 0x23F8 ... 0x23FA: EINA_FALLTHROUGH;
       case 0x24C2: EINA_FALLTHROUGH;
       case 0x25AA ... 0x25AB: EINA_FALLTHROUGH;
       case 0x25B6: EINA_FALLTHROUGH;
       case 0x25C0: EINA_FALLTHROUGH;
       case 0x25FB ... 0x25FE: EINA_FALLTHROUGH;
       case 0x2600 ... 0x2605: EINA_FALLTHROUGH;
       case 0x2607 ... 0x2612: EINA_FALLTHROUGH;
       case 0x2614 ... 0x2685: EINA_FALLTHROUGH;
       case 0x2690 ... 0x2705: EINA_FALLTHROUGH;
       case 0x2708 ... 0x2712: EINA_FALLTHROUGH;
       case 0x2714: EINA_FALLTHROUGH;
       case 0x2716: EINA_FALLTHROUGH;
       case 0x271D: EINA_FALLTHROUGH;
       case 0x2721: EINA_FALLTHROUGH;
       case 0x2728: EINA_FALLTHROUGH;
       case 0x2733 ... 0x2734: EINA_FALLTHROUGH;
       case 0x2744: EINA_FALLTHROUGH;
       case 0x2747: EINA_FALLTHROUGH;
       case 0x274C: EINA_FALLTHROUGH;
       case 0x274E: EINA_FALLTHROUGH;
       case 0x2753 ... 0x2755: EINA_FALLTHROUGH;
       case 0x2757: EINA_FALLTHROUGH;
       case 0x2763 ... 0x2767: EINA_FALLTHROUGH;
       case 0x2795 ... 0x2797: EINA_FALLTHROUGH;
       case 0x27A1: EINA_FALLTHROUGH;
       case 0x27B0: EINA_FALLTHROUGH;
       case 0x27BF: EINA_FALLTHROUGH;
       case 0x2934 ... 0x2935: EINA_FALLTHROUGH;
       case 0x2B05 ... 0x2B07: EINA_FALLTHROUGH;
       case 0x2B1B ... 0x2B1C: EINA_FALLTHROUGH;
       case 0x2B50: EINA_FALLTHROUGH;
       case 0x2B55: EINA_FALLTHROUGH;
       case 0x2E80 ... 0x303E: EINA_FALLTHROUGH;
       case 0x3041 ... 0x3247: EINA_FALLTHROUGH;
       case 0x3250 ... 0x4DBF: EINA_FALLTHROUGH;
       case 0x4E00 ... 0xA4C6: EINA_FALLTHROUGH;
       case 0xA960 ... 0xA97C: EINA_FALLTHROUGH;
       case 0xAC00 ... 0xD7A3: EINA_FALLTHROUGH;
       case 0xF900 ... 0xFAD9: EINA_FALLTHROUGH;
       case 0xFE10 ... 0xFE19: EINA_FALLTHROUGH;
       case 0xFE30 ... 0xFE6B: EINA_FALLTHROUGH;
       case 0xFF01 ... 0xFF60: EINA_FALLTHROUGH;
       case 0xFFE0 ... 0xFFE6: EINA_FALLTHROUGH;
       case 0x16FE0 ... 0x1B2FB: EINA_FALLTHROUGH;
       case 0x1F000 ... 0x1F0F5: EINA_FALLTHROUGH;
       case 0x1F10D ... 0x1F10F: EINA_FALLTHROUGH;
       case 0x1F12F: EINA_FALLTHROUGH;
       case 0x1F16C ... 0x1F171: EINA_FALLTHROUGH;
       case 0x1F17E ... 0x1F17F: EINA_FALLTHROUGH;
       case 0x1F18E: EINA_FALLTHROUGH;
       case 0x1F191 ... 0x1F19A: EINA_FALLTHROUGH;
       case 0x1F1AD: EINA_FALLTHROUGH;
       case 0x1F200 ... 0x1F53D: EINA_FALLTHROUGH;
       case 0x1F546 ... 0x1F64F: EINA_FALLTHROUGH;
       case 0x1F680 ... 0x1F6FC: EINA_FALLTHROUGH;
       case 0x1F7D5 ... 0x1F7EB: EINA_FALLTHROUGH;
       case 0x1F8B0 ... 0x1F8B1: EINA_FALLTHROUGH;
       case 0x1F90C ... 0x1F93A: EINA_FALLTHROUGH;
       case 0x1F93C ... 0x1F945: EINA_FALLTHROUGH;
       case 0x1F947 ... 0x1FAD6: EINA_FALLTHROUGH;
       case 0x20000 ... 0x3134A:

        return EINA_TRUE;
    }
   return EINA_FALSE;
}