Edje_Edit: ability to insert "after" program into specific position

API looks like this:
> edje_edit_program_after_insert_at
This commit is contained in:
Vitalii Vorobiov 2016-02-18 17:10:24 +00:00
parent e2051e334b
commit 2f6cf2c74f
2 changed files with 45 additions and 0 deletions

View File

@ -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.

View File

@ -9957,6 +9957,37 @@ edje_edit_program_after_add(Evas_Object *obj, const char *prog, const char *afte
return EINA_TRUE;
}
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)
{