![]() |
![]() |
![]() |
iBus Reference Manual | ![]() |
---|---|---|---|---|
#define IBUS_TYPE_ATTR_LIST #define IBUS_ATTR_LIST (obj) #define IBUS_ATTR_LIST_CLASS (klass) #define IBUS_IS_ATTR_LIST (obj) #define IBUS_IS_ATTR_LIST_CLASS (klass) #define IBUS_ATTR_LIST_GET_CLASS (obj) enum IBusAttrType; enum IBusAttrUnderline; IBusAttribute; IBusAttrList; IBusAttribute* ibus_attribute_new (guint type, guint value, guint start_index, guint end_index); 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); GType ibus_attr_list_get_type (); IBusAttrList* ibus_attr_list_new (); void ibus_attr_list_append (IBusAttrList *attr_list, IBusAttribute *attr); IBusAttribute* ibus_attr_list_get (IBusAttrList *attr_list, guint index);
GObject +----IBusObject +----IBusSerializable +----IBusAttribute
GObject +----IBusObject +----IBusSerializable +----IBusAttrList
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 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, } IBusAttrUnderline;
Type of IBusText attribute.
typedef struct { guint type; guint value; guint start_index; guint end_index; } IBusAttribute;
Signify the type, value and scope of the attribute.
The scope starts from start_index
till the end_index
-1.
typedef struct { GArray *attributes; } IBusAttrList;
Array of IBusAttribute.
GArray * |
GArray that holds IBusAttribute. |
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. |
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. |
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. |
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. |
GType ibus_attr_list_get_type ();
Returns GType of IBusAttrList.
Returns : |
GType of IBusAttrList. |
IBusAttrList* ibus_attr_list_new ();
New an IBusAttrList.
Returns : |
A newly allocated IBusAttrList. |
void ibus_attr_list_append (IBusAttrList *attr_list, IBusAttribute *attr);
Append an IBusAttribute to IBusAttrList.
|
An IBusAttrList instance. |
|
The IBusAttribute instance to be appended. |
IBusAttribute* ibus_attr_list_get (IBusAttrList *attr_list, guint index);
Returns IBusAttribute at given index.
|
An IBusAttrList instance. |
|
Index of the attr_list .
|
Returns : |
IBusAttribute at given index, NULL if no such IBusAttribute. |