IBusAttrList

IBusAttrList — Attributes of IBusText.

Stability Level

Stable, unless otherwise indicated

Synopsis

#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);

Object Hierarchy

  GObject
   +----IBusObject
         +----IBusSerializable
               +----IBusAttribute
  GObject
   +----IBusObject
         +----IBusSerializable
               +----IBusAttrList

Description

An IBusAttribute represents an attribute that associate to IBusText. It decorates preedit buffer and auxiliary text with underline, foreground and background colors.

Details

IBUS_TYPE_ATTR_LIST

#define             IBUS_TYPE_ATTR_LIST


IBUS_ATTR_LIST()

#define             IBUS_ATTR_LIST(obj)

obj :


IBUS_ATTR_LIST_CLASS()

#define             IBUS_ATTR_LIST_CLASS(klass)

klass :


IBUS_IS_ATTR_LIST()

#define             IBUS_IS_ATTR_LIST(obj)

obj :


IBUS_IS_ATTR_LIST_CLASS()

#define             IBUS_IS_ATTR_LIST_CLASS(klass)

klass :


IBUS_ATTR_LIST_GET_CLASS()

#define             IBUS_ATTR_LIST_GET_CLASS(obj)

obj :


enum IBusAttrType

typedef enum {
    IBUS_ATTR_TYPE_UNDERLINE    = 1,
    IBUS_ATTR_TYPE_FOREGROUND   = 2,
    IBUS_ATTR_TYPE_BACKGROUND   = 3,
} IBusAttrType;

Type of IBusText attribute.

IBUS_ATTR_TYPE_UNDERLINE

Decorate with underline.

IBUS_ATTR_TYPE_FOREGROUND

Foreground color.

IBUS_ATTR_TYPE_BACKGROUND

Background color.

enum IBusAttrUnderline

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.

IBUS_ATTR_UNDERLINE_NONE

No underline.

IBUS_ATTR_UNDERLINE_SINGLE

Single underline.

IBUS_ATTR_UNDERLINE_DOUBLE

Double underline.

IBUS_ATTR_UNDERLINE_LOW

Low underline ? FIXME

IBusAttribute

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.

guint type;

IBusAttributeType

guint value;

Value for the type.

guint start_index;

The starting index, inclusive.

guint end_index;

The ending index, exclusive.

IBusAttrList

typedef struct {
    GArray *attributes;
} IBusAttrList;

Array of IBusAttribute.

GArray *attributes;

GArray that holds IBusAttribute.

ibus_attribute_new ()

IBusAttribute *     ibus_attribute_new                  (guint type,
                                                         guint value,
                                                         guint start_index,
                                                         guint end_index);

New an IBusAttribute.

type :

Type of the attribute.

value :

Value of the attribute.

start_index :

Where attribute starts.

end_index :

Where attribute ends.

Returns :

A newly allocated IBusAttribute.

ibus_attr_underline_new ()

IBusAttribute *     ibus_attr_underline_new             (guint underline_type,
                                                         guint start_index,
                                                         guint end_index);

New an underline IBusAttribute.

underline_type :

Type of underline.

start_index :

Where attribute starts.

end_index :

Where attribute ends.

Returns :

A newly allocated IBusAttribute.

ibus_attr_foreground_new ()

IBusAttribute *     ibus_attr_foreground_new            (guint color,
                                                         guint start_index,
                                                         guint end_index);

New an foreground IBusAttribute.

color :

Color in RGB.

start_index :

Where attribute starts.

end_index :

Where attribute ends.

Returns :

A newly allocated IBusAttribute.

ibus_attr_background_new ()

IBusAttribute *     ibus_attr_background_new            (guint color,
                                                         guint start_index,
                                                         guint end_index);

New an background IBusAttribute.

color :

Color in RGB.

start_index :

Where attribute starts.

end_index :

Where attribute ends.

Returns :

A newly allocated IBusAttribute.

ibus_attr_list_get_type ()

GType               ibus_attr_list_get_type             ();

Returns GType of IBusAttrList.

Returns :

GType of IBusAttrList.

ibus_attr_list_new ()

IBusAttrList *      ibus_attr_list_new                  ();

New an IBusAttrList.

Returns :

A newly allocated IBusAttrList.

ibus_attr_list_append ()

void                ibus_attr_list_append               (IBusAttrList *attr_list,
                                                         IBusAttribute *attr);

Append an IBusAttribute to IBusAttrList.

attr_list :

An IBusAttrList instance.

attr :

The IBusAttribute instance to be appended.

ibus_attr_list_get ()

IBusAttribute *     ibus_attr_list_get                  (IBusAttrList *attr_list,
                                                         guint index);

Returns IBusAttribute at given index.

attr_list :

An IBusAttrList instance.

index :

Index of the attr_list.

Returns :

IBusAttribute at given index, NULL if no such IBusAttribute.

See Also

#IBusText