| IBus Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | ||||
enum IBusAttrType; enum IBusAttrUnderline; struct IBusAttribute; struct IBusAttributeClass; IBusAttribute * ibus_attribute_new (guint type,guint value,guint start_index,guint end_index); guint ibus_attribute_get_attr_type (IBusAttribute *attr); guint ibus_attribute_get_value (IBusAttribute *attr); guint ibus_attribute_get_start_index (IBusAttribute *attr); guint ibus_attribute_get_end_index (IBusAttribute *attr); IBusAttribute * ibus_attr_underline_new (guint underline_type,guint start_index,guint end_index); IBusAttribute * ibus_attr_foreground_new (guint color,guint start_index,guint end_index); IBusAttribute * ibus_attr_background_new (guint color,guint start_index,guint end_index);
GEnum +----IBusAttrType
GEnum +----IBusAttrUnderline
GObject
+----GInitiallyUnowned
+----IBusObject
+----IBusSerializable
+----IBusAttribute
An IBusAttribute represents an attribute that associate to IBusText. It decorates preedit buffer and auxiliary text with underline, foreground and background colors.
typedef enum {
IBUS_ATTR_TYPE_UNDERLINE = 1,
IBUS_ATTR_TYPE_FOREGROUND = 2,
IBUS_ATTR_TYPE_BACKGROUND = 3,
} IBusAttrType;
Type enumeration of IBusText attribute.
typedef enum {
IBUS_ATTR_UNDERLINE_NONE = 0,
IBUS_ATTR_UNDERLINE_SINGLE = 1,
IBUS_ATTR_UNDERLINE_DOUBLE = 2,
IBUS_ATTR_UNDERLINE_LOW = 3,
IBUS_ATTR_UNDERLINE_ERROR = 4,
} IBusAttrUnderline;
Type of IBusText attribute.
struct IBusAttribute {
guint type;
guint value;
guint start_index;
guint end_index;
};
Signify the type, value and scope of the attribute.
The scope starts from start_index till the end_index-1.
IBusAttribute * ibus_attribute_new (guint type,guint value,guint start_index,guint end_index);
New an IBusAttribute.
|
Type of the attribute. |
|
Value of the attribute. |
|
Where attribute starts. |
|
Where attribute ends. |
Returns : |
A newly allocated IBusAttribute. [transfer none] |
guint ibus_attribute_get_attr_type (IBusAttribute *attr);
Returns an enum of IBusAttrType.
Returns : |
An enum of IBusAttrType. |
guint ibus_attribute_get_value (IBusAttribute *attr);
Returns an unsigned int value relative with IBusAttrType.
If the type is IBUS_ATTR_TYPE_UNDERLINE, the return value is
IBusAttrUnderline. If the type is IBUS_ATTR_TYPE_FOREGROUND,
the return value is the color RGB.
Returns : |
An unsigned int value relative with IBusAttrType. |
guint ibus_attribute_get_start_index (IBusAttribute *attr);
Returns a start unsigned index
Returns : |
A start unsigned index |
guint ibus_attribute_get_end_index (IBusAttribute *attr);
Returns a end unsigned index
Returns : |
A end unsigned index |
IBusAttribute * ibus_attr_underline_new (guint underline_type,guint start_index,guint end_index);
New an underline IBusAttribute.
|
Type of underline. |
|
Where attribute starts. |
|
Where attribute ends. |
Returns : |
A newly allocated IBusAttribute. [transfer none] |
IBusAttribute * ibus_attr_foreground_new (guint color,guint start_index,guint end_index);
New an foreground IBusAttribute.
|
Color in RGB. |
|
Where attribute starts. |
|
Where attribute ends. |
Returns : |
A newly allocated IBusAttribute. [transfer none] |
IBusAttribute * ibus_attr_background_new (guint color,guint start_index,guint end_index);
New an background IBusAttribute.
|
Color in RGB. |
|
Where attribute starts. |
|
Where attribute ends. |
Returns : |
A newly allocated IBusAttribute. [transfer none] |