Git init
[profile/ivi/isf.git] / ism / extras / gtk2_immodule / imscim.cpp
1
2 /* ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable. */
3
4 /*
5  * Smart Common Input Method
6  *
7  * Copyright (c) 2002-2005 James Su <suzhe@tsinghua.org.cn>
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the
21  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22  * Boston, MA 02111-1307, USA.
23  */
24
25 #include <gtk/gtkimmodule.h>
26 #include <gtk/gtk.h>
27 #include "gtkimcontextscim.h"
28 #include <string.h>
29 #include <stdio.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif /* __cplusplus */
34
35 static const GtkIMContextInfo scim_info = {
36   "scim",           /* ID */
37   "Input Service Framework(It has been derived by SCIM)",       /* Human readable name */
38   "scim",           /* Translation domain */
39   SCIM_LOCALEDIR,   /* Dir for bindtextdomain (not strictly needed for "gtk+") */
40   "en:ja:ko:zh"     /* Languages for which this module is the default */
41 };
42
43 static const GtkIMContextInfo *info_list[] = {
44   &scim_info
45 };
46
47 void
48 im_module_init (GTypeModule *type_module)
49 {
50   gtk_im_context_scim_register_type (type_module);
51 }
52
53 void
54 im_module_exit (void)
55 {
56   gtk_im_context_scim_shutdown ();
57 }
58
59 void
60 im_module_list (const GtkIMContextInfo ***contexts,
61                 int                      *n_contexts)
62 {
63   *contexts = info_list;
64   *n_contexts = G_N_ELEMENTS (info_list);
65 }
66
67 GtkIMContext *
68 im_module_create (const gchar *context_id)
69 {
70   if (strcmp (context_id, "scim") == 0)
71     return gtk_im_context_scim_new ();
72   else
73     return NULL;
74 }
75
76 #ifdef __cplusplus
77 }
78 #endif /* __cplusplus */
79
80