Debian Codegraph @

gtk-input-context/client-gtk/gtk-imcontext-plugin.c

raw symbols SCIP
1 /*
2 * Copyright (C) 2010, Intel Corporation.
3 *
4 * Author: Raymond Liu <[email protected]>
5 *
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * version 2.1 as published by the Free Software Foundation.
10 *
11 * This library is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19 * 02110-1301 USA
20 */
21
22
23 #include <stdio.h>
24 #include <stdlib.h>
25 #include <string.h>
26
27 #include <gtk/gtk.h>
28 #include <gtk/gtkimmodule.h>
29
30 #include "client-imcontext-gtk.h"
31 #include "debug.h"
32
33 static const GtkIMContextInfo maliit_im_info = {
34 "Maliit", /* ID */
35 "Maliit Input Method",
36 "maliit", /* Gettext domain */
37 "",
38 "en:ja:ko:zh:*"
39 };
40
41
42 static const GtkIMContextInfo *info_list[] = {
43 &maliit_im_info
44 };
45
46
47 void im_module_init(GTypeModule *type_module);
48 void im_module_exit(void);
49 void im_module_list(const GtkIMContextInfo ***contexts, int *context_number);
50 GtkIMContext *im_module_create(const gchar *context_id);
51
52
53 void
54 im_module_init(GTypeModule *type_module)
55 {
56 STEP();
57 g_type_module_use(type_module);
58 maliit_im_context_register_type(type_module);
59 STEP();
60 }
61
62
63 void
64 im_module_exit()
65 {
66 STEP();
67 }
68
69
70 void
71 im_module_list(const GtkIMContextInfo ***contexts, int *context_number)
72 {
73 *contexts = info_list;
74 *context_number = G_N_ELEMENTS(info_list);
75 }
76
77
78 GtkIMContext *
79 im_module_create(const gchar *context_id)
80 {
81 if (g_strcmp0(context_id, "Maliit") == 0) {
82 return maliit_im_context_new();
83 } else {
84 return NULL;
85 }
86 }
87