|
Packit Service |
1d8f1c |
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
|
|
Packit Service |
1d8f1c |
/* vim:set et ts=4: */
|
|
Packit Service |
1d8f1c |
/* ibus - The Input Bus
|
|
Packit Service |
1d8f1c |
* Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
|
|
Packit Service |
1d8f1c |
* Copyright (C) 2008-2010 Red Hat, Inc.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* This library is free software; you can redistribute it and/or
|
|
Packit Service |
1d8f1c |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
1d8f1c |
* License as published by the Free Software Foundation; either
|
|
Packit Service |
1d8f1c |
* version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* This library is distributed in the hope that it will be useful,
|
|
Packit Service |
1d8f1c |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
1d8f1c |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
1d8f1c |
* Lesser General Public License for more details.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
1d8f1c |
* License along with this library; if not, write to the Free Software
|
|
Packit Service |
1d8f1c |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
|
Packit Service |
1d8f1c |
* USA
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#include <gtk/gtk.h>
|
|
Packit Service |
1d8f1c |
#include <gtk/gtkimmodule.h>
|
|
Packit Service |
1d8f1c |
#include <ibus.h>
|
|
Packit Service |
1d8f1c |
#include "ibusimcontext.h"
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#define IBUS_LOCALDIR ""
|
|
Packit Service |
1d8f1c |
static const GtkIMContextInfo ibus_im_info = {
|
|
Packit Service |
1d8f1c |
"ibus",
|
|
Packit Service |
1d8f1c |
"IBus (Intelligent Input Bus)",
|
|
Packit Service |
1d8f1c |
"ibus",
|
|
Packit Service |
1d8f1c |
IBUS_LOCALDIR,
|
|
Packit Service |
1d8f1c |
"ja:ko:zh:*"
|
|
Packit Service |
1d8f1c |
};
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static const GtkIMContextInfo *info_list[] = {
|
|
Packit Service |
1d8f1c |
&ibus_im_info
|
|
Packit Service |
1d8f1c |
};
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
G_MODULE_EXPORT const gchar*
|
|
Packit Service |
1d8f1c |
g_module_check_init (GModule *module)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
return glib_check_version (GLIB_MAJOR_VERSION,
|
|
Packit Service |
1d8f1c |
GLIB_MINOR_VERSION,
|
|
Packit Service |
1d8f1c |
0);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
G_MODULE_EXPORT void
|
|
Packit Service |
1d8f1c |
im_module_init (GTypeModule *type_module)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
/* make module resident */
|
|
Packit Service |
1d8f1c |
g_type_module_use (type_module);
|
|
Packit Service |
1d8f1c |
ibus_init ();
|
|
Packit Service |
1d8f1c |
ibus_im_context_register_type (type_module);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
G_MODULE_EXPORT void
|
|
Packit Service |
1d8f1c |
im_module_exit (void)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
G_MODULE_EXPORT GtkIMContext *
|
|
Packit Service |
1d8f1c |
im_module_create (const gchar *context_id)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
if (g_strcmp0 (context_id, "ibus") == 0) {
|
|
Packit Service |
1d8f1c |
IBusIMContext *context;
|
|
Packit Service |
1d8f1c |
context = ibus_im_context_new ();
|
|
Packit Service |
1d8f1c |
return (GtkIMContext *) context;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
return NULL;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
G_MODULE_EXPORT void
|
|
Packit Service |
1d8f1c |
im_module_list (const GtkIMContextInfo ***contexts,
|
|
Packit Service |
1d8f1c |
gint *n_contexts)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
*contexts = info_list;
|
|
Packit Service |
1d8f1c |
*n_contexts = G_N_ELEMENTS (info_list);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|