Blame modules/input/imxim.c

Packit Service fb6fa5
/* GTK - The GIMP Toolkit
Packit Service fb6fa5
 * Copyright (C) 2000 Red Hat, Inc.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * This library is free software; you can redistribute it and/or
Packit Service fb6fa5
 * modify it under the terms of the GNU Lesser General Public
Packit Service fb6fa5
 * License as published by the Free Software Foundation; either
Packit Service fb6fa5
 * version 2 of the License, or (at your option) any later version.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * This library is distributed in the hope that it will be useful,
Packit Service fb6fa5
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service fb6fa5
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service fb6fa5
 * Lesser General Public License for more details.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * You should have received a copy of the GNU Lesser General Public
Packit Service fb6fa5
 * License along with this library; if not, write to the
Packit Service fb6fa5
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit Service fb6fa5
 * Boston, MA 02111-1307, USA.
Packit Service fb6fa5
 */
Packit Service fb6fa5
Packit Service fb6fa5
#include "config.h"
Packit Service fb6fa5
#include "gtk/gtkintl.h"
Packit Service fb6fa5
#include "gtk/gtkimmodule.h"
Packit Service fb6fa5
#include "gtkimcontextxim.h"
Packit Service fb6fa5
#include <string.h>
Packit Service fb6fa5
Packit Service fb6fa5
static const GtkIMContextInfo xim_ja_info = { 
Packit Service fb6fa5
  "xim",		           /* ID */
Packit Service fb6fa5
  N_("X Input Method"),            /* Human readable name */
Packit Service fb6fa5
  GETTEXT_PACKAGE,		   /* Translation domain */
Packit Service fb6fa5
  GTK_LOCALEDIR,		   /* Dir for bindtextdomain (not strictly needed for "gtk+") */
Packit Service fb6fa5
  "ko:ja:th:zh"		           /* Languages for which this module is the default */
Packit Service fb6fa5
};
Packit Service fb6fa5
Packit Service fb6fa5
static const GtkIMContextInfo *info_list[] = {
Packit Service fb6fa5
  &xim_ja_info
Packit Service fb6fa5
};
Packit Service fb6fa5
Packit Service fb6fa5
#ifndef INCLUDE_IM_xim
Packit Service fb6fa5
#define MODULE_ENTRY(type, function) G_MODULE_EXPORT type im_module_ ## function
Packit Service fb6fa5
#else
Packit Service fb6fa5
#define MODULE_ENTRY(type, function) type _gtk_immodule_xim_ ## function
Packit Service fb6fa5
#endif
Packit Service fb6fa5
Packit Service fb6fa5
MODULE_ENTRY (void, init) (GTypeModule *type_module)
Packit Service fb6fa5
{
Packit Service fb6fa5
  gtk_im_context_xim_register_type (type_module);
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
MODULE_ENTRY (void, exit) (void)
Packit Service fb6fa5
{
Packit Service fb6fa5
  gtk_im_context_xim_shutdown ();
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
MODULE_ENTRY (void, list) (const GtkIMContextInfo ***contexts,
Packit Service fb6fa5
			   int                      *n_contexts)
Packit Service fb6fa5
{
Packit Service fb6fa5
  *contexts = info_list;
Packit Service fb6fa5
  *n_contexts = G_N_ELEMENTS (info_list);
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
MODULE_ENTRY (GtkIMContext *, create) (const gchar *context_id)
Packit Service fb6fa5
{
Packit Service fb6fa5
  if (strcmp (context_id, "xim") == 0)
Packit Service fb6fa5
    return gtk_im_context_xim_new ();
Packit Service fb6fa5
  else
Packit Service fb6fa5
    return NULL;
Packit Service fb6fa5
}