]> Pileus Git - ~andy/gtk/blob - modules/input/imxim.c
The first part of the fix for #114351 (see also gdk-pixbuf/ChangeLog and
[~andy/gtk] / modules / input / imxim.c
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 2000 Red Hat, Inc.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #include "gtk/gtkintl.h"
21 #include "gtk/gtkimmodule.h"
22 #include "gtkimcontextxim.h"
23 #include <string.h>
24
25 static const GtkIMContextInfo xim_ja_info = { 
26   "xim",                           /* ID */
27   N_("X Input Method"),            /* Human readable name */
28   GETTEXT_PACKAGE,                 /* Translation domain */
29   GTK_LOCALEDIR,                   /* Dir for bindtextdomain (not strictly needed for "gtk+") */
30   "ko:ja:zh"                       /* Languages for which this module is the default */
31 };
32
33 static const GtkIMContextInfo *info_list[] = {
34   &xim_ja_info
35 };
36
37 void
38 im_module_init (GTypeModule *type_module)
39 {
40   gtk_im_context_xim_register_type (type_module);
41 }
42
43 void 
44 im_module_exit (void)
45 {
46   gtk_im_context_xim_shutdown ();
47 }
48
49 void 
50 im_module_list (const GtkIMContextInfo ***contexts,
51                 int                      *n_contexts)
52 {
53   *contexts = info_list;
54   *n_contexts = G_N_ELEMENTS (info_list);
55 }
56
57 GtkIMContext *
58 im_module_create (const gchar *context_id)
59 {
60   if (strcmp (context_id, "xim") == 0)
61     return gtk_im_context_xim_new ();
62   else
63     return NULL;
64 }