Blame modules/input/imthai.c

Packit 98cdb6
/* GTK - The GIMP Toolkit
Packit 98cdb6
 *
Packit 98cdb6
 * This library is free software; you can redistribute it and/or
Packit 98cdb6
 * modify it under the terms of the GNU Library General Public
Packit 98cdb6
 * License as published by the Free Software Foundation; either
Packit 98cdb6
 * version 2 of the License, or (at your option) any later version.
Packit 98cdb6
 *
Packit 98cdb6
 * This library is distributed in the hope that it will be useful,
Packit 98cdb6
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 98cdb6
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 98cdb6
 * Library General Public License for more details.
Packit 98cdb6
 *
Packit 98cdb6
 * You should have received a copy of the GNU Library General Public
Packit 98cdb6
 * License along with this library; if not, write to the
Packit 98cdb6
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit 98cdb6
 * Boston, MA 02111-1307, USA.
Packit 98cdb6
 *
Packit 98cdb6
 * Author: Theppitak Karoonboonyanan <thep@linux.thai.net>
Packit 98cdb6
 *
Packit 98cdb6
 */
Packit 98cdb6
Packit 98cdb6
#include "config.h"
Packit 98cdb6
#include <string.h>
Packit 98cdb6
Packit 98cdb6
#include <gdk/gdkkeysyms.h>
Packit 98cdb6
Packit 98cdb6
#include "gtk/gtkintl.h"
Packit 98cdb6
#include "gtk/gtkimmodule.h"
Packit 98cdb6
#include "gtkimcontextthai.h"
Packit 98cdb6
Packit 98cdb6
GType type_thai = 0;
Packit 98cdb6
Packit 98cdb6
static const GtkIMContextInfo thai_info = { 
Packit 98cdb6
  "thai",	   /* ID */
Packit 98cdb6
  N_("Thai-Lao"),  /* Human readable name */
Packit 98cdb6
  GETTEXT_PACKAGE, /* Translation domain */
Packit 98cdb6
  GTK_LOCALEDIR,   /* Dir for bindtextdomain (not strictly needed for "gtk+") */
Packit 98cdb6
  "lo:th"	   /* Languages for which this module is the default */
Packit 98cdb6
};
Packit 98cdb6
Packit 98cdb6
static const GtkIMContextInfo *info_list[] = {
Packit 98cdb6
  &thai_info
Packit 98cdb6
};
Packit 98cdb6
Packit 98cdb6
#ifndef INCLUDE_IM_thai
Packit 98cdb6
#define MODULE_ENTRY(type, function) G_MODULE_EXPORT type im_module_ ## function
Packit 98cdb6
#else
Packit 98cdb6
#define MODULE_ENTRY(type, function) type _gtk_immodule_thai_ ## function
Packit 98cdb6
#endif
Packit 98cdb6
Packit 98cdb6
MODULE_ENTRY (void, init) (GTypeModule *module)
Packit 98cdb6
{
Packit 98cdb6
  gtk_im_context_thai_register_type (module);
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
MODULE_ENTRY (void, exit) (void)
Packit 98cdb6
{
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
MODULE_ENTRY (void, list) (const GtkIMContextInfo ***contexts,
Packit 98cdb6
			   int                      *n_contexts)
Packit 98cdb6
{
Packit 98cdb6
  *contexts = info_list;
Packit 98cdb6
  *n_contexts = G_N_ELEMENTS (info_list);
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
MODULE_ENTRY (GtkIMContext *, create) (const gchar *context_id)
Packit 98cdb6
{
Packit 98cdb6
  if (strcmp (context_id, "thai") == 0)
Packit 98cdb6
    return gtk_im_context_thai_new ();
Packit 98cdb6
  else
Packit 98cdb6
    return NULL;
Packit 98cdb6
}