From: Vitalii Vorobiov Date: Thu, 18 Feb 2016 17:10:24 +0000 (+0000) Subject: Edje_Edit: ability to insert "after" program into specific position X-Git-Tag: upstream/1.20.0~7410 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2f6cf2c74f76df1a093090b16735193a4eae30c5;p=platform%2Fupstream%2Fefl.git Edje_Edit: ability to insert "after" program into specific position API looks like this: > edje_edit_program_after_insert_at --- diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h index dc40eee..08b2132 100644 --- a/src/lib/edje/Edje_Edit.h +++ b/src/lib/edje/Edje_Edit.h @@ -6026,6 +6026,20 @@ EAPI Eina_List * edje_edit_program_afters_get(Evas_Object *obj, const char *prog */ EAPI Eina_Bool edje_edit_program_after_add(Evas_Object *obj, const char *prog, const char *after); +/** Add a new program name into specific place in list of 'afters' in the given program. + * + * All the programs listed in 'afters' will be executed after program execution. + * + * @param obj Object being edited. + * @param prog The name of the program that contains the list of afters + * @param after The name of another program to add to the afters list + * @param place Specific place for after to be inserted into. Note that if place is greater than total number of afters then it would append to the end of list + * + * @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise. + */ +EAPI Eina_Bool +edje_edit_program_after_insert_at(Evas_Object *obj, const char *prog, const char *after, int place); + /** Delete the given program from the list of 'afters' of the program. * * @param obj Object being edited. diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index baf0a20..2c6e46a 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -9958,6 +9958,37 @@ edje_edit_program_after_add(Evas_Object *obj, const char *prog, const char *afte } EAPI Eina_Bool +edje_edit_program_after_insert_at(Evas_Object *obj, const char *prog, const char *after, int place) +{ + Edje_Program *af; + Edje_Program_After *a; + Eina_List *l; + + GET_EPR_OR_RETURN(EINA_FALSE); + + if (place < 0) + return EINA_FALSE; + + af = _edje_program_get_byname(obj, after); + if (!af) return EINA_FALSE; + + a = _alloc(sizeof(Edje_Program_After)); + if (!a) return EINA_FALSE; + + a->id = af->id; + + if (place >= eina_list_count(epr->after)) + epr->after = eina_list_append(epr->after, a); + else + { + l = eina_list_nth_list(epr->after, place); + epr->after = eina_list_prepend_relative_list(epr->after, a, l); + } + + return EINA_TRUE; +} + +EAPI Eina_Bool edje_edit_program_after_del(Evas_Object *obj, const char *prog, const char *after) { Edje_Program *af;