summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-07-13 06:22:46 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-07-13 06:22:46 +0000
commit92d58dc53244f751ef9a0bf0b40600973c230bfa (patch)
tree0a1e701742189557d29cc84d268ca4e83624c3d4 /src/bin
parent01cefcedd78294ee62028a776cc6774d92276e49 (diff)
mouve doublewidth checking to its own file to not "pollute" termpty.c.
also make it more of a tree to minimize compares. SVN revision: 73787
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/Makefile.am1
-rw-r--r--src/bin/termpty.c217
-rw-r--r--src/bin/termptydbl.c286
-rw-r--r--src/bin/termptydbl.h2
4 files changed, 291 insertions, 215 deletions
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index 2bb6c90..dea6235 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -26,6 +26,7 @@ options_theme.c options_theme.h \
26options_wallpaper.c options_wallpaper.h \ 26options_wallpaper.c options_wallpaper.h \
27termio.c termio.h \ 27termio.c termio.h \
28termpty.c termpty.h \ 28termpty.c termpty.h \
29termptydbl.c termptydbl.h \
29utf8.c utf8.h \ 30utf8.c utf8.h \
30win.c win.h \ 31win.c win.h \
31utils.c utils.h 32utils.c utils.h
diff --git a/src/bin/termpty.c b/src/bin/termpty.c
index efb5f18..51ec2c9 100644
--- a/src/bin/termpty.c
+++ b/src/bin/termpty.c
@@ -2,6 +2,7 @@
2 2
3#include <Elementary.h> 3#include <Elementary.h>
4#include "termpty.h" 4#include "termpty.h"
5#include "termptydbl.h"
5#include <sys/types.h> 6#include <sys/types.h>
6#include <sys/stat.h> 7#include <sys/stat.h>
7#include <stdlib.h> 8#include <stdlib.h>
@@ -43,220 +44,6 @@ termpty_shutdown(void)
43 _termpty_log_dom = -1; 44 _termpty_log_dom = -1;
44} 45}
45 46
46#if defined(SUPPORT_DBLWIDTH)
47static Eina_Bool
48_is_dblwidth_get(Termpty *ty, int g)
49{
50 // check for east asian full-width (F), half-width (H), wide (W),
51 // narrow (Na) or ambiguous (A) codepoints
52 // ftp://ftp.unicode.org/Public/UNIDATA/EastAsianWidth.txt
53
54 // optimize for latin1 non-ambiguous
55 if (g <= 0xa0)
56 return EINA_FALSE;
57 // (F)
58 if ((g == 0x3000) ||
59 ((g >= 0xff01) && (g <= 0xffe6)))
60 return EINA_TRUE;
61 // (W)
62 if (((g >= 0x1100) && (g <= 0x11ff)) ||
63 ((g >= 0x2329) && (g <= 0x232A)) ||
64 ((g >= 0x2E80) && (g <= 0x4dbf)) ||
65 ((g >= 0x4e00) && (g <= 0x9fff)) ||
66 ((g >= 0xa000) && (g <= 0xa4c6)) ||
67 ((g >= 0xa960) && (g <= 0xa97c)) ||
68 ((g >= 0xac00) && (g <= 0xd7a3)) ||
69 ((g >= 0xd7b0) && (g <= 0xd7fb)) ||
70 ((g >= 0xf900) && (g <= 0xfaff)) ||
71 ((g >= 0xfe10) && (g <= 0xfe6b)) ||
72 ((g >= 0x1b000) && (g <= 0x1b001)) ||
73 ((g >= 0x1f200) && (g <= 0x1f202)) ||
74 ((g >= 0x1f210) && (g <= 0x1f251)) ||
75 ((g >= 0x20000) && (g <= 0x2fffd)) ||
76 ((g >= 0x30000) && (g <= 0x3FFFD)))
77 return EINA_TRUE;
78 // (A)
79 if (ty->state.cjk_ambiguous_wide)
80 {
81 // grep ';A #' EastAsianWidth.txt | wc -l
82 // :(
83 if ((g == 0x00a1) ||
84 (g == 0x00a4) ||
85 ((g >= 0x00a7) && (g <= 0x00a8)) ||
86 (g == 0x00aa) ||
87 ((g >= 0x00ad) && (g <= 0x00ae)) ||
88 ((g >= 0x00b0) && (g <= 0x00bf)) ||
89 (g == 0x00c6) ||
90 (g == 0x00d0) ||
91 ((g >= 0x00d7) && (g <= 0x00d8)) ||
92 ((g >= 0x00de) && (g <= 0x00df)) ||
93 (g == 0x00e0) ||
94 (g == 0x00e1) ||
95 (g == 0x00e6) ||
96 ((g >= 0x00e8) && (g <= 0x00e9)) ||
97 (g == 0x00ea) ||
98 ((g >= 0x00ec) && (g <= 0x00ed)) ||
99 (g == 0x00f0) ||
100 ((g >= 0x00f2) && (g <= 0x00f3)) ||
101 ((g >= 0x00f7) && (g <= 0x00f9)) ||
102 (g == 0x00fa) ||
103 (g == 0x00fc) ||
104 (g == 0x00fe) ||
105 (g == 0x0101) ||
106 (g == 0x0111) ||
107 (g == 0x0113) ||
108 (g == 0x011b) ||
109 ((g >= 0x0126) && (g <= 0x0127)) ||
110 (g == 0x012b) ||
111 ((g >= 0x0131) && (g <= 0x0133)) ||
112 (g == 0x0138) ||
113 ((g >= 0x013f) && (g <= 0x0142)) ||
114 (g == 0x0144) ||
115 ((g >= 0x0148) && (g <= 0x014b)) ||
116 (g == 0x014d) ||
117 ((g >= 0x0152) && (g <= 0x0153)) ||
118 ((g >= 0x0166) && (g <= 0x0167)) ||
119 (g == 0x016b) ||
120 (g == 0x01ce) ||
121 (g == 0x01d0) ||
122 (g == 0x01d2) ||
123 (g == 0x01d4) ||
124 (g == 0x01d6) ||
125 (g == 0x01d8) ||
126 (g == 0x01da) ||
127 (g == 0x01dc) ||
128 (g == 0x0251) ||
129 (g == 0x0261) ||
130 (g == 0x02c4) ||
131 (g == 0x02c7) ||
132 (g == 0x02c9) ||
133 ((g >= 0x02ca) && (g <= 0x02cb)) ||
134 (g == 0x02cd) ||
135 (g == 0x02d0) ||
136 ((g >= 0x02d8) && (g <= 0x02d9)) ||
137 ((g >= 0x02da) && (g <= 0x02db)) ||
138 (g == 0x02dd) ||
139 (g == 0x02df) ||
140 ((g >= 0x0300) && (g <= 0x036f)) ||
141 ((g >= 0x0391) && (g <= 0x03c9)) ||
142 (g == 0x0401) ||
143 ((g >= 0x0410) && (g <= 0x044f)) ||
144 (g == 0x0451) ||
145 (g == 0x2010) ||
146 ((g >= 0x2013) && (g <= 0x2016)) ||
147 ((g >= 0x2018) && (g <= 0x2019)) ||
148 (g == 0x201c) ||
149 (g == 0x201d) ||
150 ((g >= 0x2020) && (g <= 0x2022)) ||
151 ((g >= 0x2024) && (g <= 0x2027)) ||
152 (g == 0x2030) ||
153 ((g >= 0x2032) && (g <= 0x2033)) ||
154 (g == 0x2035) ||
155 (g == 0x203b) ||
156 (g == 0x203e) ||
157 (g == 0x2074) ||
158 (g == 0x207f) ||
159 ((g >= 0x2081) && (g <= 0x2084)) ||
160 (g == 0x20ac) ||
161 (g == 0x2103) ||
162 (g == 0x2105) ||
163 (g == 0x2109) ||
164 (g == 0x2113) ||
165 (g == 0x2116) ||
166 ((g >= 0x2121) && (g <= 0x2122)) ||
167 (g == 0x2126) ||
168 (g == 0x212b) ||
169 ((g >= 0x2153) && (g <= 0x2154)) ||
170 ((g >= 0x215b) && (g <= 0x215e)) ||
171 ((g >= 0x2160) && (g <= 0x216b)) ||
172 ((g >= 0x2170) && (g <= 0x2179)) ||
173 ((g >= 0x2189) && (g <= 0x2199)) ||
174 ((g >= 0x21b8) && (g <= 0x21b9)) ||
175 (g == 0x21d2) ||
176 (g == 0x21d4) ||
177 (g == 0x21e7) ||
178 (g == 0x2200) ||
179 ((g >= 0x2202) && (g <= 0x2203)) ||
180 ((g >= 0x2207) && (g <= 0x2208)) ||
181 (g == 0x220b) ||
182 (g == 0x220f) ||
183 (g == 0x2211) ||
184 (g == 0x2215) ||
185 (g == 0x221a) ||
186 ((g >= 0x221d) && (g <= 0x221f)) ||
187 (g == 0x2220) ||
188 (g == 0x2223) ||
189 (g == 0x2225) ||
190 ((g >= 0x2227) && (g <= 0x222e)) ||
191 ((g >= 0x2234) && (g <= 0x2237)) ||
192 ((g >= 0x223c) && (g <= 0x223d)) ||
193 (g == 0x2248) ||
194 (g == 0x224c) ||
195 (g == 0x2252) ||
196 ((g >= 0x2260) && (g <= 0x2261)) ||
197 ((g >= 0x2264) && (g <= 0x2267)) ||
198 ((g >= 0x226a) && (g <= 0x226b)) ||
199 ((g >= 0x226e) && (g <= 0x226f)) ||
200 ((g >= 0x2282) && (g <= 0x2283)) ||
201 ((g >= 0x2286) && (g <= 0x2287)) ||
202 (g == 0x2295) ||
203 (g == 0x2299) ||
204 (g == 0x22a5) ||
205 (g == 0x22bf) ||
206 (g == 0x2312) ||
207 ((g >= 0x2460) && (g <= 0x2595)) ||
208 ((g >= 0x25a0) && (g <= 0x25bd)) ||
209 ((g >= 0x25c0) && (g <= 0x25c1)) ||
210 ((g >= 0x25c6) && (g <= 0x25c7)) ||
211 (g == 0x25c8) ||
212 (g == 0x25cb) ||
213 ((g >= 0x25ce) && (g <= 0x25cf)) ||
214 ((g >= 0x25d0) && (g <= 0x25d1)) ||
215 ((g >= 0x25e2) && (g <= 0x25e3)) ||
216 ((g >= 0x25e4) && (g <= 0x25e5)) ||
217 (g == 0x25ef) ||
218 ((g >= 0x2605) && (g <= 0x2606)) ||
219 (g == 0x2609) ||
220 ((g >= 0x260e) && (g <= 0x260f)) ||
221 ((g >= 0x2614) && (g <= 0x2615)) ||
222 (g == 0x261c) ||
223 (g == 0x261e) ||
224 (g == 0x2640) ||
225 (g == 0x2642) ||
226 ((g >= 0x2660) && (g <= 0x2661)) ||
227 ((g >= 0x2663) && (g <= 0x2665)) ||
228 ((g >= 0x2667) && (g <= 0x266a)) ||
229 ((g >= 0x266c) && (g <= 0x266d)) ||
230 (g == 0x266f) ||
231 ((g >= 0x269e) && (g <= 0x269f)) ||
232 ((g >= 0x26be) && (g <= 0x26bf)) ||
233 ((g >= 0x26c4) && (g <= 0x26cd)) ||
234 (g == 0x26cf) ||
235 ((g >= 0x26d0) && (g <= 0x26e1)) ||
236 (g == 0x26e3) ||
237 ((g >= 0x26e8) && (g <= 0x26ff)) ||
238 (g == 0x273d) ||
239 (g == 0x2757) ||
240 ((g >= 0x2776) && (g <= 0x277f)) ||
241 ((g >= 0x2b55) && (g <= 0x2b59)) ||
242 ((g >= 0x3248) && (g <= 0x324f)) ||
243 ((g >= 0xe000) && (g <= 0xf8ff)) ||
244 ((g >= 0xfe00) && (g <= 0xfe0f)) ||
245 (g == 0xfffd) ||
246 ((g >= 0x1f100) && (g <= 0x1f12d)) ||
247 ((g >= 0x1f130) && (g <= 0x1f169)) ||
248 ((g >= 0x1f170) && (g <= 0x1f19a)) ||
249 ((g >= 0xe0100) && (g <= 0xe01ef)) ||
250 ((g >= 0xf0000) && (g <= 0xffffd)) ||
251 ((g >= 0x100000) && (g <= 0x10fffd)))
252 return EINA_TRUE;
253 }
254
255 // Na, H -> not checked
256 return EINA_FALSE;
257}
258#endif
259
260static void 47static void
261_text_clear(Termpty *ty, Termcell *cells, int count, int val, Eina_Bool inherit_att) 48_text_clear(Termpty *ty, Termcell *cells, int count, int val, Eina_Bool inherit_att)
262{ 49{
@@ -462,7 +249,7 @@ _text_append(Termpty *ty, const int *codepoints, int len)
462 cells[ty->state.cx].codepoint = g; 249 cells[ty->state.cx].codepoint = g;
463 cells[ty->state.cx].att = ty->state.att; 250 cells[ty->state.cx].att = ty->state.att;
464#if defined(SUPPORT_DBLWIDTH) 251#if defined(SUPPORT_DBLWIDTH)
465 cells[ty->state.cx].att.dblwidth = _is_dblwidth_get(ty, g); 252 cells[ty->state.cx].att.dblwidth = _termpty_is_dblwidth_get(ty, g);
466 if ((cells[ty->state.cx].att.dblwidth) && (ty->state.cx < (ty->w - 1))) 253 if ((cells[ty->state.cx].att.dblwidth) && (ty->state.cx < (ty->w - 1)))
467 { 254 {
468 cells[ty->state.cx + 1].codepoint = 0; 255 cells[ty->state.cx + 1].codepoint = 0;
diff --git a/src/bin/termptydbl.c b/src/bin/termptydbl.c
new file mode 100644
index 0000000..8c28150
--- /dev/null
+++ b/src/bin/termptydbl.c
@@ -0,0 +1,286 @@
1#include "private.h"
2
3#include <Elementary.h>
4#include "termpty.h"
5#include "termptydbl.h"
6
7Eina_Bool
8_termpty_is_dblwidth_get(Termpty *ty, int g)
9{
10#if defined(SUPPORT_DBLWIDTH)
11 // check for east asian full-width (F), half-width (H), wide (W),
12 // narrow (Na) or ambiguous (A) codepoints
13 // ftp://ftp.unicode.org/Public/UNIDATA/EastAsianWidth.txt
14
15 // optimize for latin1 non-ambiguous
16 if (g <= 0xa0)
17 return EINA_FALSE;
18 // (F)
19 if ((g == 0x3000) ||
20 ((g >= 0xff01) && (g <= 0xffe6)))
21 return EINA_TRUE;
22 // (W)
23 //
24 if (
25 // 1XXX
26 (((g >> 12) == 0x1) &&
27 (((g >= 0x1100) && (g <= 0x11ff)))) ||
28 // 2XXX
29 (((g >> 12) == 0x2) &&
30 (((g >= 0x2329) && (g <= 0x232A)) ||
31 ((g >= 0x2E80) && (g <= 0x4dbf)))) ||
32 // 4XXX
33 (((g >> 12) == 0x4) &&
34 (((g >= 0x4e00) && (g <= 0x9fff)))) ||
35 // aXXX
36 (((g >> 12) == 0xa) &&
37 (((g >= 0xa000) && (g <= 0xa4c6)) ||
38 ((g >= 0xa960) && (g <= 0xa97c)) ||
39 ((g >= 0xac00) && (g <= 0xd7a3)))) ||
40 // dXXX
41 (((g >> 12) == 0xd) &&
42 (((g >= 0xd7b0) && (g <= 0xd7fb)))) ||
43 // fXXX
44 (((g >> 12) == 0xf) &&
45 (((g >= 0xf900) && (g <= 0xfaff)) ||
46 ((g >= 0xfe10) && (g <= 0xfe6b)))) ||
47 // 1XXXX
48 (((g >> 16) == 0x1) &&
49 (((g >= 0x1b000) && (g <= 0x1b001)) ||
50 ((g >= 0x1f200) && (g <= 0x1f202)) ||
51 ((g >= 0x1f210) && (g <= 0x1f251)))) ||
52 // 2XXXX
53 (((g >> 16) == 0x2) &&
54 (((g >= 0x20000) && (g <= 0x2fffd)))) ||
55 // 3XXXX
56 (((g >> 12) == 0x3) &&
57 (((g >= 0x30000) && (g <= 0x3FFFD)))))
58 return EINA_TRUE;
59 // FIXME: can optimize by breaking into tree and ranges
60 // (A)
61 if (ty->state.cjk_ambiguous_wide)
62 {
63 // grep ';A #' EastAsianWidth.txt | wc -l
64 // :(
65 if (
66 // aX
67 (((g >> 4) == 0xa) &&
68 ((g == 0x00a1) ||
69 (g == 0x00a4) ||
70 ((g >= 0x00a7) && (g <= 0x00a8)) ||
71 (g == 0x00aa) ||
72 ((g >= 0x00ad) && (g <= 0x00ae)))) ||
73 // bX
74 (((g >> 4) == 0xb) &&
75 (((g >= 0x00b0) && (g <= 0x00bf)))) ||
76 // cX
77 (((g >> 4) == 0xc) &&
78 ((g == 0x00c6))) ||
79 // dX
80 (((g >> 4) == 0xd) &&
81 ((g == 0x00d0) ||
82 ((g >= 0x00d7) && (g <= 0x00d8)) ||
83 ((g >= 0x00de) && (g <= 0x00df)))) ||
84 // eX
85 (((g >> 4) == 0xe) &&
86 ((g == 0x00e0) ||
87 (g == 0x00e1) ||
88 (g == 0x00e6) ||
89 ((g >= 0x00e8) && (g <= 0x00e9)) ||
90 (g == 0x00ea) ||
91 ((g >= 0x00ec) && (g <= 0x00ed)))) ||
92 // fX
93 (((g >> 4) == 0xf) &&
94 ((g == 0x00f0) ||
95 ((g >= 0x00f2) && (g <= 0x00f3)) ||
96 ((g >= 0x00f7) && (g <= 0x00f9)) ||
97 (g == 0x00fa) ||
98 (g == 0x00fc) ||
99 (g == 0x00fe))) ||
100 // 1XX
101 (((g >> 8) == 0x1) &&
102 ((g == 0x0101) ||
103 (g == 0x0111) ||
104 (g == 0x0113) ||
105 (g == 0x011b) ||
106 ((g >= 0x0126) && (g <= 0x0127)) ||
107 (g == 0x012b) ||
108 ((g >= 0x0131) && (g <= 0x0133)) ||
109 (g == 0x0138) ||
110 ((g >= 0x013f) && (g <= 0x0142)) ||
111 (g == 0x0144) ||
112 ((g >= 0x0148) && (g <= 0x014b)) ||
113 (g == 0x014d) ||
114 ((g >= 0x0152) && (g <= 0x0153)) ||
115 ((g >= 0x0166) && (g <= 0x0167)) ||
116 (g == 0x016b) ||
117 (g == 0x01ce) ||
118 (g == 0x01d0) ||
119 (g == 0x01d2) ||
120 (g == 0x01d4) ||
121 (g == 0x01d6) ||
122 (g == 0x01d8) ||
123 (g == 0x01da) ||
124 (g == 0x01dc))) ||
125 // 2XX
126 (((g >> 8) == 0x2) &&
127 ((g == 0x0251) ||
128 (g == 0x0261) ||
129 (g == 0x02c4) ||
130 (g == 0x02c7) ||
131 (g == 0x02c9) ||
132 ((g >= 0x02ca) && (g <= 0x02cb)) ||
133 (g == 0x02cd) ||
134 (g == 0x02d0) ||
135 ((g >= 0x02d8) && (g <= 0x02d9)) ||
136 ((g >= 0x02da) && (g <= 0x02db)) ||
137 (g == 0x02dd) ||
138 (g == 0x02df))) ||
139 // 3XX
140 (((g >> 8) == 0x3) &&
141 (((g >= 0x0300) && (g <= 0x036f)) ||
142 ((g >= 0x0391) && (g <= 0x03c9)))) ||
143 // 4XX
144 (((g >> 8) == 0x4) &&
145 ((g == 0x0401) ||
146 ((g >= 0x0410) && (g <= 0x044f)) ||
147 (g == 0x0451))) ||
148 // 2XXX
149 (((g >> 12) == 0x2) &&
150 ((((g >> 8) == 0x20) &&
151 ((g == 0x2010) ||
152 ((g >= 0x2013) && (g <= 0x2016)) ||
153 ((g >= 0x2018) && (g <= 0x2019)) ||
154 (g == 0x201c) ||
155 (g == 0x201d) ||
156 ((g >= 0x2020) && (g <= 0x2022)) ||
157 ((g >= 0x2024) && (g <= 0x2027)) ||
158 (g == 0x2030) ||
159 ((g >= 0x2032) && (g <= 0x2033)) ||
160 (g == 0x2035) ||
161 (g == 0x203b) ||
162 (g == 0x203e) ||
163 (g == 0x2074) ||
164 (g == 0x207f) ||
165 ((g >= 0x2081) && (g <= 0x2084)) ||
166 (g == 0x20ac))) ||
167 (((g >> 8) == 0x21) &&
168 ((g == 0x2103) ||
169 (g == 0x2105) ||
170 (g == 0x2109) ||
171 (g == 0x2113) ||
172 (g == 0x2116) ||
173 ((g >= 0x2121) && (g <= 0x2122)) ||
174 (g == 0x2126) ||
175 (g == 0x212b) ||
176 ((g >= 0x2153) && (g <= 0x2154)) ||
177 ((g >= 0x215b) && (g <= 0x215e)) ||
178 ((g >= 0x2160) && (g <= 0x216b)) ||
179 ((g >= 0x2170) && (g <= 0x2179)) ||
180 ((g >= 0x2189) && (g <= 0x2199)) ||
181 ((g >= 0x21b8) && (g <= 0x21b9)) ||
182 (g == 0x21d2) ||
183 (g == 0x21d4) ||
184 (g == 0x21e7))) ||
185 (((g >> 8) == 0x22) &&
186 ((g == 0x2200) ||
187 ((g >= 0x2202) && (g <= 0x2203)) ||
188 ((g >= 0x2207) && (g <= 0x2208)) ||
189 (g == 0x220b) ||
190 (g == 0x220f) ||
191 (g == 0x2211) ||
192 (g == 0x2215) ||
193 (g == 0x221a) ||
194 ((g >= 0x221d) && (g <= 0x221f)) ||
195 (g == 0x2220) ||
196 (g == 0x2223) ||
197 (g == 0x2225) ||
198 ((g >= 0x2227) && (g <= 0x222e)) ||
199 ((g >= 0x2234) && (g <= 0x2237)) ||
200 ((g >= 0x223c) && (g <= 0x223d)) ||
201 (g == 0x2248) ||
202 (g == 0x224c) ||
203 (g == 0x2252) ||
204 ((g >= 0x2260) && (g <= 0x2261)) ||
205 ((g >= 0x2264) && (g <= 0x2267)) ||
206 ((g >= 0x226a) && (g <= 0x226b)) ||
207 ((g >= 0x226e) && (g <= 0x226f)) ||
208 ((g >= 0x2282) && (g <= 0x2283)) ||
209 ((g >= 0x2286) && (g <= 0x2287)) ||
210 (g == 0x2295) ||
211 (g == 0x2299) ||
212 (g == 0x22a5) ||
213 (g == 0x22bf))) ||
214 (((g >> 8) == 0x23) &&
215 ((g == 0x2312))) ||
216 ((((g >> 8) == 0x24) || ((g >> 8) == 0x25)) &&
217 (((g >= 0x2460) && (g <= 0x2595)))) ||
218 (((g >> 8) == 0x25) &&
219 (((g >= 0x25a0) && (g <= 0x25bd)) ||
220 ((g >= 0x25c0) && (g <= 0x25c1)) ||
221 ((g >= 0x25c6) && (g <= 0x25c7)) ||
222 (g == 0x25c8) ||
223 (g == 0x25cb) ||
224 ((g >= 0x25ce) && (g <= 0x25cf)) ||
225 ((g >= 0x25d0) && (g <= 0x25d1)) ||
226 ((g >= 0x25e2) && (g <= 0x25e3)) ||
227 ((g >= 0x25e4) && (g <= 0x25e5)) ||
228 (g == 0x25ef))) ||
229 (((g >> 8) == 0x26) &&
230 (((g >= 0x2605) && (g <= 0x2606)) ||
231 (g == 0x2609) ||
232 ((g >= 0x260e) && (g <= 0x260f)) ||
233 ((g >= 0x2614) && (g <= 0x2615)) ||
234 (g == 0x261c) ||
235 (g == 0x261e) ||
236 (g == 0x2640) ||
237 (g == 0x2642) ||
238 ((g >= 0x2660) && (g <= 0x2661)) ||
239 ((g >= 0x2663) && (g <= 0x2665)) ||
240 ((g >= 0x2667) && (g <= 0x266a)) ||
241 ((g >= 0x266c) && (g <= 0x266d)) ||
242 (g == 0x266f) ||
243 ((g >= 0x269e) && (g <= 0x269f)) ||
244 ((g >= 0x26be) && (g <= 0x26bf)) ||
245 ((g >= 0x26c4) && (g <= 0x26cd)) ||
246 (g == 0x26cf) ||
247 ((g >= 0x26d0) && (g <= 0x26e1)) ||
248 (g == 0x26e3) ||
249 ((g >= 0x26e8) && (g <= 0x26ff)))) ||
250 (((g >> 8) == 0x27) &&
251 ((g == 0x273d) ||
252 (g == 0x2757) ||
253 ((g >= 0x2776) && (g <= 0x277f)))) ||
254 (((g >> 8) == 0x2b) &&
255 (((g >= 0x2b55) && (g <= 0x2b59)))))) ||
256 // 3XXX
257 (((g >> 12) == 0x3) &&
258 (((g >= 0x3248) && (g <= 0x324f)))) ||
259 // eXXX
260 (((g >> 12) == 0xe) &&
261 (((g >= 0xe000) && (g <= 0xf8ff)))) ||
262 // fXXX
263 (((g >> 12) == 0xf) &&
264 (((g >= 0xfe00) && (g <= 0xfe0f)) ||
265 (g == 0xfffd))) ||
266 // 1XXXX
267 (((g >> 16) == 0x1) &&
268 (((g >= 0x1f100) && (g <= 0x1f12d)) ||
269 ((g >= 0x1f130) && (g <= 0x1f169)) ||
270 ((g >= 0x1f170) && (g <= 0x1f19a)))) ||
271 // eXXXX
272 (((g >> 16) == 0xe) &&
273 (((g >= 0xe0100) && (g <= 0xe01ef)))) ||
274 // fXXXX
275 (((g >> 16) == 0xf) &&
276 (((g >= 0xf0000) && (g <= 0xffffd)))) ||
277 // 1XXXXX
278 (((g >> 24) == 0x1) &&
279 (((g >= 0x100000) && (g <= 0x10fffd)))))
280 return EINA_TRUE;
281 }
282
283 // Na, H -> not checked
284#endif
285 return EINA_FALSE;
286}
diff --git a/src/bin/termptydbl.h b/src/bin/termptydbl.h
new file mode 100644
index 0000000..04e3e5f
--- /dev/null
+++ b/src/bin/termptydbl.h
@@ -0,0 +1,2 @@
1Eina_Bool _termpty_is_dblwidth_get(Termpty *ty, int g);
2