]> Pileus Git - ~andy/gtk/blob - modules/input/imime.c
4835303965356dfe195b6426c936979b609882bf
[~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 "config.h"
24 #include <string.h>
25
26 #include "gtk/gtkintl.h"
27 #include "gtk/gtkimmodule.h"
28 #include "gtkimcontextime.h"
29
30 static const GtkIMContextInfo ime_info = {
31   "ime",
32   "Windows IME",
33   "gtk+",
34   "",
35   "ja:ko:zh",
36 };
37
38 static const GtkIMContextInfo *info_list[] = {
39   &ime_info,
40 };
41
42 #ifndef INCLUDE_IM_ime
43 #define MODULE_ENTRY(type,function) G_MODULE_EXPORT type im_module_ ## function
44 #else
45 #define MODULE_ENTRY(type, function) type _gtk_immodule_ime_ ## function
46 #endif
47
48 MODULE_ENTRY (void, init) (GTypeModule * module)
49 {
50   gtk_im_context_ime_register_type (module);
51 }
52
53 MODULE_ENTRY (void, exit) (void)
54 {
55 }
56
57 MODULE_ENTRY (void, list) (const GtkIMContextInfo *** contexts, int *n_contexts)
58 {
59   *contexts = info_list;
60   *n_contexts = G_N_ELEMENTS (info_list);
61 }
62
63 MODULE_ENTRY (GtkIMContext *, create) (const gchar * context_id)
64 {
65   g_return_val_if_fail (context_id, NULL);
66
67   if (!strcmp (context_id, "ime"))
68     return g_object_new (GTK_TYPE_IM_CONTEXT_IME, NULL);
69   else
70     return NULL;
71 }