2015-03-31 21:58 GMT+02:00 Cedric BAIL <[email protected]>:

> cedric pushed a commit to branch master.
>
>
> http://git.enlightenment.org/core/efl.git/commit/?id=11a4e1ae83e74b55aef0fe42e93d7d0651085dfd
>
> commit 11a4e1ae83e74b55aef0fe42e93d7d0651085dfd
> Author: Cedric BAIL <[email protected]>
> Date:   Tue Mar 31 21:57:23 2015 +0200
>
>     edje: add edje_mmap_color_class_iterator_new().
>
>     This function make it possible to list the Color class of a specific
> Edje file.
> ---
>  src/lib/edje/Edje_Common.h | 10 ++++++++-
>  src/lib/edje/edje_util.c   | 56
> ++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 65 insertions(+), 1 deletion(-)
>
> diff --git a/src/lib/edje/Edje_Common.h b/src/lib/edje/Edje_Common.h
> index 850a9f8..db91730 100644
> --- a/src/lib/edje/Edje_Common.h
> +++ b/src/lib/edje/Edje_Common.h
> @@ -1263,7 +1263,7 @@ EAPI Eina_List   *edje_color_class_list
>  (void);
>  /**
>   * @brief Iterate over all the active class of an application.
>   *
> - * @return Return an iterator of Edje_Color_Class of the currently active
> color class
> + * @return an iterator of Edje_Color_Class of the currently active color
> class
>   *
>   * This function only iterate over the Edje_Color_Class in use by
>   * an application.
> @@ -1271,6 +1271,14 @@ EAPI Eina_List   *edje_color_class_list
>  (void);
>  EAPI Eina_Iterator *edje_color_class_active_iterator_new(void);
>
>  /**
> + * @brief Iterate over all the color class provided by an Edje file.
> + *
> + * @return an iterator of Edje_Color_Class provided by the Edje file.
> + */
> +EAPI Eina_Iterator *edje_mmap_color_class_iterator_new(Eina_File *f)
>


This new API seems quite "alien" to me...
2 questions:
* do we really need the _mmap_ part in the name?
* why the param is an Eina_File? I cannot remember of other edje api like
this,
all the other funcs that access the whole edj use the a char*






> +
> +
> +/**
>   * @}
>   */
>
> diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
> index a76f922..9410a0a 100644
> --- a/src/lib/edje/edje_util.c
> +++ b/src/lib/edje/edje_util.c
> @@ -897,6 +897,62 @@ edje_object_color_class_del(Evas_Object *obj, const
> char *color_class)
>     _edje_emit(ed, "color_class,del", color_class);
>  }
>
> +typedef struct _Edje_File_Color_Class_Iterator
> Edje_File_Color_Class_Iterator;
> +struct _Edje_File_Color_Class_Iterator
> +{
> +   Edje_Active_Color_Class_Iterator it;
> +
> +   Edje_File *edf;
> +};
> +
> +static void *
> +_edje_mmap_color_class_iterator_container(Eina_Iterator *it)
> +{
> +   Edje_File_Color_Class_Iterator *et = (void*) it;
> +
> +   return et->edf->f;
> +}
> +
> +static void
> +_edje_mmap_color_class_iterator_free(Eina_Iterator *it)
> +{
> +   Edje_File_Color_Class_Iterator *et = (void*) it;
> +
> +   eina_iterator_free(et->it.classes);
> +   _edje_cache_file_unref(et->edf);
> +   EINA_MAGIC_SET(&et->it.iterator, 0);
> +   free(et);
> +}
> +
> +EAPI Eina_Iterator *
> +edje_mmap_color_class_iterator_new(Eina_File *f)
> +{
> +   Edje_File_Color_Class_Iterator *it;
> +   Edje_File *edf;
> +   int error_ret;
> +
> +   edf = _edje_cache_file_coll_open(f, NULL, &error_ret, NULL, NULL);
> +   if (!edf) return NULL;
> +
> +   it = calloc(1, sizeof (Edje_File_Color_Class_Iterator));
> +   if (!it) goto on_error;
> +
> +   EINA_MAGIC_SET(&it->it.iterator, EINA_MAGIC_ITERATOR);
> +   it->edf = edf;
> +   it->it.classes = eina_hash_iterator_tuple_new(edf->color_hash);
> +
> +   it->it.iterator.version = EINA_ITERATOR_VERSION;
> +   it->it.iterator.next = _edje_color_class_active_iterator_next;
> +   it->it.iterator.get_container =
> _edje_mmap_color_class_iterator_container;
> +   it->it.iterator.free = _edje_mmap_color_class_iterator_free;
> +
> +   return &it->it.iterator;
> +
> + on_error:
> +   _edje_cache_file_unref(edf);
> +   return NULL;
> +}
> +
>  EAPI Eina_Bool
>  edje_text_class_set(const char *text_class, const char *font,
> Evas_Font_Size size)
>  {
>
> --
>
>
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to