Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        backgrounds.c dialog.c eimage.c eimage.h extinitwin.c hiwin.c 
        iclass.c iconify.c pager.c text.c tooltips.c ttfont.c warp.c 
        x.c 


Log Message:
Pass Win to image rendering functions (for visual info).

===================================================================
RCS file: /cvs/e/e16/e/src/backgrounds.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -3 -r1.73 -r1.74
--- backgrounds.c       8 May 2006 16:26:22 -0000       1.73
+++ backgrounds.c       13 May 2006 13:25:30 -0000      1.74
@@ -613,7 +613,7 @@
      {
        /* Window, no fg, no offset, and scale to 100%, or tiled, no trans */
        pmap = BackgroundCreatePixmap(draw, w, h, VRoot.depth);
-       EImageRenderOnDrawable(bg->bg.im, pmap, 0, 0, w, h, 0);
+       EImageRenderOnDrawable(bg->bg.im, NULL, pmap, 0, 0, w, h, 0);
 
 #if 0                          /* FIXME - Remove? */
        if (x == 0 && y == 0)   /* Hmmm. Always true. */
@@ -679,7 +679,7 @@
        EImageBlend(im, bg->top.im, 1, 0, 0, ww, hh, x, y, w, h, 0, 0);
      }
 
-   EImageRenderOnDrawable(im, pmap, 0, 0, rw, rh, 0);
+   EImageRenderOnDrawable(im, NULL, pmap, 0, 0, rw, rh, 0);
    if (im != bg->bg.im)
       EImageFree(im);
 
@@ -1756,7 +1756,8 @@
                im = BackgroundCacheMini(bg, 1, 0);
                if (im)
                  {
-                    EImageRenderOnDrawable(im, pmap, x + 4, 4, 64, 48, 0);
+                    EImageRenderOnDrawable(im, NULL, pmap, x + 4, 4, 64, 48,
+                                           0);
                     EImageFree(im);
                  }
             }
===================================================================
RCS file: /cvs/e/e16/e/src/dialog.c,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -3 -r1.158 -r1.159
--- dialog.c    11 May 2006 20:47:26 -0000      1.158
+++ dialog.c    13 May 2006 13:25:30 -0000      1.159
@@ -478,7 +478,7 @@
                 db->w - (h + 2 + pad->left + pad->right),
                 h, h, TextclassGetJustification(db->tclass));
 
-       EImageRenderOnDrawable(im, Xwin(db->win), pad->left, pad->top, h, h, 1);
+       EImageRenderOnDrawable(im, db->win, None, pad->left, pad->top, h, h, 1);
        EImageFree(im);
      }
    else
@@ -1199,7 +1199,7 @@
             EImageGetSize(im, &iw, &ih);
             di->win = ECreateWindow(d->win, 0, 0, iw, ih, 0);
             EMapWindow(di->win);
-            EImageRenderPixmaps(im, Xwin(di->win), &pmap, &mask, 0, 0);
+            EImageRenderPixmaps(im, di->win, &pmap, &mask, 0, 0);
             ESetWindowBackgroundPixmap(di->win, pmap);
             EShapeCombineMask(di->win, ShapeBounding, 0, 0, mask, ShapeSet);
             EImagePixmapFree(pmap);
===================================================================
RCS file: /cvs/e/e16/e/src/eimage.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- eimage.c    23 Apr 2006 22:11:26 -0000      1.4
+++ eimage.c    13 May 2006 13:25:30 -0000      1.5
@@ -25,6 +25,10 @@
 #include "xwin.h"
 #include <Imlib2.h>
 
+static Window       _default_draw;
+static Visual      *_default_vis;
+static Colormap     _default_cmap;
+
 void
 EImageInit(Display * dpy)
 {
@@ -33,9 +37,13 @@
 
    imlib_set_color_usage(128);
 
+   _default_draw = DefaultRootWindow(dpy);
+   _default_vis = DefaultVisual(dpy, DefaultScreen(dpy));
+   _default_cmap = DefaultColormap(dpy, DefaultScreen(dpy));
+
    imlib_context_set_display(dpy);
-   imlib_context_set_visual(DefaultVisual(dpy, DefaultScreen(dpy)));
-   imlib_context_set_colormap(DefaultColormap(dpy, DefaultScreen(dpy)));
+   imlib_context_set_visual(_default_vis);
+   imlib_context_set_colormap(_default_cmap);
 
    imlib_context_set_dither(1);
 }
@@ -350,30 +358,47 @@
 }
 
 void
