Eolian: Integration of Evas Text

This commit is contained in:
Daniel Zaoui 2014-03-09 10:31:28 +02:00
parent b545750bee
commit 9b8f036beb
7 changed files with 2247 additions and 725 deletions

View File

@ -7,12 +7,15 @@ BUILT_SOURCES += \
lib/evas/canvas/evas_polygon.eo.c \
lib/evas/canvas/evas_polygon.eo.h \
lib/evas/canvas/evas_rectangle.eo.c \
lib/evas/canvas/evas_rectangle.eo.h
lib/evas/canvas/evas_rectangle.eo.h \
lib/evas/canvas/evas_text.eo.c \
lib/evas/canvas/evas_text.eo.h
EXTRA_DIST += \
lib/evas/canvas/evas_line.eo \
lib/evas/canvas/evas_polygon.eo \
lib/evas/canvas/evas_rectangle.eo
lib/evas/canvas/evas_rectangle.eo \
lib/evas/canvas/evas_text.eo
lib_LTLIBRARIES += lib/evas/libevas.la
noinst_LTLIBRARIES =
@ -30,7 +33,8 @@ installed_evascanvasheadersdir = $(includedir)/evas-@VMAJ@/canvas
nodist_installed_evascanvasheaders_DATA = \
lib/evas/canvas/evas_line.eo.h \
lib/evas/canvas/evas_polygon.eo.h \
lib/evas/canvas/evas_rectangle.eo.h
lib/evas/canvas/evas_rectangle.eo.h \
lib/evas/canvas/evas_text.eo.h
noinst_HEADERS = \
lib/evas/include/evas_inline.x \

View File

@ -0,0 +1,3 @@
abstract Eo_Abstract_Class ()
{
}

170
src/lib/eo/eo_base.eo Normal file
View File

@ -0,0 +1,170 @@
abstract Eo_Base ()
{
constructors {
constructor {
/*@ Call the object's constructor.
Should not be used with #eo_do. Only use it with #eo_do_super. */
}
}
properties {
parent {
set {
/*@ Set the parent of an object
Parents keep references to their children so in order to delete objects that have parents you need to set parent to NULL or use eo_del() that does that for you (and also unrefs the object). */
}
get {
/*@ Get the parent of an object */
}
values {
Eo* parent; /*@ the new parent */
}
}
event_global_freeze {
get {
/*@ return freeze events of object.
Return event freeze count. */
}
values {
int fcount; /*@ The event freeze count of the object */
}
}
event_freeze {
get {
/*@ return freeze events of object.
Return event freeze count. */
}
values {
int fcount; /*@ The event freeze count of the object */
}
}
}
methods {
event_callback_forwarder_del {
/*@ Remove an event callback forwarder for an event and an object. */
params {
@in const Eo_Event_Description* desc; /*@ The description of the event to listen to */
@in Eo* new_obj; /*@ The object to emit events from */
}
}
event_thaw {
/*@ thaw events of object.
Lets event callbacks be called for the object. */
}
event_freeze {
/*@ freeze events of object.
Prevents event callbacks from being called for the object. */
}
event_global_freeze {
/*@ freeze events of object.
Prevents event callbacks from being called for the object. */
}
event_callback_array_del {
/*@ Del a callback array with a specific data associated to it for an event. */
params {
@in const Eo_Callback_Array_Item* array; /*@ an #Eo_Callback_Array_Item of events to listen to */
@in const void* user_data; /*@ The data to compare */
}
}
wref_del {
/*@ Delete the weak reference passed. */
params {
@inout Eo** wref;
}
}
destructor {
/*@ Call the object's destructor.
Should not be used with #eo_do. Only use it with #eo_do_super. */
}
data_set {
/*@ Set generic data to object. */
params {
@in const char* key; /*@ the key associated with the data */
@in const void* data; /*@ the data to set */
@in eo_base_data_free_func free_func; /*@ the func to free data with (NULL means */
}
}
data_get {
/*@ Get generic data from object. */
params {
@in const char* key; /*@ the key associated with the data */
@out void* data; /*@ the data for the key */
}
}
event_callback_del {
/*@ Del a callback with a specific data associated to it for an event. */
params {
@in const Eo_Event_Description* desc; /*@ The description of the event to listen to */
@in Eo_Event_Cb func; /*@ the callback to delete */
@in const void* user_data; /*@ The data to compare */
}
}
event_global_thaw {
/*@ thaw events of object.
Lets event callbacks be called for the object. */
}
data_del {
/*@ Del generic data from object. */
params {
@in const char* key; /*@ the key associated with the data */
}
}
event_callback_array_priority_add {
/*@ Add a callback array for an event with a specific priority.
callbacks of the same priority are called in reverse order of creation. */
params {
@in const Eo_Callback_Array_Item* array; /*@ an #Eo_Callback_Array_Item of events to listen to */
@in Eo_Callback_Priority priority; /*@ The priority of the callback */
@in const void* data; /*@ additional data to pass to the callback */
}
}
wref_add {
/*@ Add a new weak reference to obj.
This function registers the object handle pointed by wref to obj so when obj is deleted it'll be updated to NULL. This functions should be used when you want to keep track of an object in a safe way, but you don't want to prevent it from being freed. */
params {
@inout Eo** wref;
}
}
dbg_info_get {
/*@ Get dbg information from the object. */
params {
@in Eo_Dbg_Info* root_node; /*@ node of the tree */
}
}
event_callback_forwarder_add {
/*@ Add an event callback forwarder for an event and an object. */
params {
@in const Eo_Event_Description* desc; /*@ The description of the event to listen to */
@in Eo* new_obj; /*@ The object to emit events from */
}
}
event_callback_call {
/*@ Call the callbacks for an event of an object. */
params {
@in const Eo_Event_Description* desc; /*@ The description of the event to call */
@in const void* event_info; /*@ Extra event info to pass to the callbacks */
@out Eina_Bool aborted; /*@ @c EINA_TRUE if one of the callbacks aborted the call, @c EINA_FALSE otherwise */
}
}
event_callback_priority_add {
/*@ Add a callback for an event with a specific priority.
callbacks of the same priority are called in reverse order of creation. */
params {
@in const Eo_Event_Description* desc; /*@ The description of the event to listen to */
@in Eo_Callback_Priority priority; /*@ The priority of the callback */
@in Eo_Event_Cb cb; /*@ the callback to call */
@in const void* data; /*@ additional data to pass to the callback */
}
}
children_iterator_new {
/*@ Get an iterator on all childrens */
params {
@inout Eina_Iterator** it;
}
}
}
events {
callback,add; /*@ A callback was added. */
callback,del; /*@ A callback was deleted. */
del; /*@ Obj is being deleted. */
}
}

