]> Pileus Git - ~andy/gtk/blob - modules/input/imxim.c
printing: Don't load custom paper sizes in file backend
[~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, see <http://www.gnu.org/licenses/>.
16  */
17
18 #include "config.h"
19 #include "gtk/gtkintl.h"
20 #include "gtk/gtkimmodule.h"
21 #include "gtkimcontextxim.h"
22 #include <string.h>
23
24 static const GtkIMContextInfo xim_ja_info = { 
25   "xim",                           /* ID */
26   N_("X Input Method"),            /* Human readable name */
27   GETTEXT_PACKAGE,                 /* Translation domain */
28   GTK_LOCALEDIR,                   /* Dir for bindtextdomain (not strictly needed for "gtk+") */
29   "ko:ja:th:zh"                    /* Languages for which this module is the default */
30 };
31
32 static const GtkIMContextInfo *info_list[] = {
33   &xim_ja_info
34 };
35
36 #ifndef INCLUDE_IM_xim
37 #define MODULE_ENTRY(type, function) G_MODULE_EXPORT type im_module_ ## function
38 #else
39 #define MODULE_ENTRY(type, function) type _gtk_immodule_xim_ ## function
40 #endif
41
42 MODULE_ENTRY (void, init) (GTypeModule *type_module)
43 {
44   gtk_im_context_xim_register_type (type_module);
45 }
46
47 MODULE_ENTRY (void, exit) (void)
48 {
49   gtk_im_context_xim_shutdown ();
50 }
51
52 MODULE_ENTRY (void, list) (const GtkIMContextInfo ***contexts,
53                            int                      *n_contexts)
54 {
55   *contexts = info_list;
56   *n_contexts = G_N_ELEMENTS (info_list);
57 }
58
59 MODULE_ENTRY (GtkIMContext *, create) (const gchar *context_id)
60 {
61   if (strcmp (context_id, "xim") == 0)
62     return gtk_im_context_xim_new ();
63   else
64     return NULL;
65 }