summaryrefslogtreecommitdiff
path: root/src/lib/edje/edje_edit.c
diff options
context:
space:
mode:
authorVyacheslav Reutskiy <v.reutskiy@samsung.com>2013-12-19 15:33:53 +0900
committerCedric BAIL <cedric.bail@samsung.com>2013-12-19 15:53:27 +0900
commit811c97eabb72f001d0cdb971c5cd9df54700b39c (patch)
treef0f32a01bb4e33f32685e3d46cc65a1aad3abf80 /src/lib/edje/edje_edit.c
parent0ad1dfe4e596aeb194b205e63a771d26279a1846 (diff)
edje: edje_edit - adding getter and setter for text source
This commit will add API for working with text source. There are two functions will be added: 1. edje_edit_state_text_source_get 2. edje_edit_state_text_source_set Reviewers: cedric, seoz, raster CC: cedric Differential Revision: https://phab.enlightenment.org/D389 Signed-off-by: Cedric BAIL <cedric.bail@samsung.com>
Diffstat (limited to '')
-rw-r--r--src/lib/edje/edje_edit.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index 6c8f19a50f..edf558f138 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -4652,6 +4652,46 @@ edje_edit_part_effect_set(Evas_Object *obj, const char *part, Edje_Text_Effect e
4652 return EINA_TRUE; 4652 return EINA_TRUE;
4653} 4653}
4654 4654
4655EAPI const char *
4656edje_edit_state_text_source_get(Evas_Object *obj, const char *part, const char *state, double value)
4657{
4658 Edje_Real_Part *rel;
4659
4660 GET_PD_OR_RETURN(NULL);
4661
4662 if ((rp->part->type == EDJE_PART_TYPE_TEXT) ||
4663 (rp->part->type == EDJE_PART_TYPE_TEXTBLOCK))
4664 {
4665 Edje_Part_Description_Text *txt;
4666 txt = (Edje_Part_Description_Text *) pd;
4667 if (txt->text.id_text_source == -1) return NULL;
4668 rel = ed->table_parts[txt->text.id_text_source % ed->table_parts_size];
4669 if (rel->part->name) return eina_stringshare_add(rel->part->name);
4670 }
4671
4672 return NULL;
4673}
4674
4675EAPI Eina_Bool
4676edje_edit_state_text_source_set(Evas_Object *obj, const char *part, const char *state, double value, const char *source)
4677{
4678 Edje_Part_Description_Text *txt;
4679 int id_text_source;
4680 GET_PD_OR_RETURN(EINA_FALSE);
4681 if (!source) return EINA_FALSE;
4682
4683 if ((rp->part->type != EDJE_PART_TYPE_TEXT) ||
4684 (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK))
4685 return EINA_FALSE;
4686
4687 txt = (Edje_Part_Description_Text *) pd;
4688 id_text_source = _edje_part_id_find(ed, source);
4689 txt->text.id_text_source = id_text_source;
4690
4691 /* need to recalc, because the source part can has a text */
4692 edje_object_calc_force(obj);
4693 return EINA_TRUE;
4694}
4655/****************/ 4695/****************/
4656/* IMAGES API */ 4696/* IMAGES API */
4657/****************/ 4697/****************/