![]() |
![]() |
![]() |
adg-1 reference manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <adg-1/adg.h> struct AdgTextualIface; void adg_textual_set_font_dress (AdgTextual *textual
,AdgDress dress
); AdgDress adg_textual_get_font_dress (AdgTextual *textual
); void adg_textual_set_text (AdgTextual *textual
,const gchar *text
); gchar * adg_textual_dup_text (AdgTextual *textual
); void adg_textual_text_changed (AdgTextual *textual
,const gchar *old_text
);
The AdgTextual interface should be implemented by entities that can be expressed by text. AdgToyText is a typical case but also more complex entities could implement it.
struct AdgTextualIface { /* Virtual table */ void (*set_font_dress) (AdgTextual *textual, AdgDress dress); AdgDress (*get_font_dress) (AdgTextual *textual); void (*set_text) (AdgTextual *textual, const gchar *text); gchar * (*dup_text) (AdgTextual *textual); /* Signals */ void (*text_changed) (AdgTextual *textual, const gchar *old_text); };
The virtual methods set_text
and dup_text
must be implemented
by all the types which implement this interface.
abstract virtual method to change the font dress. | |
abstract virtual method to get the active font dress. | |
abstract virtual method to set a new text. | |
abstract virtual method that returns a duplicate of the actual text. | |
default signal handler for "text-changed". |
Since 1.0
void adg_textual_set_font_dress (AdgTextual *textual
,AdgDress dress
);
Sets the font dress of textual
to dress
.
|
an object that implements AdgTextual |
|
the new dress |
Since 1.0
AdgDress adg_textual_get_font_dress (AdgTextual *textual
);
Gets the current font dress of textual
, eventually resolved to
an AdgFontStyle before the rendering.
|
an object that implements AdgTextual |
Returns : |
the current font dress of textual . [transfer none]
|
Since 1.0
void adg_textual_set_text (AdgTextual *textual
,const gchar *text
);
Sets a new text on textual
. If text
is the same as the old text
no actions are performed, otherwise the set_text()
virtual method
is called and the "text-changed" signal is emitted.
|
an object that implements AdgTextual |
|
the new text to be set |
Since 1.0
gchar * adg_textual_dup_text (AdgTextual *textual
);
Gets a duplicate of the current text bound to textual
.
|
an object that implements AdgTextual |
Returns : |
the current text of textual : free with g_free() when finished |
Since 1.0
void adg_textual_text_changed (AdgTextual *textual
,const gchar *old_text
);
Emits the "text-changed" signal on textual
.
This function is only useful when creating a new class that implements the AdgTextual interface.
|
an object that implements AdgTextual |
|
the old text bound to textual
|
Since 1.0