furrymyad pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=2f6cf2c74f76df1a093090b16735193a4eae30c5

commit 2f6cf2c74f76df1a093090b16735193a4eae30c5
Author: Vitalii Vorobiov <vi.vorob...@samsung.com>
Date:   Thu Feb 18 17:10:24 2016 +0000

    Edje_Edit: ability to insert "after" program into specific position
    
    API looks like this:
    > edje_edit_program_after_insert_at
---
 src/lib/edje/Edje_Edit.h | 14 ++++++++++++++
 src/lib/edje/edje_edit.c | 31 +++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+)

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;

-- 


Reply via email to