]> Pileus Git - ~andy/gtk/blob - modules/input/imime.c
modules/engines/Makefile.am Decide whether to build the ms-windows theme
[~andy/gtk] / modules / input / imime.c
1 /*
2  * gtkimmoduleime
3  * Copyright (C) 2003 Takuro Ashie
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser 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.
9  *
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  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser 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.
19  *
20  * $Id$
21  */
22
23 #include <gtk/gtkimmodule.h>
24 #include "gtkimcontextime.h"
25
26 #include <string.h>
27
28 static const GtkIMContextInfo ime_info = {
29   "ime",
30   "Windows IME",
31   "gtk+",
32   "",
33   "ja:ko:zh",
34 };
35
36 static const GtkIMContextInfo *info_list[] = {
37   &ime_info,
38 };
39
40 void
41 im_module_init (GTypeModule * module)
42 {
43   gtk_im_context_ime_register_type (module);
44 }
45
46 void
47 im_module_exit (void)
48 {
49 }
50
51 void
52 im_module_list (const GtkIMContextInfo *** contexts, int *n_contexts)
53 {
54   *contexts = info_list;
55   *n_contexts = G_N_ELEMENTS (info_list);
56 }
57
58 GtkIMContext *
59 im_module_create (const gchar * context_id)
60 {
61   g_return_val_if_fail (context_id, NULL);
62
63   if (!strcmp (context_id, "ime"))
64     return g_object_new (GTK_TYPE_IM_CONTEXT_IME, NULL);
65   else
66     return NULL;
67 }