Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src


Modified Files:
        ewl_image.c ewl_image.h 


Log Message:
Add parameters for setting the group for loading edjes as images.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_image.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -3 -r1.38 -r1.39
--- ewl_image.c 26 Feb 2004 05:38:34 -0000      1.38
+++ ewl_image.c 20 Apr 2004 20:28:05 -0000      1.39
@@ -8,7 +8,7 @@
  * @return Returns a pointer to a new image widget on success, NULL on failure.
  * @brief Load an image widget with specified image contents
  */
-Ewl_Widget     *ewl_image_new(char *i)
+Ewl_Widget     *ewl_image_new(char *i, char *k)
 {
        Ewl_Image      *image;
 
@@ -18,7 +18,7 @@
        if (!image)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ewl_image_init(image, i);
+       ewl_image_init(image, i, k);
 
        DRETURN_PTR(EWL_WIDGET(image), DLEVEL_STABLE);
 }
@@ -31,7 +31,7 @@
  *
  * Sets the fields and callbacks of @a i to their default values.
  */
-void ewl_image_init(Ewl_Image * i, char *path)
+void ewl_image_init(Ewl_Image * i, char *path, char *key)
 {
        Ewl_Widget     *w;
 
@@ -61,7 +61,7 @@
        i->sw = 1.0;
        i->sh = 1.0;
 
-       ewl_image_set_file(i, path);
+       ewl_image_set_file(i, path, key);
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
@@ -74,7 +74,7 @@
  *
  * Set the image displayed by @a i to the one found at the path @a im.
  */
-void ewl_image_set_file(Ewl_Image * i, char *im)
+void ewl_image_set_file(Ewl_Image * i, char *im, char *key)
 {
        int             old_type;
        Ewl_Widget     *w;
@@ -88,6 +88,7 @@
        emb = ewl_embed_find_by_widget(w);
 
        IF_FREE(i->path);
+       IF_FREE(i->key);
 
        /*
         * Determine the type of image to be loaded.
@@ -96,6 +97,8 @@
        if (im) {
                i->type = ewl_image_get_type(im);
                i->path = strdup(im);
+               if (key)
+                       i->key = strdup(key);
        }
        else
                i->type = EWL_IMAGE_TYPE_NORMAL;
@@ -245,7 +248,8 @@
                        return;
 
                if (i->path)
-                       edje_object_file_set(i->image, i->path, "EWL");
+                       edje_object_file_set(i->image, i->path,
+                                            (i->key ? i->key : "EWL"));
 
        } else {
                i->image = evas_object_image_add(emb->evas);
@@ -253,7 +257,8 @@
                        return;
 
                if (i->path)
-                       evas_object_image_file_set(i->image, i->path, NULL);
+                       edje_object_file_set(i->image, i->path,
+                                            (i->key ? i->key : "EWL"));
        }
 
        evas_object_layer_set(i->image, ewl_widget_get_layer_sum(w));
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_image.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- ewl_image.h 27 Jan 2004 06:08:35 -0000      1.19
+++ ewl_image.h 20 Apr 2004 20:28:07 -0000      1.20
@@ -35,14 +35,15 @@
        Ewl_Image_Type  type;
        Evas_Object    *image;
        char           *path;
+       char           *key;
        char            proportional;
        int             ow, oh;
        double          sw, sh;
 };
 
-Ewl_Widget     *ewl_image_new(char *i);
-void            ewl_image_init(Ewl_Image * i, char *path);
-void            ewl_image_set_file(Ewl_Image * i, char *im);
+Ewl_Widget     *ewl_image_new(char *i, char *k);
+void            ewl_image_init(Ewl_Image * i, char *path, char *key);
+void            ewl_image_set_file(Ewl_Image * i, char *im, char *key);
 void            ewl_image_set_proportional(Ewl_Image * i, char p);
 void           ewl_image_scale(Ewl_Image *i, double wp, double hp);
 void           ewl_image_scale_to(Ewl_Image *i, int w, int h);




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to