-EImageRenderOnDrawable(EImage * im, Drawable draw, int x, int y, int w, int h,
-                      int blend)
+EImageRenderOnDrawable(EImage * im, Win win, Drawable draw, int x, int y,
+                      int w, int h, int blend)
 {
+   Visual             *vis;
+
    imlib_context_set_image(im);
-   imlib_context_set_drawable(draw);
+   imlib_context_set_drawable((draw != None) ? draw : WinGetXwin(win));
+   vis = (win) ? WinGetVisual(win) : NULL;
+   if (vis)
+      imlib_context_set_visual(vis);
+
    if (blend)
       imlib_context_set_blend(1);
    imlib_render_image_on_drawable_at_size(x, y, w, h);
    if (blend)
       imlib_context_set_blend(0);
+
+   if (vis)
+      imlib_context_set_visual(_default_vis);
 }
 
 void
-EImageRenderPixmaps(EImage * im, Drawable draw, Pixmap * pmap, Pixmap * mask,
+EImageRenderPixmaps(EImage * im, Win win, Pixmap * pmap, Pixmap * mask,
                    int w, int h)
 {
+   Visual             *vis;
+
    imlib_context_set_image(im);
-   imlib_context_set_drawable(draw);
+   imlib_context_set_drawable((win) ? WinGetXwin(win) : _default_draw);
+   vis = (win) ? WinGetVisual(win) : NULL;
+   if (vis)
+      imlib_context_set_visual(vis);
 
    *pmap = *mask = None;
    if (w <= 0 || h <= 0)
       imlib_render_pixmaps_for_whole_image(pmap, mask);
    else
       imlib_render_pixmaps_for_whole_image_at_size(pmap, mask, w, h);
+
+   if (vis)
+      imlib_context_set_visual(_default_vis);
 }
 
 void
===================================================================
RCS file: /cvs/e/e16/e/src/eimage.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- eimage.h    23 Apr 2006 22:11:26 -0000      1.3
+++ eimage.h    13 May 2006 13:25:30 -0000      1.4
@@ -23,6 +23,9 @@
 #ifndef _EIMAGE_H_
 #define _EIMAGE_H_
 
+#include <X11/Xlib.h>
+#include "xwin.h"
+
 typedef void        EImage;
 typedef void        EImageColorModifier;
 
@@ -73,11 +76,11 @@
                                             int iw, int ih, int grab,
                                             int get_mask_from_shape);
 
