1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 2000 Red Hat Software
3 * Copyright (C) 2000 SuSE Linux Ltd
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
20 * Original author: Owen Taylor <otaylor@redhat.com>
22 * Modified for Inuktitut - Robert Brady <robert@suse.co.uk>
24 * Modified for Amharic - Daniel Yacob <locales@geez.org>
32 #include <gdk/gdkkeysyms.h>
34 #include "gtk/gtkintl.h"
35 #include "gtk/gtkimcontextsimple.h"
36 #include "gtk/gtkimmodule.h"
38 GType type_am_et_translit = 0;
40 static void am_et_class_init (GtkIMContextSimpleClass *class);
41 static void am_et_init (GtkIMContextSimple *im_context);
44 am_et_register_type (GTypeModule *module)
46 static const GTypeInfo object_info =
48 sizeof (GtkIMContextSimpleClass),
50 (GBaseFinalizeFunc) NULL,
51 (GClassInitFunc) am_et_class_init,
52 NULL, /* class_finalize */
53 NULL, /* class_data */
54 sizeof (GtkIMContextSimple),
56 (GInstanceInitFunc) am_et_init,
60 g_type_module_register_type (module,
61 GTK_TYPE_IM_CONTEXT_SIMPLE,
62 "GtkIMContextAmharicEthiopia",
67 a, 0, 0, 0, 0, 0, b+5, \
68 a, 'A', 0, 0, 0, 0, b+3, \
69 a, 'E', 0, 0, 0, 0, b+4, \
70 a, 'I', 0, 0, 0, 0, b+2, \
71 a, 'O', 0, 0, 0, 0, b+6, \
72 a, 'U', 0, 0, 0, 0, b+1, \
73 a, 'a', 0, 0, 0, 0, b+3, \
74 a, 'e', 0, 0, 0, 0, b, \
75 a, 'e', 'e', 0, 0, 0, b+4, \
76 a, 'i', 0, 0, 0, 0, b+2, \
77 a, 'o', 0, 0, 0, 0, b+6, \
78 a, 'u', 0, 0, 0, 0, b+1,
81 a, 0, 0, 0, 0, 0, b+5, \
82 a, 'A', 0, 0, 0, 0, b+3, \
83 a, 'E', 0, 0, 0, 0, b+4, \
84 a, 'I', 0, 0, 0, 0, b+2, \
85 a, 'O', 0, 0, 0, 0, b+6, \
86 a, 'U', 0, 0, 0, 0, b+1, \
87 a, 'W', 0, 0, 0, 0, b+7, \
88 a, 'W', 'A', 0, 0, 0, b+7, \
89 a, 'W', 'a', 0, 0, 0, b+7,
91 a, 'a', 0, 0, 0, 0, b+3, \
92 a, 'e', 0, 0, 0, 0, b, \
93 a, 'e', 'e', 0, 0, 0, b+4, \
94 a, 'i', 0, 0, 0, 0, b+2, \
95 a, 'o', 0, 0, 0, 0, b+6, \
96 a, 'u', 0, 0, 0, 0, b+1, \
97 a, 'w', 'w', 0, 0, 0, b+7, \
98 a, 'w', 'w', 'a', 0, 0, b+7,
105 a, 0, 0, 0, 0, 0, b+5, \
106 a, 'A', 0, 0, 0, 0, b+3, \
107 a, 'E', 0, 0, 0, 0, b+4, \
108 a, 'I', 0, 0, 0, 0, b+2, \
109 a, 'O', 0, 0, 0, 0, b+6, \
110 a, 'O', 'O', 0, 0, 0, b+8, \
111 a, 'O', 'o', 0, 0, 0, b+8, \
112 a, 'U', 0, 0, 0, 0, b+1, \
113 a, 'W', 0, 0, 0, 0, b+11, \
114 a, 'W', '\'', 0, 0, 0, b+13, \
115 a, 'W', 'A', 0, 0, 0, b+11, \
116 a, 'W', 'E', 0, 0, 0, b+12, \
117 a, 'W', 'I', 0, 0, 0, b+10, \
118 a, 'W', 'U', 0, 0, 0, b+13, \
119 a, 'W', 'a', 0, 0, 0, b+11, \
120 a, 'W', 'e', 0, 0, 0, b+8, \
121 a, 'W', 'e', 'e', 0, 0, b+12, \
122 a, 'W', 'i', 0, 0, 0, b+10, \
123 a, 'W', 'u', 0, 0, 0, b+13, \
124 a, 'a', 0, 0, 0, 0, b+3, \
125 a, 'e', 0, 0, 0, 0, b, \
126 a, 'e', 'e', 0, 0, 0, b+4, \
127 a, 'i', 0, 0, 0, 0, b+2, \
128 a, 'o', 0, 0, 0, 0, b+6, \
129 a, 'o', 'o', 0, 0, 0, b+8, \
130 a, 'u', 0, 0, 0, 0, b+1, \
131 a, 'w', 'w', 0, 0, 0, b+11, \
132 a, 'w', 'w', '\'', 0, 0, b+13, \
133 a, 'w', 'w', 'E', 0, 0, b+12, \
134 a, 'w', 'w', 'a', 0, 0, b+11, \
135 a, 'w', 'w', 'e', 0, 0, b+8, \
136 a, 'w', 'w', 'e', 'e', 0, b+12, \
137 a, 'w', 'w', 'i', 0, 0, b+10, \
138 a, 'w', 'w', 'u', 0, 0, b+13,
140 static guint16 am_et_compose_seqs[] = {
141 /* do punctuation and numerals here */
143 '\'', 0, 0, 0, 0, 0, GDK_dead_grave, /* hopefully this has no side effects */
144 '\'', '\'', 0, 0, 0, 0, GDK_apostrophe,
145 '\'', '1', 0, 0, 0, 0, 0x1369,
146 '\'', '1', '0', 0, 0, 0, 0x1372,
147 '\'', '1', '0', '0', 0, 0, 0x137b,
148 '\'', '1', '0', 'k', 0, 0, 0x137c,
149 /* '\'', '1', '0', '0', '0', 0, 0x137b,
150 '\'', '1', '0', '0', '0', '0', 0, 0x137c, */
151 '\'', '2', 0, 0, 0, 0, 0x136a,
152 '\'', '2', '0', 0, 0, 0, 0x1373,
153 '\'', '3', 0, 0, 0, 0, 0x136b,
154 '\'', '3', '0', 0, 0, 0, 0x1374,
155 '\'', '4', 0, 0, 0, 0, 0x136c,
156 '\'', '4', '0', 0, 0, 0, 0x1375,
157 '\'', '5', 0, 0, 0, 0, 0x136d,
158 '\'', '5', '0', 0, 0, 0, 0x1376,
159 '\'', '6', 0, 0, 0, 0, 0x136e,
160 '\'', '6', '0', 0, 0, 0, 0x1377,
161 '\'', '7', 0, 0, 0, 0, 0x136f,
162 '\'', '7', '0', 0, 0, 0, 0x1378,
163 '\'', '8', 0, 0, 0, 0, 0x1370,
164 '\'', '8', '0', 0, 0, 0, 0x1379,
165 '\'', '9', 0, 0, 0, 0, 0x1371,
166 '\'', '9', '0', 0, 0, 0, 0x137a,
167 ',', 0, 0, 0, 0, 0, 0x1363,
168 ',', ',', 0, 0, 0, 0, ',',
169 '-', 0, 0, 0, 0, 0, '-',
170 '-', ':', 0, 0, 0, 0, 0x1365,
171 ':', 0, 0, 0, 0, 0, 0x1361,
172 ':', '-', 0, 0, 0, 0, 0x1366,
173 ':', ':', 0, 0, 0, 0, 0x1362,
174 ':', ':', ':', 0, 0, 0, ':',
175 ':', '|', ':', 0, 0, 0, 0x1368,
176 ';', 0, 0, 0, 0, 0, 0x1364,
177 ';', ';', 0, 0, 0, 0, ';',
178 '<', 0, 0, 0, 0, 0, '<',
179 '<', '<', 0, 0, 0, 0, 0x00AB,
180 '>', 0, 0, 0, 0, 0, '>',
181 '>', '>', 0, 0, 0, 0, 0x00BB,
182 '?', 0, 0, 0, 0, 0, '?',
183 '?', '?', 0, 0, 0, 0, 0x1367,
184 'A', 0, 0, 0, 0, 0, 0x12A3,
185 'A','A', 0, 0, 0, 0, 0x12D3,
189 'E', 0, 0, 0, 0, 0, 0x12A4,
190 'E','E', 0, 0, 0, 0, 0x12D4,
192 'F', 'Y', 0, 0, 0, 0, 0x135A,
193 'F', 'Y', 'A', 0, 0, 0, 0x135A,
194 'F', 'Y', 'a', 0, 0, 0, 0x135A,
198 'I', 0, 0, 0, 0, 0, 0x12A5,
199 'I','A', 0, 0, 0, 0, 0x12A3,
200 'I','E', 0, 0, 0, 0, 0x12A4,
201 'I','I', 0, 0, 0, 0, 0x12D5,
202 'I','I','E', 0, 0, 0, 0x12D4,
203 'I','I','a', 0, 0, 0, 0x12D3,
204 'I','I','e', 0, 0, 0, 0x12D0,
205 'I','I','i', 0, 0, 0, 0x12D2,
206 'I','I','o', 0, 0, 0, 0x12D6,
207 'I','I','u', 0, 0, 0, 0x12D1,
208 'I','O', 0, 0, 0, 0, 0x12A6,
209 'I','U', 0, 0, 0, 0, 0x12A1,
210 'I','W', 0, 0, 0, 0, 0x12A7,
211 'I','a', 0, 0, 0, 0, 0x12A3,
212 'I','e', 0, 0, 0, 0, 0x12A0,
213 'I','i', 0, 0, 0, 0, 0x12A2,
214 'I','o', 0, 0, 0, 0, 0x12A6,
215 'I','u', 0, 0, 0, 0, 0x12A1,
219 'M', 'Y', 0, 0, 0, 0, 0x1359,
220 'M', 'Y', 'A', 0, 0, 0, 0x1359,
221 'M', 'Y', 'a', 0, 0, 0, 0x1359,
224 'O', 0, 0, 0, 0, 0, 0x12A6,
225 'O','O', 0, 0, 0, 0, 0x12D6,
229 'R', 'Y', 0, 0, 0, 0, 0x1358,
230 'R', 'Y', 'A', 0, 0, 0, 0x1358,
231 'R', 'Y', 'a', 0, 0, 0, 0x1358,
233 'S', 0, 0, 0, 0, 0, 0x1338+5,
234 'S', 'A', 0, 0, 0, 0, 0x1338+3,
235 'S', 'E', 0, 0, 0, 0, 0x1338+4,
236 'S', 'I', 0, 0, 0, 0, 0x1338+2,
237 'S', 'O', 0, 0, 0, 0, 0x1338+6,
238 'S', 'S', 0, 0, 0, 0, 0x1340+5,
239 'S', 'S', 'A', 0, 0, 0, 0x1340+3,
240 'S', 'S', 'E', 0, 0, 0, 0x1340+4,
241 'S', 'S', 'I', 0, 0, 0, 0x1340+2,
242 'S', 'S', 'O', 0, 0, 0, 0x1340+6,
243 'S', 'S', 'U', 0, 0, 0, 0x1340+1,
244 'S', 'S', 'a', 0, 0, 0, 0x1340+3,
245 'S', 'S', 'e', 0, 0, 0, 0x1340,
246 'S', 'S', 'e', 'e', 0, 0, 0x1340+4,
247 'S', 'S', 'i', 0, 0, 0, 0x1340+2,
248 'S', 'S', 'o', 0, 0, 0, 0x1340+6,
249 'S', 'S', 'u', 0, 0, 0, 0x1340+1,
250 'S', 'U', 0, 0, 0, 0, 0x1338+1,
251 'S', 'W', 0, 0, 0, 0, 0x1338+7,
252 'S', 'W', 'A', 0, 0, 0, 0x1338+7,
253 'S', 'W', 'a', 0, 0, 0, 0x1338+7,
254 'S', 'a', 0, 0, 0, 0, 0x1338+3,
255 'S', 'e', 0, 0, 0, 0, 0x1338,
256 'S', 'e', 'e', 0, 0, 0, 0x1338+4,
257 'S', 'i', 0, 0, 0, 0, 0x1338+2,
258 'S', 'o', 0, 0, 0, 0, 0x1338+6,
259 'S', 'u', 0, 0, 0, 0, 0x1338+1,
260 'S', 'w', 'w', 0, 0, 0, 0x1338+7,
261 'S', 'w', 'w', 'a', 0, 0, 0x1338+7,
263 'U', 0, 0, 0, 0, 0, 0x12A1,
264 'U','U', 0, 0, 0, 0, 0x12D1,
271 /* much, much work to be done for lone vowels */
272 'a', 0, 0, 0, 0, 0, 0x12A0,
273 'a','a', 0, 0, 0, 0, 0x12D3,
274 'a','a','a', 0, 0, 0, 0x12D0,
275 'a','a','a','a', 0, 0, 0x12A3,
276 'a','a','a','a','a', 0, 0x12A0,
280 'e', 0, 0, 0, 0, 0, 0x12A5,
281 'e','A', 0, 0, 0, 0, 0x12A3,
282 'e','E', 0, 0, 0, 0, 0x12A4,
283 'e','I', 0, 0, 0, 0, 0x12A2,
284 'e','O', 0, 0, 0, 0, 0x12A6,
285 'e','U', 0, 0, 0, 0, 0x12A1,
286 'e','W', 0, 0, 0, 0, 0x12A7,
287 'e','a', 0, 0, 0, 0, 0x12D0,
288 'e','e', 0, 0, 0, 0, 0x12D5,
289 'e','e','E', 0, 0, 0, 0x12D4,
290 'e','e','a', 0, 0, 0, 0x12D3,
291 'e','e','e', 0, 0, 0, 0x12D0,
292 'e','e','i', 0, 0, 0, 0x12D2,
293 'e','e','o', 0, 0, 0, 0x12D6,
294 'e','e','u', 0, 0, 0, 0x12D1,
295 'e','i', 0, 0, 0, 0, 0x12A2,
296 'e','o', 0, 0, 0, 0, 0x12A6,
297 'e','u', 0, 0, 0, 0, 0x12A1,
299 'f', 'Y', 0, 0, 0, 0, 0x135A,
300 'f', 'Y', 'A', 0, 0, 0, 0x135A,
301 'f', 'Y', 'a', 0, 0, 0, 0x135A,
304 'h', 0, 0, 0, 0, 0, 0x1200+5,
305 'h', 'A', 0, 0, 0, 0, 0x1200+3,
306 'h', 'E', 0, 0, 0, 0, 0x1200+4,
307 'h', 'I', 0, 0, 0, 0, 0x1200+2,
308 'h', 'O', 0, 0, 0, 0, 0x1200+6,
309 'h', 'U', 0, 0, 0, 0, 0x1200+1,
310 'h', 'W', 0, 0, 0, 0, 0x1280+11,
311 'h', 'W', '\'', 0, 0, 0, 0x1280+13,
312 'h', 'W', 'A', 0, 0, 0, 0x1280+11,
313 'h', 'W', 'E', 0, 0, 0, 0x1280+12,
314 'h', 'W', 'I', 0, 0, 0, 0x1280+10,
315 'h', 'W', 'U', 0, 0, 0, 0x1280+13,
316 'h', 'W', 'a', 0, 0, 0, 0x1280+11,
317 'h', 'W', 'e', 0, 0, 0, 0x1280+8,
318 'h', 'W', 'e', 'e', 0, 0, 0x1280+12,
319 'h', 'W', 'i', 0, 0, 0, 0x1280+10,
320 'h', 'W', 'u', 0, 0, 0, 0x1280+13,
321 'h', 'a', 0, 0, 0, 0, 0x1200+3,
322 'h', 'e', 0, 0, 0, 0, 0x1200,
323 'h', 'e', 'e', 0, 0, 0, 0x1200+4,
324 'h', 'h', 0, 0, 0, 0, 0x1280+5,
325 'h', 'h', 'A', 0, 0, 0, 0x1280+3,
326 'h', 'h', 'E', 0, 0, 0, 0x1280+4,
327 'h', 'h', 'I', 0, 0, 0, 0x1280+2,
328 'h', 'h', 'O', 0, 0, 0, 0x1280+6,
329 'h', 'h', 'O', 'O', 0, 0, 0x1280+8,
330 'h', 'h', 'U', 0, 0, 0, 0x1280+1,
331 'h', 'h', 'W', 0, 0, 0, 0x1280+11,
332 'h', 'h', 'W', '\'', 0, 0, 0x1280+13,
333 'h', 'h', 'W', 'A', 0, 0, 0x1280+11,
334 'h', 'h', 'W', 'E', 0, 0, 0x1280+12,
335 'h', 'h', 'W', 'I', 0, 0, 0x1280+10,
336 'h', 'h', 'W', 'U', 0, 0, 0x1280+13,
337 'h', 'h', 'W', 'a', 0, 0, 0x1280+11,
338 'h', 'h', 'W', 'e', 0, 0, 0x1280+8,
339 'h', 'h', 'W', 'e', 'e', 0, 0x1280+12,
340 'h', 'h', 'W', 'i', 0, 0, 0x1280+10,
341 'h', 'h', 'W', 'u', 0, 0, 0x1280+13,
342 'h', 'h', 'a', 0, 0, 0, 0x1280+3,
343 'h', 'h', 'e', 0, 0, 0, 0x1280,
344 'h', 'h', 'e', 'e', 0, 0, 0x1280+4,
345 'h', 'h', 'i', 0, 0, 0, 0x1280+2,
346 'h', 'h', 'o', 0, 0, 0, 0x1280+6,
347 'h', 'h', 'o', 'o', 0, 0, 0x1280+8,
348 'h', 'h', 'u', 0, 0, 0, 0x1280+1,
349 'h', 'h', 'w', 'w', 0, 0, 0x1280+11,
350 'h', 'h', 'w', 'w', 'a', 0, 0x1280+11,
351 'h', 'h', 'w', 'w', 0, 0, 0x1280+11,
352 'h', 'h', 'w', 'w', '\'', 0, 0x1280+13,
353 'h', 'h', 'w', 'w', 'E', 0, 0x1280+12,
354 'h', 'h', 'w', 'w', 'a', 0, 0x1280+11,
355 'h', 'h', 'w', 'w', 'e', 0, 0x1280+8,
356 /* 'h', 'h', 'w', 'w', 'e', 'e', 0, 0x1280+12, too long for now */
357 'h', 'h', 'w', 'w', 'i', 0, 0x1280+10,
358 'h', 'h', 'w', 'w', 'u', 0, 0x1280+13,
359 'h', 'i', 0, 0, 0, 0, 0x1200+2,
360 'h', 'o', 0, 0, 0, 0, 0x1200+6,
361 'h', 'u', 0, 0, 0, 0, 0x1200+1,
362 'h', 'w', 'w', 0, 0, 0, 0x1280+11,
363 'h', 'w', 'w', 'a', 0, 0, 0x1280+11,
364 'h', 'w', 'w', 0, 0, 0, 0x1280+11,
365 'h', 'w', 'w', '\'', 0, 0, 0x1280+13,
366 'h', 'w', 'w', 'E', 0, 0, 0x1280+12,
367 'h', 'w', 'w', 'a', 0, 0, 0x1280+11,
368 'h', 'w', 'w', 'e', 0, 0, 0x1280+8,
369 'h', 'w', 'w', 'e', 'e', 0, 0x1280+12,
370 'h', 'w', 'w', 'i', 0, 0, 0x1280+10,
371 'h', 'w', 'w', 'u', 0, 0, 0x1280+13,
372 'i', 0, 0, 0, 0, 0, 0x12A2,
373 'i', 'i', 0, 0, 0, 0, 0x12D2,
378 'm', 'Y', 0, 0, 0, 0, 0x1359,
379 'm', 'Y', 'A', 0, 0, 0, 0x1359,
380 'm', 'Y', 'a', 0, 0, 0, 0x1359,
383 'o', 0, 0, 0, 0, 0, 0x12A6,
384 'o','o', 0, 0, 0, 0, 0x12D6,
388 'r', 'Y', 0, 0, 0, 0, 0x1358,
389 'r', 'Y', 'A', 0, 0, 0, 0x1358,
390 'r', 'Y', 'a', 0, 0, 0, 0x1358,
392 's', 0, 0, 0, 0, 0, 0x1230+5,
393 's', 'A', 0, 0, 0, 0, 0x1230+3,
394 's', 'E', 0, 0, 0, 0, 0x1230+4,
395 's', 'I', 0, 0, 0, 0, 0x1230+2,
396 's', 'O', 0, 0, 0, 0, 0x1230+6,
397 's', 'U', 0, 0, 0, 0, 0x1230+1,
398 's', 'W', 0, 0, 0, 0, 0x1230+7,
399 's', 'W', 'A', 0, 0, 0, 0x1230+7,
400 's', 'W', 'a', 0, 0, 0, 0x1230+7,
401 's', 'a', 0, 0, 0, 0, 0x1230+3,
402 's', 'e', 0, 0, 0, 0, 0x1230,
403 's', 'e', 'e', 0, 0, 0, 0x1230+4,
404 's', 'i', 0, 0, 0, 0, 0x1230+2,
405 's', 'o', 0, 0, 0, 0, 0x1230+6,
406 's', 's', 0, 0, 0, 0, 0x1220+5,
407 's', 's', 'A', 0, 0, 0, 0x1220+3,
408 's', 's', 'E', 0, 0, 0, 0x1220+4,
409 's', 's', 'I', 0, 0, 0, 0x1220+2,
410 's', 's', 'O', 0, 0, 0, 0x1220+6,
411 's', 's', 'U', 0, 0, 0, 0x1220+1,
412 's', 's', 'W', 0, 0, 0, 0x1220+7,
413 's', 's', 'W', 'A', 0, 0, 0x1220+7,
414 's', 's', 'W', 'a', 0, 0, 0x1220+7,
415 's', 's', 'a', 0, 0, 0, 0x1220+3,
416 's', 's', 'e', 0, 0, 0, 0x1220,
417 's', 's', 'e', 'e', 0, 0, 0x1220+4,
418 's', 's', 'i', 0, 0, 0, 0x1220+2,
419 's', 's', 'o', 0, 0, 0, 0x1220+6,
420 's', 's', 'u', 0, 0, 0, 0x1220+1,
421 's', 's', 'w', 'w', 0, 0, 0x1220+7,
422 's', 's', 'w', 'w', 'a', 0, 0x1220+7,
423 's', 'u', 0, 0, 0, 0, 0x1230+1,
424 's', 'w', 'w', 0, 0, 0, 0x1230+7,
425 's', 'w', 'w', 'a', 0, 0, 0x1230+7,
427 'u', 0, 0, 0, 0, 0, 0x12A1,
428 'u','u', 0, 0, 0, 0, 0x12D1,
434 GDK_Shift_L, GDK_space, 0, 0, 0, 0, 0x1361,
435 GDK_Shift_R, GDK_space, 0, 0, 0, 0, 0x1361,
439 am_et_class_init (GtkIMContextSimpleClass *class)
444 am_et_init (GtkIMContextSimple *im_context)
446 gtk_im_context_simple_add_table (im_context,
449 G_N_ELEMENTS (am_et_compose_seqs) / (5 + 2));
452 static const GtkIMContextInfo am_et_info = {
454 N_("Amharic (EZ+)"), /* Human readable name */
455 GETTEXT_PACKAGE, /* Translation domain */
456 GTK_LOCALEDIR, /* Dir for bindtextdomain (not strictly needed for "gtk+") */
457 "am" /* Languages for which this module is the default */
460 static const GtkIMContextInfo *info_list[] = {
465 im_module_init (GTypeModule *module)
467 am_et_register_type (module);
471 im_module_exit (void)
476 im_module_list (const GtkIMContextInfo ***contexts,
479 *contexts = info_list;
480 *n_contexts = G_N_ELEMENTS (info_list);
484 im_module_create (const gchar *context_id)
486 if (strcmp (context_id, "am_et") == 0)
487 return GTK_IM_CONTEXT (g_object_new (type_am_et_translit,NULL));