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

« back to all changes in this revision

Viewing changes to extras/immodules/common/scim-bridge-attribute.h

  • 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
/**
 
21
 * @file
 
22
 * @author Ryo Dairiki <ryo-dairiki@users.sourceforge.net>
 
23
 * @brief This header describes about attributes.
 
24
 *
 
25
 * Attributes are used to give the clients some hints how the preedit strings should be shown.\n
 
26
 * They are used to highlight the current segment in the convertion mode,
 
27
 * or to underline the newly-input-strings.
 
28
 */
 
29
 
 
30
#ifndef SCIMBRIDGEATTRIBUTE_H_
 
31
#define SCIMBRIDGEATTRIBUTE_H_
 
32
 
 
33
#include "scim-bridge.h"
 
34
 
 
35
enum _scim_bridge_attribute_type_t
 
36
{
 
37
    ATTRIBUTE_NONE,
 
38
    ATTRIBUTE_DECORATE,
 
39
    ATTRIBUTE_FOREGROUND,
 
40
    ATTRIBUTE_BACKGROUND
 
41
};
 
42
 
 
43
/**
 
44
 * This is enumeration type for the type of attributes.
 
45
 */
 
46
typedef enum _scim_bridge_attribute_type_t scim_bridge_attribute_type_t;
 
47
 
 
48
/**
 
49
 * This is type for the value or the color of attributes.
 
50
 */
 
51
typedef unsigned int scim_bridge_attribute_value_t;
 
52
 
 
53
/**
 
54
 * This is the type of attribute.
 
55
 */
 
56
typedef struct _ScimBridgeAttribute ScimBridgeAttribute;
 
57
 
 
58
/**
 
59
 * The attribute type, which means that the attribute is invalid.
 
60
 */
 
61
static const scim_bridge_attribute_value_t SCIM_BRIDGE_ATTRIBUTE_DECORATE_NONE = 0x1000000;
 
62
 
 
63
/**
 
64
 * The attribute type, which means that the attribute provides an underline.
 
65
 */
 
66
static const scim_bridge_attribute_value_t SCIM_BRIDGE_ATTRIBUTE_DECORATE_UNDERLINE = 0x2000000;
 
67
 
 
68
/**
 
69
 * The attribute type, which means that the attribute provides an highlight.
 
70
 */
 
71
static const scim_bridge_attribute_value_t SCIM_BRIDGE_ATTRIBUTE_DECORATE_HIGHLIGHT = 0x4000000;
 
72
 
 
73
/**
 
74
 * The attribute type, which means that the attribute provides an reversed highlight.
 
75
 */
 
76
static const scim_bridge_attribute_value_t SCIM_BRIDGE_ATTRIBUTE_DECORATE_REVERSE = 0x8000000;
 
77
 
 
78
#ifdef __cplusplus
 
79
extern "C"
 
