Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/modules/engines/xrender_x11


Modified Files:
        evas_engine.c evas_engine.h evas_engine_image.c 


Log Message:


added the ability to set load scaledown, dpi or load size - the svg loader
uses these to know what to render and how (or has defaults if these are not
set)

===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/xrender_x11/evas_engine.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- evas_engine.c       7 Jun 2006 23:30:15 -0000       1.10
+++ evas_engine.c       18 Aug 2006 14:45:25 -0000      1.11
@@ -65,7 +65,7 @@
 static int  eng_gradient_alpha_get(void *data, void *gradient, int spread, int 
op);
 static void eng_gradient_map(void *data, void *context, void *gradient, int 
spread);
 static void eng_gradient_draw(void *data, void *context, void *surface, void 
*gradient, int x, int y, int w, int h, double angle, int spread);
-static void *eng_image_load(void *data, const char *file, const char *key, int 
*error);
+static void *eng_image_load(void *data, const char *file, const char *key, int 
*error, Evas_Image_Load_Opts *lo);
 static void *eng_image_new_from_data(void *data, int w, int h, DATA32 
*image_data);
 static void *eng_image_new_from_copied_data(void *data, int w, int h, DATA32 
*image_data);
 static void eng_image_free(void *data, void *image);
@@ -476,14 +476,14 @@
 }
 
 static void *
-eng_image_load(void *data, const char *file, const char *key, int *error)
+eng_image_load(void *data, const char *file, const char *key, int *error, 
Evas_Image_Load_Opts *lo)
 {
    Render_Engine *re;
    XR_Image *im;
    
    re = (Render_Engine *)data;
    *error = 0;
-   im = _xre_image_load(re->xinf, file, key);
+   im = _xre_image_load(re->xinf, file, key, lo);
    return im;
 }
 
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/xrender_x11/evas_engine.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- evas_engine.h       7 Jun 2006 23:30:15 -0000       1.4
+++ evas_engine.h       18 Aug 2006 14:45:25 -0000      1.5
@@ -99,12 +99,13 @@
    char            *format;
    const char      *comment;
    Tilebuf         *updates;
+   RGBA_Image_Loadopts load_opts;
    unsigned char    alpha : 1;
    unsigned char    dirty : 1;
    unsigned char    free_data : 1;
 };
 
-XR_Image *_xre_image_load(Ximage_Info *xinf, const char *file, const char 
*key);
+XR_Image *_xre_image_load(Ximage_Info *xinf, const char *file, const char 
*key, Evas_Image_Load_Opts *lo);
 XR_Image *_xre_image_new_from_data(Ximage_Info *xinf, int w, int h, void 
*data);
 XR_Image *_xre_image_new_from_copied_data(Ximage_Info *xinf, int w, int h, 
void *data);
 XR_Image *_xre_image_new(Ximage_Info *xinf, int w, int h);
===================================================================
RCS file: 
/cvs/e/e17/libs/evas/src/modules/engines/xrender_x11/evas_engine_image.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- evas_engine_image.c 7 Jun 2006 23:30:15 -0000       1.6
+++ evas_engine_image.c 18 Aug 2006 14:45:25 -0000      1.7
@@ -66,16 +66,26 @@
 }
 
 XR_Image *
-_xre_image_load(Ximage_Info *xinf, const char *file, const char *key)
+_xre_image_load(Ximage_Info *xinf, const char *file, const char *key, 
Evas_Image_Load_Opts *lo)
 {
    XR_Image *im;
    char buf[4096];
 
    if (!file) return NULL;
-   if (key)
-     snprintf(buf, sizeof(buf), "/@[EMAIL PROTECTED]@/%s//://%s", xinf->disp, 
xinf->root, file, key);
+   if (!lo)
+     {
+       if (key)
+         snprintf(buf, sizeof(buf), "/@[EMAIL PROTECTED]@/%s//://%s", 
xinf->disp, xinf->root, file, key);
+       else
+         snprintf(buf, sizeof(buf), "/@[EMAIL PROTECTED]@/%s", xinf->disp, 
xinf->root, file);
+     }
    else
-     snprintf(buf, sizeof(buf), "/@[EMAIL PROTECTED]@/%s", xinf->disp, 
xinf->root, file);
+     {
+       if (key)
+         snprintf(buf, sizeof(buf), "//@/%i/%1.5f/%ix%i//@[EMAIL 
PROTECTED]@/%s//://%s", lo->scale_down_by, lo->dpi, lo->w, lo->h, xinf->disp, 
xinf->root, file, key);
+       else
+         snprintf(buf, sizeof(buf), "//@/%i/%1.5f/%ix%i//@[EMAIL 
PROTECTED]@/%s", lo->scale_down_by, lo->dpi, lo->w, lo->h, xinf->disp, 
xinf->root, file);
+     }
    im = __xre_image_find(buf);
    if (im)
      {
@@ -84,7 +94,7 @@
    
    im = calloc(1, sizeof(XR_Image));
    if (!im) return NULL;
-   im->im = evas_common_load_image_from_file(file, key);
+   im->im = evas_common_load_image_from_file(file, key, lo);
    if (!im->im)
      {
        free(im);
@@ -98,6 +108,7 @@
    im->w = im->im->image->w;
    im->h = im->im->image->h;
    im->references = 1;
+   if (lo) im->load_opts = *lo;
    if (im->im->info.comment) im->comment = 
evas_stringshare_add(im->im->info.comment);
 //   if (im->im->info.format == 1) im->format = evas_stringshare_add("png");
    if (im->im->flags & RGBA_IMAGE_HAS_ALPHA) im->alpha = 1;
@@ -249,7 +260,7 @@
    if (im->data) data = im->data;
    else
      {
-       if (!im->im) im->im = evas_common_load_image_from_file(im->file, 
im->key);
+       if (!im->im) im->im = evas_common_load_image_from_file(im->file, 
im->key, &(im->load_opts));
        if (im->im)
          {
             evas_common_load_image_data_from_file(im->im);
@@ -372,7 +383,7 @@
    if (im->data) data = im->data;
    else
      {
-       if (!im->im) im->im = evas_common_load_image_from_file(im->file, 
im->key);
+       if (!im->im) im->im = evas_common_load_image_from_file(im->file, 
im->key, &(im->load_opts));
        if (im->im)
          {
             evas_common_load_image_data_from_file(im->im);
@@ -503,7 +514,7 @@
    if (im->data) data = im->data;
    else
      {
-       if (!im->im) im->im = evas_common_load_image_from_file(im->file, 
im->key);
+       if (!im->im) im->im = evas_common_load_image_from_file(im->file, 
im->key, &(im->load_opts));
        if (im->im)
          {
             evas_common_load_image_data_from_file(im->im);



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to