File: im-module.c

package info (click to toggle)
matchbox-keyboard 0.1%2Bsvn20080916-11
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 1,048 kB
  • ctags: 539
  • sloc: ansic: 3,950; xml: 1,778; makefile: 85; sh: 2
file content (64 lines) | stat: -rw-r--r-- 1,544 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* 
 *  Matchbox Keyboard - A lightweight software keyboard.
 *
 *  Author: Ross Burton <ross@o-hand.com>
 *
 *  Copyright (c) 2007 OpenedHand Ltd - http://o-hand.com
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2, or (at your option)
 *  any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 */

#include <string.h>
#include <gtk/gtkimmodule.h>
#include "im-context.h"

#define IM_CONTEXT "matchbox-im-invoker"

static const
GtkIMContextInfo im_info = {
  IM_CONTEXT, "Virtual Keyboard",
  /* TODO: localise the above string */
  "", "", "*"
};

static const GtkIMContextInfo *info_list[] = { &im_info };

void
im_module_list(const GtkIMContextInfo ***contexts, guint *n_contexts )
{
  *contexts = info_list;
  *n_contexts = G_N_ELEMENTS (info_list);
}

void
im_module_init(GTypeModule *module)
{
  mb_im_context_register_type (module);
}

void
im_module_exit(void)
{
}

/* returns a new GtkIMContext with the id HILDON_IM_CONTEXT_ID or NULL
 * if given id does not match HILDON_IM_CONTEXT_ID
 */
GtkIMContext *
im_module_create(const gchar *context_id)
{
  if (strcmp (context_id, IM_CONTEXT) == 0) {
    return mb_im_context_new();
  } else {
    return NULL;
  }
}