80
{
 
81
#endif
 
82
 
 
83
    /**
 
84
     * Allocate an attribute.
 
85
     *
 
86
     * @return a new attribute.
 
87
     */
 
88
    ScimBridgeAttribute *scim_bridge_alloc_attribute ();
 
89
 
 
90
    /**
 
91
     * Free an attribute.
 
92
     *
 
93
     * @param attribute The attribute to free.
 
94
     * @note Do not use free (). It will cause memleaks.
 
95
     */
 
96
    void scim_bridge_free_attribute (ScimBridgeAttribute *attribute);
 
97
 
 
98
    /**
 
99
     * Copy an attribute into another.
 
100
     *
 
101
     * @param src The attribute to duplicate.
 
102
     * @param dst The destination to copy in.
 
103
     */
 
104
    void scim_bridge_copy_attribute (ScimBridgeAttribute *dst, const ScimBridgeAttribute *src);
 
105
 
 
106
    /**
 
107
     * See if one attribute equals the other.
 
108
     *
 
109
     * @param atr1 The attribute.
 
110
     * @param atr2 Another attribute.
 
111
     * @return true if the two attributes are the same.
 
112
     */
 
113
    boolean scim_bridge_attribute_equals (const ScimBridgeAttribute *atr1, const ScimBridgeAttribute *atr2);
 
114
 
 
115
    /**
 
116
     * Get the type of an attribute.
 
117
     *
 
118
     * @param attribute The attribute.
 
119
     * @return The type of the attribute.
 
120
     */
 
121
    scim_bridge_attribute_type_t scim_bridge_attribute_get_type (const ScimBridgeAttribute *attribute);
 
122
 
 
123
    /**
 
124
     * Set the type of an attribute.
 
125
     *
 
126
     * @param attribute The attribute.
 
127
     */
 
128
    void scim_bridge_attribute_set_type (ScimBridgeAttribute *attribute, scim_bridge_attribute_type_t type);
 
129
 
 
130
    /**
 
131
     * Get the begining index of the attribute.
 
132
     *
 
133
     * @param attribute The attribute.
 
134
     * @return The index of the first wide-character to apply this attribute.
 
135
     */
 
136
    size_t scim_bridge_attribute_get_begin (const ScimBridgeAttribute *attribute);
 
137
 
 
138
    /**
 
139
     * Set the begining index of the attribute.
 
140
     *
 
141
     * @param attribute The attribute.
 
142
     * @param begin The index of the first wide-character to apply this attribute.
 
143
     */
 
144
    void scim_bridge_attribute_set_begin (ScimBridgeAttribute *attribute, size_t begin);
 
145
 
 
146
    /**
 
147
     * Get the ending index of the attribute.
 
148
     *
 
149
     * @param attribute The attribute.
 
150
     * @return The index of the end wide-character to apply this attribute.
 
151
     */
 
152
    size_t scim_bridge_attribute_get_end (const ScimBridgeAttribute *attribute);
 
153
 
 
154
    /**
 
155
     * Set the ending index of the attribute.
 
156
     *
 
157
     * @param attribute The attribute.
 
158
     * @param end The index of the end wide-character to apply this attribute.
 
159
     */
 
160
    void scim_bridge_attribute_set_end (ScimBridgeAttribute *attribute, size_t end);
 
161
 
 
162
    /**
 
163
     * Get the type of the attribute.
 
164
     *
 
165
     * @param attribute The attribute.
 
166
     * @return The type of the attribute.
 
167
     */
 
168
    scim_bridge_attribute_type_t scim_bridge_attribute_get_type (const ScimBridgeAttribute *attribute);
 
169
 
 
170
    /**
 
171
     * Set the type of the attribute.
 
172
     *
 
173
     * @param attribute The attribute.
 
174
     * @param type The type of the attribute.
 
175
     */
 
176
    void scim_bridge_attribute_set_type (ScimBridgeAttribute *attribute, scim_bridge_attribute_type_t type);
 
177
 
 
178
    /**
 
179
     * Get the value of the attribute.\n
 
180
     * Notice, the value stands for RGB color from 0x000000 to 0xFFFFFF\n
 
181
     * if the attribute type is ATTRIBUTE_FOREGROUND or ATTRIBUTE_BACKGROUND.
 
182
     *
 
183
     * @param attribute The attribute.
 
184
     * @return The value of the attribute.
 
185
     */
 
186
    scim_bridge_attribute_value_t scim_bridge_attribute_get_value (const ScimBridgeAttribute *attribute);
 
187
 
 
188
    /**
 
189
     * Set the value of the attribute.\n
 
190
     * Notice, the value stands for RGB color from 0x000000 to 0xFFFFFF\n
 
191
     * if the attribute type is ATTRIBUTE_FOREGROUND or ATTRIBUTE_BACKGROUND.
 
192
     *
 
193
     * @param attribute The attribute.
 
194
     * @param value The value of the attribute.
 
195
     */
 
196
    void scim_bridge_attribute_set_value (ScimBridgeAttribute *attribute, scim_bridge_attribute_value_t value);
 
197
 
 
198
    /**
 
199
     * Set the color of the attribute.\n
 
200
     * The color value will be ignored
 
201
     * when the attribute type is not ATTRIBUTE_FOREGROUND nor ATTRIBUTE_BACKGROUND.
 
202
     *
 
203
     * @param attribute The attribute.
 
204
     * @param red The red value, from 0x0 to 0xFF.
 
205
     * @param green The green value, from 0x0 to 0xFF.
 
206
     * @param blue The blue value, from 0x0 to 0xFF.
 
207
     */
 
208
    void scim_bridge_attribute_set_color (ScimBridgeAttribute *attribute, unsigned int red, unsigned int green, unsigned int blue);
 
209
 
 
210
    /**
 
211
     * Get the red value of the attribute.\n
 
212
     * The color value has no meanings
 
213
     * when the attribute type is not ATTRIBUTE_FOREGROUND nor ATTRIBUTE_BACKGROUND.
 
214
     *
 
215
     * @param attribute The attribute.
 
216
     * @return The red value, from 0x0 to 0xFF.
 
217
     */
 
218
    unsigned int scim_bridge_attribute_get_red (const ScimBridgeAttribute *attribute);
 
219
 
 
220
    /**
 
221
     * Set the red value of the attribute.\n
 
222
     * The color value has no meanings
 
223
     * when the attribute type is not ATTRIBUTE_FOREGROUND nor ATTRIBUTE_BACKGROUND.
 
224
     *
 
225
     * @param attribute The attribute.
 
226
     * @param red The red value, from 0x0 to 0xFF.
 
227
     */
 
228
    void scim_bridge_attribute_set_red (ScimBridgeAttribute *attribute, unsigned int red);
 
229
 
 
230
    /**
 
231
     * Get the green value of the attribute.\n
 
232
     * The color value has no meanings
 
233
     * when the attribute type is not ATTRIBUTE_FOREGROUND nor ATTRIBUTE_BACKGROUND.
 
234
     *
 
235
     * @param attribute The attribute.
 
236
     * @return The green value, from 0x0 to 0xFF.
 
237
     */
 
238
    unsigned int scim_bridge_attribute_get_green (const ScimBridgeAttribute *attribute);
 
239
 
 
240
    /**
 
241
     * Set the green value of the attribute.\n
 
242
     * The color value has no meanings
 
243
     * when the attribute type is not ATTRIBUTE_FOREGROUND nor ATTRIBUTE_BACKGROUND.
 
244
     *
 
245
     * @param attribute The attribute.
 
246
     * @param green The green value, from 0x0 to 0xFF.
 
247
     */
 
248
    void scim_bridge_attribute_set_green (ScimBridgeAttribute *attribute, unsigned int green);
 
249
 
 
250
    /**
 
251
     * Get the blue value of the attribute.\n
 
252
     * The color value has no meanings
 
253
     * when the attribute type is not ATTRIBUTE_FOREGROUND nor ATTRIBUTE_BACKGROUND.
 
254
     *
 
255
     * @param attribute The attribute.
 
256
     * @return The blue value, from 0x0 to 0xFF.
 
257
     */
 
258
    unsigned int scim_bridge_attribute_get_blue (const ScimBridgeAttribute *attribute);
 
259
 
 
260
    /**
 
261
     * Set the blue value of the attribute.\n
 
262
     * The color value has no meanings
 
263
     * when the attribute type is not ATTRIBUTE_FOREGROUND nor ATTRIBUTE_BACKGROUND.
 
264
     *
 
265
     * @param attribute The attribute.
 
266
     * @param blue The blue value, from 0x0 to 0xFF.
 
267
     */
 
268
    void scim_bridge_attribute_set_blue (ScimBridgeAttribute *attribute, unsigned int blue);
 
269
 
 
270
#ifdef __cplusplus
 
271
}
 
272
#endif
 
273
#endif                                            /*SCIMBRIDGEATTRIBUTE_H_*/