Edje textblock: Added edje_object_part_text_style_user_set/get

That correspond to the new textblock functions.

SVN revision: 67474
This commit is contained in:
Tom Hacohen 2012-01-23 16:10:27 +00:00
parent 98c61bfe6c
commit cc198996bc
3 changed files with 71 additions and 0 deletions

View File

@ -291,3 +291,8 @@
* Fix the ability to change the edje file source of an edje object
inside a callback - it worked but you couldn't swallow/set text etc.
2012-01-03 Tom Hacohen (TAsn)
* Entry: Added edje_object_part_text_style_user_set/get that'll use
the new corresponding textblock functions.

View File

@ -2447,6 +2447,33 @@ EAPI Eina_Bool edje_object_part_text_set (Evas_Object *obj, const c
*/
EAPI const char *edje_object_part_text_get (const Evas_Object *obj, const char *part);
/**
* @brief Set the style of the
*
* @param obj A valid Evas_Object handle
* @param part The part name
* @param style The style to set (textblock conventions).
*
* This function sets the style associated with the textblock part.
*
* @since 1.2.0
*/
EAPI void edje_object_part_text_style_user_set(Evas_Object *obj, const char *part, const char *style);
/**
* @brief Return the text of the object part.
*
* @param obj A valid Evas_Object handle
* @param part The part name
*
* @return The text string
*
* This function returns the style associated with the textblock part.
*
* @since 1.2.0
*/
EAPI const char *edje_object_part_text_style_user_get(Evas_Object *obj, const char *part);
/**
* @brief Sets the raw (non escaped) text for an object part.
*

View File

@ -1058,6 +1058,45 @@ _edje_object_part_text_raw_append(Evas_Object *obj, Edje_Real_Part *rp, const ch
return EINA_TRUE;
}
EAPI void
edje_object_part_text_style_user_set(Evas_Object *obj, const char *part,
const char *style)
{
Edje *ed;
Edje_Real_Part *rp;
Evas_Textblock_Style *ts;
ed = _edje_fetch(obj);
if ((!ed) || (!part) || (!style)) return;
rp = _edje_real_part_recursive_get(ed, (char *)part);
if (!rp) return;
if (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) return;
ts = evas_textblock_style_new();
evas_textblock_style_set(ts, style);
evas_object_textblock_style_user_set(rp->object, ts);
}
EAPI const char *
edje_object_part_text_style_user_get(Evas_Object *obj, const char *part)
{
Edje *ed;
Edje_Real_Part *rp;
const Evas_Textblock_Style *ts;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return NULL;
rp = _edje_real_part_recursive_get(ed, (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);
if (ts)
return evas_textblock_style_get(ts);
else
return NULL;
}
EAPI Eina_Bool
edje_object_part_text_set(Evas_Object *obj, const char *part, const char *text)
{