View File

@ -1809,6 +1809,9 @@ enum
*
* @{
*/
#include "canvas/evas_text.eo.h"
#if 0
#define EVAS_OBJ_TEXT_CLASS evas_object_text_class_get()
@ -2311,6 +2314,7 @@ enum
*/
#define evas_obj_text_filter_source_set(name, obj) EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_FILTER_SOURCE_SET), EO_TYPECHECK(const char *, name), EO_TYPECHECK(Eo *, obj)
#endif
/**
* @}
*/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,422 @@
class Evas_Text (Evas_Object)
{
legacy_prefix: evas_object_text;
properties {
font_source {
set {
/*@
Set the font (source) file to be used on a given text object.
This function allows the font file to be explicitly set for a given
text object, overriding system lookup, which will first occur in
the given file's contents.
@see evas_object_text_font_get() */
}
get {
/*@
Get the font file's path which is being used on a given text
object.
@return The font file's path.
@see evas_object_text_font_get() for more details */
}
values {
const char* font_source; /*@ The font file's path. */
}
}
shadow_color {
set {
/*@
Sets the shadow color for the given text object.
Shadow effects, which are fading colors decorating the text
underneath it, will just be shown if the object is set to one of
the following styles:
- #EVAS_TEXT_STYLE_SHADOW
- #EVAS_TEXT_STYLE_OUTLINE_SHADOW
- #EVAS_TEXT_STYLE_FAR_SHADOW
- #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
- #EVAS_TEXT_STYLE_SOFT_SHADOW
- #EVAS_TEXT_STYLE_FAR_SOFT_SHADOW
One can also change the direction where the shadow grows to, with
evas_object_text_style_set().
@see evas_object_text_shadow_color_get() */
}
get {
/*@
Retrieves the shadow color for the given text object.
@note Use @c NULL pointers on the color components you're not
interested in: they'll be ignored by the function.
@see evas_object_text_shadow_color_set() for more details. */
}
values {
int r; /*@ The red component of the given color. */
int g; /*@ The green component of the given color. */
int b; /*@ The blue component of the given color. */
int a; /*@ The alpha component of the given color. */
}
}
ellipsis {
set {
/*@
@brief Sets the ellipsis that should be used for the text object.
This is a value between 0.0 and 1.0 indicating the position of the text
to be shown. 0.0 means the start will be shown and the end trimmed, 1.0
means the beginning will be trimmed and the end will be shown, and any value
in between will cause ellipsis to be added in both end of the text and the
requested part to be shown.
-1.0 means ellipsis is turned off.
@since 1.8 */
}
get {
/*@
@brief Gets the ellipsis currently set on the text object.
@return The ellipsis set on the text object.
@see evas_object_text_ellipsis_set.
@since 1.8 */
}
values {
double ellipsis; /*@ the ellipsis. */
}
}
bidi_delimiters {
set {
/*@
@brief Sets the BiDi delimiters used in the textblock.
BiDi delimiters are use for in-paragraph separation of bidi segments. This
is useful for example in recipients fields of e-mail clients where bidi
oddities can occur when mixing RTL and LTR.
@since 1.1 */
}
get {
/*@
@brief Gets the BiDi delimiters used in the textblock.
BiDi delimiters are use for in-paragraph separation of bidi segments. This
is useful for example in recipients fields of e-mail clients where bidi
oddities can occur when mixing RTL and LTR.
@return A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
@since 1.1 */
}
values {
const char* delim; /*@ A null terminated string of delimiters, e.g ",|". */
}
}
outline_color {
set {
/*@
Sets the outline color for the given text object.
Outline effects (colored lines around text glyphs) will just be
shown if the object is set to one of the following styles:
- #EVAS_TEXT_STYLE_OUTLINE
- #EVAS_TEXT_STYLE_SOFT_OUTLINE
- #EVAS_TEXT_STYLE_OUTLINE_SHADOW
- #EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
@see evas_object_text_outline_color_get() */
}
get {
/*@
Retrieves the outline color for the given text object.
@note Use @c NULL pointers on the color components you're not
interested in: they'll be ignored by the function.
@see evas_object_text_outline_color_set() for more details. */
}
values {
int r; /*@ The red component of the given color. */
int g; /*@ The green component of the given color. */
int b; /*@ The blue component of the given color. */
int a; /*@ The alpha component of the given color. */
}
}
text {
set {
/*@
Sets the text string to be displayed by the given text object.
@see evas_object_text_text_get() */
}
get {
/*@
Retrieves the text string currently being displayed by the given
text object.
@return The text string currently being displayed on it.
@note Do not free() the return value.
@see evas_object_text_text_set() */
}
values {
const char* text; /*@ Text string to display on it. */
}
}
glow2_color {
set {
/*@
Sets the 'glow 2' color for the given text object.
'Glow 2' effects, which are glowing colors decorating the text's
(immediate) surroundings, will just be shown if the object is set
to the #EVAS_TEXT_STYLE_GLOW style. See also
evas_object_text_glow_color_set().
@see evas_object_text_glow2_color_get() */
}
get {
/*@
Retrieves the 'glow 2' color for the given text object.
@note Use @c NULL pointers on the color components you're not
interested in: they'll be ignored by the function.
@see evas_object_text_glow2_color_set() for more details. */
}
values {
int r; /*@ The red component of the given color. */
int g; /*@ The green component of the given color. */
int b; /*@ The blue component of the given color. */
int a; /*@ The alpha component of the given color. */
}
}
font {
set {
/*@
Set the font family or filename, and size on a given text object.
This function allows the font name and size of a text object to be
set. The @p font string has to follow fontconfig's convention on
naming fonts, as it's the underlying library used to query system
fonts by Evas (see the @c fc-list command's output, on your system,
to get an idea). Alternatively, one can use a full path to a font file.
@see evas_object_text_font_get()
@see evas_object_text_font_source_set() */
}
get {
/*@
Retrieve the font family and size in use on a given text object.
This function allows the font name and size of a text object to be
queried. Be aware that the font name string is still owned by Evas
and should @b not have free() called on it by the caller of the
function.
@see evas_object_text_font_set() */
}
values {
const char* font; /*@ The font family name or filename. */
Evas_Font_Size size; /*@ The font size, in points. */
}
}
style {
set {
/*@
Sets the style to apply on the given text object.
Text object styles are one of the values in
#Evas_Text_Style_Type. Some of those values are combinations of
more than one style, and some account for the direction of the
rendering of shadow effects.
@note One may use the helper macros #EVAS_TEXT_STYLE_BASIC_SET and
#EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET to assemble a style value.
The following figure illustrates the text styles:
@image html text-styles.png
@image rtf text-styles.png
@image latex text-styles.eps
@see evas_object_text_style_get()
@see evas_object_text_shadow_color_set()
@see evas_object_text_outline_color_set()
@see evas_object_text_glow_color_set()
@see evas_object_text_glow2_color_set() */
}
get {
/*@
Retrieves the style on use on the given text object.
@return the style type in use.
@see evas_object_text_style_set() for more details. */
}
values {
Evas_Text_Style_Type style; /*@ a style type. */
}
}
glow_color {
set {
/*@
Sets the glow color for the given text object.
Glow effects, which are glowing colors decorating the text's
surroundings, will just be shown if the object is set to the
#EVAS_TEXT_STYLE_GLOW style.
@note Glow effects are placed from a short distance of the text
itself, but no touching it. For glowing effects right on the
borders of the glyphs, see 'glow 2' effects
(evas_object_text_glow2_color_set()).
@see evas_object_text_glow_color_get() */
}
get {
/*@
Retrieves the glow color for the given text object.
@note Use @c NULL pointers on the color components you're not
interested in: they'll be ignored by the function.
@see evas_object_text_glow_color_set() for more details. */
}
values {
int r; /*@ The red component of the given color. */
int g; /*@ The green component of the given color. */
int b; /*@ The blue component of the given color. */
int a; /*@ The alpha component of the given color. */
}
}
filter_program {
set {
/*@ Set an Evas filter program on this Text Object. If the program fails to compile (syntax error, invalid buffer name, etc...), the standard text effects will be applied instead (SHADOW, etc...). switch back to the standard text effects. */
}
values {
const char* program; /*@ The program code, as defined by the @ref evasfiltersref */
}
}
filter_source {
set {
/*@ Bind an object to use as a mask or texture with Evas Filters. This will create automatically a new RGBA buffer containing the source object's pixels (as it is rendered). */
}
values {
const char* name; /*@ Object name as used in the program code */
Eo* eobj; /*@ Eo object to use through proxy rendering */
}
}
max_descent {
get {
return Evas_Coord;
}
}
style_pad {
get {
/*@
Gets the text style pad of a text object. */
}
values {
int l; /*@ The left pad (or @c NULL). */
int r; /*@ The right pad (or @c NULL). */
int t; /*@ The top pad (or @c NULL). */
int b; /*@ The bottom pad (or @c NULL). */
}
}
direction {
get {
/*@
Retrieves the direction of the text currently being displayed in the
text object.
@return the direction of the text */
return Evas_BiDi_Direction;
}
}
ascent {
get {
return Evas_Coord;
}
}
horiz_advance {
get {
return Evas_Coord;
}
}
inset {
get {
return Evas_Coord;
}
}
max_ascent {
get {
return Evas_Coord;
}
}
vert_advance {
get {
return Evas_Coord;
}
}
descent {
get {
return Evas_Coord;
}
}
}
methods {
last_up_to_pos {
/*@ Returns the logical position of the last char in the text up to the pos given. this is NOT the position of the last char because of the possibility of RTL in the text. */
const;
return int;
params {
@in Evas_Coord x; /*@ in */
@in Evas_Coord y; /*@ in */
}
}
char_coords_get {
const;
return int;
params {
@in Evas_Coord x; /*@ in */
@in Evas_Coord y; /*@ in */
@out Evas_Coord cx; /*@ out */
@out Evas_Coord cy; /*@ out */
@out Evas_Coord cw; /*@ out */
@out Evas_Coord ch; /*@ out */
}
}
char_pos_get {
/*@
Retrieve position and dimension information of a character within a text @c Evas_Object.
This function is used to obtain the X, Y, width and height of the character
located at @p pos within the @c Evas_Object @p obj. @p obj must be a text object
as created with evas_object_text_add(). Any of the @c Evas_Coord parameters (@p cx,
@p cy, @p cw, @p ch) may be @c NULL in which case no value will be assigned to that
parameter.
@return @c EINA_FALSE on success, @c EINA_TRUE on error. */
const;
return Eina_Bool;
params {
@in int pos; /*@ The character position to request co-ordinates for. */
@out Evas_Coord cx; /*@ A pointer to an @c Evas_Coord to store the X value in (can be NULL). */
@out Evas_Coord cy; /*@ A pointer to an @c Evas_Coord to store the Y value in (can be NULL). */
@out Evas_Coord cw; /*@ A pointer to an @c Evas_Coord to store the Width value in (can be NULL). */
@out Evas_Coord ch; /*@ A pointer to an @c Evas_Coord to store the Height value in (can be NULL). */
}
}
}
implements {
Eo_Base::constructor;
Eo_Base::destructor;
Eo_Base::dbg_info_get;
Evas_Object::size::set;
}
}