Commit e9520a863a11e43a1f526f20c841eb078ff03126
1 parent
6e6a7d1f
Exists in
master
and in
5 other branches
Implementando identificação de caracteres pelo nome "X"
Showing
6 changed files
with
457 additions
and
222 deletions
Show diff stats
charsets/bracket.xml
... | ... | @@ -31,8 +31,13 @@ |
31 | 31 | <pw3270-remap host='bracket' cgcsgid='0x02b90025' display='ISO-8859-1'> |
32 | 32 | |
33 | 33 | <char ebc='0x00ad' iso='[' scope='both' one-way='no' /> |
34 | - <char ebc='0x00ba' iso='0x0dd' scope='both' one-way='no' /> | |
34 | + | |
35 | + <!-- char ebc='0x00ba' iso='0x0dd' scope='both' one-way='no' / --> | |
36 | + <char ebc='0x00ba' iso='Yacute' scope='both' one-way='no' /> | |
37 | + | |
35 | 38 | <char ebc='0x00bd' iso=']' scope='both' one-way='no' /> |
36 | - <char ebc='0x00bb' iso='0x0a8' scope='both' one-way='no' /> | |
39 | + | |
40 | + <!-- char ebc='0x00bb' iso='0x0a8' scope='both' one-way='no' / --> | |
41 | + <char ebc='0x00bb' iso='diaeresis' scope='both' one-way='no' /> | |
37 | 42 | |
38 | 43 | </pw3270-remap> | ... | ... |
pw3270.cbp
... | ... | @@ -14,6 +14,7 @@ |
14 | 14 | <Option type="1" /> |
15 | 15 | <Option compiler="gcc" /> |
16 | 16 | <Option use_console_runner="0" /> |
17 | + <Option parameters="--remap=./charsets/bracket.xml" /> | |
17 | 18 | <Compiler> |
18 | 19 | <Add option="-g" /> |
19 | 20 | <Add option="-DDEBUG=1" /> |
... | ... | @@ -74,6 +75,7 @@ |
74 | 75 | <Unit filename="src/classlib/class.mak.in" /> |
75 | 76 | <Unit filename="src/classlib/private.h" /> |
76 | 77 | <Unit filename="src/include/lib3270.h" /> |
78 | + <Unit filename="src/include/lib3270/X11keysym.h" /> | |
77 | 79 | <Unit filename="src/include/lib3270/action_table.h" /> |
78 | 80 | <Unit filename="src/include/lib3270/actions.h" /> |
79 | 81 | <Unit filename="src/include/lib3270/charset.h" /> | ... | ... |
... | ... | @@ -0,0 +1,217 @@ |
1 | +/* | |
2 | + * Copyright 1999 by Paul Mattes. | |
3 | + * Permission to use, copy, modify, and distribute this software and its | |
4 | + * documentation for any purpose and without fee is hereby granted, | |
5 | + * provided that the above copyright notice appear in all copies and that | |
6 | + * both that copyright notice and this permission notice appear in | |
7 | + * supporting documentation. | |
8 | + * | |
9 | + * c3270, s3270 and tcl3270 are distributed in the hope that they will | |
10 | + * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file LICENSE | |
12 | + * for more details. | |
13 | + */ | |
14 | + | |
15 | +/* X11 keysyms used by c3270, s3270 and tcl3270 */ | |
16 | + | |
17 | +#if !defined(_x11_keysym_h) /*[*/ | |
18 | +#define _x11_keysym_h 1 | |
19 | + | |
20 | +/* Latin-1 Keysyms */ | |
21 | +#define XK_space 0x020 | |
22 | +#define XK_exclam 0x021 | |
23 | +#define XK_quotedbl 0x022 | |
24 | +#define XK_numbersign 0x023 | |
25 | +#define XK_dollar 0x024 | |
26 | +#define XK_percent 0x025 | |
27 | +#define XK_ampersand 0x026 | |
28 | +#define XK_apostrophe 0x027 | |
29 | +#define XK_quoteright 0x027 | |
30 | +#define XK_parenleft 0x028 | |
31 | +#define XK_parenright 0x029 | |
32 | +#define XK_asterisk 0x02a | |
33 | +#define XK_plus 0x02b | |
34 | +#define XK_comma 0x02c | |
35 | +#define XK_minus 0x02d | |
36 | +#define XK_period 0x02e | |
37 | +#define XK_slash 0x02f | |
38 | +#define XK_0 0x030 | |
39 | +#define XK_1 0x031 | |
40 | +#define XK_2 0x032 | |
41 | +#define XK_3 0x033 | |
42 | +#define XK_4 0x034 | |
43 | +#define XK_5 0x035 | |
44 | +#define XK_6 0x036 | |
45 | +#define XK_7 0x037 | |
46 | +#define XK_8 0x038 | |
47 | +#define XK_9 0x039 | |
48 | +#define XK_colon 0x03a | |
49 | +#define XK_semicolon 0x03b | |
50 | +#define XK_less 0x03c | |
51 | +#define XK_equal 0x03d | |
52 | +#define XK_greater 0x03e | |
53 | +#define XK_question 0x03f | |
54 | +#define XK_at 0x040 | |
55 | +#define XK_A 0x041 | |
56 | +#define XK_B 0x042 | |
57 | +#define XK_C 0x043 | |
58 | +#define XK_D 0x044 | |
59 | +#define XK_E 0x045 | |
60 | +#define XK_F 0x046 | |
61 | +#define XK_G 0x047 | |
62 | +#define XK_H 0x048 | |
63 | +#define XK_I 0x049 | |
64 | +#define XK_J 0x04a | |
65 | +#define XK_K 0x04b | |
66 | +#define XK_L 0x04c | |
67 | +#define XK_M 0x04d | |
68 | +#define XK_N 0x04e | |
69 | +#define XK_O 0x04f | |
70 | +#define XK_P 0x050 | |
71 | +#define XK_Q 0x051 | |
72 | +#define XK_R 0x052 | |
73 | +#define XK_S 0x053 | |
74 | +#define XK_T 0x054 | |
75 | +#define XK_U 0x055 | |
76 | +#define XK_V 0x056 | |
77 | +#define XK_W 0x057 | |
78 | +#define XK_X 0x058 | |
79 | +#define XK_Y 0x059 | |
80 | +#define XK_Z 0x05a | |
81 | +#define XK_bracketleft 0x05b | |
82 | +#define XK_backslash 0x05c | |
83 | +#define XK_bracketright 0x05d | |
84 | +#define XK_asciicircum 0x05e | |
85 | +#define XK_underscore 0x05f | |
86 | +#define XK_grave 0x060 | |
87 | +#define XK_quoteleft 0x060 | |
88 | +#define XK_a 0x061 | |
89 | +#define XK_b 0x062 | |
90 | +#define XK_c 0x063 | |
91 | +#define XK_d 0x064 | |
92 | +#define XK_e 0x065 | |
93 | +#define XK_f 0x066 | |
94 | +#define XK_g 0x067 | |
95 | +#define XK_h 0x068 | |
96 | +#define XK_i 0x069 | |
97 | +#define XK_j 0x06a | |
98 | +#define XK_k 0x06b | |
99 | +#define XK_l 0x06c | |
100 | +#define XK_m 0x06d | |
101 | +#define XK_n 0x06e | |
102 | +#define XK_o 0x06f | |
103 | +#define XK_p 0x070 | |
104 | +#define XK_q 0x071 | |
105 | +#define XK_r 0x072 | |
106 | +#define XK_s 0x073 | |
107 | +#define XK_t 0x074 | |
108 | +#define XK_u 0x075 | |
109 | +#define XK_v 0x076 | |
110 | +#define XK_w 0x077 | |
111 | +#define XK_x 0x078 | |
112 | +#define XK_y 0x079 | |
113 | +#define XK_z 0x07a | |
114 | +#define XK_braceleft 0x07b | |
115 | +#define XK_bar 0x07c | |
116 | +#define XK_braceright 0x07d | |
117 | +#define XK_asciitilde 0x07e | |
118 | +#define XK_nobreakspace 0x0a0 | |
119 | +#define XK_exclamdown 0x0a1 | |
120 | +#define XK_cent 0x0a2 | |
121 | +#define XK_sterling 0x0a3 | |
122 | +#define XK_currency 0x0a4 | |
123 | +#define XK_yen 0x0a5 | |
124 | +#define XK_brokenbar 0x0a6 | |
125 | +#define XK_section 0x0a7 | |
126 | +#define XK_diaeresis 0x0a8 | |
127 | +#define XK_copyright 0x0a9 | |
128 | +#define XK_ordfeminine 0x0aa | |
129 | +#define XK_guillemotleft 0x0ab | |
130 | +#define XK_notsign 0x0ac | |
131 | +#define XK_hyphen 0x0ad | |
132 | +#define XK_registered 0x0ae | |
133 | +#define XK_macron 0x0af | |
134 | +#define XK_degree 0x0b0 | |
135 | +#define XK_plusminus 0x0b1 | |
136 | +#define XK_twosuperior 0x0b2 | |
137 | +#define XK_threesuperior 0x0b3 | |
138 | +#define XK_acute 0x0b4 | |
139 | +#define XK_mu 0x0b5 | |
140 | +#define XK_paragraph 0x0b6 | |
141 | +#define XK_periodcentered 0x0b7 | |
142 | +#define XK_cedilla 0x0b8 | |
143 | +#define XK_onesuperior 0x0b9 | |
144 | +#define XK_masculine 0x0ba | |
145 | +#define XK_guillemotright 0x0bb | |
146 | +#define XK_onequarter 0x0bc | |
147 | +#define XK_onehalf 0x0bd | |
148 | +#define XK_threequarters 0x0be | |
149 | +#define XK_questiondown 0x0bf | |
150 | +#define XK_Agrave 0x0c0 | |
151 | +#define XK_Aacute 0x0c1 | |
152 | +#define XK_Acircumflex 0x0c2 | |
153 | +#define XK_Atilde 0x0c3 | |
154 | +#define XK_Adiaeresis 0x0c4 | |
155 | +#define XK_Aring 0x0c5 | |
156 | +#define XK_AE 0x0c6 | |
157 | +#define XK_Ccedilla 0x0c7 | |
158 | +#define XK_Egrave 0x0c8 | |
159 | +#define XK_Eacute 0x0c9 | |
160 | +#define XK_Ecircumflex 0x0ca | |
161 | +#define XK_Ediaeresis 0x0cb | |
162 | +#define XK_Igrave 0x0cc | |
163 | +#define XK_Iacute 0x0cd | |
164 | +#define XK_Icircumflex 0x0ce | |
165 | +#define XK_Idiaeresis 0x0cf | |
166 | +#define XK_ETH 0x0d0 | |
167 | +#define XK_Eth 0x0d0 | |
168 | +#define XK_Ntilde 0x0d1 | |
169 | +#define XK_Ograve 0x0d2 | |
170 | +#define XK_Oacute 0x0d3 | |
171 | +#define XK_Ocircumflex 0x0d4 | |
172 | +#define XK_Otilde 0x0d5 | |
173 | +#define XK_Odiaeresis 0x0d6 | |
174 | +#define XK_multiply 0x0d7 | |
175 | +#define XK_Ooblique 0x0d8 | |
176 | +#define XK_Ugrave 0x0d9 | |
177 | +#define XK_Uacute 0x0da | |
178 | +#define XK_Ucircumflex 0x0db | |
179 | +#define XK_Udiaeresis 0x0dc | |
180 | +#define XK_Yacute 0x0dd | |
181 | +#define XK_THORN 0x0de | |
182 | +#define XK_Thorn 0x0de | |
183 | +#define XK_ssharp 0x0df | |
184 | +#define XK_agrave 0x0e0 | |
185 | +#define XK_aacute 0x0e1 | |
186 | +#define XK_acircumflex 0x0e2 | |
187 | +#define XK_atilde 0x0e3 | |
188 | +#define XK_adiaeresis 0x0e4 | |
189 | +#define XK_aring 0x0e5 | |
190 | +#define XK_ae 0x0e6 | |
191 | +#define XK_ccedilla 0x0e7 | |
192 | +#define XK_egrave 0x0e8 | |
193 | +#define XK_eacute 0x0e9 | |
194 | +#define XK_ecircumflex 0x0ea | |
195 | +#define XK_ediaeresis 0x0eb | |
196 | +#define XK_igrave 0x0ec | |
197 | +#define XK_iacute 0x0ed | |
198 | +#define XK_icircumflex 0x0ee | |
199 | +#define XK_idiaeresis 0x0ef | |
200 | +#define XK_eth 0x0f0 | |
201 | +#define XK_ntilde 0x0f1 | |
202 | +#define XK_ograve 0x0f2 | |
203 | +#define XK_oacute 0x0f3 | |
204 | +#define XK_ocircumflex 0x0f4 | |
205 | +#define XK_otilde 0x0f5 | |
206 | +#define XK_odiaeresis 0x0f6 | |
207 | +#define XK_division 0x0f7 | |
208 | +#define XK_oslash 0x0f8 | |
209 | +#define XK_ugrave 0x0f9 | |
210 | +#define XK_uacute 0x0fa | |
211 | +#define XK_ucircumflex 0x0fb | |
212 | +#define XK_udiaeresis 0x0fc | |
213 | +#define XK_yacute 0x0fd | |
214 | +#define XK_thorn 0x0fe | |
215 | +#define XK_ydiaeresis 0x0ff | |
216 | + | |
217 | +#endif /*]*/ | ... | ... |
src/lib3270/X11keysym.h
... | ... | @@ -1,217 +0,0 @@ |
1 | -/* | |
2 | - * Copyright 1999 by Paul Mattes. | |
3 | - * Permission to use, copy, modify, and distribute this software and its | |
4 | - * documentation for any purpose and without fee is hereby granted, | |
5 | - * provided that the above copyright notice appear in all copies and that | |
6 | - * both that copyright notice and this permission notice appear in | |
7 | - * supporting documentation. | |
8 | - * | |
9 | - * c3270, s3270 and tcl3270 are distributed in the hope that they will | |
10 | - * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file LICENSE | |
12 | - * for more details. | |
13 | - */ | |
14 | - | |
15 | -/* X11 keysyms used by c3270, s3270 and tcl3270 */ | |
16 | - | |
17 | -#if !defined(_x11_keysym_h) /*[*/ | |
18 | -#define _x11_keysym_h 1 | |
19 | - | |
20 | -/* Latin-1 Keysyms */ | |
21 | -#define XK_space 0x020 | |
22 | -#define XK_exclam 0x021 | |
23 | -#define XK_quotedbl 0x022 | |
24 | -#define XK_numbersign 0x023 | |
25 | -#define XK_dollar 0x024 | |
26 | -#define XK_percent 0x025 | |
27 | -#define XK_ampersand 0x026 | |
28 | -#define XK_apostrophe 0x027 | |
29 | -#define XK_quoteright 0x027 | |
30 | -#define XK_parenleft 0x028 | |
31 | -#define XK_parenright 0x029 | |
32 | -#define XK_asterisk 0x02a | |
33 | -#define XK_plus 0x02b | |
34 | -#define XK_comma 0x02c | |
35 | -#define XK_minus 0x02d | |
36 | -#define XK_period 0x02e | |
37 | -#define XK_slash 0x02f | |
38 | -#define XK_0 0x030 | |
39 | -#define XK_1 0x031 | |
40 | -#define XK_2 0x032 | |
41 | -#define XK_3 0x033 | |
42 | -#define XK_4 0x034 | |
43 | -#define XK_5 0x035 | |
44 | -#define XK_6 0x036 | |
45 | -#define XK_7 0x037 | |
46 | -#define XK_8 0x038 | |
47 | -#define XK_9 0x039 | |
48 | -#define XK_colon 0x03a | |
49 | -#define XK_semicolon 0x03b | |
50 | -#define XK_less 0x03c | |
51 | -#define XK_equal 0x03d | |
52 | -#define XK_greater 0x03e | |
53 | -#define XK_question 0x03f | |
54 | -#define XK_at 0x040 | |
55 | -#define XK_A 0x041 | |
56 | -#define XK_B 0x042 | |
57 | -#define XK_C 0x043 | |
58 | -#define XK_D 0x044 | |
59 | -#define XK_E 0x045 | |
60 | -#define XK_F 0x046 | |
61 | -#define XK_G 0x047 | |
62 | -#define XK_H 0x048 | |
63 | -#define XK_I 0x049 | |
64 | -#define XK_J 0x04a | |
65 | -#define XK_K 0x04b | |
66 | -#define XK_L 0x04c | |
67 | -#define XK_M 0x04d | |
68 | -#define XK_N 0x04e | |
69 | -#define XK_O 0x04f | |
70 | -#define XK_P 0x050 | |
71 | -#define XK_Q 0x051 | |
72 | -#define XK_R 0x052 | |
73 | -#define XK_S 0x053 | |
74 | -#define XK_T 0x054 | |
75 | -#define XK_U 0x055 | |
76 | -#define XK_V 0x056 | |
77 | -#define XK_W 0x057 | |
78 | -#define XK_X 0x058 | |
79 | -#define XK_Y 0x059 | |
80 | -#define XK_Z 0x05a | |
81 | -#define XK_bracketleft 0x05b | |
82 | -#define XK_backslash 0x05c | |
83 | -#define XK_bracketright 0x05d | |
84 | -#define XK_asciicircum 0x05e | |
85 | -#define XK_underscore 0x05f | |
86 | -#define XK_grave 0x060 | |
87 | -#define XK_quoteleft 0x060 | |
88 | -#define XK_a 0x061 | |
89 | -#define XK_b 0x062 | |
90 | -#define XK_c 0x063 | |
91 | -#define XK_d 0x064 | |
92 | -#define XK_e 0x065 | |
93 | -#define XK_f 0x066 | |
94 | -#define XK_g 0x067 | |
95 | -#define XK_h 0x068 | |
96 | -#define XK_i 0x069 | |
97 | -#define XK_j 0x06a | |
98 | -#define XK_k 0x06b | |
99 | -#define XK_l 0x06c | |
100 | -#define XK_m 0x06d | |
101 | -#define XK_n 0x06e | |
102 | -#define XK_o 0x06f | |
103 | -#define XK_p 0x070 | |
104 | -#define XK_q 0x071 | |
105 | -#define XK_r 0x072 | |
106 | -#define XK_s 0x073 | |
107 | -#define XK_t 0x074 | |
108 | -#define XK_u 0x075 | |
109 | -#define XK_v 0x076 | |
110 | -#define XK_w 0x077 | |
111 | -#define XK_x 0x078 | |
112 | -#define XK_y 0x079 | |
113 | -#define XK_z 0x07a | |
114 | -#define XK_braceleft 0x07b | |
115 | -#define XK_bar 0x07c | |
116 | -#define XK_braceright 0x07d | |
117 | -#define XK_asciitilde 0x07e | |
118 | -#define XK_nobreakspace 0x0a0 | |
119 | -#define XK_exclamdown 0x0a1 | |
120 | -#define XK_cent 0x0a2 | |
121 | -#define XK_sterling 0x0a3 | |
122 | -#define XK_currency 0x0a4 | |
123 | -#define XK_yen 0x0a5 | |
124 | -#define XK_brokenbar 0x0a6 | |
125 | -#define XK_section 0x0a7 | |
126 | -#define XK_diaeresis 0x0a8 | |
127 | -#define XK_copyright 0x0a9 | |
128 | -#define XK_ordfeminine 0x0aa | |
129 | -#define XK_guillemotleft 0x0ab | |
130 | -#define XK_notsign 0x0ac | |
131 | -#define XK_hyphen 0x0ad | |
132 | -#define XK_registered 0x0ae | |
133 | -#define XK_macron 0x0af | |
134 | -#define XK_degree 0x0b0 | |
135 | -#define XK_plusminus 0x0b1 | |
136 | -#define XK_twosuperior 0x0b2 | |
137 | -#define XK_threesuperior 0x0b3 | |
138 | -#define XK_acute 0x0b4 | |
139 | -#define XK_mu 0x0b5 | |
140 | -#define XK_paragraph 0x0b6 | |
141 | -#define XK_periodcentered 0x0b7 | |
142 | -#define XK_cedilla 0x0b8 | |
143 | -#define XK_onesuperior 0x0b9 | |
144 | -#define XK_masculine 0x0ba | |
145 | -#define XK_guillemotright 0x0bb | |
146 | -#define XK_onequarter 0x0bc | |
147 | -#define XK_onehalf 0x0bd | |
148 | -#define XK_threequarters 0x0be | |
149 | -#define XK_questiondown 0x0bf | |
150 | -#define XK_Agrave 0x0c0 | |
151 | -#define XK_Aacute 0x0c1 | |
152 | -#define XK_Acircumflex 0x0c2 | |
153 | -#define XK_Atilde 0x0c3 | |
154 | -#define XK_Adiaeresis 0x0c4 | |
155 | -#define XK_Aring 0x0c5 | |
156 | -#define XK_AE 0x0c6 | |
157 | -#define XK_Ccedilla 0x0c7 | |
158 | -#define XK_Egrave 0x0c8 | |
159 | -#define XK_Eacute 0x0c9 | |
160 | -#define XK_Ecircumflex 0x0ca | |
161 | -#define XK_Ediaeresis 0x0cb | |
162 | -#define XK_Igrave 0x0cc | |
163 | -#define XK_Iacute 0x0cd | |
164 | -#define XK_Icircumflex 0x0ce | |
165 | -#define XK_Idiaeresis 0x0cf | |
166 | -#define XK_ETH 0x0d0 | |
167 | -#define XK_Eth 0x0d0 | |
168 | -#define XK_Ntilde 0x0d1 | |
169 | -#define XK_Ograve 0x0d2 | |
170 | -#define XK_Oacute 0x0d3 | |
171 | -#define XK_Ocircumflex 0x0d4 | |
172 | -#define XK_Otilde 0x0d5 | |
173 | -#define XK_Odiaeresis 0x0d6 | |
174 | -#define XK_multiply 0x0d7 | |
175 | -#define XK_Ooblique 0x0d8 | |
176 | -#define XK_Ugrave 0x0d9 | |
177 | -#define XK_Uacute 0x0da | |
178 | -#define XK_Ucircumflex 0x0db | |
179 | -#define XK_Udiaeresis 0x0dc | |
180 | -#define XK_Yacute 0x0dd | |
181 | -#define XK_THORN 0x0de | |
182 | -#define XK_Thorn 0x0de | |
183 | -#define XK_ssharp 0x0df | |
184 | -#define XK_agrave 0x0e0 | |
185 | -#define XK_aacute 0x0e1 | |
186 | -#define XK_acircumflex 0x0e2 | |
187 | -#define XK_atilde 0x0e3 | |
188 | -#define XK_adiaeresis 0x0e4 | |
189 | -#define XK_aring 0x0e5 | |
190 | -#define XK_ae 0x0e6 | |
191 | -#define XK_ccedilla 0x0e7 | |
192 | -#define XK_egrave 0x0e8 | |
193 | -#define XK_eacute 0x0e9 | |
194 | -#define XK_ecircumflex 0x0ea | |
195 | -#define XK_ediaeresis 0x0eb | |
196 | -#define XK_igrave 0x0ec | |
197 | -#define XK_iacute 0x0ed | |
198 | -#define XK_icircumflex 0x0ee | |
199 | -#define XK_idiaeresis 0x0ef | |
200 | -#define XK_eth 0x0f0 | |
201 | -#define XK_ntilde 0x0f1 | |
202 | -#define XK_ograve 0x0f2 | |
203 | -#define XK_oacute 0x0f3 | |
204 | -#define XK_ocircumflex 0x0f4 | |
205 | -#define XK_otilde 0x0f5 | |
206 | -#define XK_odiaeresis 0x0f6 | |
207 | -#define XK_division 0x0f7 | |
208 | -#define XK_oslash 0x0f8 | |
209 | -#define XK_ugrave 0x0f9 | |
210 | -#define XK_uacute 0x0fa | |
211 | -#define XK_ucircumflex 0x0fb | |
212 | -#define XK_udiaeresis 0x0fc | |
213 | -#define XK_yacute 0x0fd | |
214 | -#define XK_thorn 0x0fe | |
215 | -#define XK_ydiaeresis 0x0ff | |
216 | - | |
217 | -#endif /*]*/ |
src/lib3270/charset.c
src/pw3270/v3270/charset.c
... | ... | @@ -31,6 +31,7 @@ |
31 | 31 | #include "private.h" |
32 | 32 | #include <lib3270/charset.h> |
33 | 33 | #include <lib3270/log.h> |
34 | + #include <lib3270/X11keysym.h> | |
34 | 35 | |
35 | 36 | #define ERROR_DOMAIN g_quark_from_static_string(PACKAGE_NAME) |
36 | 37 | |
... | ... | @@ -54,6 +55,222 @@ |
54 | 55 | |
55 | 56 | static unsigned short getChar(const gchar *id, GError **error) { |
56 | 57 | |
58 | + static struct | |
59 | + { | |
60 | + const char * name; | |
61 | + unsigned short keysym; | |
62 | + } latin[] = | |
63 | + { | |
64 | + { "space", XK_space }, | |
65 | + { "exclam", XK_exclam }, | |
66 | + { "quotedbl", XK_quotedbl }, | |
67 | + { "numbersign", XK_numbersign }, | |
68 | + { "dollar", XK_dollar }, | |
69 | + { "percent", XK_percent }, | |
70 | + { "ampersand", XK_ampersand }, | |
71 | + { "apostrophe", XK_apostrophe }, | |
72 | + { "quoteright", XK_quoteright }, | |
73 | + { "parenleft", XK_parenleft }, | |
74 | + { "parenright", XK_parenright }, | |
75 | + { "asterisk", XK_asterisk }, | |
76 | + { "plus", XK_plus }, | |
77 | + { "comma", XK_comma }, | |
78 | + { "minus", XK_minus }, | |
79 | + { "period", XK_period }, | |
80 | + { "slash", XK_slash }, | |
81 | + { "0", XK_0 }, | |
82 | + { "1", XK_1 }, | |
83 | + { "2", XK_2 }, | |
84 | + { "3", XK_3 }, | |
85 | + { "4", XK_4 }, | |
86 | + { "5", XK_5 }, | |
87 | + { "6", XK_6 }, | |
88 | + { "7", XK_7 }, | |
89 | + { "8", XK_8 }, | |
90 | + { "9", XK_9 }, | |
91 | + { "colon", XK_colon }, | |
92 | + { "semicolon", XK_semicolon }, | |
93 | + { "less", XK_less }, | |
94 | + { "equal", XK_equal }, | |
95 | + { "greater", XK_greater }, | |
96 | + { "question", XK_question }, | |
97 | + { "at", XK_at }, | |
98 | + { "A", XK_A }, | |
99 | + { "B", XK_B }, | |
100 | + { "C", XK_C }, | |
101 | + { "D", XK_D }, | |
102 | + { "E", XK_E }, | |
103 | + { "F", XK_F }, | |
104 | + { "G", XK_G }, | |
105 | + { "H", XK_H }, | |
106 | + { "I", XK_I }, | |
107 | + { "J", XK_J }, | |
108 | + { "K", XK_K }, | |
109 | + { "L", XK_L }, | |
110 | + { "M", XK_M }, | |
111 | + { "N", XK_N }, | |
112 | + { "O", XK_O }, | |
113 | + { "P", XK_P }, | |
114 | + { "Q", XK_Q }, | |
115 | + { "R", XK_R }, | |
116 | + { "S", XK_S }, | |
117 | + { "T", XK_T }, | |
118 | + { "U", XK_U }, | |
119 | + { "V", XK_V }, | |
120 | + { "W", XK_W }, | |
121 | + { "X", XK_X }, | |
122 | + { "Y", XK_Y }, | |
123 | + { "Z", XK_Z }, | |
124 | + { "bracketleft", XK_bracketleft }, | |
125 | + { "backslash", XK_backslash }, | |
126 | + { "bracketright", XK_bracketright }, | |
127 | + { "asciicircum", XK_asciicircum }, | |
128 | + { "underscore", XK_underscore }, | |
129 | + { "grave", XK_grave }, | |
130 | + { "quoteleft", XK_quoteleft }, | |
131 | + { "a", XK_a }, | |
132 | + { "b", XK_b }, | |
133 | + { "c", XK_c }, | |
134 | + { "d", XK_d }, | |
135 | + { "e", XK_e }, | |
136 | + { "f", XK_f }, | |
137 | + { "g", XK_g }, | |
138 | + { "h", XK_h }, | |
139 | + { "i", XK_i }, | |
140 | + { "j", XK_j }, | |
141 | + { "k", XK_k }, | |
142 | + { "l", XK_l }, | |
143 | + { "m", XK_m }, | |
144 | + { "n", XK_n }, | |
145 | + { "o", XK_o }, | |
146 | + { "p", XK_p }, | |
147 | + { "q", XK_q }, | |
148 | + { "r", XK_r }, | |
149 | + { "s", XK_s }, | |
150 | + { "t", XK_t }, | |
151 | + { "u", XK_u }, | |
152 | + { "v", XK_v }, | |
153 | + { "w", XK_w }, | |
154 | + { "x", XK_x }, | |
155 | + { "y", XK_y }, | |
156 | + { "z", XK_z }, | |
157 | + { "braceleft", XK_braceleft }, | |
158 | + { "bar", XK_bar }, | |
159 | + { "braceright", XK_braceright }, | |
160 | + { "asciitilde", XK_asciitilde }, | |
161 | + { "nobreakspace", XK_nobreakspace }, | |
162 | + { "exclamdown", XK_exclamdown }, | |
163 | + { "cent", XK_cent }, | |
164 | + { "sterling", XK_sterling }, | |
165 | + { "currency", XK_currency }, | |
166 | + { "yen", XK_yen }, | |
167 | + { "brokenbar", XK_brokenbar }, | |
168 | + { "section", XK_section }, | |
169 | + { "diaeresis", XK_diaeresis }, | |
170 | + { "copyright", XK_copyright }, | |
171 | + { "ordfeminine", XK_ordfeminine }, | |
172 | + { "guillemotleft", XK_guillemotleft }, | |
173 | + { "notsign", XK_notsign }, | |
174 | + { "hyphen", XK_hyphen }, | |
175 | + { "registered", XK_registered }, | |
176 | + { "macron", XK_macron }, | |
177 | + { "degree", XK_degree }, | |
178 | + { "plusminus", XK_plusminus }, | |
179 | + { "twosuperior", XK_twosuperior }, | |
180 | + { "threesuperior", XK_threesuperior }, | |
181 | + { "acute", XK_acute }, | |
182 | + { "mu", XK_mu }, | |
183 | + { "paragraph", XK_paragraph }, | |
184 | + { "periodcentered", XK_periodcentered }, | |
185 | + { "cedilla", XK_cedilla }, | |
186 | + { "onesuperior", XK_onesuperior }, | |
187 | + { "masculine", XK_masculine }, | |
188 | + { "guillemotright", XK_guillemotright }, | |
189 | + { "onequarter", XK_onequarter }, | |
190 | + { "onehalf", XK_onehalf }, | |
191 | + { "threequarters", XK_threequarters }, | |
192 | + { "questiondown", XK_questiondown }, | |
193 | + { "Agrave", XK_Agrave }, | |
194 | + { "Aacute", XK_Aacute }, | |
195 | + { "Acircumflex", XK_Acircumflex }, | |
196 | + { "Atilde", XK_Atilde }, | |
197 | + { "Adiaeresis", XK_Adiaeresis }, | |
198 | + { "Aring", XK_Aring }, | |
199 | + { "AE", XK_AE }, | |
200 | + { "Ccedilla", XK_Ccedilla }, | |
201 | + { "Egrave", XK_Egrave }, | |
202 | + { "Eacute", XK_Eacute }, | |
203 | + { "Ecircumflex", XK_Ecircumflex }, | |
204 | + { "Ediaeresis", XK_Ediaeresis }, | |
205 | + { "Igrave", XK_Igrave }, | |
206 | + { "Iacute", XK_Iacute }, | |
207 | + { "Icircumflex", XK_Icircumflex }, | |
208 | + { "Idiaeresis", XK_Idiaeresis }, | |
209 | + { "ETH", XK_ETH }, | |
210 | + { "Eth", XK_Eth }, | |
211 | + { "Ntilde", XK_Ntilde }, | |
212 | + { "Ograve", XK_Ograve }, | |
213 | + { "Oacute", XK_Oacute }, | |
214 | + { "Ocircumflex", XK_Ocircumflex }, | |
215 | + { "Otilde", XK_Otilde }, | |
216 | + { "Odiaeresis", XK_Odiaeresis }, | |
217 | + { "multiply", XK_multiply }, | |
218 | + { "Ooblique", XK_Ooblique }, | |
219 | + { "Ugrave", XK_Ugrave }, | |
220 | + { "Uacute", XK_Uacute }, | |
221 | + { "Ucircumflex", XK_Ucircumflex }, | |
222 | + { "Udiaeresis", XK_Udiaeresis }, | |
223 | + { "Yacute", XK_Yacute }, | |
224 | + { "THORN", XK_THORN }, | |
225 | + { "Thorn", XK_Thorn }, | |
226 | + { "ssharp", XK_ssharp }, | |
227 | + { "agrave", XK_agrave }, | |
228 | + { "aacute", XK_aacute }, | |
229 | + { "acircumflex", XK_acircumflex }, | |
230 | + { "atilde", XK_atilde }, | |
231 | + { "adiaeresis", XK_adiaeresis }, | |
232 | + { "aring", XK_aring }, | |
233 | + { "ae", XK_ae }, | |
234 | + { "ccedilla", XK_ccedilla }, | |
235 | + { "egrave", XK_egrave }, | |
236 | + { "eacute", XK_eacute }, | |
237 | + { "ecircumflex", XK_ecircumflex }, | |
238 | + { "ediaeresis", XK_ediaeresis }, | |
239 | + { "igrave", XK_igrave }, | |
240 | + { "iacute", XK_iacute }, | |
241 | + { "icircumflex", XK_icircumflex }, | |
242 | + { "idiaeresis", XK_idiaeresis }, | |
243 | + { "eth", XK_eth }, | |
244 | + { "ntilde", XK_ntilde }, | |
245 | + { "ograve", XK_ograve }, | |
246 | + { "oacute", XK_oacute }, | |
247 | + { "ocircumflex", XK_ocircumflex }, | |
248 | + { "otilde", XK_otilde }, | |
249 | + { "odiaeresis", XK_odiaeresis }, | |
250 | + { "division", XK_division }, | |
251 | + { "oslash", XK_oslash }, | |
252 | + { "ugrave", XK_ugrave }, | |
253 | + { "uacute", XK_uacute }, | |
254 | + { "ucircumflex", XK_ucircumflex }, | |
255 | + { "udiaeresis", XK_udiaeresis }, | |
256 | + { "yacute", XK_yacute }, | |
257 | + { "thorn", XK_thorn }, | |
258 | + { "ydiaeresis", XK_ydiaeresis }, | |
259 | + | |
260 | + // The following are, umm, hacks to allow symbolic names for | |
261 | + // control codes. | |
262 | + #if !defined(_WIN32) | |
263 | + { "BackSpace", 0x08 }, | |
264 | + { "Tab", 0x09 }, | |
265 | + { "Linefeed", 0x0a }, | |
266 | + { "Return", 0x0d }, | |
267 | + { "Escape", 0x1b }, | |
268 | + { "Delete", 0x7f }, | |
269 | + #endif | |
270 | + }; | |
271 | + | |
272 | + size_t ix; | |
273 | + | |
57 | 274 | if(*error) { |
58 | 275 | return 0; |
59 | 276 | } |
... | ... | @@ -62,15 +279,26 @@ |
62 | 279 | |
63 | 280 | unsigned int rc = 0; |
64 | 281 | |
65 | - if(sscanf(id + 2, "%x", &rc) != 1) { | |
282 | + if(sscanf(id + 2, "%x", &rc) != 1) | |
283 | + { | |
66 | 284 | *error = g_error_new(ERROR_DOMAIN,EINVAL,"%s",_( "Can't parse character value" )); |
67 | - return; | |
285 | + return 0; | |
68 | 286 | } |
69 | 287 | |
70 | 288 | return (unsigned short) rc; |
71 | 289 | |
72 | 290 | } |
73 | 291 | |
292 | + for(ix=0;ix < G_N_ELEMENTS(latin);ix++) { | |
293 | + if(!g_ascii_strcasecmp(id,latin[ix].name)) | |
294 | + return latin[ix].keysym; | |
295 | + } | |
296 | + | |
297 | + if(strlen(id) != 1) | |
298 | + { | |
299 | + *error = g_error_new(ERROR_DOMAIN,EINVAL,"%s",_( "Invalid character value" )); | |
300 | + return 0; | |
301 | + } | |
74 | 302 | |
75 | 303 | return (unsigned short) *id; |
76 | 304 | } | ... | ... |