~bratsche/ubuntu/maverick/gtk+2.0/menu-activation-fix

« back to all changes in this revision

Viewing changes to modules/input/immultipress.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-06-13 10:00:13 UTC
  • mto: (72.2.1 lenny) (1.5.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20070613100013-qstao3cwpm6xdlxc
Tags: upstream-2.11.2
ImportĀ upstreamĀ versionĀ 2.11.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2006 Openismus GmbH
 
2
 * 
 
3
 * This library is free software; you can redistribute it and/or
 
4
 * modify it under the terms of the GNU Lesser General Public
 
5
 * License as published by the Free Software Foundation; either
 
6
 * version 2 of the License, or (at your option) any later version.
 
7
 *
 
8
 * This library is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
11
 * Lesser General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU Lesser General Public
 
14
 * License along with this library; if not, write to the
 
15
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
16
 * Boston, MA 02111-1307, USA.
 
17
 */
 
18
 
 
19
#include "gtkimcontextmultipress.h"
 
20
#include <gtk/gtkimmodule.h> /* For GtkIMContextInfo */
 
21
#include <config.h>
 
22
#include <glib/gi18n.h>
 
23
#include <string.h> /* For strcmp() */
 
24
 
 
25
#define CONTEXT_ID "multipress"
 
26
 
 
27
/** NOTE: Change the default language from "" to "*" to enable this input method by default for all locales.
 
28
 */
 
29
static const GtkIMContextInfo info = { 
 
30
  CONTEXT_ID,              /* ID */
 
31
  N_("Multipress"),     /* Human readable name */
 
32
  GETTEXT_PACKAGE,         /* Translation domain. Defined in configure.ac */
 
33
  MULTIPRESS_LOCALEDIR,    /* Dir for bindtextdomain (not strictly needed for "gtk+"). Defined in the Makefile.am */
 
34
  ""                       /* Languages for which this module is the default */
 
35
};
 
36
 
 
37
static const GtkIMContextInfo *info_list[] = {
 
38
  &info
 
39
};
 
40
 
 
41
void
 
42
im_module_init (GTypeModule *module)
 
43
{
 
44
  gtk_im_context_multipress_register_type(module);
 
45
}
 
46
 
 
47
void 
 
48
im_module_exit (void)
 
49
{
 
50
}
 
51
 
 
52
void 
 
53
im_module_list (const GtkIMContextInfo ***contexts,
 
54
                int                      *n_contexts)
 
55
{
 
56
  *contexts = info_list;
 
57
  *n_contexts = G_N_ELEMENTS (info_list);
 
58
}
 
59
 
 
60
GtkIMContext *
 
61
im_module_create (const gchar *context_id)
 
62
{
 
63
  if (strcmp (context_id, CONTEXT_ID) == 0)
 
64
  {
 
65
    GtkIMContext* imcontext = GTK_IM_CONTEXT(g_object_new (GTK_TYPE_IM_CONTEXT_MULTIPRESS, NULL));
 
66
    return imcontext;
 
67
  }
 
68
  else
 
69
    return NULL;
 
70
}