ClutterLabel

ClutterLabel — Actor for displaying text

Synopsis




ClutterActor*       clutter_label_new                   (void);
ClutterActor*       clutter_label_new_with_text         (const gchar *font_name,
                                                         const gchar *text);
ClutterActor*       clutter_label_new_full              (const gchar *font_name,
                                                         const gchar *text,
                                                         ClutterColor *color);
void                clutter_label_set_text              (ClutterLabel *label,
                                                         const gchar *text);
const gchar*        clutter_label_get_text              (ClutterLabel *label);
void                clutter_label_set_font_name         (ClutterLabel *label,
                                                         const gchar *font_name);
const gchar*        clutter_label_get_font_name         (ClutterLabel *label);
void                clutter_label_set_color             (ClutterLabel *label,
                                                         const ClutterColor *color);
void                clutter_label_get_color             (ClutterLabel *label,
                                                         ClutterColor *color);
void                clutter_label_set_ellipsize         (ClutterLabel *label,
                                                         PangoEllipsizeMode mode);
PangoEllipsizeMode  clutter_label_get_ellipsize         (ClutterLabel *label);
void                clutter_label_set_line_wrap         (ClutterLabel *label,
                                                         gboolean wrap);
gboolean            clutter_label_get_line_wrap         (ClutterLabel *label);
void                clutter_label_set_line_wrap_mode    (ClutterLabel *label,
                                                         PangoWrapMode wrap_mode);
PangoWrapMode       clutter_label_get_line_wrap_mode    (ClutterLabel *label);
PangoLayout*        clutter_label_get_layout            (ClutterLabel *label);
void                clutter_label_set_attributes        (ClutterLabel *label,
                                                         PangoAttrList *attrs);
PangoAttrList*      clutter_label_get_attributes        (ClutterLabel *label);
void                clutter_label_set_use_markup        (ClutterLabel *label,
                                                         gboolean setting);
gboolean            clutter_label_get_use_markup        (ClutterLabel *label);
void                clutter_label_set_alignment         (ClutterLabel *label,
                                                         PangoAlignment alignment);
PangoAlignment      clutter_label_get_alignment         (ClutterLabel *label);


Description

ClutterLabel is a ClutterTexture that displays text.

Details

clutter_label_new ()

ClutterActor*       clutter_label_new                   (void);

Creates a new, empty ClutterLabel.

Returns : the newly created ClutterLabel

clutter_label_new_with_text ()

ClutterActor*       clutter_label_new_with_text         (const gchar *font_name,
                                                         const gchar *text);

Creates a new ClutterLabel displaying text using font_name.

font_name : the name (and size) of the font to be used
text : the text to be displayed
Returns : a ClutterLabel

clutter_label_new_full ()

ClutterActor*       clutter_label_new_full              (const gchar *font_name,
                                                         const gchar *text,
                                                         ClutterColor *color);

Creates a new ClutterLabel displaying text with color color using font_name.

font_name : the name (and size) of the font to be used
text : the text to be displayed
color : ClutterColor for text
Returns : a ClutterLabel

clutter_label_set_text ()

void                clutter_label_set_text              (ClutterLabel *label,
                                                         const gchar *text);

Sets text as the text to be displayed by label.

label : a ClutterLabel
text : the text to be displayed

clutter_label_get_text ()

const gchar*        clutter_label_get_text              (ClutterLabel *label);

Retrieves the text displayed by label

label : a ClutterLabel
Returns : the text of the label. The returned string is owned by ClutterLabel and should not be modified or freed.

clutter_label_set_font_name ()

void                clutter_label_set_font_name         (ClutterLabel *label,
                                                         const gchar *font_name);

Sets font_name as the font used by label.

font_name must be a string containing the font name and its size, similarly to what you would feed to the pango_font_description_from_string() function.

label : a ClutterLabel
font_name : a font name and size, or NULL for the default font

clutter_label_get_font_name ()

const gchar*        clutter_label_get_font_name         (ClutterLabel *label);

Retrieves the font used by label.

label : a ClutterLabel
Returns : a string containing the font name, in a format understandable by pango_font_description_from_string(). The string is owned by ClutterLabel and should not be modified or freed.

clutter_label_set_color ()

void                clutter_label_set_color             (ClutterLabel *label,
                                                         const ClutterColor *color);

Sets the color of label.

label : a ClutterLabel
color : a ClutterColor

