Just to be curious...why you need this function? for what you use it?
Dave

2009/7/13 Enlightenment SVN <[email protected]>

> Log:
>  Created new function edje_edit_image_data_add().
>
>  Now it's possible to add an image that is already inside the eet (with a
>  default key name) to the edje image collection.
>
>
> Author:       antognolli
> Date:         2009-07-13 12:17:35 -0700 (Mon, 13 Jul 2009)
> New Revision: 41320
>
> Modified:
>  trunk/edje/src/lib/Edje_Edit.h trunk/edje/src/lib/edje_edit.c
>
> Modified: trunk/edje/src/lib/Edje_Edit.h
> ===================================================================
> --- trunk/edje/src/lib/Edje_Edit.h      2009-07-13 11:55:49 UTC (rev 41319)
> +++ trunk/edje/src/lib/Edje_Edit.h      2009-07-13 19:17:35 UTC (rev 41320)
> @@ -1575,6 +1575,21 @@
>    const char* path        ///< The name of the image file to include in
> the edje
>  );
>
> +/**Add an image entry to the image collection
> + *
> + * This function adds the given image entry to the edje image collection.
> The
> + * image needs to be inside the eet already, with key name "images/id".
> After
> + * you have to create a new image_part that use this image, referring to
> it as
> + * "name". Note that all the parts in the edje share the same image
> collection,
> + * thus you can/must use the same image for different part.
> + */
> +EAPI unsigned char        /// @return TRUE on success or FALSE on failure
> +edje_edit_image_data_add(
> +   Evas_Object *obj,      ///< The edje object
> +   const char *name,      ///< The image entry name
> +   int id                 ///< The image id
> +);
> +
>  /**Get normal image name for a given part state. Remember to free the
> returned string using edje_edit_string_free().*/
>  EAPI const char *          ///@return The name of the image used by state
>  edje_edit_state_image_get(
>
> Modified: trunk/edje/src/lib/edje_edit.c
> ===================================================================
> --- trunk/edje/src/lib/edje_edit.c      2009-07-13 11:55:49 UTC (rev 41319)
> +++ trunk/edje/src/lib/edje_edit.c      2009-07-13 19:17:35 UTC (rev 41320)
> @@ -3443,6 +3443,53 @@
>    return 1;
>  }
>
> +EAPI unsigned char
> +edje_edit_image_data_add(Evas_Object *obj, const char *name, int id)
> +{
> +   Eina_List *l;
> +   Edje_Image_Directory_Entry *de;
> +   Edje_Image_Directory_Entry *i, *t;
> +   int free_id = 0;
> +
> +   GET_ED_OR_RETURN(0);
> +
> +   if (!name) return 0;
> +   if (!ed->file) return 0;
> +   if (!ed->path) return 0;
> +
> +   /* Create Image_Directory if not exist */
> +   if (!ed->file->image_dir)
> +     ed->file->image_dir = mem_alloc(sizeof(Edje_Image_Directory));
> +
> +   /* Loop trough image directory to find if image exist */
> +   t = NULL;
> +   EINA_LIST_FOREACH(ed->file->image_dir->entries, l, i)
> +     {
> +       if (!i) return 0;
> +       if (i->id == id) t = i;
> +     }
> +
> +   /* Create Image Entry */
> +   if (!t)
> +     de = mem_alloc(sizeof(Edje_Image_Directory_Entry));
> +   else
> +     {
> +       de = t;
> +       free(de->entry);
> +     }
> +   de->entry = mem_strdup(name);
> +   de->id = id;
> +   de->source_type = 1;
> +   de->source_param = 1;
> +
> +   /* Add image to Image Directory */
> +   if (!t)
> +     ed->file->image_dir->entries =
> +       eina_list_append(ed->file->image_dir->entries, de);
> +
> +   return 1;
> +}
> +
>  EAPI int
>  edje_edit_image_id_get(Evas_Object *obj, const char *image_name)
>  {
>
>
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> enlightenment-svn mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
>
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to