From 4a98f4360a5dadbad5497dce8586d30928b3dbfa Mon Sep 17 00:00:00 2001 From: tasn Date: Wed, 7 Mar 2012 14:03:43 +0000 Subject: [PATCH] Edje entry: Replaced style_user_set/get with push/pop/peek. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@68955 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- ChangeLog | 6 ++++++ src/lib/Edje.h | 14 ++++++++++++-- src/lib/edje_util.c | 23 +++++++++++++++++++---- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3dfcc76..f31d28e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -376,3 +376,9 @@ * Entry: Added double click and triple click. Double click selects a word. Triple click selects a line. + +2012-03-07 Tom Hacohen (TAsn) + + * Entry: Replaced edje_object_part_text_style_user_set/get + with edje_object_part_text_style_user_set/get to correspond to + textblock's recent changes. diff --git a/src/lib/Edje.h b/src/lib/Edje.h index 107a19e..45a6461 100644 --- a/src/lib/Edje.h +++ b/src/lib/Edje.h @@ -2481,7 +2481,7 @@ EAPI const char *edje_object_part_text_get (const Evas_Object *obj, c * * @since 1.2.0 */ -EAPI void edje_object_part_text_style_user_set(Evas_Object *obj, const char *part, const char *style); +EAPI void edje_object_part_text_style_user_push(Evas_Object *obj, const char *part, const char *style); /** * @brief Return the text of the object part. @@ -2495,7 +2495,17 @@ EAPI void edje_object_part_text_style_user_set(Evas_Object *obj, const char *par * * @since 1.2.0 */ -EAPI const char *edje_object_part_text_style_user_get(Evas_Object *obj, const char *part); +EAPI const char *edje_object_part_text_style_user_peek(const Evas_Object *obj, const char *part); + +/** + * @brief Delete the top style form the user style stack. + * + * @param obj A valid Evas_Object handle + * @param part The part name + * + * @since 1.2.0 + */ +EAPI void edje_object_part_text_style_user_pop(Evas_Object *obj, const char *part); /** * @brief Sets the raw (non escaped) text for an object part. diff --git a/src/lib/edje_util.c b/src/lib/edje_util.c index f844e78..31183e1 100644 --- a/src/lib/edje_util.c +++ b/src/lib/edje_util.c @@ -1059,7 +1059,7 @@ _edje_object_part_text_raw_append(Evas_Object *obj, Edje_Real_Part *rp, const ch } EAPI void -edje_object_part_text_style_user_set(Evas_Object *obj, const char *part, +edje_object_part_text_style_user_push(Evas_Object *obj, const char *part, const char *style) { Edje *ed; @@ -1074,12 +1074,27 @@ edje_object_part_text_style_user_set(Evas_Object *obj, const char *part, ts = evas_textblock_style_new(); evas_textblock_style_set(ts, style); - evas_object_textblock_style_user_set(rp->object, ts); + evas_object_textblock_style_user_push(rp->object, ts); evas_textblock_style_free(ts); } +EAPI void +edje_object_part_text_style_user_pop(Evas_Object *obj, const char *part) +{ + Edje *ed; + Edje_Real_Part *rp; + + ed = _edje_fetch(obj); + if ((!ed) || (!part)) return; + rp = _edje_real_part_recursive_get(ed, part); + if (!rp) return; + if (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) return; + + evas_object_textblock_style_user_pop(rp->object); +} + EAPI const char * -edje_object_part_text_style_user_get(Evas_Object *obj, const char *part) +edje_object_part_text_style_user_peek(const Evas_Object *obj, const char *part) { Edje *ed; Edje_Real_Part *rp; @@ -1091,7 +1106,7 @@ edje_object_part_text_style_user_get(Evas_Object *obj, const char *part) if (!rp) return NULL; if (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) return NULL; - ts = evas_object_textblock_style_user_get(rp->object); + ts = evas_object_textblock_style_user_peek(rp->object); if (ts) return evas_textblock_style_get(ts); else -- 2.7.4