clutter_label_get_color ()

void                clutter_label_get_color             (ClutterLabel *label,
                                                         ClutterColor *color);

Retrieves the color of label.

label : a ClutterLabel
color : return location for a ClutterColor

clutter_label_set_ellipsize ()

void                clutter_label_set_ellipsize         (ClutterLabel *label,
                                                         PangoEllipsizeMode mode);

Sets the mode used to ellipsize (add an ellipsis: "...") to the text if there is not enough space to render the entire string.

label : a ClutterLabel
mode : a PangoEllipsizeMode

Since 0.2


clutter_label_get_ellipsize ()

PangoEllipsizeMode  clutter_label_get_ellipsize         (ClutterLabel *label);

Returns the ellipsizing position of the label. See clutter_label_set_ellipsize().

label : a ClutterLabel
Returns : PangoEllipsizeMode

Since 0.2


clutter_label_set_line_wrap ()

void                clutter_label_set_line_wrap         (ClutterLabel *label,
                                                         gboolean wrap);

Toggles line wrapping within the ClutterLabel widget. TRUE makes it break lines if text exceeds the widget's size. FALSE lets the text get cut off by the edge of the widget if it exceeds the widget size.

label : a ClutterLabel
wrap : the setting

Since 0.2


clutter_label_get_line_wrap ()

gboolean            clutter_label_get_line_wrap         (ClutterLabel *label);

Returns whether lines in the label are automatically wrapped. See clutter_label_set_line_wrap().

label : a ClutterLabel
Returns : TRUE if the lines of the label are automatically wrapped.

Since 0.2


clutter_label_set_line_wrap_mode ()

void                clutter_label_set_line_wrap_mode    (ClutterLabel *label,
                                                         PangoWrapMode wrap_mode);

If line wrapping is on (see clutter_label_set_line_wrap()) this controls how the line wrapping is done. The default is PANGO_WRAP_WORD which means wrap on word boundaries.

label : a ClutterLabel
wrap_mode : the line wrapping mode

Since 0.2


clutter_label_get_line_wrap_mode ()

PangoWrapMode       clutter_label_get_line_wrap_mode    (ClutterLabel *label);

Returns line wrap mode used by the label. See clutter_label_set_line_wrap_mode().

label : a ClutterLabel
Returns : TRUE if the lines of the label are automatically wrapped.

Since 0.2


clutter_label_get_layout ()

PangoLayout*        clutter_label_get_layout            (ClutterLabel *label);

Gets the PangoLayout used to display the label. The layout is useful to e.g. convert text positions to pixel positions. The returned layout is owned by the label so need not be freed by the caller.

label : a ClutterLabel
Returns : the PangoLayout for this label

Since 0.2


clutter_label_set_attributes ()

void                clutter_label_set_attributes        (ClutterLabel *label,
                                                         PangoAttrList *attrs);

Sets a PangoAttrList; the attributes in the list are applied to the label text. The attributes set with this function will be ignored if the "use_markup" property is TRUE.

label : a ClutterLabel
attrs : a PangoAttrList

Since 0.2


clutter_label_get_attributes ()

PangoAttrList*      clutter_label_get_attributes        (ClutterLabel *label);

Gets the attribute list that was set on the label using clutter_label_set_attributes(), if any.

label : a ClutterLabel
Returns : the attribute list, or NULL if none was set.

Since 0.2


clutter_label_set_use_markup ()

void                clutter_label_set_use_markup        (ClutterLabel *label,
                                                         gboolean setting);

Sets whether the text of the label contains markup in Pango's text markup language.

label : a ClutterLabel
setting : TRUE if the label's text should be parsed for markup.

clutter_label_get_use_markup ()

gboolean            clutter_label_get_use_markup        (ClutterLabel *label);

Returns whether the label's text is interpreted as marked up with the Pango text markup language. See clutter_label_set_use_markup().

label : a ClutterLabel
Returns : TRUE if the label's text will be parsed for markup.

clutter_label_set_alignment ()

void                clutter_label_set_alignment         (ClutterLabel *label,
                                                         PangoAlignment alignment);

Sets text alignment of the label.

label : a ClutterLabel
alignment : A PangoAlignment

clutter_label_get_alignment ()

PangoAlignment      clutter_label_get_alignment         (ClutterLabel *label);

Returns the label's text alignment

label : a ClutterLabel
Returns : The labels PangoAlignment Since 0.2