~ubuntu-branches/ubuntu/trusty/scim-bridge/trusty

« back to all changes in this revision

Viewing changes to client-gtk/im-scim-bridge-gtk.c

  • Committer: Bazaar Package Importer
  • Author(s): Hou ZhengPeng
  • Date: 2006-04-02 18:07:30 UTC
  • Revision ID: james.westby@ubuntu.com-20060402180730-x4zlfe8odh4yzcld
Tags: upstream-0.1.3
ImportĀ upstreamĀ versionĀ 0.1.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
#include <string.h>
 
3
 
 
4
#include <gtk/gtk.h>
 
5
#include <gtk/gtkimmodule.h>
 
6
 
 
7
#include "scim-bridge-client-imcontext-gtk.h"
 
8
 
 
9
static const GtkIMContextInfo scim_bridge_info =
 
10
{
 
11
    /* ID */
 
12
    "scim-bridge",
 
13
    /* Human readable name */
 
14
    "SCIM Bridge Input Method",
 
15
    /* Translation domain */
 
16
    "",
 
17
    /* Dir for bindtextdomain (not strictly needed for "gtk+") */
 
18
    "",
 
19
    /* Languages for which this module is the default */
 
20
    ""
 
21
};
 
22
 
 
23
static const GtkIMContextInfo *info_list[] =
 
24
{
 
25
    &scim_bridge_info
 
26
};
 
27
 
 
28
/* Public functions */
 
29
void im_module_init (GTypeModule *type_module);
 
30
void im_module_exit (void);
 
31
void im_module_list (const GtkIMContextInfo ***contexts, int *context_count);
 
32
GtkIMContext *im_module_create (const gchar *context_id);
 
33
 
 
34
/* Implementations */
 
35
void im_module_init (GTypeModule *type_module)
 
36
{
 
37
    scim_bridge_client_imcontext_register_type (type_module);
 
38
}
 
39
 
 
40
 
 
41
void im_module_exit (void)
 
42
{
 
43
    scim_bridge_client_imcontext_shutdown ();
 
44
}
 
45
 
 
46
 
 
47
void im_module_list (const GtkIMContextInfo ***contexts, int *context_count)
 
48
{
 
49
    *contexts = info_list;
 
50
    *context_count = G_N_ELEMENTS (info_list);
 
51
}
 
52
 
 
53
 
 
54
GtkIMContext *im_module_create (const gchar *context_id)
 
55
{
 
56
    if (strcmp (context_id, "scim-bridge") == 0) {
 
57
        return scim_bridge_client_imcontext_new ();
 
58
    } else {
 
59
        return NULL;
 
60
    }
 
61
}