aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/evas/src/lib/canvas/evas_object_text.c
diff options
context:
space:
mode:
Diffstat (limited to 'legacy/evas/src/lib/canvas/evas_object_text.c')
-rw-r--r--legacy/evas/src/lib/canvas/evas_object_text.c1162
1 files changed, 695 insertions, 467 deletions
diff --git a/legacy/evas/src/lib/canvas/evas_object_text.c b/legacy/evas/src/lib/canvas/evas_object_text.c
index 2afc588645..8e436b9036 100644
--- a/legacy/evas/src/lib/canvas/evas_object_text.c
+++ b/legacy/evas/src/lib/canvas/evas_object_text.c
@@ -1,6 +1,12 @@
#include "evas_common.h" /* Includes evas_bidi_utils stuff. */
#include "evas_private.h"
+#include "Eo.h"
+
+EAPI Eo_Op EVAS_OBJ_TEXT_BASE_ID = EO_NOOP;
+
+#define MY_CLASS EVAS_OBJ_TEXT_CLASS
+
/* save typing */
#define ENFN obj->layer->evas->engine.func
#define ENDT obj->layer->evas->engine.data.output
@@ -51,27 +57,26 @@ struct _Evas_Object_Text_Item
};
/* private methods for text objects */
-static void evas_object_text_init(Evas_Object *obj);
-static void *evas_object_text_new(void);
-static void evas_object_text_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y);
-static void evas_object_text_free(Evas_Object *obj);
-static void evas_object_text_render_pre(Evas_Object *obj);
-static void evas_object_text_render_post(Evas_Object *obj);
+static void evas_object_text_init(Evas_Object *eo_obj);
+static void evas_object_text_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y);
+static void evas_object_text_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
+static void evas_object_text_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
+static void evas_object_text_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
-static unsigned int evas_object_text_id_get(Evas_Object *obj);
-static unsigned int evas_object_text_visual_id_get(Evas_Object *obj);
-static void *evas_object_text_engine_data_get(Evas_Object *obj);
+static unsigned int evas_object_text_id_get(Evas_Object *eo_obj);
+static unsigned int evas_object_text_visual_id_get(Evas_Object *eo_obj);
+static void *evas_object_text_engine_data_get(Evas_Object *eo_obj);
-static int evas_object_text_is_opaque(Evas_Object *obj);
-static int evas_object_text_was_opaque(Evas_Object *obj);
+static int evas_object_text_is_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
+static int evas_object_text_was_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
-static void evas_object_text_scale_update(Evas_Object *obj);
-static void _evas_object_text_recalc(Evas_Object *obj);
+static void evas_object_text_scale_update(Evas_Object *eo_obj);
+static void _evas_object_text_recalc(Evas_Object *eo_obj);
static const Evas_Object_Func object_func =
{
/* methods (compulsory) */
- evas_object_text_free,
+ NULL,
evas_object_text_render,
evas_object_text_render_pre,
evas_object_text_render_post,
@@ -97,13 +102,12 @@ static const Evas_Object_Func object_func =
/* the actual api call to add a rect */
/* it has no other api calls as all properties are standard */
-EVAS_MEMPOOL(_mp_obj);
-
static int
-_evas_object_text_char_coords_get(const Evas_Object *obj,
+_evas_object_text_char_coords_get(const Evas_Object *eo_obj,
const Evas_Object_Text *o,
size_t pos, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
{
+ Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
Evas_Object_Text_Item *it;
EINA_INLIST_FOREACH(EINA_INLIST_GET(o->items), it)
@@ -159,9 +163,10 @@ _evas_object_text_it_compare_logical(const void *_it1, const void *_it2)
#endif
static int
-_evas_object_text_last_up_to_pos(const Evas_Object *obj,
+_evas_object_text_last_up_to_pos(const Evas_Object *eo_obj,
const Evas_Object_Text *o, Evas_Coord cx, Evas_Coord cy)
{
+ Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
Evas_Object_Text_Item *it;
#ifdef BIDI_SUPPORT
@@ -212,10 +217,11 @@ _evas_object_text_last_up_to_pos(const Evas_Object *obj,
}
static int
-_evas_object_text_char_at_coords(const Evas_Object *obj,
+_evas_object_text_char_at_coords(const Evas_Object *eo_obj,
const Evas_Object_Text *o, Evas_Coord cx, Evas_Coord cy,
Evas_Coord *rx, Evas_Coord *ry, Evas_Coord *rw, Evas_Coord *rh)
{
+ Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
Evas_Object_Text_Item *it;
EINA_INLIST_FOREACH(EINA_INLIST_GET(o->items), it)
@@ -235,12 +241,12 @@ _evas_object_text_char_at_coords(const Evas_Object *obj,
}
static Evas_Coord
-_evas_object_text_horiz_advance_get(const Evas_Object *obj,
+_evas_object_text_horiz_advance_get(const Evas_Object *eo_obj,
const Evas_Object_Text *o)
{
Evas_Object_Text_Item *it, *last_it = NULL;
Evas_Coord adv;
- (void) obj;
+ (void) eo_obj;
adv = 0;
EINA_INLIST_FOREACH(EINA_INLIST_GET(o->items), it)
@@ -264,30 +270,38 @@ _evas_object_text_vert_advance_get(const Evas_Object *obj __UNUSED__,
EAPI Evas_Object *
evas_object_text_add(Evas *e)
{
- Evas_Object *obj;
-
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
return NULL;
MAGIC_CHECK_END();
- obj = evas_object_new(e);
- evas_object_text_init(obj);
- evas_object_inject(obj, e);
- return obj;
+ Evas_Object *eo_obj = eo_add(EVAS_OBJ_TEXT_CLASS, e);
+ eo_unref(eo_obj);
+ return eo_obj;
}
-EAPI void
-evas_object_text_font_source_set(Evas_Object *obj, const char *font_source)
+static void
+_constructor(Eo *eo_obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
{
- Evas_Object_Text *o;
+ eo_do_super(eo_obj, eo_constructor());
+ evas_object_text_init(eo_obj);
+ Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
+ evas_object_inject(eo_obj, obj, evas_object_evas_get(eo_parent_get(eo_obj)));
+}
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- return;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+EAPI void
+evas_object_text_font_source_set(Evas_Object *eo_obj, const char *font_source)
+{
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return;
MAGIC_CHECK_END();
+ eo_do(eo_obj, evas_obj_text_font_source_set(font_source));
+}
+
+static void
+_text_font_source_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object_Text *o = _pd;
+ const char *font_source = va_arg(*list, const char *);
if ((o->cur.source) && (font_source) &&
(!strcmp(o->cur.source, font_source)))
return;
@@ -300,35 +314,45 @@ evas_object_text_font_source_set(Evas_Object *obj, const char *font_source)
}
EAPI const char *
-evas_object_text_font_source_get(const Evas_Object *obj)
+evas_object_text_font_source_get(const Evas_Object *eo_obj)
{
- Evas_Object_Text *o;
-
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return NULL;
MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
- return NULL;
- MAGIC_CHECK_END();
- return o->cur.source;
+ const char *font_source = NULL;
+ eo_do((Eo *)eo_obj, evas_obj_text_font_source_get(&font_source));
+ return font_source;
+}
+
+static void
+_text_font_source_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const Evas_Object_Text *o = _pd;
+
+ const char ** font_source = va_arg(*list, const char **);
+ *font_source = o->cur.source;
}
EAPI void
-evas_object_text_font_set(Evas_Object *obj, const char *font, Evas_Font_Size size)
+evas_object_text_font_set(Evas_Object *eo_obj, const char *font, Evas_Font_Size size)
+{
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
+ return;
+ MAGIC_CHECK_END();
+ eo_do(eo_obj, evas_obj_text_font_set(font, size));
+}
+
+static void
+_text_font_set(Eo *eo_obj, void *_pd, va_list *list)
{
- Evas_Object_Text *o;
+ Evas_Object_Text *o = _pd;
int is, was = 0, pass = 0, freeze = 0;
Evas_Font_Description *fdesc;
+ const char *font = va_arg(*list, const char*);
+ Evas_Font_Size size = va_arg(*list, Evas_Font_Size);
+
if ((!font) || (size <= 0)) return;
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- return;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
- return;
- MAGIC_CHECK_END();
fdesc = evas_font_desc_new();
evas_font_name_parse(fdesc, font);
@@ -346,12 +370,13 @@ evas_object_text_font_set(Evas_Object *obj, const char *font, Evas_Font_Size siz
eina_stringshare_replace(&o->cur.font, font);
o->prev.font = NULL;
- if (obj->layer->evas->events_frozen <= 0)
+ Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
+ if (!(obj->layer->evas->is_frozen))
{
- pass = evas_event_passes_through(obj);
- freeze = evas_event_freezes_through(obj);
+ pass = evas_event_passes_through(eo_obj, obj);
+ freeze = evas_event_freezes_through(eo_obj, obj);
if ((!pass) && (!freeze))
- was = evas_object_is_in_output_rect(obj,
+ was = evas_object_is_in_output_rect(eo_obj, obj,
obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y, 1, 1);
}
@@ -359,11 +384,11 @@ evas_object_text_font_set(Evas_Object *obj, const char *font, Evas_Font_Size siz
/* DO IT */
if (o->font)
{
- evas_font_free(obj->layer->evas, o->font);
+ evas_font_free(obj->layer->evas->evas, o->font);
o->font = NULL;
}
- o->font = evas_font_load(obj->layer->evas, o->cur.fdesc, o->cur.source,
+ o->font = evas_font_load(obj->layer->evas->evas, o->cur.fdesc, o->cur.source,
(int)(((double) o->cur.size) * obj->cur.scale));
if (o->font)
{
@@ -379,46 +404,48 @@ evas_object_text_font_set(Evas_Object *obj, const char *font, Evas_Font_Size siz
o->max_ascent = 0;
o->max_descent = 0;
}
- _evas_object_text_recalc(obj);
+ _evas_object_text_recalc(eo_obj);
o->changed = 1;
- evas_object_change(obj);
- evas_object_clip_dirty(obj);
- evas_object_coords_recalc(obj);
- if (obj->layer->evas->events_frozen <= 0)
+ evas_object_change(eo_obj, obj);
+ evas_object_clip_dirty(eo_obj, obj);
+ evas_object_coords_recalc(eo_obj, obj);
+ if (!(obj->layer->evas->is_frozen))
{
if ((!pass) && (!freeze))
{
- is = evas_object_is_in_output_rect(obj,
+ is = evas_object_is_in_output_rect(eo_obj, obj,
obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y,
1, 1);
if ((is ^ was) && obj->cur.visible)
- evas_event_feed_mouse_move(obj->layer->evas,
+ evas_event_feed_mouse_move(obj->layer->evas->evas,
obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y,
obj->layer->evas->last_timestamp,
NULL);
}
}
- evas_object_inform_call_resize(obj);
+ evas_object_inform_call_resize(eo_obj);
}
EAPI void
-evas_object_text_font_get(const Evas_Object *obj, const char **font, Evas_Font_Size *size)
+evas_object_text_font_get(const Evas_Object *eo_obj, const char **font, Evas_Font_Size *size)
{
- Evas_Object_Text *o;
-
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- if (font) *font = "";
- if (size) *size = 0;
- return;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
if (font) *font = "";
if (size) *size = 0;
return;
MAGIC_CHECK_END();
+ eo_do((Eo *)eo_obj, evas_obj_text_font_get(font, size));
+}
+
+static void
+_text_font_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const Evas_Object_Text *o = _pd;
+ const char **font = va_arg(*list, const char **);
+ Evas_Font_Size *size = va_arg(*list, Evas_Font_Size *);
+
if (font) *font = o->cur.font;
if (size) *size = o->cur.size;
}
@@ -433,10 +460,11 @@ evas_object_text_font_get(const Evas_Object *obj, const char **font, Evas_Font_S
* @param str the string to use.
*/
static Evas_Object_Text_Item *
-_evas_object_text_item_new(Evas_Object *obj, Evas_Object_Text *o,
+_evas_object_text_item_new(Evas_Object *eo_obj, Evas_Object_Text *o,
Evas_Font_Instance *fi, const Eina_Unicode *str, Evas_Script_Type script,
size_t pos, size_t visual_pos, size_t len)
{
+ Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
Evas_Object_Text_Item *it;
it = calloc(1, sizeof(Evas_Object_Text_Item));
@@ -472,9 +500,9 @@ _evas_object_text_item_new(Evas_Object *obj, Evas_Object_Text *o,
* @param o the text object
*/
static void
-_evas_object_text_item_order(Evas_Object *obj, Evas_Object_Text *o)
+_evas_object_text_item_order(Evas_Object *eo_obj, Evas_Object_Text *o)
{
- (void) obj;
+ (void) eo_obj;
#ifdef BIDI_SUPPORT
/*FIXME: not very efficient, sort the items arrays. */
/* Reorder if it's a bidi text */
@@ -526,8 +554,9 @@ _evas_object_text_item_order(Evas_Object *obj, Evas_Object_Text *o)
* @param text the text to layout
*/
static void
-_evas_object_text_layout(Evas_Object *obj, Evas_Object_Text *o, const Eina_Unicode *text)
+_evas_object_text_layout(Evas_Object *eo_obj, Evas_Object_Text *o, const Eina_Unicode *text)
{
+ Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
EvasBiDiStrIndex *v_to_l = NULL;
size_t pos, visual_pos;
int len = eina_unicode_strlen(text);
@@ -573,7 +602,7 @@ _evas_object_text_layout(Evas_Object *obj, Evas_Object_Text *o, const Eina_Unico
#else
visual_pos = pos;
#endif
- _evas_object_text_item_new(obj, o, cur_fi, text, script,
+ _evas_object_text_item_new(eo_obj, o, cur_fi, text, script,
pos, visual_pos, run_len);
pos += run_len;
@@ -582,33 +611,37 @@ _evas_object_text_layout(Evas_Object *obj, Evas_Object_Text *o, const Eina_Unico
}
}
- _evas_object_text_item_order(obj, o);
+ _evas_object_text_item_order(eo_obj, o);
if (v_to_l) free(v_to_l);
}
EAPI void
-evas_object_text_text_set(Evas_Object *obj, const char *_text)
+evas_object_text_text_set(Evas_Object *eo_obj, const char *_text)
{
- Evas_Object_Text *o;
- int is, was, len;
- Eina_Unicode *text;
-
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- return;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return;
MAGIC_CHECK_END();
+ eo_do(eo_obj, evas_obj_text_text_set(_text));
+}
+
+static void
+_text_text_set(Eo *eo_obj, void *_pd, va_list *list)
+{
+ Evas_Object_Text *o = _pd;
+ int is, was, len;
+ Eina_Unicode *text;
+
+ const char *_text = va_arg(*list, const char *);
if ((o->cur.utf8_text) && (_text) && (!strcmp(o->cur.utf8_text, _text)))
return;
text = eina_unicode_utf8_to_unicode(_text, &len);
if (!text) text = eina_unicode_strdup(EINA_UNICODE_EMPTY_STRING);
- was = evas_object_is_in_output_rect(obj,
+ Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
+ was = evas_object_is_in_output_rect(eo_obj, obj,
obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y, 1, 1);
/* DO II */
@@ -616,13 +649,13 @@ evas_object_text_text_set(Evas_Object *obj, const char *_text)
if (o->items) _evas_object_text_items_clear(o);
- if ((text) && (*text))
+ if ((text) && (*text))
{
- _evas_object_text_layout(obj, o, text);
+ _evas_object_text_layout(eo_obj, o, text);
eina_stringshare_replace(&o->cur.utf8_text, _text);
o->prev.utf8_text = NULL;
}
- else
+ else
{
eina_stringshare_replace(&o->cur.utf8_text, NULL);
}
@@ -631,219 +664,279 @@ evas_object_text_text_set(Evas_Object *obj, const char *_text)
free(text);
text = NULL;
}
- _evas_object_text_recalc(obj);
+ _evas_object_text_recalc(eo_obj);
o->changed = 1;
- evas_object_change(obj);
- evas_object_clip_dirty(obj);
- evas_object_coords_recalc(obj);
- is = evas_object_is_in_output_rect(obj,
+ evas_object_change(eo_obj, obj);
+ evas_object_clip_dirty(eo_obj, obj);
+ evas_object_coords_recalc(eo_obj, obj);
+ is = evas_object_is_in_output_rect(eo_obj, obj,
obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y, 1, 1);
if ((is || was) && obj->cur.visible)
- evas_event_feed_mouse_move(obj->layer->evas,
+ evas_event_feed_mouse_move(obj->layer->evas->evas,
obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y,
obj->layer->evas->last_timestamp,
NULL);
- evas_object_inform_call_resize(obj);
+ evas_object_inform_call_resize(eo_obj);
if (text) free(text);
}
EAPI void
-evas_object_text_bidi_delimiters_set(Evas_Object *obj, const char *delim)
+evas_object_text_bidi_delimiters_set(Evas_Object *eo_obj, const char *delim)
{
- Evas_Object_Text *o;
-
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- return;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return;
MAGIC_CHECK_END();
+ eo_do(eo_obj, evas_obj_text_bidi_delimiters_set(delim));
+}
+
+static void
+_text_bidi_delimiters_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object_Text *o = _pd;
+
+ const char *delim = va_arg(*list, const char *);
eina_stringshare_replace(&o->bidi_delimiters, delim);
}
EAPI const char *
-evas_object_text_bidi_delimiters_get(const Evas_Object *obj)
+evas_object_text_bidi_delimiters_get(const Evas_Object *eo_obj)
{
- Evas_Object_Text *o;
-
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- return NULL;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return NULL;
MAGIC_CHECK_END();
-
- return o->bidi_delimiters;
+ const char *delim = NULL;
+ eo_do((Eo *)eo_obj, evas_obj_text_bidi_delimiters_get(&delim));
+ return delim;
}
+static void
+_text_bidi_delimiters_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const Evas_Object_Text *o = _pd;
+ const char **delim = va_arg(*list, const char **);
+ *delim = o->bidi_delimiters;
+}
EAPI const char *
-evas_object_text_text_get(const Evas_Object *obj)
+evas_object_text_text_get(const Evas_Object *eo_obj)
{
- Evas_Object_Text *o;
-
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- return NULL;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return NULL;
MAGIC_CHECK_END();
- return o->cur.utf8_text;
+ const char *text = NULL;
+ eo_do((Eo *)eo_obj, evas_obj_text_text_get(&text));
+ return text;
}
-EAPI Evas_BiDi_Direction
-evas_object_text_direction_get(const Evas_Object *obj)
+static void
+_text_text_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
- Evas_Object_Text *o;
+ const char **text = va_arg(*list, const char **);
+ const Evas_Object_Text *o = _pd;
+ *text = o->cur.utf8_text;
+}
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- return EVAS_BIDI_DIRECTION_NEUTRAL;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+EAPI Evas_BiDi_Direction
+evas_object_text_direction_get(const Evas_Object *eo_obj)
+{
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return EVAS_BIDI_DIRECTION_NEUTRAL;
MAGIC_CHECK_END();
- if (o->items)
- {
- return o->items->text_props.bidi.dir;
- }
- return EVAS_BIDI_DIRECTION_NEUTRAL;
+ Evas_BiDi_Direction bidi_dir = EVAS_BIDI_DIRECTION_NEUTRAL;
+ eo_do((Eo *)eo_obj, evas_obj_text_direction_get(&bidi_dir));
+ return bidi_dir;
}
-EAPI Evas_Coord
-evas_object_text_ascent_get(const Evas_Object *obj)
+static void
+_text_direction_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
- Evas_Object_Text *o;
+ Evas_BiDi_Direction *bidi_dir = va_arg(*list, Evas_BiDi_Direction *);
+ const Evas_Object_Text *o = _pd;
+ *bidi_dir = o->items ? o->items->text_props.bidi.dir : EVAS_BIDI_DIRECTION_NEUTRAL;
+}
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- return 0;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+EAPI Evas_Coord
+evas_object_text_ascent_get(const Evas_Object *eo_obj)
+{
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return 0;
MAGIC_CHECK_END();
- return o->ascent;
+ Evas_Coord ascent = 0;
+ eo_do((Eo *)eo_obj, evas_obj_text_ascent_get(&ascent));
+ return ascent;
}
-EAPI Evas_Coord
-evas_object_text_descent_get(const Evas_Object *obj)
+static void
+_text_ascent_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
- Evas_Object_Text *o;
+ Evas_Coord *ascent = va_arg(*list, Evas_Coord *);
+ const Evas_Object_Text *o = _pd;
+ *ascent = o->ascent;
+}
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- return 0;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+EAPI Evas_Coord
+evas_object_text_descent_get(const Evas_Object *eo_obj)
+{
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return 0;
MAGIC_CHECK_END();
- return o->descent;
+ Evas_Coord descent = 0;
+ eo_do((Eo *)eo_obj, evas_obj_text_descent_get(&descent));
+ return descent;
}
-EAPI Evas_Coord
-evas_object_text_max_ascent_get(const Evas_Object *obj)
+static void
+_text_descent_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
- Evas_Object_Text *o;
+ Evas_Coord *descent = va_arg(*list, Evas_Coord *);
+ const Evas_Object_Text *o = _pd;
+ *descent = o->descent;
+}
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- return 0;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+EAPI Evas_Coord
+evas_object_text_max_ascent_get(const Evas_Object *eo_obj)
+{
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return 0;
MAGIC_CHECK_END();
- return o->max_ascent;
+ Evas_Coord max_ascent = 0;
+ eo_do((Eo *)eo_obj, evas_obj_text_max_ascent_get(&max_ascent));
+ return max_ascent;
}
-EAPI Evas_Coord
-evas_object_text_max_descent_get(const Evas_Object *obj)
+static void
+_text_max_ascent_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
- Evas_Object_Text *o;
+ Evas_Coord *max_ascent = va_arg(*list, Evas_Coord *);
+ const Evas_Object_Text *o = _pd;
+ *max_ascent = o->max_ascent;
+}
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- return 0;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+EAPI Evas_Coord
+evas_object_text_max_descent_get(const Evas_Object *eo_obj)
+{
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return 0;
MAGIC_CHECK_END();
- return o->max_descent;
+ Evas_Coord max_descent = 0;
+ eo_do((Eo *)eo_obj, evas_obj_text_max_descent_get(&max_descent));
+ return max_descent;
}
-EAPI Evas_Coord
-evas_object_text_inset_get(const Evas_Object *obj)
+static void
+_text_max_descent_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
- Evas_Object_Text *o;
+ Evas_Coord *max_descent = va_arg(*list, Evas_Coord *);
+ const Evas_Object_Text *o = _pd;
+ *max_descent = o->max_descent;
+}
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- return 0;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+EAPI Evas_Coord
+evas_object_text_inset_get(const Evas_Object *eo_obj)
+{
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return 0;
MAGIC_CHECK_END();
- if (!o->font) return 0;
- if (!o->items) return 0;
- return ENFN->font_inset_get(ENDT, o->font, &o->items->text_props);
+ Evas_Coord inset = 0;
+ eo_do((Eo *)eo_obj, evas_obj_text_inset_get(&inset));
+ return inset;
}
-EAPI Evas_Coord
-evas_object_text_horiz_advance_get(const Evas_Object *obj)
+static void
+_text_inset_get(Eo *eo_obj, void *_pd, va_list *list)
{
- Evas_Object_Text *o;
+ Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
+ Evas_Coord *inset = va_arg(*list, Evas_Coord *);
+ *inset = 0;
+ const Evas_Object_Text *o = _pd;
+ if (!o->font) return;
+ if (!o->items) return;
+ *inset = ENFN->font_inset_get(ENDT, o->font, &o->items->text_props);
+}
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- return 0;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+EAPI Evas_Coord
+evas_object_text_horiz_advance_get(const Evas_Object *eo_obj)
+{
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return 0;
MAGIC_CHECK_END();
- if (!o->font) return 0;
- if (!o->items) return 0;
- return _evas_object_text_horiz_advance_get(obj, o);
+ Evas_Coord horiz = 0;
+ eo_do((Eo *)eo_obj, evas_obj_text_horiz_advance_get(&horiz));
+ return horiz;
}
-EAPI Evas_Coord
-evas_object_text_vert_advance_get(const Evas_Object *obj)
+static void
+_text_horiz_advance_get(Eo *eo_obj, void *_pd, va_list *list)
{
- Evas_Object_Text *o;
+ Evas_Coord *horiz = va_arg(*list, Evas_Coord *);
+ *horiz = 0;
+ const Evas_Object_Text *o = _pd;
+ if (!o->font) return;
+ if (!o->items) return;
+ *horiz = _evas_object_text_horiz_advance_get(eo_obj, o);
+}
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- return 0;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+EAPI Evas_Coord
+evas_object_text_vert_advance_get(const Evas_Object *eo_obj)
+{
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return 0;
MAGIC_CHECK_END();
- if (!o->font) return 0;
- if (!o->items) return o->ascent + o->descent;
- return _evas_object_text_vert_advance_get(obj, o);
+ Evas_Coord vert = 0;
+ eo_do((Eo *)eo_obj, evas_obj_text_vert_advance_get(&vert));
+ return vert;
}
-EAPI Eina_Bool
-evas_object_text_char_pos_get(const Evas_Object *obj, int pos, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
+static void
+_text_vert_advance_get(Eo *eo_obj, void *_pd, va_list *list)
{
- Evas_Object_Text *o;
- int l = 0, r = 0, t = 0, b = 0;
- int ret, x = 0, y = 0, w = 0, h = 0;
+ Evas_Coord *vert = va_arg(*list, Evas_Coord *);
+ *vert = 0;
+ const Evas_Object_Text *o = _pd;
+ if (!o->font) return;
+ if (!o->items)
+ {
+ *vert = o->ascent + o->descent;
+ return;
+ }
+ *vert = _evas_object_text_vert_advance_get(eo_obj, o);
+}
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- return EINA_FALSE;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+EAPI Eina_Bool
+evas_object_text_char_pos_get(const Evas_Object *eo_obj, int pos, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
+{
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return EINA_FALSE;
MAGIC_CHECK_END();
- if (!o->font) return EINA_FALSE;
- if (!o->items || (pos < 0)) return EINA_FALSE;
- ret = _evas_object_text_char_coords_get(obj, o, (size_t) pos,
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *)eo_obj, evas_obj_text_char_pos_get(pos, cx, cy, cw, ch, &ret));
+ return ret;
+}
+
+static void
+_text_char_pos_get(Eo *eo_obj, void *_pd, va_list *list)
+{
+ int pos = va_arg(*list, int);
+ Evas_Coord *cx = va_arg(*list, Evas_Coord *);
+ Evas_Coord *cy = va_arg(*list, Evas_Coord *);
+ Evas_Coord *cw = va_arg(*list, Evas_Coord *);
+ Evas_Coord *ch = va_arg(*list, Evas_Coord *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ const Evas_Object_Text *o = _pd;
+ int l = 0, r = 0, t = 0, b = 0;
+ int x = 0, y = 0, w = 0, h = 0;
+
+ if (!o->font) return;
+ if (!o->items || (pos < 0)) return;
+
+ Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
+
+ Eina_Bool int_ret = _evas_object_text_char_coords_get(eo_obj, o, (size_t) pos,
&x, &y, &w, &h);
evas_text_style_pad_get(o->cur.style, &l, &r, &t, &b);
y += o->max_ascent - t;
@@ -866,44 +959,68 @@ evas_object_text_char_pos_get(const Evas_Object *obj, int pos, Evas_Coord *cx, E
if (cy) *cy = y;
if (cw) *cw = w + l + r;
if (ch) *ch = h + t + b;
- return ret;
+ if (ret) *ret = int_ret;
}
EAPI int
-evas_object_text_last_up_to_pos(const Evas_Object *obj, Evas_Coord x, Evas_Coord y)
+evas_object_text_last_up_to_pos(const Evas_Object *eo_obj, Evas_Coord x, Evas_Coord y)
{
- Evas_Object_Text *o;
-
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return -1;
MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+ int res = -1;
+ eo_do((Eo *)eo_obj, evas_obj_text_last_up_to_pos(x, y, &res));
+ return res;
+}
+
+static void
+_text_last_up_to_pos(Eo *eo_obj, void *_pd, va_list *list)
+{
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ int *ret = va_arg(*list, int *);
+ *ret = -1;
+
+ const Evas_Object_Text *o = _pd;
+
+ if (!o->font) return;
+ if (!o->items) return;
+ int int_ret = _evas_object_text_last_up_to_pos(eo_obj, o, x, y - o->max_ascent);
+ if (ret) *ret = int_ret;
+}
+
+EAPI int
+evas_object_text_char_coords_get(const Evas_Object *eo_obj, Evas_Coord x, Evas_Coord y, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
+{
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return -1;
MAGIC_CHECK_END();
- if (!o->font) return -1;
- if (!o->items) return -1;
- return _evas_object_text_last_up_to_pos(obj, o, x, y - o->max_ascent);
+ int res = -1;
+ eo_do((Eo *)eo_obj, evas_obj_text_char_coords_get(x, y, cx, cy, cw, ch, &res));
+ return res;
}
-EAPI int
-evas_object_text_char_coords_get(const Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
+static void
+_text_char_coords_get(Eo *eo_obj, void *_pd, va_list *list)
{
- Evas_Object_Text *o;
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Evas_Coord *cx = va_arg(*list, Evas_Coord *);
+ Evas_Coord *cy = va_arg(*list, Evas_Coord *);
+ Evas_Coord *cw = va_arg(*list, Evas_Coord *);
+ Evas_Coord *ch = va_arg(*list, Evas_Coord *);
+ int *ret = va_arg(*list, int *);
+ if (ret) *ret = -1;
+
+ const Evas_Object_Text *o = _pd;
int l = 0, r = 0, t = 0, b = 0;
- int ret, rx = 0, ry = 0, rw = 0, rh = 0;
+ int rx = 0, ry = 0, rw = 0, rh = 0;
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- return -1;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
- return -1;
- MAGIC_CHECK_END();
- if (!o->font) return -1;
- if (!o->items) return -1;
- ret = _evas_object_text_char_at_coords(obj, o, x, y - o->max_ascent,
+ if (!o->font) return;
+ if (!o->items) return;
+
+ int int_ret = _evas_object_text_char_at_coords(eo_obj, o, x, y - o->max_ascent,
&rx, &ry, &rw, &rh);
evas_text_style_pad_get(o->cur.style, &l, &r, &t, &b);
ry += o->max_ascent - t;
@@ -913,6 +1030,7 @@ evas_object_text_char_coords_get(const Evas_Object *obj, Evas_Coord x, Evas_Coor
rw += rx;
rx = 0;
}
+ Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
if ((rx + rw) > obj->cur.geometry.w) rw = obj->cur.geometry.w - rx;
if (rw < 0) rw = 0;
if (ry < 0)
@@ -926,23 +1044,28 @@ evas_object_text_char_coords_get(const Evas_Object *obj, Evas_Coord x, Evas_Coor
if (cy) *cy = ry;
if (cw) *cw = rw + l + r;
if (ch) *ch = rh + t + b;
- return ret;
+ if (ret) *ret = int_ret;
}
EAPI void
-evas_object_text_style_set(Evas_Object *obj, Evas_Text_Style_Type style)
+evas_object_text_style_set(Evas_Object *eo_obj, Evas_Text_Style_Type style)
{
- Evas_Object_Text *o;
- int pl = 0, pr = 0, pt = 0, pb = 0, l = 0, r = 0, t = 0, b = 0;
-
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- return;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return;
MAGIC_CHECK_END();
+ eo_do(eo_obj, evas_obj_text_style_set(style));
+}
+
+static void
+_text_style_set(Eo *eo_obj, void *_pd, va_list *list)
+{
+ Evas_Text_Style_Type style = va_arg(*list, Evas_Text_Style_Type);
+ Evas_Object_Text *o = _pd;
+ int pl = 0, pr = 0, pt = 0, pb = 0, l = 0, r = 0, t = 0, b = 0;
+
if (o->cur.style == style) return;
+ Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
+
evas_text_style_pad_get(o->cur.style, &pl, &pr, &pt, &pb);
o->cur.style = style;
evas_text_style_pad_get(o->cur.style, &l, &r, &t, &b);
@@ -951,37 +1074,47 @@ evas_object_text_style_set(Evas_Object *obj, Evas_Text_Style_Type style)
else
obj->cur.geometry.w = 0;
obj->cur.geometry.h += (t - pt) + (b - pb);
- evas_object_change(obj);
- evas_object_clip_dirty(obj);
+ evas_object_change(eo_obj, obj);
+ evas_object_clip_dirty(eo_obj, obj);
}
EAPI Evas_Text_Style_Type
-evas_object_text_style_get(const Evas_Object *obj)
+evas_object_text_style_get(const Evas_Object *eo_obj)
{
- Evas_Object_Text *o;
-
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return EVAS_TEXT_STYLE_PLAIN;
MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
- return EVAS_TEXT_STYLE_PLAIN;
- MAGIC_CHECK_END();
- return o->cur.style;
+ Evas_Text_Style_Type style = EVAS_TEXT_STYLE_PLAIN;
+ eo_do((Eo *)eo_obj, evas_obj_text_style_get(&style));
+ return style;
}
-EAPI void
-evas_object_text_shadow_color_set(Evas_Object *obj, int r, int g, int b, int a)
+static void
+_text_style_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
- Evas_Object_Text *o;
+ Evas_Text_Style_Type *style = va_arg(*list, Evas_Text_Style_Type *);
+ const Evas_Object_Text *o = _pd;
+ *style = o->cur.style;
+}
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- return;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+EAPI void
+evas_object_text_shadow_color_set(Evas_Object *eo_obj, int r, int g, int b, int a)
+{
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return;
MAGIC_CHECK_END();
+ eo_do(eo_obj, evas_obj_text_shadow_color_set(r, g, b, a));
+}
+
+static void
+_text_shadow_color_set(Eo *eo_obj, void *_pd, va_list *list)
+{
+ int r = va_arg(*list, int);
+ int g = va_arg(*list, int);
+ int b = va_arg(*list, int);
+ int a = va_arg(*list, int);
+ Evas_Object_Text *o = _pd;
+
if ((o->cur.shadow.r == r) && (o->cur.shadow.g == g) &&
(o->cur.shadow.b == b) && (o->cur.shadow.a == a))
return;
@@ -990,29 +1123,28 @@ evas_object_text_shadow_color_set(Evas_Object *obj, int r, int g, int b, int a)
o->cur.shadow.b = b;
o->cur.shadow.a = a;
o->changed = 1;
- evas_object_change(obj);
+ Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
+ evas_object_change(eo_obj, obj);
}
EAPI void
-evas_object_text_shadow_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a)
+evas_object_text_shadow_color_get(const Evas_Object *eo_obj, int *r, int *g, int *b, int *a)
{
- Evas_Object_Text *o;
-
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- if (r) *r = 0;
- if (g) *g = 0;
- if (b) *b = 0;
- if (a) *a = 0;
- return;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
- if (r) *r = 0;
- if (g) *g = 0;
- if (b) *b = 0;
- if (a) *a = 0;
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return;
MAGIC_CHECK_END();
+ eo_do((Eo *)eo_obj, evas_obj_text_shadow_color_get(r, g, b, a));
+}
+
+static void
+_text_shadow_color_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *r = va_arg(*list, int *);
+ int *g = va_arg(*list, int *);
+ int *b = va_arg(*list, int *);
+ int *a = va_arg(*list, int *);
+ const Evas_Object_Text *o = _pd;
+
if (r) *r = o->cur.shadow.r;
if (g) *g = o->cur.shadow.g;
if (b) *b = o->cur.shadow.b;
@@ -1020,17 +1152,23 @@ evas_object_text_shadow_color_get(const Evas_Object *obj, int *r, int *g, int *b
}
EAPI void
-evas_object_text_glow_color_set(Evas_Object *obj, int r, int g, int b, int a)
+evas_object_text_glow_color_set(Evas_Object *eo_obj, int r, int g, int b, int a)
{
- Evas_Object_Text *o;
-
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- return;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return;
MAGIC_CHECK_END();
+ eo_do(eo_obj, evas_obj_text_glow_color_set(r, g, b, a));
+}
+
+static void
+_text_glow_color_set(Eo *eo_obj, void *_pd, va_list *list)
+{
+ int r = va_arg(*list, int);
+ int g = va_arg(*list, int);
+ int b = va_arg(*list, int);
+ int a = va_arg(*list, int);
+ Evas_Object_Text *o = _pd;
+
if ((o->cur.glow.r == r) && (o->cur.glow.g == g) &&
(o->cur.glow.b == b) && (o->cur.glow.a == a))
return;
@@ -1039,29 +1177,31 @@ evas_object_text_glow_color_set(Evas_Object *obj, int r, int g, int b, int a)
o->cur.glow.b = b;
o->cur.glow.a = a;
o->changed = 1;
- evas_object_change(obj);
+ Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
+ evas_object_change(eo_obj, obj);
}
EAPI void
-evas_object_text_glow_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a)
+evas_object_text_glow_color_get(const Evas_Object *eo_obj, int *r, int *g, int *b, int *a)
{
- Evas_Object_Text *o;
-
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- if (r) *r = 0;
- if (g) *g = 0;
- if (b) *b = 0;
- if (a) *a = 0;
- return;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
if (r) *r = 0;
if (g) *g = 0;
if (b) *b = 0;
if (a) *a = 0;
return;
MAGIC_CHECK_END();
+ eo_do((Eo *)eo_obj, evas_obj_text_glow_color_get(r, g, b, a));
+}
+
+static void
+_text_glow_color_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *r = va_arg(*list, int *);
+ int *g = va_arg(*list, int *);
+ int *b = va_arg(*list, int *);
+ int *a = va_arg(*list, int *);
+ const Evas_Object_Text *o = _pd;
if (r) *r = o->cur.glow.r;
if (g) *g = o->cur.glow.g;
if (b) *b = o->cur.glow.b;
@@ -1069,17 +1209,23 @@ evas_object_text_glow_color_get(const Evas_Object *obj, int *r, int *g, int *b,
}
EAPI void
-evas_object_text_glow2_color_set(Evas_Object *obj, int r, int g, int b, int a)
+evas_object_text_glow2_color_set(Evas_Object *eo_obj, int r, int g, int b, int a)
{
- Evas_Object_Text *o;
-
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- return;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return;
MAGIC_CHECK_END();
+ eo_do(eo_obj, evas_obj_text_glow2_color_set(r, g, b, a));
+}
+
+static void
+_text_glow2_color_set(Eo *eo_obj, void *_pd, va_list *list)
+{
+ int r = va_arg(*list, int);
+ int g = va_arg(*list, int);
+ int b = va_arg(*list, int);
+ int a = va_arg(*list, int);
+ Evas_Object_Text *o = _pd;
+
if ((o->cur.glow2.r == r) && (o->cur.glow2.g == g) &&
(o->cur.glow2.b == b) && (o->cur.glow2.a == a))
return;
@@ -1088,29 +1234,31 @@ evas_object_text_glow2_color_set(Evas_Object *obj, int r, int g, int b, int a)
o->cur.glow2.b = b;
o->cur.glow2.a = a;
o->changed = 1;
- evas_object_change(obj);
+ Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
+ evas_object_change(eo_obj, obj);
}
EAPI void
-evas_object_text_glow2_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a)
+evas_object_text_glow2_color_get(const Evas_Object *eo_obj, int *r, int *g, int *b, int *a)
{
- Evas_Object_Text *o;
-
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- if (r) *r = 0;
- if (g) *g = 0;
- if (b) *b = 0;
- if (a) *a = 0;
- return;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
if (r) *r = 0;
if (g) *g = 0;
if (b) *b = 0;
if (a) *a = 0;
return;
MAGIC_CHECK_END();
+ eo_do((Eo *)eo_obj, evas_obj_text_glow2_color_get(r, g, b, a));
+}
+
+static void
+_text_glow2_color_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *r = va_arg(*list, int *);
+ int *g = va_arg(*list, int *);
+ int *b = va_arg(*list, int *);
+ int *a = va_arg(*list, int *);
+ const Evas_Object_Text *o = _pd;
if (r) *r = o->cur.glow2.r;
if (g) *g = o->cur.glow2.g;
if (b) *b = o->cur.glow2.b;
@@ -1118,17 +1266,22 @@ evas_object_text_glow2_color_get(const Evas_Object *obj, int *r, int *g, int *b,
}
EAPI void
-evas_object_text_outline_color_set(Evas_Object *obj, int r, int g, int b, int a)
+evas_object_text_outline_color_set(Evas_Object *eo_obj, int r, int g, int b, int a)
{
- Evas_Object_Text *o;
-
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- return;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return;
MAGIC_CHECK_END();
+ eo_do(eo_obj, evas_obj_text_outline_color_set(r, g, b, a));
+}
+
+static void
+_text_outline_color_set(Eo *eo_obj, void *_pd, va_list *list)
+{
+ int r = va_arg(*list, int);
+ int g = va_arg(*list, int);
+ int b = va_arg(*list, int);
+ int a = va_arg(*list, int);
+ Evas_Object_Text *o = _pd;
if ((o->cur.outline.r == r) && (o->cur.outline.g == g) &&
(o->cur.outline.b == b) && (o->cur.outline.a == a))
return;
@@ -1137,29 +1290,31 @@ evas_object_text_outline_color_set(Evas_Object *obj, int r, int g, int b, int a)
o->cur.outline.b = b;
o->cur.outline.a = a;
o->changed = 1;
- evas_object_change(obj);
+ Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
+ evas_object_change(eo_obj, obj);
}
EAPI void
-evas_object_text_outline_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a)
+evas_object_text_outline_color_get(const Evas_Object *eo_obj, int *r, int *g, int *b, int *a)
{
- Evas_Object_Text *o;
-
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- if (r) *r = 0;
- if (g) *g = 0;
- if (b) *b = 0;
- if (a) *a = 0;
- return;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ)
if (r) *r = 0;
if (g) *g = 0;
if (b) *b = 0;
if (a) *a = 0;
return;
MAGIC_CHECK_END();
+ eo_do((Eo *)eo_obj, evas_obj_text_outline_color_get(r, g, b, a));
+}
+
+static void
+_text_outline_color_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *r = va_arg(*list, int *);
+ int *g = va_arg(*list, int *);
+ int *b = va_arg(*list, int *);
+ int *a = va_arg(*list, int *);
+ const Evas_Object_Text *o = _pd;
if (r) *r = o->cur.outline.r;
if (g) *g = o->cur.outline.g;
if (b) *b = o->cur.outline.b;
@@ -1167,26 +1322,27 @@ evas_object_text_outline_color_get(const Evas_Object *obj, int *r, int *g, int *
}
EAPI void
-evas_object_text_style_pad_get(const Evas_Object *obj, int *l, int *r, int *t, int *b)
+evas_object_text_style_pad_get(const Evas_Object *eo_obj, int *l, int *r, int *t, int *b)
{
- int sl = 0, sr = 0, st = 0, sb = 0;
- Evas_Object_Text *o;
-
- MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- if (l) *l = 0;
- if (r) *r = 0;
- if (t) *t = 0;
- if (b) *b = 0;
- return;
- MAGIC_CHECK_END();
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
if (l) *l = 0;
if (r) *r = 0;
if (t) *t = 0;
if (b) *b = 0;
return;
MAGIC_CHECK_END();
+ eo_do((Eo *)eo_obj, evas_obj_text_style_pad_get(l, r, t, b));
+}
+
+static void
+_text_style_pad_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *l = va_arg(*list, int *);
+ int *r = va_arg(*list, int *);
+ int *t = va_arg(*list, int *);
+ int *b = va_arg(*list, int *);
+ int sl = 0, sr = 0, st = 0, sb = 0;
+ const Evas_Object_Text *o = _pd;
/* use temps to be certain we have initialized values */
evas_text_style_pad_get(o->cur.style, &sl, &sr, &st, &sb);
if (l) *l = sl;
@@ -1360,10 +1516,9 @@ evas_text_style_pad_get(Evas_Text_Style_Type style, int *l, int *r, int *t, int
/* all nice and private */
static void
-evas_object_text_init(Evas_Object *obj)
+evas_object_text_init(Evas_Object *eo_obj)
{
- /* alloc text ob, setup methods and default values */
- obj->object_data = evas_object_text_new();
+ Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
/* set up default settings for this kind of object */
obj->cur.color.r = 255;
obj->cur.color.g = 255;
@@ -1379,55 +1534,45 @@ evas_object_text_init(Evas_Object *obj)
/* set up methods (compulsory) */
obj->func = &object_func;
obj->type = o_type;
-}
-
-static void *
-evas_object_text_new(void)
-{
- Evas_Object_Text *o;
+ Evas_Object_Text *o = eo_data_get(eo_obj, MY_CLASS);
/* alloc obj private data */
- EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_text", Evas_Object_Text, 8, NULL);
- o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Text);
- if (!o) return NULL;
- EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Text);
- o->magic = MAGIC_OBJ_TEXT;
o->prev = o->cur;
#ifdef BIDI_SUPPORT
o->bidi_par_props = evas_bidi_paragraph_props_new();
#endif
- return o;
}
static void
-evas_object_text_free(Evas_Object *obj)
+_destructor(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- Evas_Object_Text *o;
+ Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
+ evas_object_text_free(eo_obj, obj);
+ eo_do_super(eo_obj, eo_destructor());
+}
+
+static void
+evas_object_text_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
+{
+ Evas_Object_Text *o = eo_data_get(eo_obj, MY_CLASS);
- /* frees private object data. very simple here */
- o = (Evas_Object_Text *)(obj->object_data);
- MAGIC_CHECK(o, Evas_Object_Text, MAGIC_OBJ_TEXT);
- return;
- MAGIC_CHECK_END();
/* free obj */
if (o->items) _evas_object_text_items_clear(o);
if (o->cur.utf8_text) eina_stringshare_del(o->cur.utf8_text);
if (o->cur.font) eina_stringshare_del(o->cur.font);
if (o->cur.fdesc) evas_font_desc_unref(o->cur.fdesc);
if (o->cur.source) eina_stringshare_del(o->cur.source);
- if (o->font) evas_font_free(obj->layer->evas, o->font);
+ if (o->font) evas_font_free(obj->layer->evas->evas, o->font);
#ifdef BIDI_SUPPORT
evas_bidi_paragraph_props_unref(o->bidi_par_props);
#endif
- o->magic = 0;
- EVAS_MEMPOOL_FREE(_mp_obj, o);
}
static void
-evas_object_text_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y)
+evas_object_text_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y)
{
int i, j;
- Evas_Object_Text *o;
+ Evas_Object_Text *o = eo_data_get(eo_obj, MY_CLASS);
Evas_Object_Text_Item *it;
const char vals[5][5] =
{
@@ -1441,7 +1586,6 @@ evas_object_text_render(Evas_Object *obj, void *output, void *context, void *sur
int shad_dst, shad_sz, dx, dy, haveshad;
/* render object to surface with context, and offxet by x,y */
- o = (Evas_Object_Text *)(obj->object_data);
evas_text_style_pad_get(o->cur.style, &sl, NULL, &st, NULL);
ENFN->context_multiplier_unset(output, context);
ENFN->context_render_op_set(output, context, obj->cur.render_op);
@@ -1472,11 +1616,14 @@ evas_object_text_render(Evas_Object *obj, void *output, void *context, void *sur
#define COLOR_SET(object, sub, col) \
if (obj->cur.clipper)\
+ { \
+ Evas_Object_Protected_Data *cur_clipper = eo_data_get(obj->cur.clipper, EVAS_OBJ_CLASS); \
ENFN->context_color_set(output, context, \
- ((int)object->sub.col.r * ((int)obj->cur.clipper->cur.cache.clip.r + 1)) >> 8, \
- ((int)object->sub.col.g * ((int)obj->cur.clipper->cur.cache.clip.g + 1)) >> 8, \
- ((int)object->sub.col.b * ((int)obj->cur.clipper->cur.cache.clip.b + 1)) >> 8, \
- ((int)object->sub.col.a * ((int)obj->cur.clipper->cur.cache.clip.a + 1)) >> 8); \
+ ((int)object->sub.col.r * ((int)cur_clipper->cur.cache.clip.r + 1)) >> 8, \
+ ((int)object->sub.col.g * ((int)cur_clipper->cur.cache.clip.g + 1)) >> 8, \
+ ((int)object->sub.col.b * ((int)cur_clipper->cur.cache.clip.b + 1)) >> 8, \
+ ((int)object->sub.col.a * ((int)cur_clipper->cur.cache.clip.a + 1)) >> 8); \
+ } \
else\
ENFN->context_color_set(output, context, \
object->sub.col.r, \
@@ -1486,11 +1633,14 @@ evas_object_text_render(Evas_Object *obj, void *output, void *context, void *sur
#define COLOR_SET_AMUL(object, sub, col, amul) \
if (obj->cur.clipper) \
+ { \
+ Evas_Object_Protected_Data *cur_clipper = eo_data_get(obj->cur.clipper, EVAS_OBJ_CLASS); \
ENFN->context_color_set(output, context, \
- (((int)object->sub.col.r) * ((int)obj->cur.clipper->cur.cache.clip.r) * (amul)) / 65025, \
- (((int)object->sub.col.g) * ((int)obj->cur.clipper->cur.cache.clip.g) * (amul)) / 65025, \
- (((int)object->sub.col.b) * ((int)obj->cur.clipper->cur.cache.clip.b) * (amul)) / 65025, \
- (((int)object->sub.col.a) * ((int)obj->cur.clipper->cur.cache.clip.a) * (amul)) / 65025); \
+ (((int)object->sub.col.r) * ((int)cur_clipper->cur.cache.clip.r) * (amul)) / 65025, \
+ (((int)object->sub.col.g) * ((int)cur_clipper->cur.cache.clip.g) * (amul)) / 65025, \
+ (((int)object->sub.col.b) * ((int)cur_clipper->cur.cache.clip.b) * (amul)) / 65025, \
+ (((int)object->sub.col.a) * ((int)cur_clipper->cur.cache.clip.a) * (amul)) / 65025); \
+ } \
else \
ENFN->context_color_set(output, context, \
(((int)object->sub.col.r) * (amul)) / 255, \
@@ -1668,9 +1818,9 @@ evas_object_text_render(Evas_Object *obj, void *output, void *context, void *sur
}
static void
-evas_object_text_render_pre(Evas_Object *obj)
+evas_object_text_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
{
- Evas_Object_Text *o;
+ Evas_Object_Text *o = eo_data_get(eo_obj, MY_CLASS);
int is_v, was_v;
/* dont pre-render the obj twice! */
@@ -1681,39 +1831,39 @@ evas_object_text_render_pre(Evas_Object *obj)
elsewhere, decoding video etc.
Then when this is done the object needs to figure if it changed and
if so what and where and add the appropriate redraw rectangles */
- o = (Evas_Object_Text *)(obj->object_data);
/* if someone is clipping this obj - go calculate the clipper */
if (obj->cur.clipper)
{
+ Evas_Object_Protected_Data *clipper = eo_data_get(obj->cur.clipper, EVAS_OBJ_CLASS);
if (obj->cur.cache.clip.dirty)
- evas_object_clip_recalc(obj->cur.clipper);
- obj->cur.clipper->func->render_pre(obj->cur.clipper);
+ evas_object_clip_recalc(obj->cur.clipper, clipper);
+ clipper->func->render_pre(obj->cur.clipper, clipper);
}
/* now figure what changed and add draw rects
if it just became visible or invisible */
- is_v = evas_object_is_visible(obj);
- was_v = evas_object_was_visible(obj);
+ is_v = evas_object_is_visible(eo_obj, obj);
+ was_v = evas_object_was_visible(eo_obj, obj);
if (is_v != was_v)
{
evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes,
- obj, is_v, was_v);
+ eo_obj, is_v, was_v);
goto done;
}
if (obj->changed_map)
{
- evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
- obj);
+ evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
+ eo_obj, obj);
goto done;
}
/* its not visible - we accounted for it appearing or not so just abort */
if (!is_v) goto done;
/* clipper changed this is in addition to anything else for obj */
- evas_object_render_pre_clipper_change(&obj->layer->evas->clip_changes, obj);
+ evas_object_render_pre_clipper_change(&obj->layer->evas->clip_changes, eo_obj);
/* if we restacked (layer or just within a layer) and dont clip anyone */
if (obj->restack)
{
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
- obj);
+ eo_obj, obj);
goto done;
}
/* if it changed color */
@@ -1723,7 +1873,7 @@ evas_object_text_render_pre(Evas_Object *obj)
(obj->cur.color.a != obj->prev.color.a))
{
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
- obj);
+ eo_obj, obj);
goto done;
}
/* if it changed geometry - and obviously not visibility or color
@@ -1735,19 +1885,19 @@ evas_object_text_render_pre(Evas_Object *obj)
(obj->cur.geometry.h != obj->prev.geometry.h))
{
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
- obj);
+ eo_obj, obj);
goto done;
}
if (obj->cur.render_op != obj->prev.render_op)
{
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
- obj);
+ eo_obj, obj);
goto done;
}
if (obj->cur.scale != obj->prev.scale)
{
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
- obj);
+ eo_obj, obj);
goto done;
}
if (o->changed)
@@ -1774,64 +1924,57 @@ evas_object_text_render_pre(Evas_Object *obj)
((o->cur.glow2.a != o->prev.glow2.a)))
{
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
- obj);
+ eo_obj, obj);
goto done;
}
}
done:
evas_object_render_pre_effect_updates(&obj->layer->evas->clip_changes,
- obj, is_v, was_v);
+ eo_obj, is_v, was_v);
}
static void
-evas_object_text_render_post(Evas_Object *obj)
+evas_object_text_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj EINA_UNUSED)
{
- Evas_Object_Text *o;
+ Evas_Object_Text *o = eo_data_get(eo_obj, MY_CLASS);
/* this moves the current data to the previous state parts of the object
in whatever way is safest for the object. also if we don't need object
data anymore we can free it if the object deems this is a good idea */
- o = (Evas_Object_Text *)(obj->object_data);
/* remove those pesky changes */
- evas_object_clip_changes_clean(obj);
+ evas_object_clip_changes_clean(eo_obj);
/* move cur to prev safely for object data */
- evas_object_cur_prev(obj);
+ evas_object_cur_prev(eo_obj);
o->prev = o->cur;
o->changed = 0;
}
static unsigned int
-evas_object_text_id_get(Evas_Object *obj)
+evas_object_text_id_get(Evas_Object *eo_obj)
{
- Evas_Object_Text *o;
-
- o = (Evas_Object_Text *)(obj->object_data);
+ Evas_Object_Text *o = eo_data_get(eo_obj, MY_CLASS);
if (!o) return 0;
return MAGIC_OBJ_TEXT;
}
static unsigned int
-evas_object_text_visual_id_get(Evas_Object *obj)
+evas_object_text_visual_id_get(Evas_Object *eo_obj)
{
- Evas_Object_Text *o;
-
- o = (Evas_Object_Text *)(obj->object_data);
+ Evas_Object_Text *o = eo_data_get(eo_obj, MY_CLASS);
if (!o) return 0;
return MAGIC_OBJ_SHAPE;
}
static void *
-evas_object_text_engine_data_get(Evas_Object *obj)
+evas_object_text_engine_data_get(Evas_Object *eo_obj)
{
- Evas_Object_Text *o;
-
- o = (Evas_Object_Text *)(obj->object_data);
+ Evas_Object_Text *o = eo_data_get(eo_obj, MY_CLASS);
if (!o) return NULL;
return o->font;
}
static int
-evas_object_text_is_opaque(Evas_Object *obj __UNUSED__)
+evas_object_text_is_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED)
{
/* this returns 1 if the internal object data implies that the object is
currently fully opaque over the entire gradient it occupies */
@@ -1839,7 +1982,7 @@ evas_object_text_is_opaque(Evas_Object *obj __UNUSED__)
}
static int
-evas_object_text_was_opaque(Evas_Object *obj __UNUSED__)
+evas_object_text_was_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED)
{
/* this returns 1 if the internal object data implies that the object was
currently fully opaque over the entire gradient it occupies */
@@ -1847,13 +1990,12 @@ evas_object_text_was_opaque(Evas_Object *obj __UNUSED__)
}
static void
-evas_object_text_scale_update(Evas_Object *obj)
+evas_object_text_scale_update(Evas_Object *eo_obj)
{
- Evas_Object_Text *o;
+ Evas_Object_Text *o = eo_data_get(eo_obj, MY_CLASS);
int size;
const char *font;
- o = (Evas_Object_Text *)(obj->object_data);
font = eina_stringshare_add(o->cur.font);
size = o->cur.size;
if (o->cur.font) eina_stringshare_del(o->cur.font);
@@ -1861,46 +2003,46 @@ evas_object_text_scale_update(Evas_Object *obj)
o->prev.font = NULL;
o->cur.size = 0;
o->prev.size = 0;
- evas_object_text_font_set(obj, font, size);
+ evas_object_text_font_set(eo_obj, font, size);
}
void
-_evas_object_text_rehint(Evas_Object *obj)
+_evas_object_text_rehint(Evas_Object *eo_obj)
{
- Evas_Object_Text *o;
+ Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
+ Evas_Object_Text *o = eo_data_get(eo_obj, MY_CLASS);
int is, was;
- o = (Evas_Object_Text *)(obj->object_data);
if (!o->font) return;
- evas_font_load_hinting_set(obj->layer->evas, o->font,
+ evas_font_load_hinting_set(obj->layer->evas->evas, o->font,
obj->layer->evas->hinting);
- was = evas_object_is_in_output_rect(obj,
+ was = evas_object_is_in_output_rect(eo_obj, obj,
obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y, 1, 1);
/* DO II */
- _evas_object_text_recalc(obj);
+ _evas_object_text_recalc(eo_obj);
o->changed = 1;
- evas_object_change(obj);
- evas_object_clip_dirty(obj);
- evas_object_coords_recalc(obj);
- is = evas_object_is_in_output_rect(obj,
+ evas_object_change(eo_obj, obj);
+ evas_object_clip_dirty(eo_obj, obj);
+ evas_object_coords_recalc(eo_obj, obj);
+ is = evas_object_is_in_output_rect(eo_obj, obj,
obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y, 1, 1);
if ((is || was) && obj->cur.visible)
- evas_event_feed_mouse_move(obj->layer->evas,
+ evas_event_feed_mouse_move(obj->layer->evas->evas,
obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y,
obj->layer->evas->last_timestamp,
NULL);
- evas_object_inform_call_resize(obj);
+ evas_object_inform_call_resize(eo_obj);
}
static void
-_evas_object_text_recalc(Evas_Object *obj)
+_evas_object_text_recalc(Evas_Object *eo_obj)
{
- Evas_Object_Text *o;
+ Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
+ Evas_Object_Text *o = eo_data_get(eo_obj, MY_CLASS);
Eina_Unicode *text = NULL;
- o = (Evas_Object_Text *)(obj->object_data);
if (o->items) _evas_object_text_items_clear(o);
if (o->cur.utf8_text)
@@ -1909,7 +2051,7 @@ _evas_object_text_recalc(Evas_Object *obj)
if (!text) text = eina_unicode_strdup(EINA_UNICODE_EMPTY_STRING);
- _evas_object_text_layout(obj, o, text);
+ _evas_object_text_layout(eo_obj, o, text);
if (text) free(text);
@@ -1918,8 +2060,8 @@ _evas_object_text_recalc(Evas_Object *obj)
int w, h;
int l = 0, r = 0, t = 0, b = 0;
- w = _evas_object_text_horiz_advance_get(obj, o);
- h = _evas_object_text_vert_advance_get(obj, o);
+ w = _evas_object_text_horiz_advance_get(eo_obj, o);
+ h = _evas_object_text_vert_advance_get(eo_obj, o);
evas_text_style_pad_get(o->cur.style, &l, &r, &t, &b);
obj->cur.geometry.w = w + l + r;
obj->cur.geometry.h = h + t + b;
@@ -1936,3 +2078,89 @@ _evas_object_text_recalc(Evas_Object *obj)
}
}
+static void
+_class_constructor(Eo_Class *klass)
+{
+ const Eo_Op_Func_Description func_desc[] = {
+ EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
+ EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_DESTRUCTOR), _destructor),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_FONT_SOURCE_SET), _text_font_source_set),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_FONT_SOURCE_GET), _text_font_source_get),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_FONT_SET), _text_font_set),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_FONT_GET), _text_font_get),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_TEXT_SET), _text_text_set),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_BIDI_DELIMITERS_SET), _text_bidi_delimiters_set),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_BIDI_DELIMITERS_GET), _text_bidi_delimiters_get),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_TEXT_GET), _text_text_get),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_DIRECTION_GET), _text_direction_get),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_ASCENT_GET), _text_ascent_get),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_DESCENT_GET), _text_descent_get),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_MAX_ASCENT_GET), _text_max_ascent_get),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_MAX_DESCENT_GET), _text_max_descent_get),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_INSET_GET), _text_inset_get),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_HORIZ_ADVANCE_GET), _text_horiz_advance_get),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_VERT_ADVANCE_GET), _text_vert_advance_get),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_CHAR_POS_GET), _text_char_pos_get),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_LAST_UP_TO_POS), _text_last_up_to_pos),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_CHAR_COORDS_GET), _text_char_coords_get),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_STYLE_SET), _text_style_set),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_STYLE_GET), _text_style_get),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_SHADOW_COLOR_SET), _text_shadow_color_set),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_SHADOW_COLOR_GET), _text_shadow_color_get),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_GLOW_COLOR_SET), _text_glow_color_set),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_GLOW_COLOR_GET), _text_glow_color_get),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_GLOW2_COLOR_SET), _text_glow2_color_set),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_GLOW2_COLOR_GET), _text_glow2_color_get),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_OUTLINE_COLOR_SET), _text_outline_color_set),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_OUTLINE_COLOR_GET), _text_outline_color_get),
+ EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_STYLE_PAD_GET), _text_style_pad_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_FONT_SOURCE_SET, "Set the font (source) file to be used on a given text object."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_FONT_SOURCE_GET, "Get the font file's path which is being used on a given text"),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_FONT_SET, "Set the font family and size on a given text object."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_FONT_GET, "Retrieve the font family and size in use on a given text object."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_TEXT_SET, "Sets the text string to be displayed by the given text object."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_BIDI_DELIMITERS_SET, "Sets the BiDi delimiters used in the text."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_BIDI_DELIMITERS_GET, "Gets the BiDi delimiters used in the text."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_TEXT_GET, "Retrieves the text string currently being displayed by the given text object."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_DIRECTION_GET, "Retrieves the direction of the text currently being displayed in the text object."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_ASCENT_GET, "Get the ascent of the text."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_DESCENT_GET, "Get the descent of the text."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_MAX_ASCENT_GET, "Get the max ascent of the text."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_MAX_DESCENT_GET, "Get the max descent of the text."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_INSET_GET, "Get the inset of the text."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_HORIZ_ADVANCE_GET, "Get the horizontal advance of the text."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_VERT_ADVANCE_GET, "Get the vertical advance of the text."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_CHAR_POS_GET, "Retrieve position and dimension information of a character within a text Evas_Object."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_LAST_UP_TO_POS, "Retrieves the logical position of the last char in the text up to the pos given."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_CHAR_COORDS_GET, "? evas_object_text_char_coords_get"),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_STYLE_SET, "Sets the style to apply on the given text object."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_STYLE_GET, "Retrieves the style on use on the given text object."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_SHADOW_COLOR_SET, "Sets the shadow color for the given text object."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_SHADOW_COLOR_GET, "Retrieves the shadow color for the given text object."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_GLOW_COLOR_SET, "Sets the glow color for the given text object."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_GLOW_COLOR_GET, "Retrieves the glow color for the given text object."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_GLOW2_COLOR_SET, "Sets the 'glow 2' color for the given text object."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_GLOW2_COLOR_GET, "Retrieves the 'glow 2' color for the given text object."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_OUTLINE_COLOR_SET, "Sets the outline color for the given text object."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_OUTLINE_COLOR_GET, "Retrieves the outline color for the given text object."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_STYLE_PAD_GET, "Gets the text style pad of a text object."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ "Evas_Object_Text",
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&EVAS_OBJ_TEXT_BASE_ID, op_desc, EVAS_OBJ_TEXT_SUB_ID_LAST),
+ NULL,
+ sizeof(Evas_Object_Text),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(evas_object_text_class_get, &class_desc, EVAS_OBJ_CLASS, NULL);
+