| IBus Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | ||||
IBusText;
IBusText * ibus_text_new_from_string (const gchar *str);
IBusText * ibus_text_new_from_ucs4 (const gunichar *str);
IBusText * ibus_text_new_from_static_string (const gchar *str);
IBusText * ibus_text_new_from_printf (const gchar *fmt,
...);
IBusText * ibus_text_new_from_unichar (gunichar c);
void ibus_text_append_attribute (IBusText *text,
guint type,
guint value,
guint start_index,
gint end_index);
guint ibus_text_get_length (IBusText *text);
An IBusText is the main text object in IBus. The text is decorated according to associated IBusAttribute, e.g. the foreground/background color, underline, and applied scope.
typedef struct {
gboolean is_static;
gchar *text;
IBusAttrList *attrs;
} IBusText;
A text object in IBus.
gboolean |
Whether text is static, i.e., no need and will not be freed. Only TRUE if IBusText is newed from ibus_text_new_from_static_string().
|
gchar * |
The string content of IBusText in UTF-8. |
IBusAttrList * |
Associated IBusAttributes. |
IBusText * ibus_text_new_from_string (const gchar *str);
New an IBusText whose content is copied from a text string.
|
An text string to be set. |
Returns : |
A newly allocated IBusText. |
IBusText * ibus_text_new_from_ucs4 (const gunichar *str);
New an IBusText whose content is copied from a UCS4 encoded text string.
|
An text string to be set. |
Returns : |
A newly allocated IBusText. |
IBusText * ibus_text_new_from_static_string (const gchar *str);
New an IBusText whose content is from a static string.
Note that it is the developer's duty to ensure str is static.
|
An text string to be set. |
Returns : |
A newly allocated IBusText. |
IBusText * ibus_text_new_from_printf (const gchar *fmt, ...);
New an IBusText from a printf expression.
|
printf format string. |
|
arguments for fmt.
|
Returns : |
A newly allocated IBusText. |
IBusText * ibus_text_new_from_unichar (gunichar c);
New an IBusText from a single UCS4-encoded character.
|
A single UCS4-encoded character. |
Returns : |
A newly allocated IBusText. |
void ibus_text_append_attribute (IBusText *text, guint type, guint value, guint start_index, gint end_index);
Append an IBusAttribute for IBusText.
|
an IBusText |
|
IBusAttributeType for text.
|
|
Value for the type. |
|
The starting index, inclusive. |
|
The ending index, exclusive. |
guint ibus_text_get_length (IBusText *text);
Return number of characters in an IBusText.
This function is based on g_utf8_strlen(), so unlike strlen(),
it does not count by bytes but characters instead.
|
An IBusText. |
Returns : |
Number of character in text, not counted by bytes.
|