From ebc6c8d0719e992c5393a95781295f72159ac8f6 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 7 Mar 2012 14:03:43 +0000 Subject: [PATCH] Edje entry: Replaced style_user_set/get with push/pop/peek. SVN revision: 68955 --- legacy/edje/ChangeLog | 6 ++++++ legacy/edje/src/lib/Edje.h | 14 ++++++++++++-- legacy/edje/src/lib/edje_util.c | 23 +++++++++++++++++++---- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/legacy/edje/ChangeLog b/legacy/edje/ChangeLog index 3dfcc76b27..f31d28ea77 100644 --- a/legacy/edje/ChangeLog +++ b/legacy/edje/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/legacy/edje/src/lib/Edje.h b/legacy/edje/src/lib/Edje.h index 107a19e852..45a6461d7d 100644 --- a/legacy/edje/src/lib/Edje.h +++ b/legacy/edje/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/legacy/edje/src/lib/edje_util.c b/legacy/edje/src/lib/edje_util.c index f844e78b91..31183e152f 100644 --- a/legacy/edje/src/lib/edje_util.c +++ b/legacy/edje/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