Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals | ![]() |
![]() |
![]() |
![]() |
struct ClutterText; struct ClutterTextClass; ClutterActor * clutter_text_new (void
); ClutterActor * clutter_text_new_full (const gchar *font_name
,const gchar *text
,const ClutterColor *color
); ClutterActor * clutter_text_new_with_text (const gchar *font_name
,const gchar *text
); ClutterActor * clutter_text_new_with_buffer (ClutterTextBuffer *buffer
); void clutter_text_set_buffer (ClutterText *self
,ClutterTextBuffer *buffer
); ClutterTextBuffer * clutter_text_get_buffer (ClutterText *self
); void clutter_text_set_text (ClutterText *self
,const gchar *text
); void clutter_text_set_markup (ClutterText *self
,const gchar *markup
); const gchar * clutter_text_get_text (ClutterText *self
); void clutter_text_set_activatable (ClutterText *self
,gboolean activatable
); gboolean clutter_text_get_activatable (ClutterText *self
); void clutter_text_set_attributes (ClutterText *self
,PangoAttrList *attrs
); PangoAttrList * clutter_text_get_attributes (ClutterText *self
); void clutter_text_set_color (ClutterText *self
,const ClutterColor *color
); void clutter_text_get_color (ClutterText *self
,ClutterColor *color
); void clutter_text_set_ellipsize (ClutterText *self
,PangoEllipsizeMode mode
); PangoEllipsizeMode clutter_text_get_ellipsize (ClutterText *self
); void clutter_text_set_font_name (ClutterText *self
,const gchar *font_name
); const gchar * clutter_text_get_font_name (ClutterText *self
); void clutter_text_set_font_description (ClutterText *self
,PangoFontDescription *font_desc
); PangoFontDescription * clutter_text_get_font_description (ClutterText *self
); void clutter_text_set_password_char (ClutterText *self
,gunichar wc
); gunichar clutter_text_get_password_char (ClutterText *self
); void clutter_text_set_justify (ClutterText *self
,gboolean justify
); gboolean clutter_text_get_justify (ClutterText *self
); PangoLayout * clutter_text_get_layout (ClutterText *self
); void clutter_text_set_line_alignment (ClutterText *self
,PangoAlignment alignment
); PangoAlignment clutter_text_get_line_alignment (ClutterText *self
); void clutter_text_set_line_wrap (ClutterText *self
,gboolean line_wrap
); gboolean clutter_text_get_line_wrap (ClutterText *self
); void clutter_text_set_line_wrap_mode (ClutterText *self
,PangoWrapMode wrap_mode
); PangoWrapMode clutter_text_get_line_wrap_mode (ClutterText *self
); void clutter_text_set_max_length (ClutterText *self
,gint max
); gint clutter_text_get_max_length (ClutterText *self
); void clutter_text_set_selectable (ClutterText *self
,gboolean selectable
); gboolean clutter_text_get_selectable (ClutterText *self
); void clutter_text_set_selection (ClutterText *self
,gssize start_pos
,gssize end_pos
); gchar * clutter_text_get_selection (ClutterText *self
); void clutter_text_set_selection_bound (ClutterText *self
,gint selection_bound
); gint clutter_text_get_selection_bound (ClutterText *self
); void clutter_text_set_single_line_mode (ClutterText *self
,gboolean single_line
); gboolean clutter_text_get_single_line_mode (ClutterText *self
); void clutter_text_set_use_markup (ClutterText *self
,gboolean setting
); gboolean clutter_text_get_use_markup (ClutterText *self
); void clutter_text_set_editable (ClutterText *self
,gboolean editable
); gboolean clutter_text_get_editable (ClutterText *self
); void clutter_text_insert_text (ClutterText *self
,const gchar *text
,gssize position
); void clutter_text_insert_unichar (ClutterText *self
,gunichar wc
); void clutter_text_delete_chars (ClutterText *self
,guint n_chars
); void clutter_text_delete_text (ClutterText *self
,gssize start_pos
,gssize end_pos
); gboolean clutter_text_delete_selection (ClutterText *self
); gchar * clutter_text_get_chars (ClutterText *self
,gssize start_pos
,gssize end_pos
); void clutter_text_set_cursor_color (ClutterText *self
,const ClutterColor *color
); void clutter_text_get_cursor_color (ClutterText *self
,ClutterColor *color
); void clutter_text_set_selection_color (ClutterText *self
,const ClutterColor *color
); void clutter_text_get_selection_color (ClutterText *self
,ClutterColor *color
); void clutter_text_set_selected_text_color (ClutterText *self
,const ClutterColor *color
); void clutter_text_get_selected_text_color (ClutterText *self
,ClutterColor *color
); void clutter_text_set_cursor_position (ClutterText *self
,gint position
); gint clutter_text_get_cursor_position (ClutterText *self
); void clutter_text_set_cursor_visible (ClutterText *self
,gboolean cursor_visible
); gboolean clutter_text_get_cursor_visible (ClutterText *self
); void clutter_text_set_cursor_size (ClutterText *self
,gint size
); guint clutter_text_get_cursor_size (ClutterText *self
); void clutter_text_get_cursor_rect (ClutterText *self
,ClutterRect *rect
); gboolean clutter_text_activate (ClutterText *self
); gint clutter_text_coords_to_position (ClutterText *self
,gfloat x
,gfloat y
); gboolean clutter_text_position_to_coords (ClutterText *self
,gint position
,gfloat *x
,gfloat *y
,gfloat *line_height
); void clutter_text_set_preedit_string (ClutterText *self
,const gchar *preedit_str
,PangoAttrList *preedit_attrs
,guint cursor_pos
); void clutter_text_get_layout_offsets (ClutterText *self
,gint *x
,gint *y
);
ClutterText implements ClutterContainer, ClutterScriptable, ClutterAnimatable and AtkImplementorIface.
"activatable" gboolean : Read / Write "attributes" PangoAttrList* : Read / Write "buffer" ClutterTextBuffer* : Read / Write "color" ClutterColor* : Read / Write "cursor-color" ClutterColor* : Read / Write "cursor-color-set" gboolean : Read "cursor-position" gint : Read / Write "cursor-size" gint : Read / Write "cursor-visible" gboolean : Read / Write "editable" gboolean : Read / Write "ellipsize" PangoEllipsizeMode : Read / Write "font-description" PangoFontDescription* : Read / Write "font-name" gchar* : Read / Write "justify" gboolean : Read / Write "line-alignment" PangoAlignment : Read / Write "line-wrap" gboolean : Read / Write "line-wrap-mode" PangoWrapMode : Read / Write "max-length" gint : Read / Write "password-char" guint : Read / Write "position" gint : Read / Write "selectable" gboolean : Read / Write "selected-text-color" ClutterColor* : Read / Write "selected-text-color-set" gboolean : Read "selection-bound" gint : Read / Write "selection-color" ClutterColor* : Read / Write "selection-color-set" gboolean : Read "single-line-mode" gboolean : Read / Write "text" gchar* : Read / Write "use-markup" gboolean : Read / Write
"activate" :Run Last
"cursor-changed" :Run Last
"cursor-event" :Run Last
"delete-text" :Action
"insert-text" :Action
"text-changed" :Run Last
ClutterText is an actor that displays custom text using Pango as the text rendering engine.
ClutterText also allows inline editing of the text if the
actor is set editable using clutter_text_set_editable()
.
Selection using keyboard or pointers can be enabled using
clutter_text_set_selectable()
.
ClutterText is available since Clutter 1.0
struct ClutterTextClass { /* signals, not vfuncs */ void (* text_changed) (ClutterText *self); void (* activate) (ClutterText *self); void (* cursor_event) (ClutterText *self, const ClutterGeometry *geometry); void (* cursor_changed) (ClutterText *self); };
The ClutterTextClass struct contains only private data.
class handler for the "text-changed" signal | |
class handler for the "activate" signal | |
class handler for the "cursor-event" signal | |
class handler for the "cursor-changed" signal |
Since 1.0
ClutterActor * clutter_text_new (void
);
Creates a new ClutterText actor. This actor can be used to display and edit text.
Returns : |
the newly created ClutterText actor |
Since 1.0
ClutterActor * clutter_text_new_full (const gchar *font_name
,const gchar *text
,const ClutterColor *color
);
Creates a new ClutterText actor, using font_name
as the font
description; text
will be used to set the contents of the actor;
and color
will be used as the color to render text
.
This function is equivalent to calling clutter_text_new()
,
clutter_text_set_font_name()
, clutter_text_set_text()
and
clutter_text_set_color()
.
|
a string with a font description |
|
the contents of the actor |
|
the color to be used to render text
|
Returns : |
the newly created ClutterText actor |
Since 1.0
ClutterActor * clutter_text_new_with_text (const gchar *font_name
,const gchar *text
);
Creates a new ClutterText actor, using font_name
as the font
description; text
will be used to set the contents of the actor.
This function is equivalent to calling clutter_text_new()
,
clutter_text_set_font_name()
, and clutter_text_set_text()
.
|
a string with a font description. [allow-none] |
|
the contents of the actor |
Returns : |
the newly created ClutterText actor |
Since 1.0
ClutterActor * clutter_text_new_with_buffer (ClutterTextBuffer *buffer
);
Creates a new entry with the specified text buffer.
|
The buffer to use for the new ClutterText. |
Returns : |
a new ClutterText |
Since 1.10
void clutter_text_set_buffer (ClutterText *self
,ClutterTextBuffer *buffer
);
Set the ClutterTextBuffer object which holds the text for this widget.
|
a ClutterText |
|
a ClutterTextBuffer |
Since 1.10
ClutterTextBuffer * clutter_text_get_buffer (ClutterText *self
);
Get the ClutterTextBuffer object which holds the text for this widget.
|
a ClutterText |
Returns : |
A GtkEntryBuffer object. [transfer none] |
Since 1.10
void clutter_text_set_text (ClutterText *self
,const gchar *text
);
Sets the contents of a ClutterText actor.
If the "use-markup" property was set to TRUE
it
will be reset to FALSE
as a side effect. If you want to
maintain the "use-markup" you should use the
clutter_text_set_markup()
function instead
|
a ClutterText |
|
the text to set. Passing NULL is the same
as passing "" (the empty string). [allow-none]
|
Since 1.0
void clutter_text_set_markup (ClutterText *self
,const gchar *markup
);
Sets markup
as the contents of a ClutterText.
This is a convenience function for setting a string containing Pango markup, and it is logically equivalent to:
1 2 3 |
/* the order is important */ clutter_text_set_text (CLUTTER_TEXT (actor), markup); clutter_text_set_use_markup (CLUTTER_TEXT (actor), TRUE); |
|
a ClutterText |
|
a string containing Pango markup.
Passing NULL is the same as passing "" (the empty string). [allow-none]
|
Since 1.0
const gchar * clutter_text_get_text (ClutterText *self
);
Retrieves a pointer to the current contents of a ClutterText actor.
If you need a copy of the contents for manipulating, either
use g_strdup()
on the returned string, or use:
1 |
copy = clutter_text_get_chars (text, 0, -1); |
Which will return a newly allocated string.
If the ClutterText actor is empty, this function will return
an empty string, and not NULL
.
|
a ClutterText |
Returns : |
the contents of the actor. The returned string is owned by the ClutterText actor and should never be modified or freed. [transfer none] |
Since 1.0
void clutter_text_set_activatable (ClutterText *self
,gboolean activatable
);
Sets whether a ClutterText actor should be activatable.
An activatable ClutterText actor will emit the "activate" signal whenever the 'Enter' (or 'Return') key is pressed; if it is not activatable, a new line will be appended to the current content.
An activatable ClutterText must also be set as editable using
clutter_text_set_editable()
.
|
a ClutterText |
|
whether the ClutterText actor should be activatable |
Since 1.0
gboolean clutter_text_get_activatable (ClutterText *self
);
Retrieves whether a ClutterText is activatable or not.
|
a ClutterText |
Returns : |
TRUE if the actor is activatable |
Since 1.0
void clutter_text_set_attributes (ClutterText *self
,PangoAttrList *attrs
);
Sets the attributes list that are going to be applied to the ClutterText contents.
The ClutterText actor will take a reference on the PangoAttrList passed to this function.
|
a ClutterText |
|
a PangoAttrList or NULL to unset the attributes. [allow-none]
|
Since 1.0
PangoAttrList * clutter_text_get_attributes (ClutterText *self
);
Gets the attribute list that was set on the ClutterText actor
clutter_text_set_attributes()
, if any.
|
a ClutterText |
Returns : |
the attribute list, or NULL if none was set. The
returned value is owned by the ClutterText and should not be unreferenced. [transfer none]
|
Since 1.0
void clutter_text_set_color (ClutterText *self
,const ClutterColor *color
);
Sets the color of the contents of a ClutterText actor.
The overall opacity of the ClutterText actor will be the
result of the alpha value of color
and the composited
opacity of the actor itself on the scenegraph, as returned
by clutter_actor_get_paint_opacity()
.
|
a ClutterText |
|
a ClutterColor |
Since 1.0
void clutter_text_get_color (ClutterText *self
,ClutterColor *color
);
Retrieves the text color as set by clutter_text_set_color()
.
|
a ClutterText |
|
return location for a ClutterColor. [out caller-allocates] |
Since 1.0
void clutter_text_set_ellipsize (ClutterText *self
,PangoEllipsizeMode mode
);
Sets the mode used to ellipsize (add an ellipsis: "...") to the text if there is not enough space to render the entire contents of a ClutterText actor
|
a ClutterText |
|
a PangoEllipsizeMode |
Since 1.0
PangoEllipsizeMode clutter_text_get_ellipsize (ClutterText *self
);
Returns the ellipsizing position of a ClutterText actor, as
set by clutter_text_set_ellipsize()
.
|
a ClutterText |
Returns : |
PangoEllipsizeMode |
Since 1.0
void clutter_text_set_font_name (ClutterText *self
,const gchar *font_name
);
Sets the font used by a ClutterText. The font_name
string
must either be NULL
, which means that the font name from the
default ClutterBackend will be used; or be something that can
be parsed by the pango_font_description_from_string()
function,
like:
1 2 3 |
clutter_text_set_font_name (text, "Sans 10pt"); clutter_text_set_font_name (text, "Serif 16px"); clutter_text_set_font_name (text, "Helvetica 10"); |
|
a ClutterText |
|
a font name, or NULL to set the default font name. [allow-none]
|
Since 1.0
const gchar * clutter_text_get_font_name (ClutterText *self
);
Retrieves the font name as set by clutter_text_set_font_name()
.
|
a ClutterText |
Returns : |
a string containing the font name. The returned string is owned by the ClutterText actor and should not be modified or freed |
Since 1.0
void clutter_text_set_font_description (ClutterText *self
,PangoFontDescription *font_desc
);
Sets font_desc
as the font description for a ClutterText
The PangoFontDescription is copied by the ClutterText actor
so you can safely call pango_font_description_free()
on it after
calling this function.
|
a ClutterText |
|
a PangoFontDescription |
Since 1.2
PangoFontDescription * clutter_text_get_font_description
(ClutterText *self
);
Retrieves the PangoFontDescription used by self
|
a ClutterText |
Returns : |
a PangoFontDescription. The returned value is owned by the ClutterText actor and it should not be modified or freed |
Since 1.2
void clutter_text_set_password_char (ClutterText *self
,gunichar wc
);
Sets the character to use in place of the actual text in a password text actor.
If wc
is 0 the text will be displayed as it is entered in the
ClutterText actor.
|
a ClutterText |
|
a Unicode character, or 0 to unset the password character |
Since 1.0
gunichar clutter_text_get_password_char (ClutterText *self
);
Retrieves the character to use in place of the actual text
as set by clutter_text_set_password_char()
.
|
a ClutterText |
Returns : |
a Unicode character or 0 if the password character is not set |
Since 1.0
void clutter_text_set_justify (ClutterText *self
,gboolean justify
);
Sets whether the text of the ClutterText actor should be justified on both margins. This setting is ignored if Clutter is compiled against Pango < 1.18.
|
a ClutterText |
|
whether the text should be justified |
Since 1.0
gboolean clutter_text_get_justify (ClutterText *self
);
Retrieves whether the ClutterText actor should justify its contents on both margins.
|
a ClutterText |
Returns : |
TRUE if the text should be justified |
Since 0.6
PangoLayout * clutter_text_get_layout (ClutterText *self
);
Retrieves the current PangoLayout used by a ClutterText actor.
|
a ClutterText |
Returns : |
a PangoLayout. The returned object is owned by the ClutterText actor and should not be modified or freed. [transfer none] |
Since 1.0
void clutter_text_set_line_alignment (ClutterText *self
,PangoAlignment alignment
);
Sets the way that the lines of a wrapped label are aligned with respect to each other. This does not affect the overall alignment of the label within its allocated or specified width.
To align a ClutterText actor you should add it to a container that supports alignment, or use the anchor point.
|
a ClutterText |
|
A PangoAlignment |
Since 1.0
PangoAlignment clutter_text_get_line_alignment (ClutterText *self
);
Retrieves the alignment of a ClutterText, as set by
clutter_text_set_line_alignment()
.
|
a ClutterText |
Returns : |
a PangoAlignment |
Since 1.0
void clutter_text_set_line_wrap (ClutterText *self
,gboolean line_wrap
);
Sets whether the contents of a ClutterText actor should wrap, if they don't fit the size assigned to the actor.
|
a ClutterText |
|
whether the contents should wrap |
Since 1.0
gboolean clutter_text_get_line_wrap (ClutterText *self
);
Retrieves the value set using clutter_text_set_line_wrap()
.
|
a ClutterText |
Returns : |
TRUE if the ClutterText actor should wrap
its contents |
Since 1.0
void clutter_text_set_line_wrap_mode (ClutterText *self
,PangoWrapMode wrap_mode
);
If line wrapping is enabled (see clutter_text_set_line_wrap()
) this
function controls how the line wrapping is performed. The default is
PANGO_WRAP_WORD
which means wrap on word boundaries.
|
a ClutterText |
|
the line wrapping mode |
Since 1.0
PangoWrapMode clutter_text_get_line_wrap_mode (ClutterText *self
);
Retrieves the line wrap mode used by the ClutterText actor.
See clutter_text_set_line_wrap_mode()
.
|
a ClutterText |
Returns : |
the wrap mode used by the ClutterText |
Since 1.0
void clutter_text_set_max_length (ClutterText *self
,gint max
);
Sets the maximum allowed length of the contents of the actor. If the current contents are longer than the given length, then they will be truncated to fit.
|
a ClutterText |
|
the maximum number of characters allowed in the text actor; 0 to disable or -1 to set the length of the current string |
Since 1.0
gint clutter_text_get_max_length (ClutterText *self
);
Gets the maximum length of text that can be set into a text actor.
See clutter_text_set_max_length()
.
|
a ClutterText |
Returns : |
the maximum number of characters. |
Since 1.0
void clutter_text_set_selectable (ClutterText *self
,gboolean selectable
);
Sets whether a ClutterText actor should be selectable.
A selectable ClutterText will allow selecting its contents using the pointer or the keyboard.
|
a ClutterText |
|
whether the ClutterText actor should be selectable |
Since 1.0
gboolean clutter_text_get_selectable (ClutterText *self
);
Retrieves whether a ClutterText is selectable or not.
|
a ClutterText |
Returns : |
TRUE if the actor is selectable |
Since 1.0
void clutter_text_set_selection (ClutterText *self
,gssize start_pos
,gssize end_pos
);
Selects the region of text between start_pos
and end_pos
.
This function changes the position of the cursor to match
start_pos
and the selection bound to match end_pos
.
|
a ClutterText |
|
start of the selection, in characters |
|
end of the selection, in characters |
Since 1.0
gchar * clutter_text_get_selection (ClutterText *self
);
Retrieves the currently selected text.
|
a ClutterText |
Returns : |
a newly allocated string containing the currently
selected text, or NULL . Use g_free() to free the returned
string. |
Since 1.0
void clutter_text_set_selection_bound (ClutterText *self
,gint selection_bound
);
Sets the other end of the selection, starting from the current cursor position.
If selection_bound
is -1, the selection unset.
|
a ClutterText |
|
the position of the end of the selection, in characters |
Since 1.0
gint clutter_text_get_selection_bound (ClutterText *self
);
Retrieves the other end of the selection of a ClutterText actor, in characters from the current cursor position.
|
a ClutterText |
Returns : |
the position of the other end of the selection |
Since 1.0
void clutter_text_set_single_line_mode (ClutterText *self
,gboolean single_line
);
Sets whether a ClutterText actor should be in single line mode or not. Only editable ClutterTexts can be in single line mode.
A text actor in single line mode will not wrap text and will clip the visible area to the predefined size. The contents of the text actor will scroll to display the end of the text if its length is bigger than the allocated width.
When setting the single line mode the "activatable" property is also set as a side effect. Instead of entering a new line character, the text actor will emit the "activate" signal.
|
a ClutterText |
|
whether to enable single line mode |
Since 1.0
gboolean clutter_text_get_single_line_mode (ClutterText *self
);
Retrieves whether the ClutterText actor is in single line mode.
|
a ClutterText |
Returns : |
TRUE if the ClutterText actor is in single line mode |
Since 1.0
void clutter_text_set_use_markup (ClutterText *self
,gboolean setting
);
Sets whether the contents of the ClutterText actor contains markup in Pango's text markup language.
Setting "use-markup" on an editable ClutterText will not have any effect except hiding the markup.
See also "use-markup".
|
a ClutterText |
|
TRUE if the text should be parsed for markup. |
Since 1.0
gboolean clutter_text_get_use_markup (ClutterText *self
);
Retrieves whether the contents of the ClutterText actor should be parsed for the Pango text markup.
|
a ClutterText |
Returns : |
TRUE if the contents will be parsed for markup |
Since 1.0
void clutter_text_set_editable (ClutterText *self
,gboolean editable
);
Sets whether the ClutterText actor should be editable.
An editable ClutterText with key focus set using
clutter_actor_grab_key_focus()
or clutter_stage_set_key_focus()
will receive key events and will update its contents accordingly.
|
a ClutterText |
|
whether the ClutterText should be editable |
Since 1.0
gboolean clutter_text_get_editable (ClutterText *self
);
Retrieves whether a ClutterText is editable or not.
|
a ClutterText |
Returns : |
TRUE if the actor is editable |
Since 1.0
void clutter_text_insert_text (ClutterText *self
,const gchar *text
,gssize position
);
Inserts text
into a ClutterActor at the given position.
If position
is a negative number, the text will be appended
at the end of the current contents of the ClutterText.
The position is expressed in characters, not in bytes.
|
a ClutterText |
|
the text to be inserted |
|
the position of the insertion, or -1 |
Since 1.0
void clutter_text_insert_unichar (ClutterText *self
,gunichar wc
);
Inserts wc
at the current cursor position of a
ClutterText actor.
|
a ClutterText |
|
a Unicode character |
Since 1.0
void clutter_text_delete_chars (ClutterText *self
,guint n_chars
);
Deletes n_chars
inside a ClutterText actor, starting from the
current cursor position.
Somewhat awkwardly, the cursor position is decremented by the same number of characters you've deleted.
|
a ClutterText |
|
the number of characters to delete |
Since 1.0
void clutter_text_delete_text (ClutterText *self
,gssize start_pos
,gssize end_pos
);
Deletes the text inside a ClutterText actor between start_pos
and end_pos
.
The starting and ending positions are expressed in characters, not in bytes.
|
a ClutterText |
|
starting position |
|
ending position |
Since 1.0
gboolean clutter_text_delete_selection (ClutterText *self
);
Deletes the currently selected text
This function is only useful in subclasses of ClutterText
|
a ClutterText |
Returns : |
TRUE if text was deleted or if the text actor
is empty, and FALSE otherwise |
Since 1.0
gchar * clutter_text_get_chars (ClutterText *self
,gssize start_pos
,gssize end_pos
);
Retrieves the contents of the ClutterText actor between
start_pos
and end_pos
, but not including end_pos
.
The positions are specified in characters, not in bytes.
|
a ClutterText |
|
start of text, in characters |
|
end of text, in characters |
Returns : |
a newly allocated string with the contents of
the text actor between the specified positions. Use g_free()
to free the resources when done |
Since 1.0
void clutter_text_set_cursor_color (ClutterText *self
,const ClutterColor *color
);
Sets the color of the cursor of a ClutterText actor.
If color
is NULL
, the cursor color will be the same as the
text color.
|
a ClutterText |
|
the color of the cursor, or NULL to unset it. [allow-none]
|
Since 1.0
void clutter_text_get_cursor_color (ClutterText *self
,ClutterColor *color
);
Retrieves the color of the cursor of a ClutterText actor.
|
a ClutterText |
|
return location for a ClutterColor. [out] |
Since 1.0
void clutter_text_set_selection_color (ClutterText *self
,const ClutterColor *color
);
Sets the color of the selection of a ClutterText actor.
If color
is NULL
, the selection color will be the same as the
cursor color, or if no cursor color is set either then it will be
the same as the text color.
|
a ClutterText |
|
the color of the selection, or NULL to unset it. [allow-none]
|
Since 1.0
void clutter_text_get_selection_color (ClutterText *self
,ClutterColor *color
);
Retrieves the color of the selection of a ClutterText actor.
|
a ClutterText |
|
return location for a ClutterColor. [out caller-allocates] |
Since 1.0
void clutter_text_set_selected_text_color (ClutterText *self
,const ClutterColor *color
);
Sets the selected text color of a ClutterText actor.
If color
is NULL
, the selected text color will be the same as the
selection color, which then falls back to cursor, and then text color.
|
a ClutterText |
|
the selected text color, or NULL to unset it. [allow-none]
|
Since 1.8
void clutter_text_get_selected_text_color (ClutterText *self
,ClutterColor *color
);
Retrieves the color of selected text of a ClutterText actor.
|
a ClutterText |
|
return location for a ClutterColor. [out caller-allocates] |
Since 1.8
void clutter_text_set_cursor_position (ClutterText *self
,gint position
);
Sets the cursor of a ClutterText actor at position
.
The position is expressed in characters, not in bytes.
|
a ClutterText |
|
the new cursor position, in characters |
Since 1.0
gint clutter_text_get_cursor_position (ClutterText *self
);
Retrieves the cursor position.
|
a ClutterText |
Returns : |
the cursor position, in characters |
Since 1.0
void clutter_text_set_cursor_visible (ClutterText *self
,gboolean cursor_visible
);
Sets whether the cursor of a ClutterText actor should be visible or not.
The color of the cursor will be the same as the text color
unless clutter_text_set_cursor_color()
has been called.
The size of the cursor can be set using clutter_text_set_cursor_size()
.
The position of the cursor can be changed programmatically using
clutter_text_set_cursor_position()
.
|
a ClutterText |
|
whether the cursor should be visible |
Since 1.0
gboolean clutter_text_get_cursor_visible (ClutterText *self
);
Retrieves whether the cursor of a ClutterText actor is visible.
|
a ClutterText |
Returns : |
TRUE if the cursor is visible |
Since 1.0
void clutter_text_set_cursor_size (ClutterText *self
,gint size
);
Sets the size of the cursor of a ClutterText. The cursor
will only be visible if the "cursor-visible" property
is set to TRUE
.
|
a ClutterText |
|
the size of the cursor, in pixels, or -1 to use the default value |
Since 1.0
guint clutter_text_get_cursor_size (ClutterText *self
);
Retrieves the size of the cursor of a ClutterText actor.
|
a ClutterText |
Returns : |
the size of the cursor, in pixels |
Since 1.0
void clutter_text_get_cursor_rect (ClutterText *self
,ClutterRect *rect
);
Retrieves the rectangle that contains the cursor.
The coordinates of the rectangle's origin are in actor-relative coordinates.
|
a ClutterText |
|
return location of a ClutterRect. [out caller-allocates] |
Since 1.16
gboolean clutter_text_activate (ClutterText *self
);
Emits the "activate" signal, if self
has been set
as activatable using clutter_text_set_activatable()
.
This function can be used to emit the ::activate signal inside a "captured-event" or "key-press-event" signal handlers before the default signal handler for the ClutterText is invoked.
|
a ClutterText |
Returns : |
TRUE if the ::activate signal has been emitted,
and FALSE otherwise |
Since 1.0
gint clutter_text_coords_to_position (ClutterText *self
,gfloat x
,gfloat y
);
Retrieves the position of the character at the given coordinates.
Return: the position of the character
|
a ClutterText |
|
the X coordinate, relative to the actor |
|
the Y coordinate, relative to the actor |
Since 1.10
gboolean clutter_text_position_to_coords (ClutterText *self
,gint position
,gfloat *x
,gfloat *y
,gfloat *line_height
);
Retrieves the coordinates of the given position
.
|
a ClutterText |
|
position in characters |
|
return location for the X coordinate, or NULL . [out]
|
|
return location for the Y coordinate, or NULL . [out]
|
|
return location for the line height, or NULL . [out]
|
Returns : |
TRUE if the conversion was successful |
Since 1.0
void clutter_text_set_preedit_string (ClutterText *self
,const gchar *preedit_str
,PangoAttrList *preedit_attrs
,guint cursor_pos
);
Sets, or unsets, the pre-edit string. This function is useful for input methods to display a string (with eventual specific Pango attributes) before it is entered inside the ClutterText buffer.
The preedit string and attributes are ignored if the ClutterText actor is not editable.
This function should not be used by applications
|
a ClutterText |
|
the pre-edit string, or NULL to unset it. [allow-none]
|
|
the pre-edit string attributes. [allow-none] |
|
the cursor position for the pre-edit string |
Since 1.2
void clutter_text_get_layout_offsets (ClutterText *self
,gint *x
,gint *y
);
Obtains the coordinates where the ClutterText will draw the PangoLayout representing the text.
|
a ClutterText |
|
location to store X offset of layout, or NULL . [out]
|
|
location to store Y offset of layout, or NULL . [out]
|
Since 1.8
"activatable"
property "activatable" gboolean : Read / Write
Toggles whether return invokes the activate signal or not.
Default value: TRUE
Since 1.0
"attributes"
property "attributes" PangoAttrList* : Read / Write
A list of PangoStyleAttributes to be applied to the contents of the ClutterText actor.
Since 1.0
"buffer"
property"buffer" ClutterTextBuffer* : Read / Write
The buffer which stores the text for this ClutterText.
If set to NULL
, a default buffer will be created.
Since 1.8
"color"
property"color" ClutterColor* : Read / Write
The color used to render the text.
Since 1.0
"cursor-color"
property"cursor-color" ClutterColor* : Read / Write
The color of the cursor.
Since 1.0
"cursor-color-set"
property "cursor-color-set" gboolean : Read
Will be set to TRUE
if "cursor-color" has been set.
Default value: FALSE
Since 1.0
"cursor-position"
property "cursor-position" gint : Read / Write
The current input cursor position. -1 is taken to be the end of the text
Allowed values: >= -1
Default value: -1
Since 1.12
"cursor-size"
property "cursor-size" gint : Read / Write
The size of the cursor, in pixels. If set to -1 the size used will be the default cursor size of 2 pixels.
Allowed values: >= -1
Default value: 2
Since 1.0
"cursor-visible"
property "cursor-visible" gboolean : Read / Write
Whether the input cursor is visible or not, it will only be visible
if both "cursor-visible" and "editable" are
set to TRUE
.
Default value: TRUE
Since 1.0
"editable"
property "editable" gboolean : Read / Write
Whether key events delivered to the actor causes editing.
Default value: FALSE
Since 1.0
"ellipsize"
property "ellipsize" PangoEllipsizeMode : Read / Write
The preferred place to ellipsize the contents of the ClutterText actor
Default value: PANGO_ELLIPSIZE_NONE
Since 1.0
"font-description"
property "font-description" PangoFontDescription* : Read / Write
The PangoFontDescription that should be used by the ClutterText
If you have a string describing the font then you should look at "font-name" instead
Since 1.2
"font-name"
property "font-name" gchar* : Read / Write
The font to be used by the ClutterText, as a string
that can be parsed by pango_font_description_from_string()
.
If set to NULL
, the default system font will be used instead.
Default value: NULL
Since 1.0
"justify"
property "justify" gboolean : Read / Write
Whether the contents of the ClutterText should be justified on both margins.
Default value: FALSE
Since 1.0
"line-alignment"
property "line-alignment" PangoAlignment : Read / Write
The preferred alignment for the text. This property controls the alignment of multi-line paragraphs.
Default value: PANGO_ALIGN_LEFT
Since 1.0
"line-wrap"
property "line-wrap" gboolean : Read / Write
Whether to wrap the lines of "text" if the contents exceed the available allocation. The wrapping strategy is controlled by the "line-wrap-mode" property.
Default value: FALSE
Since 1.0
"line-wrap-mode"
property "line-wrap-mode" PangoWrapMode : Read / Write
If "line-wrap" is set to TRUE
, this property will
control how the text is wrapped.
Default value: PANGO_WRAP_WORD
Since 1.0
"max-length"
property "max-length" gint : Read / Write
The maximum length of the contents of the ClutterText actor.
Allowed values: >= -1
Default value: 0
Since 1.0
"password-char"
property "password-char" guint : Read / Write
If non-zero, the character that should be used in place of the actual text in a password text actor.
Default value: 0
Since 1.0
"position"
property "position" gint : Read / Write
ClutterText:position
has been deprecated since version 1.12 and should not be used in newly-written code. Use ClutterText:cursor-position instead.
The current input cursor position. -1 is taken to be the end of the text
Allowed values: >= -1
Default value: -1
Since 1.0
"selectable"
property "selectable" gboolean : Read / Write
Whether it is possible to select text, either using the pointer or the keyboard.
Default value: TRUE
Since 1.0
"selected-text-color"
property"selected-text-color" ClutterColor* : Read / Write
The color of selected text.
Since 1.8
"selected-text-color-set"
property "selected-text-color-set" gboolean : Read
Will be set to TRUE
if "selected-text-color" has been set.
Default value: FALSE
Since 1.8
"selection-bound"
property "selection-bound" gint : Read / Write
The current input cursor position. -1 is taken to be the end of the text
Allowed values: >= -1
Default value: -1
Since 1.0
"selection-color"
property"selection-color" ClutterColor* : Read / Write
The color of the selection.
Since 1.0
"selection-color-set"
property "selection-color-set" gboolean : Read
Will be set to TRUE
if "selection-color" has been set.
Default value: FALSE
Since 1.0
"single-line-mode"
property "single-line-mode" gboolean : Read / Write
Whether the ClutterText actor should be in single line mode or not. A single line ClutterText actor will only contain a single line of text, scrolling it in case its length is bigger than the allocated size.
Setting this property will also set the "activatable" property as a side-effect.
The "single-line-mode" property is used only if the
"editable" property is set to TRUE
.
Default value: FALSE
Since 1.0
"text"
property "text" gchar* : Read / Write
The text to render inside the actor.
Default value: ""
Since 1.0
"use-markup"
property "use-markup" gboolean : Read / Write
Whether the text includes Pango markup.
For more informations about the Pango markup format, see
pango_layout_set_markup()
in the Pango documentation.
TRUE
and FALSE
. Once a string with markup has been set on
a ClutterText actor with :use-markup set to TRUE
, the markup
is stripped from the string.
Default value: FALSE
Since 1.0
"activate"
signalvoid user_function (ClutterText *self,
gpointer user_data) : Run Last
The ::activate signal is emitted each time the actor is 'activated'
by the user, normally by pressing the 'Enter' key. The signal is
emitted only if "activatable" is set to TRUE
.
|
the ClutterText that emitted the signal |
|
user data set when the signal handler was connected. |
Since 1.0
"cursor-changed"
signalvoid user_function (ClutterText *self,
gpointer user_data) : Run Last
The ::cursor-changed signal is emitted whenever the cursor position or size changes.
|
the ClutterText that emitted the signal |
|
user data set when the signal handler was connected. |
Since 1.16
"cursor-event"
signalvoid user_function (ClutterText *self,
ClutterGeometry *geometry,
gpointer user_data) : Run Last
ClutterText::cursor-event
has been deprecated since version 1.16 and should not be used in newly-written code. Use the "cursor-changed" signal instead
The ::cursor-event signal is emitted whenever the cursor position
changes inside a ClutterText actor. Inside geometry
it is stored
the current position and size of the cursor, relative to the actor
itself.
|
the ClutterText that emitted the signal |
|
the coordinates of the cursor |
|
user data set when the signal handler was connected. |
Since 1.0
"delete-text"
signalvoid user_function (ClutterText *self,
gint start_pos,
gint end_pos,
gpointer user_data) : Action
This signal is emitted when text is deleted from the actor by
the user. It is emitted before self
text changes.
|
the ClutterText that emitted the signal |
|
the starting position |
|
the end position |
|
user data set when the signal handler was connected. |
Since 1.2
"insert-text"
signalvoid user_function (ClutterText *self,
gchar *new_text,
gint new_text_length,
gpointer position,
gpointer user_data) : Action
This signal is emitted when text is inserted into the actor by
the user. It is emitted before self
text changes.
|
the ClutterText that emitted the signal |
|
the new text to insert |
|
the length of the new text, in bytes, or -1 if new_text is nul-terminated |
|
the position, in characters, at which to insert the new text. this is an in-out parameter. After the signal emission is finished, it should point after the newly inserted text. |
|
user data set when the signal handler was connected. |
Since 1.2
"text-changed"
signalvoid user_function (ClutterText *self,
gpointer user_data) : Run Last
The ::text-changed signal is emitted after actor
's text changes
|
the ClutterText that emitted the signal |
|
user data set when the signal handler was connected. |
Since 1.0