Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        container.c dialog.c eimage.c eimage.h hiwin.c xwin.h 


Log Message:
Introduce EImageApplyToWin.

===================================================================
RCS file: /cvs/e/e16/e/src/container.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- container.c 15 Dec 2007 16:29:22 -0000      1.18
+++ container.c 15 Dec 2007 17:10:47 -0000      1.19
@@ -1061,7 +1061,6 @@
    int                 ib_x0, ib_y0, ib_w0, ib_h0;
    EImage             *im;
    int                 ww, hh;
-   Pixmap              pmap, mask;
 
    if (!ct->ic_box)
       ContainerLayoutImageWin(ct);
@@ -1160,13 +1159,8 @@
    if (im)
      {
        EMapWindow(ct->icon_win);
-       EImageRenderPixmaps(im, ct->icon_win, EIMAGE_HIGH_MASK_THR,
-                           &pmap, &mask, 0, 0);
-       ESetWindowBackgroundPixmap(ct->icon_win, pmap);
-       EShapeCombineMask(ct->icon_win, ShapeBounding, 0, 0, mask, ShapeSet);
-       EImagePixmapsFree(pmap, mask);
+       EImageApplyToWin(im, ct->icon_win, EIMAGE_HIGH_MASK_THR, 0, 0);
        EImageFree(im);
-       EClearWindow(ct->icon_win);
 
        if (ct->type == IB_TYPE_SYSTRAY && ct->nobg && !ct->draw_icon_base)
           EShapePropagate(ct->icon_win);
===================================================================
RCS file: /cvs/e/e16/e/src/dialog.c,v
retrieving revision 1.191
retrieving revision 1.192
diff -u -3 -r1.191 -r1.192
--- dialog.c    15 Dec 2007 16:29:22 -0000      1.191
+++ dialog.c    15 Dec 2007 17:10:47 -0000      1.192
@@ -1167,16 +1167,10 @@
        im = ThemeImageLoad(di->item.image.image);
        if (im)
          {
-            Pixmap              pmap = 0, mask = 0;
-
             EImageGetSize(im, &iw, &ih);
             di->win = ECreateWindow(d->win, 0, 0, iw, ih, 0);
             EMapWindow(di->win);
-            EImageRenderPixmaps(im, di->win, 0, &pmap, &mask, 0, 0);
-            ESetWindowBackgroundPixmap(di->win, pmap);
-            EShapeCombineMask(di->win, ShapeBounding, 0, 0, mask, ShapeSet);
-            EClearWindow(di->win);
-            EImagePixmapsFree(pmap, mask);
+            EImageApplyToWin(im, di->win, 0, 0, 0);
             EImageFree(im);
          }
        di->w = iw;
===================================================================
RCS file: /cvs/e/e16/e/src/eimage.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- eimage.c    15 Dec 2007 16:29:22 -0000      1.19
+++ eimage.c    15 Dec 2007 17:10:47 -0000      1.20
@@ -460,6 +460,19 @@
 }
 
 void
+EImageApplyToWin(EImage * im, Win win, int flags, int w, int h)
+{
+   Pixmap              pmap, mask;
+
+   EImageRenderPixmaps(im, win, flags, &pmap, &mask, w, h);
+   ESetWindowBackgroundPixmap(win, pmap);
+   if ((mask != None) || (mask == None && WinIsShaped(win)))
+      EShapeCombineMask(win, ShapeBounding, 0, 0, mask, ShapeSet);
+   EImagePixmapsFree(pmap, mask);
+   EClearWindow(win);
+}
+
+void
 ScaleRect(Win wsrc, Drawable src, Win wdst, Pixmap dst, Pixmap * pdst,
          int sx, int sy, int sw, int sh,
          int dx, int dy, int dw, int dh, int scale)
===================================================================
RCS file: /cvs/e/e16/e/src/eimage.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- eimage.h    15 Dec 2007 16:29:22 -0000      1.12
+++ eimage.h    15 Dec 2007 17:10:47 -0000      1.13
@@ -92,6 +92,9 @@
                                        int w, int h);
 void                EImagePixmapsFree(Pixmap pmap, Pixmap mask);
 
+void                EImageApplyToWin(EImage * im, Win win, int flags,
+                                    int w, int h);
+
 EImageColorModifier *EImageColorModifierCreate(void);
 void                EImageColorModifierSetTables(EImageColorModifier * icm,
                                                 unsigned char *r,
===================================================================
RCS file: /cvs/e/e16/e/src/hiwin.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -3 -r1.28 -r1.29
--- hiwin.c     15 Dec 2007 16:29:22 -0000      1.28
+++ hiwin.c     15 Dec 2007 17:10:47 -0000      1.29
@@ -108,21 +108,9 @@
 static void
 HiwinRenderImageDrawX(Hiwin * phi, Drawable draw __UNUSED__)
 {
-#if 0
-   EImageRenderOnDrawable(phi->im, EoGetWin(phi), draw, 0,
-                         0, 0, EoGetW(phi), EoGetH(phi));
-#else
-   Pixmap              pmap, mask;
-
-   EImageRenderPixmaps(phi->im, EoGetWin(phi), EIMAGE_ANTI_ALIAS, &pmap, &mask,
-                      EoGetW(phi), EoGetH(phi));
-   ESetWindowBackgroundPixmap(EoGetWin(phi), pmap);
-   if (mask)
-      EShapeCombineMask(EoGetWin(phi), ShapeBounding, 0, 0, mask, ShapeSet);
-   EImagePixmapsFree(pmap, mask);
-   EClearWindow(EoGetWin(phi));
+   EImageApplyToWin(phi->im, EoGetWin(phi), EIMAGE_ANTI_ALIAS,
+                   EoGetW(phi), EoGetH(phi));
    EoShapeUpdate(phi, 0);
-#endif
 }
 
 static void
===================================================================
RCS file: /cvs/e/e16/e/src/xwin.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -3 -r1.35 -r1.36
--- xwin.h      15 Dec 2007 12:36:58 -0000      1.35
+++ xwin.h      15 Dec 2007 17:10:47 -0000      1.36
@@ -99,7 +99,7 @@
 #define             WinGetDepth(win)           ((win)->depth)
 #define             WinGetVisual(win)          ((win)->visual)
 #define             WinGetCmap(win)            ((win)->cmap)
-#define             WinIsShaped(win)           ((win)->num_rect > 0)
+#define             WinIsShaped(win)           ((win)->num_rect != 0)
 #else
 Window              WinGetXwin(const Win win);
 int                 WinGetX(const Win win);



-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to