-void                EImageRenderOnDrawable(EImage * im, Drawable draw,
+void                EImageRenderOnDrawable(EImage * im, Win win, Drawable draw,
                                           int x, int y, int w, int h,
                                           int blend);
 
-void                EImageRenderPixmaps(EImage * im, Drawable draw,
+void                EImageRenderPixmaps(EImage * im, Win win,
                                        Pixmap * pmap, Pixmap * mask,
                                        int w, int h);
 void                EImagePixmapFree(Pixmap pmap);
===================================================================
RCS file: /cvs/e/e16/e/src/extinitwin.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- extinitwin.c        29 Apr 2006 19:39:21 -0000      1.16
+++ extinitwin.c        13 May 2006 13:25:30 -0000      1.17
@@ -118,7 +118,7 @@
           im = EImageLoad(s);
           if (im)
             {
-               EImageRenderPixmaps(im, w2, &pmap, &mask, 0, 0);
+               EImageRenderPixmaps(im, NULL, &pmap, &mask, 0, 0);
                EImageGetSize(im, &w, &h);
                XShapeCombineMask(disp, w2, ShapeBounding, 0, 0, mask,
                                  ShapeSet);
===================================================================
RCS file: /cvs/e/e16/e/src/hiwin.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- hiwin.c     7 May 2006 16:21:37 -0000       1.16
+++ hiwin.c     13 May 2006 13:25:30 -0000      1.17
@@ -83,7 +83,8 @@
 static void
 HiwinRenderImageDrawX(Hiwin * phi, Drawable draw)
 {
-   EImageRenderOnDrawable(phi->im, draw, 0, 0, EoGetW(phi), EoGetH(phi), 0);
+   EImageRenderOnDrawable(phi->im, EoGetWin(phi), draw, 0, 0,
+                         EoGetW(phi), EoGetH(phi), 0);
 }
 
 static void
===================================================================
RCS file: /cvs/e/e16/e/src/iclass.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -3 -r1.102 -r1.103
--- iclass.c    8 May 2006 16:26:22 -0000       1.102
+++ iclass.c    13 May 2006 13:25:30 -0000      1.103
@@ -813,7 +813,7 @@
        x = y = 0;
      }
 
-   EImageRenderOnDrawable(im, draw, x, y, w, h, 0);
+   EImageRenderOnDrawable(im, win, draw, x, y, w, h, 0);
    EImageFree(im);
 
    return pmap;
@@ -983,14 +983,14 @@
        pmm->mask = None;
        pmm->w = w;
        pmm->h = h;
-       EImageRenderOnDrawable(ii, pmap, 0, 0, w, h, 0);
+       EImageRenderOnDrawable(ii, win, pmap, 0, 0, w, h, 0);
 
        if (make_mask && !(flags & ICLASS_ATTR_NO_CLIP))
          {
             if (EImageHasAlpha(is->im))
               {
                  /* Make the scaled clip mask to be used */
-                 EImageRenderPixmaps(is->im, Xwin(win), &pmap, &mask, w, h);
+                 EImageRenderPixmaps(is->im, win, &pmap, &mask, w, h);
 
                  /* Replace the mask with the correct one */
                  pmm->mask = EXCreatePixmapCopy(mask, w, h, 1);
@@ -1011,7 +1011,7 @@
        pmm->pmap = pmm->mask = None;
        pmm->w = w;
        pmm->h = h;
-       EImageRenderPixmaps(is->im, Xwin(win), &pmm->pmap, &pmm->mask, w, h);
+       EImageRenderPixmaps(is->im, win, &pmm->pmap, &pmm->mask, w, h);
      }
    else
      {
@@ -1047,7 +1047,7 @@
        pmm->pmap = pmm->mask = None;
        pmm->w = pw;
        pmm->h = ph;
-       EImageRenderPixmaps(is->im, Xwin(win), &pmm->pmap, &pmm->mask, pw, ph);
+       EImageRenderPixmaps(is->im, win, &pmm->pmap, &pmm->mask, pw, ph);
      }
 }
 
===================================================================
RCS file: /cvs/e/e16/e/src/iconify.c,v
retrieving revision 1.207
retrieving revision 1.208
diff -u -3 -r1.207 -r1.208
--- iconify.c   12 May 2006 09:27:59 -0000      1.207
+++ iconify.c   13 May 2006 13:25:30 -0000      1.208
@@ -1675,7 +1675,7 @@
    if (im)
      {
        EMapWindow(ib->icon_win);
-       EImageRenderPixmaps(im, Xwin(ib->icon_win), &pmap, &mask, 0, 0);
+       EImageRenderPixmaps(im, ib->icon_win, &pmap, &mask, 0, 0);
        ESetWindowBackgroundPixmap(ib->icon_win, pmap);
        EShapeCombineMask(ib->icon_win, ShapeBounding, 0, 0, mask, ShapeSet);
        EImagePixmapFree(pmap);
===================================================================
RCS file: /cvs/e/e16/e/src/pager.c,v
retrieving revision 1.214
retrieving revision 1.215
diff -u -3 -r1.214 -r1.215
--- pager.c     11 May 2006 20:47:26 -0000      1.214
+++ pager.c     13 May 2006 13:25:30 -0000      1.215
@@ -524,7 +524,7 @@
        im = EImageLoad(s);
        if (im)
          {
-            EImageRenderOnDrawable(im, pmap, 0, 0, p->dw, p->dh, 0);
+            EImageRenderOnDrawable(im, p->win, pmap, 0, 0, p->dw, p->dh, 0);
             EImageDecache(im);
          }
        else
===================================================================
RCS file: /cvs/e/e16/e/src/text.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -3 -r1.67 -r1.68
--- text.c      8 May 2006 16:26:22 -0000       1.67
+++ text.c      13 May 2006 13:25:30 -0000      1.68
@@ -756,7 +756,7 @@
 }
 
 static void
-TextDrawRotTo(Win win __UNUSED__, Drawable src, Drawable dst, int x, int y,
+TextDrawRotTo(Win win, Drawable src, Drawable dst, int x, int y,
              int w, int h, TextState * ts)
 {
    EImage             *im;
@@ -767,20 +767,20 @@
      case FONT_TO_UP:
        im = EImageGrabDrawable(src, 0, y, x, h, w, 0);
        EImageOrientate(im, 1);
-       EImageRenderOnDrawable(im, dst, 0, 0, w, h, 0);
+       EImageRenderOnDrawable(im, win, dst, 0, 0, w, h, 0);
        EImageFree(im);
        break;
      case FONT_TO_DOWN:
        EXGetGeometry(src, NULL, NULL, NULL, &win_w, NULL, NULL, NULL);
        im = EImageGrabDrawable(src, None, win_w - y - h, x, h, w, 0);
        EImageOrientate(im, 3);
-       EImageRenderOnDrawable(im, dst, 0, 0, w, h, 0);
+       EImageRenderOnDrawable(im, win, dst, 0, 0, w, h, 0);
        EImageFree(im);
        break;
      case FONT_TO_LEFT:        /* Holy carumba! That's for yoga addicts, maybe 
.... */
        im = EImageGrabDrawable(src, None, x, y, w, h, 0);
        EImageOrientate(im, 2);
-       EImageRenderOnDrawable(im, dst, 0, 0, w, h, 0);
+       EImageRenderOnDrawable(im, win, dst, 0, 0, w, h, 0);
        EImageFree(im);
        break;
      default:
@@ -789,7 +789,7 @@
 }
 
 static void
-TextDrawRotBack(Win win __UNUSED__, Drawable dst, Drawable src, int x, int y,
+TextDrawRotBack(Win win, Drawable dst, Drawable src, int x, int y,
                int w, int h, TextState * ts)
 {
    EImage             *im;
@@ -800,20 +800,20 @@
      case FONT_TO_UP:
        im = EImageGrabDrawable(src, None, 0, 0, w, h, 0);
        EImageOrientate(im, 3);
-       EImageRenderOnDrawable(im, dst, y, x, h, w, 0);
+       EImageRenderOnDrawable(im, win, dst, y, x, h, w, 0);
        EImageFree(im);
        break;
      case FONT_TO_DOWN:
        EXGetGeometry(dst, NULL, NULL, NULL, &win_w, NULL, NULL, NULL);
        im = EImageGrabDrawable(src, None, 0, 0, w, h, 0);
        EImageOrientate(im, 1);
-       EImageRenderOnDrawable(im, dst, win_w - y - h, x, h, w, 0);
+       EImageRenderOnDrawable(im, win, dst, win_w - y - h, x, h, w, 0);
        EImageFree(im);
        break;
      case FONT_TO_LEFT:        /* Holy carumba! That's for yoga addicts, maybe 
.... */
        im = EImageGrabDrawable(src, None, 0, 0, w, h, 0);
        EImageOrientate(im, 2);
-       EImageRenderOnDrawable(im, dst, x, y, w, h, 0);
+       EImageRenderOnDrawable(im, win, dst, x, y, w, h, 0);
        EImageFree(im);
        break;
      default:
===================================================================
RCS file: /cvs/e/e16/e/src/tooltips.c,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -3 -r1.103 -r1.104
--- tooltips.c  8 May 2006 16:26:22 -0000       1.103
+++ tooltips.c  13 May 2006 13:25:30 -0000      1.104
@@ -265,7 +265,7 @@
       return;
 
    EImageGetSize(im, &w, &h);
-   EImageRenderOnDrawable(im, Xwin(tt->TTWIN->win), x, y, w, h, 1);
+   EImageRenderOnDrawable(im, tt->TTWIN->win, None, x, y, w, h, 1);
 
    *px = x + w;
 }
===================================================================
RCS file: /cvs/e/e16/e/src/ttfont.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -3 -r1.48 -r1.49
--- ttfont.c    29 Mar 2006 19:13:17 -0000      1.48
+++ ttfont.c    13 May 2006 13:25:30 -0000      1.49
@@ -78,7 +78,7 @@
    imlib_context_set_font(f->face);
    ImlibSetFgColorFromGC(gc, cm);
    imlib_text_draw(0, 0, text);
-   EImageRenderOnDrawable(im, win, x, y - ascent, w, h, 0);
+   EImageRenderOnDrawable(im, NULL, win, x, y - ascent, w, h, 0);
    EImageFree(im);
 }
 
===================================================================
RCS file: /cvs/e/e16/e/src/warp.c,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -3 -r1.95 -r1.96
--- warp.c      8 May 2006 16:26:22 -0000       1.95
+++ warp.c      13 May 2006 13:25:30 -0000      1.96
@@ -222,8 +222,8 @@
                                   Conf.warplist.icon_mode);
             if (im)
               {
-                 EImageRenderOnDrawable(im, Xwin(wi->win), pad->left +
-                                        ICON_PAD, ICON_PAD,
+                 EImageRenderOnDrawable(im, wi->win, None,
+                                        pad->left + ICON_PAD, ICON_PAD,
                                         icon_size, icon_size, 1);
                  EImageFree(im);
               }
===================================================================
RCS file: /cvs/e/e16/e/src/x.c,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -3 -r1.136 -r1.137
--- x.c 12 May 2006 12:01:41 -0000      1.136
+++ x.c 13 May 2006 13:25:30 -0000      1.137
@@ -596,12 +596,15 @@
    win = EXidCreate();
    if (!win)
       return NULL;
+
    win->xwin = xwin;
    win->x = x;
    win->y = y;
    win->w = w;
    win->h = h;
    win->depth = depth;
+   win->visual = VRoot.vis;
+
    return win;
 }
 




-------------------------------------------------------
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