aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/lib/elm_color_class.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-04-05 16:02:08 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-04-05 16:26:22 -0400
commit2b03eb5a09d95a1839db45bda66b24fa9fd0277a (patch)
tree83696f178bf987f699f9fe5f851df6b90c3f7ed7 /legacy/elementary/src/lib/elm_color_class.c
parentcolorclass: add subsystem for remotely editing colorclasses over dbus (diff)
downloadefl-2b03eb5a09d95a1839db45bda66b24fa9fd0277a.tar.gz
colorclass: add util function for listing color classes out of an open edje file
Diffstat (limited to 'legacy/elementary/src/lib/elm_color_class.c')
-rw-r--r--legacy/elementary/src/lib/elm_color_class.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/legacy/elementary/src/lib/elm_color_class.c b/legacy/elementary/src/lib/elm_color_class.c
index e34c051dce..845d2306dd 100644
--- a/legacy/elementary/src/lib/elm_color_class.c
+++ b/legacy/elementary/src/lib/elm_color_class.c
@@ -703,3 +703,29 @@ elm_color_class_list_cb_set(Elm_Color_Class_List_Cb cb)
{
list_cb = cb;
}
+
+EAPI Eina_List *
+elm_color_class_util_edje_file_list(Eina_File *f)
+{
+ Edje_Color_Class *ecc, *ecc2;
+ Eina_Iterator *it;
+ Eina_List *ret = NULL;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(f, NULL);
+
+ it = edje_mmap_color_class_iterator_new(f);
+ if (!it) return NULL;
+ EINA_ITERATOR_FOREACH(it, ecc)
+ {
+ ecc2 = malloc(sizeof(Edje_Color_Class));
+ memcpy(ecc2, ecc, sizeof(Edje_Color_Class));
+ ecc2->name = eina_stringshare_add(ecc->name);
+ if (tl_cb)
+ ecc2->desc = eina_stringshare_add(tl_cb((char*)ecc->desc));
+ else
+ ecc2->desc = eina_stringshare_add(ecc->desc);
+ ret = eina_list_append(ret, ecc2);
+ }
+ eina_iterator_free(it);
+ return ret;
+}