4
* Copyright (c) 2006 Ryo Dairiki <ryo-dairiki@users.sourceforge.net>
7
* This library is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Lesser General Public
9
* License as published by the Free Software Foundation and
10
* appearing in the file LICENSE.LGPL included in the package of this file.
11
* You can also redistribute it and/or modify it under the terms of
12
* the GNU General Public License as published by the Free Software Foundation and
13
* appearing in the file LICENSE.GPL included in the package of this file.
15
* This library is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
25
#include <gtk/gtkimmodule.h>
27
#include "scim-bridge.h"
28
#include "scim-bridge-client.h"
29
#include "scim-bridge-client-gtk.h"
30
#include "scim-bridge-client-imcontext-gtk.h"
32
static const GtkIMContextInfo scim_bridge_info =
36
/* Human readable name */
38
/* Translation domain */
40
/* Dir for bindtextdomain (not strictly needed for "gtk+") */
42
/* Languages for which this module is the default */
46
static const GtkIMContextInfo *info_list[] =
51
/* Public functions */
52
void im_module_init (GTypeModule *type_module);
53
void im_module_exit (void);
54
void im_module_list (const GtkIMContextInfo ***contexts, int *context_count);
55
GtkIMContext *im_module_create (const gchar *context_id);
59
void im_module_init (GTypeModule *type_module)
61
scim_bridge_client_imcontext_register_type (type_module);
62
scim_bridge_client_gtk_initialize ();
64
static boolean first_time = TRUE;
65
if (first_time) atexit (scim_bridge_client_gtk_finalize);
70
void im_module_exit ()
72
scim_bridge_client_gtk_finalize ();
76
void im_module_list (const GtkIMContextInfo ***contexts, int *context_count)
78
*contexts = info_list;
79
*context_count = G_N_ELEMENTS (info_list);
83
GtkIMContext *im_module_create (const gchar *context_id)
85
if (strcmp (context_id, "scim") == 0) {
86
return scim_bridge_client_imcontext_new ();