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>
28 #include <gdk/gdkkeysyms.h>
30 #include "gtk/gtkintl.h"
31 #include "gtk/gtkimcontextsimple.h"
32 #include "gtk/gtkimmodule.h"
34 GType type_inuktitut_translit = 0;
36 static void inuktitut_class_init (GtkIMContextSimpleClass *class);
37 static void inuktitut_init (GtkIMContextSimple *im_context);
40 inuktitut_register_type (GTypeModule *module)
42 static const GTypeInfo object_info =
44 sizeof (GtkIMContextSimpleClass),
46 (GBaseFinalizeFunc) NULL,
47 (GClassInitFunc) inuktitut_class_init,
48 NULL, /* class_finalize */
49 NULL, /* class_data */
50 sizeof (GtkIMContextSimple),
52 (GtkObjectInitFunc) inuktitut_init,
55 type_inuktitut_translit =
56 g_type_module_register_type (module,
57 GTK_TYPE_IM_CONTEXT_SIMPLE,
58 "GtkIMContextInukitut",
62 #define SYL(a,b,c,d) \
64 a, 'a', 0, 0, 0, b+7-d, \
65 a, 'a','a',0, 0, b+8-d, \
67 a, 'i','i',0, 0, b+1, \
68 a, 'o', 0, 0, 0, b+2, \
69 a, 'o','o',0, 0, b+3, \
70 a, 'u', 0, 0, 0, b+2, \
73 static guint16 inuktitut_compose_seqs[] = {
74 'a', 0, 0, 0 , 0, 0x140a,
75 'a', 'a', 0, 0, 0, 0x140b,
77 SYL('c', 0x148b, 0x14a1, 2) /* As g */
78 SYL('f', 0x1555, 0x155d, 2)
79 SYL('g', 0x148b, 0x14a1, 2)
80 SYL('h', 0x14ef, 0x1505, 2)
82 'i', 0, 0, 0 , 0, 0x1403,
83 'i', 'i', 0, 0, 0, 0x1404,
85 SYL('j', 0x1528, 0x153e, 2)
86 SYL('k', 0x146d, 0x1483, 2)
87 SYL('l', 0x14d5, 0x14ea, 2)
88 SYL('m', 0x14a5, 0x14bb, 2)
89 SYL('n', 0x14c2, 0x14d0, 2)
91 'o', 0, 0, 0 , 0, 0x1405, /* as u */
92 'o', 'o', 0, 0, 0, 0x1406,
94 SYL('p', 0x1431, 0x1449, 0)
95 SYL('q', 0x157f, 0x1585, 3)
96 SYL('r', 0x1546, 0x1550, 2)
97 SYL('s', 0x14ef, 0x1505, 2) /* As h */
98 SYL('t', 0x144e, 0x1466, 0)
100 'u', 0, 0, 0 , 0, 0x1405,
101 'u', 'u', 0, 0, 0, 0x1406,
103 SYL('v', 0x1555, 0x155d, 2) /* as f */
104 SYL('y', 0x1528, 0x153e, 2) /* As j */
106 SYL(GDK_lstroke, 0x15a0, 0x15a6, 3) /* l- */
107 SYL(GDK_eng, 0x158f, 0x1595, 3) /* ng */
111 inuktitut_class_init (GtkIMContextSimpleClass *class)
116 inuktitut_init (GtkIMContextSimple *im_context)
118 gtk_im_context_simple_add_table (im_context,
119 inuktitut_compose_seqs,
121 G_N_ELEMENTS (inuktitut_compose_seqs) / (4 + 2));
124 static const GtkIMContextInfo inuktitut_info = {
125 "inuktitut", /* ID */
126 N_("Inukitut (Transliterated)"), /* Human readable name */
127 "gtk+", /* Translation domain */
128 GTK_LOCALEDIR, /* Dir for bindtextdomain (not strictly needed for "gtk+") */
129 "iu" /* Languages for which this module is the default */
132 static const GtkIMContextInfo *info_list[] = {
137 im_module_init (GTypeModule *module)
139 inuktitut_register_type (module);
143 im_module_exit (void)
148 im_module_list (const GtkIMContextInfo ***contexts,
151 *contexts = info_list;
152 *n_contexts = G_N_ELEMENTS (info_list);
156 im_module_create (const gchar *context_id)
158 if (strcmp (context_id, "inuktitut") == 0)
159 return GTK_IM_CONTEXT (gtk_type_new (type_inuktitut_translit));