Enlightenment CVS committal Author : kwo Project : e16 Module : e
Dir : e16/e/src Modified Files: dialog.c eimage.c eimage.h extinitwin.c fx.c iclass.c icons.c Log Message: Move theme path related stuff out of eimage.c, add function to get image data. =================================================================== RCS file: /cvs/e/e16/e/src/dialog.c,v retrieving revision 1.178 retrieving revision 1.179 diff -u -3 -r1.178 -r1.179 --- dialog.c 27 Dec 2006 16:17:26 -0000 1.178 +++ dialog.c 28 Dec 2006 17:44:42 -0000 1.179 @@ -418,16 +418,16 @@ switch (db->image) { case DLG_BUTTON_OK: - im = EImageLoad("pix/ok.png"); + im = ThemeImageLoad("pix/ok.png"); break; case DLG_BUTTON_CANCEL: - im = EImageLoad("pix/cancel.png"); + im = ThemeImageLoad("pix/cancel.png"); break; case DLG_BUTTON_APPLY: - im = EImageLoad("pix/apply.png"); + im = ThemeImageLoad("pix/apply.png"); break; case DLG_BUTTON_CLOSE: - im = EImageLoad("pix/close.png"); + im = ThemeImageLoad("pix/close.png"); break; default: break; @@ -1221,7 +1221,7 @@ di->h = ih; break; case DITEM_IMAGE: - im = EImageLoad(di->item.image.image); + im = ThemeImageLoad(di->item.image.image); if (im) { Pixmap pmap = 0, mask = 0; =================================================================== RCS file: /cvs/e/e16/e/src/eimage.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- eimage.c 25 Dec 2006 10:21:21 -0000 1.10 +++ eimage.c 28 Dec 2006 17:44:42 -0000 1.11 @@ -55,27 +55,7 @@ EImage * EImageLoad(const char *file) { - EImage *im; - char *f; - - if (!file) - return NULL; - - if (file[0] == '/') - { - im = imlib_load_image(file); - return im; - } - - f = ThemeFileFind(file, 0); - if (f) - { - im = imlib_load_image(f); - Efree(f); - return im; - } - - return NULL; + return imlib_load_image(file); } void @@ -201,6 +181,13 @@ imlib_context_set_image(im); *pw = imlib_image_get_width(); *ph = imlib_image_get_height(); +} + +void * +EImageGetData(EImage * im) +{ + imlib_context_set_image(im); + return imlib_image_get_data_for_reading_only(); } void =================================================================== RCS file: /cvs/e/e16/e/src/eimage.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- eimage.h 14 May 2006 10:59:30 -0000 1.5 +++ eimage.h 28 Dec 2006 17:44:42 -0000 1.6 @@ -54,6 +54,7 @@ int EImageHasAlpha(EImage * im); void EImageGetSize(EImage * im, int *pw, int *ph); +void *EImageGetData(EImage * im); void EImageFill(EImage * im, int x, int y, int w, int h, int r, int g, int b, int a); @@ -99,5 +100,7 @@ int dx, int dy, int dw, int dh, int scale); void EDrawableDumpImage(Drawable draw, const char *txt); + +EImage *ThemeImageLoad(const char *file); #endif /* _EIMAGE_H_ */ =================================================================== RCS file: /cvs/e/e16/e/src/extinitwin.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- extinitwin.c 19 Nov 2006 21:55:51 -0000 1.18 +++ extinitwin.c 28 Dec 2006 17:44:42 -0000 1.19 @@ -115,7 +115,7 @@ if (EDebug(EDBUG_TYPE_SESSION)) Eprintf("ExtInitWinCreate - child %s\n", s); - im = EImageLoad(s); + im = ThemeImageLoad(s); if (im) { EImageRenderPixmaps(im, NULL, &pmap, &mask, 0, 0); =================================================================== RCS file: /cvs/e/e16/e/src/fx.c,v retrieving revision 1.75 retrieving revision 1.76 diff -u -3 -r1.75 -r1.76 --- fx.c 9 Dec 2006 20:02:20 -0000 1.75 +++ fx.c 28 Dec 2006 17:44:42 -0000 1.76 @@ -634,7 +634,7 @@ { EImage *im; - im = EImageLoad(string); + im = ThemeImageLoad(string); if (im) { int x, y, w, h; =================================================================== RCS file: /cvs/e/e16/e/src/iclass.c,v retrieving revision 1.109 retrieving revision 1.110 diff -u -3 -r1.109 -r1.110 --- iclass.c 9 Dec 2006 21:32:03 -0000 1.109 +++ iclass.c 28 Dec 2006 17:44:42 -0000 1.110 @@ -168,6 +168,32 @@ #endif /* ENABLE_THEME_TRANSPARENCY */ +EImage * +ThemeImageLoad(const char *file) +{ + EImage *im; + char *f; + + if (!file) + return NULL; + + if (file[0] == '/') + { + im = EImageLoad(file); + return im; + } + + f = ThemeFileFind(file, 0); + if (f) + { + im = EImageLoad(f); + Efree(f); + return im; + } + + return NULL; +} + static ImageState * ImagestateCreate(void) { =================================================================== RCS file: /cvs/e/e16/e/src/icons.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- icons.c 19 Nov 2006 21:55:51 -0000 1.14 +++ icons.c 28 Dec 2006 17:44:42 -0000 1.15 @@ -178,7 +178,7 @@ if (!file) return NULL; - im = EImageLoad(file); + im = ThemeImageLoad(file); return im; } ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs