~ubuntu-branches/ubuntu/wily/scim/wily-proposed

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Rolf Leggewie, Rolf Leggewie, Tz-Huan Huang
  • Date: 2012-06-30 11:21:42 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20120630112142-a4cwzsr16dty8dk7
Tags: 1.4.14-1
[ Rolf Leggewie ]
* new upstream release 1.4.14
  - drop 32_scim-1.4.8-fix-dlopen.patch which has landed upstream
* bump compat level to 9
* debian/control: add Toni Mueller as co-maintainer
  Welcome aboard!

[ Tz-Huan Huang ]
* start shipping a couple of newly introduced im-module packages
* debian/rules:
  - simplify dh_auto_install override where upstream changes allow this
  - drop -fpermissive from CXXFLAGS, fixed upstream
* debian/README.*: update the documentation

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * SCIM Bridge
 
3
 *
 
4
 * Copyright (c) 2006 Ryo Dairiki <ryo-dairiki@users.sourceforge.net>
 
5
 *
 
6
 *
 
7
 * This library is free software; you can redistribute it and/or
 
8
 * modify it under the terms of the GNU Lesser General Public
 
9
 * License as published by the Free Software Foundation and 
 
10
 * appearing in the file LICENSE.LGPL included in the package of this file.
 
11
 * You can also redistribute it and/or modify it under the terms of 
 
12
 * the GNU General Public License as published by the Free Software Foundation and 
 
13
 * appearing in the file LICENSE.GPL included in the package of this file.
 
14
 *
 
15
 * This library is distributed in the hope that it will be useful,
 
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
18
 */
 
19
 
 
20
#include <stdio.h>
 
21
#include <stdlib.h>
 
22
#include <string.h>
 
23
 
 
24
#include <gtk/gtk.h>
 
25
#include <gtk/gtkimmodule.h>
 
26
 
 
27
#include "scim-bridge.h"
 
28
#include "scim-bridge-client.h"
 
29
#include "scim-bridge-client-gtk.h"
 
30
#include "scim-bridge-client-imcontext-gtk.h"
 
31
 
 
32
static const GtkIMContextInfo scim_bridge_info =
 
33
{
 
34
    /* ID */
 
35
    "scim",
 
36
    /* Human readable name */
 
37
    "SCIM Input Method",
 
38
    /* Translation domain */
 
39
    "",
 
40
    /* Dir for bindtextdomain (not strictly needed for "gtk+") */
 
41
    "",
 
42
    /* Languages for which this module is the default */
 
43
    ""
 
44
};
 
45
 
 
46
static const GtkIMContextInfo *info_list[] =
 
47
{
 
48
    &scim_bridge_info
 
49
};
 
50
 
 
51
/* Public functions */
 
52
void im_module_init (GTypeModule *type_module);
 
53
void im_module_exit (void);
 
54
void im_module_list (const GtkIMContextInfo ***contexts, int *context_count);
 
55
GtkIMContext *im_module_create (const gchar *context_id);
 
56
 
 
57
 
 
58
/* Implementations */
 
59
void im_module_init (GTypeModule *type_module)
 
60
{
 
61
    scim_bridge_client_imcontext_register_type (type_module);
 
62
    scim_bridge_client_gtk_initialize ();
 
63
    
 
64
    static boolean first_time = TRUE;
 
65
    if (first_time) atexit (scim_bridge_client_gtk_finalize);
 
66
    first_time = FALSE;
 
67
}
 
68
 
 
69
 
 
70
void im_module_exit ()
 
71
{
 
72
    scim_bridge_client_gtk_finalize ();
 
73
}
 
74
 
 
75
 
 
76
void im_module_list (const GtkIMContextInfo ***contexts, int *context_count)
 
77
{
 
78
    *contexts = info_list;
 
79
    *context_count = G_N_ELEMENTS (info_list);
 
80
}
 
81
 
 
82
 
 
83
GtkIMContext *im_module_create (const gchar *context_id)
 
84
{
 
85
    if (strcmp (context_id, "scim") == 0) {
 
86
        return scim_bridge_client_imcontext_new ();
 
87
    } else {
 
88
        return NULL;
 
89
    }
 
90
}