~ubuntu-branches/ubuntu/quantal/ibus-chewing/quantal-updates

« back to all changes in this revision

Viewing changes to src/ibus-chewing-engine.h

  • Committer: Bazaar Package Importer
  • Author(s): LI Daobing
  • Date: 2009-09-17 19:06:19 UTC
  • mfrom: (1.1.5 upstream) (0.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20090917190619-glkpocbc4ityzr8b
Tags: 1.2.0.20090917-1
new upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Generated by GOB (v2.0.15)   (do not edit directly) */
 
2
 
 
3
 
 
4
 
 
5
/*
 
6
 * Copyright © 2009  Red Hat, Inc. All rights reserved.
 
7
 * Copyright © 2009  Ding-Yi Chen <dchen at redhat.com>
 
8
 *
 
9
 * This file is part of the ibus-chewing Project.
 
10
 *
 
11
 * This program is free software; you can redistribute it and/or
 
12
 * modify it under the terms of the GNU General Public License
 
13
 * as published by the Free Software Foundation; either version 2
 
14
 * of the License, or (at your option) any later version.
 
15
 *
 
16
 * This program is distributed in the hope that it will be useful,
 
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
19
 * GNU General Public License for more details.
 
20
 *
 
21
 * You should have received a copy of the GNU General Public License
 
22
 * along with this program; if not, write to the Free Software
 
23
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
24
 */
 
25
#include <stdlib.h>
 
26
#include <libintl.h>
 
27
#include <ibus.h>
 
28
#include <chewing.h>
 
29
#include <string.h>
 
30
#include <stdio.h>
 
31
#define GETTEXT_PACKAGE "gtk20"
 
32
#include <glib/gi18n.h>
 
33
#include <gtk/gtk.h>
 
34
#include <X11/extensions/XTest.h>
 
35
#include <X11/Xlib.h>
 
36
#include <ctype.h>
 
37
 
 
38
#include <glib.h>
 
39
#include <glib-object.h>
 
40
#ifndef __IBUS_CHEWING_ENGINE_H__
 
41
#define __IBUS_CHEWING_ENGINE_H__
 
42
 
 
43
#ifdef __cplusplus
 
44
extern "C" {
 
45
#endif /* __cplusplus */
 
46
 
 
47
 
 
48
typedef enum {
 
49
        CHEWING_KBTYPE_INVALID = -1,
 
50
        CHEWING_KBTYPE_DEFAULT,
 
51
        CHEWING_KBTYPE_HSU,
 
52
        CHEWING_KBTYPE_IBM,
 
53
        CHEWING_KBTYPE_GIN_YIEH,
 
54
        CHEWING_KBTYPE_ETEN,
 
55
        CHEWING_KBTYPE_ETEN26,
 
56
        CHEWING_KBTYPE_DVORAK,
 
57
        CHEWING_KBTYPE_DVORAK_HSU,
 
58
        CHEWING_KBTYPE_DACHEN_CP26,
 
59
        CHEWING_KBTYPE_HAN_YU
 
60
} ChewingKbType;
 
61
#define CHEWING_TYPE_KBTYPE chewing_kbtype_get_type()
 
62
GType chewing_kbtype_get_type (void);
 
63
 
 
64
 
 
65
typedef enum {
 
66
        CHEWING_MODIFIER_SYNC_DISABLE,
 
67
        CHEWING_MODIFIER_SYNC_FROM_KEYBOARD,
 
68
        CHEWING_MODIFIER_SYNC_FROM_IM
 
69
} ChewingModifierSync;
 
70
#define CHEWING_TYPE_MODIFIER_SYNC chewing_modifier_sync_get_type()
 
71
GType chewing_modifier_sync_get_type (void);
 
72
 
 
73
 
 
74
typedef enum {
 
75
        CHEWING_INPUT_MODE_BYPASS,
 
76
        CHEWING_INPUT_MODE_EDITING,
 
77
        CHEWING_INPUT_MODE_SELECTING,
 
78
        CHEWING_INPUT_MODE_SELECTING_DONE
 
79
} ChewingInputMode;
 
80
#define CHEWING_TYPE_INPUT_MODE chewing_input_mode_get_type()
 
81
GType chewing_input_mode_get_type (void);
 
82
 
 
83
 
 
84
 
 
85
#include "maker-dialog.h"
 
86
#define GCONF_KEY_PREFIX "/desktop/ibus/engine/Chewing/"
 
87
#define EASY_SYMBOL_INPUT_WORK_AROUND
 
88
#define CHOICE_FROM_REARWARD_WORK_AROUND
 
89
#define CURSOR_LAST_SIZE 2
 
90
 
 
91
extern PropertySpec propSpecs[];
 
92
extern const gchar *page_labels[];
 
93
extern const gchar *button_labels[];
 
94
extern GtkResponseType button_responses[];
 
95
#define ZHUYIN_BUFFER_SIZE 12
 
96
 
 
97
#define ENGINE_STATUS_INITIALIZED       1
 
98
#define ENGINE_STATUS_ENABLED           2
 
99
#define ENGINE_STATUS_FOCUS_IN          4
 
100
 
 
101
#ifdef IBUS_1_1
 
102
/*
 
103
 * Dummy data structure for ibus 1.1 and early.
 
104
 */
 
105
typedef void IBusKeymap;
 
106
IBusKeymap *ibus_keymap_new(gchar *keymap_name);
 
107
#endif /* IBUS_1_1 */
 
108
 
 
109
 
 
110
/*
 
111
 * Type checking and casting macros
 
112
 */
 
113
#define IBUS_TYPE_CHEWING_ENGINE        (ibus_chewing_engine_get_type())
 
114
#define IBUS_CHEWING_ENGINE(obj)        G_TYPE_CHECK_INSTANCE_CAST((obj), ibus_chewing_engine_get_type(), IBusChewingEngine)
 
115
#define IBUS_CHEWING_ENGINE_CONST(obj)  G_TYPE_CHECK_INSTANCE_CAST((obj), ibus_chewing_engine_get_type(), IBusChewingEngine const)
 
116
#define IBUS_CHEWING_ENGINE_CLASS(klass)        G_TYPE_CHECK_CLASS_CAST((klass), ibus_chewing_engine_get_type(), IBusChewingEngineClass)
 
117
#define IBUS_IS_CHEWING_ENGINE(obj)     G_TYPE_CHECK_INSTANCE_TYPE((obj), ibus_chewing_engine_get_type ())
 
118
 
 
119
#define IBUS_CHEWING_ENGINE_GET_CLASS(obj)      G_TYPE_INSTANCE_GET_CLASS((obj), ibus_chewing_engine_get_type(), IBusChewingEngineClass)
 
120
 
 
121
/* Private structure type */
 
122
typedef struct _IBusChewingEnginePrivate IBusChewingEnginePrivate;
 
123
 
 
124
/*
 
125
 * Main object structure
 
126
 */
 
127
#ifndef __TYPEDEF_IBUS_CHEWING_ENGINE__
 
128
#define __TYPEDEF_IBUS_CHEWING_ENGINE__
 
129
typedef struct _IBusChewingEngine IBusChewingEngine;
 
130
#endif
 
131
struct _IBusChewingEngine {
 
132
        IBusEngine __parent__;
 
133
        /*< public >*/
 
134
        ChewingContext * context;
 
135
        ChewingModifierSync syncCapsLock_local;
 
136
        GtkWidget * setting_dialog;
 
137
        IBusProperty * chieng_prop;
 
138
        IBusProperty * alnumSize_prop;
 
139
        IBusProperty * settings_prop;
 
140
        IBusPropList * prop_list;
 
141
        IBusConfig * config;
 
142
        /*< private >*/
 
143
        gint selKeys[MAX_SELKEY]; /* protected */
 
144
        gboolean plainZhuyin; /* protected */
 
145
        ChewingInputMode inputMode; /* protected */
 
146
        gboolean forceLowercaseEnglish; /* protected */
 
147
        gboolean numpadAlwaysNumber; /* protected */
 
148
        IBusLookupTable * table; /* protected */
 
149
        IBusKeymap * keymap_us; /* protected */
 
150
        IBusChewingEnginePrivate *_priv;
 
151
};
 
152
 
 
153
/*
 
154
 * Class definition
 
155
 */
 
156
typedef struct _IBusChewingEngineClass IBusChewingEngineClass;
 
157
struct _IBusChewingEngineClass {
 
158
        IBusEngineClass __parent__;
 
159
        IBusText * chieng_prop_label_chi;
 
160
        IBusText * chieng_prop_label_eng;
 
161
        IBusText * alnumSize_prop_label_full;
 
162
        IBusText * alnumSize_prop_label_half;
 
163
        IBusText * settings_prop_label;
 
164
};
 
165
 
 
166
 
 
167
/*
 
168
 * Public methods
 
169
 */
 
170
GType   ibus_chewing_engine_get_type    (void);
 
171
void    ibus_chewing_engine_refresh_property_list       (IBusChewingEngine * self);
 
172
void    ibus_chewing_engine_hide_property_list  (IBusChewingEngine * self);
 
173
gboolean        ibus_chewing_engine_save_config (IBusChewingEngine * self,
 
174
                                        const gchar * key_suffix);
 
175
gboolean        ibus_chewing_engine_save_config_all     (IBusChewingEngine * self);
 
176
 
 
177
#ifdef __cplusplus
 
178
}
 
179
#endif /* __cplusplus */
 
180
 
 
181
#endif