Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        backgrounds.c dialog.c iclass.c menus.c progress.c tclass.c 
        tclass.h text.c tooltips.c warp.c 


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

===================================================================
RCS file: /cvs/e/e16/e/src/backgrounds.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -3 -r1.72 -r1.73
--- backgrounds.c       7 May 2006 16:21:37 -0000       1.72
+++ backgrounds.c       8 May 2006 16:26:22 -0000       1.73
@@ -1746,7 +1746,7 @@
 
                     TextSize(tc, 0, 0, STATE_NORMAL,
                              _("No\nBackground"), &tw, &th, 17);
-                    TextDraw(tc, pmap, 0, 0, STATE_NORMAL,
+                    TextDraw(tc, win, pmap, 0, 0, STATE_NORMAL,
                              _("No\nBackground"), x + 4,
                              4 + ((48 - th) / 2), 64, 48, 17, 512);
                  }
===================================================================
RCS file: /cvs/e/e16/e/src/dialog.c,v
retrieving revision 1.156
retrieving revision 1.157
diff -u -3 -r1.156 -r1.157
--- dialog.c    7 May 2006 16:21:37 -0000       1.156
+++ dialog.c    8 May 2006 16:26:22 -0000       1.157
@@ -473,7 +473,7 @@
 
        pad = ImageclassGetPadding(ic);
        h = db->h - (pad->top + pad->bottom);
-       TextDraw(db->tclass, Xwin(db->win), 0, 0, state, db->text,
+       TextDraw(db->tclass, db->win, None, 0, 0, state, db->text,
                 h + 2 + pad->left, pad->top,
                 db->w - (h + 2 + pad->left + pad->right),
                 h, h, TextclassGetJustification(db->tclass));
@@ -523,7 +523,7 @@
        EImageBorder       *pad;
 
        pad = ImageclassGetPadding(d->iclass);
-       TextDraw(d->tclass, d->pmap, 0, 0, STATE_NORMAL, d->text,
+       TextDraw(d->tclass, d->win, d->pmap, 0, 0, STATE_NORMAL, d->text,
                 pad->left, pad->top, d->w - (pad->left + pad->right),
                 d->h - (pad->top + pad->bottom),
                 d->h - (pad->top + pad->bottom),
@@ -1737,7 +1737,7 @@
        break;
 
       draw_text:
-       TextDraw(di->tclass, d->pmap, 0, 0, STATE_NORMAL, di->text,
+       TextDraw(di->tclass, d->win, d->pmap, 0, 0, STATE_NORMAL, di->text,
                 x, di->y, w, 99999, 17, TextclassGetJustification(di->tclass));
        break;
      }
===================================================================
RCS file: /cvs/e/e16/e/src/iclass.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -3 -r1.101 -r1.102
--- iclass.c    7 May 2006 16:21:37 -0000       1.101
+++ iclass.c    8 May 2006 16:26:22 -0000       1.102
@@ -1187,9 +1187,12 @@
             if (ts && text)
               {
                  if (pmm.type != 0)
-                    pmap = EXCreatePixmapCopy(pmm.pmap, w, h, VRoot.depth);
+                   {
+                      pmap = ECreatePixmap(win, w, h, 0);
+                      EXCopyArea(pmm.pmap, pmap, 0, 0, w, h, 0, 0);
+                   }
 
-                 TextstateDrawText(ts, pmap, text, ic->padding.left,
+                 TextstateDrawText(ts, win, pmap, text, ic->padding.left,
                                    ic->padding.top,
                                    w - (ic->padding.left +
                                         ic->padding.right),
===================================================================
RCS file: /cvs/e/e16/e/src/menus.c,v
retrieving revision 1.246
retrieving revision 1.247
diff -u -3 -r1.246 -r1.247
--- menus.c     7 May 2006 16:21:37 -0000       1.246
+++ menus.c     8 May 2006 16:26:22 -0000       1.247
@@ -955,7 +955,7 @@
 
        if (mi->text)
          {
-            TextDraw(m->style->tclass, mi_pmm->pmap, 0, 0, mi->state,
+            TextDraw(m->style->tclass, mi->win, mi_pmm->pmap, 0, 0, mi->state,
                      _(mi->text), mi->text_x, mi->text_y, mi->text_w,
                      mi->text_h, 17,
                      TextclassGetJustification(m->style->tclass));
===================================================================
RCS file: /cvs/e/e16/e/src/progress.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- progress.c  29 Apr 2006 19:39:21 -0000      1.33
+++ progress.c  8 May 2006 16:26:22 -0000       1.34
@@ -176,7 +176,7 @@
 
    pad = ImageclassGetPadding(p->inc);
    EClearWindow(p->n_win->win);
-   TextDraw(p->tnc, Xwin(p->n_win->win), 0, 0, STATE_CLICKED, s,
+   TextDraw(p->tnc, p->n_win->win, None, 0, 0, STATE_CLICKED, s,
            pad->left, pad->top, p->h * 5 - (pad->left + pad->right),
            p->h - (pad->top + pad->bottom), p->h - (pad->top + pad->bottom),
            TextclassGetJustification(p->tnc));
@@ -203,7 +203,7 @@
    EobjMap(p->p_win, 0);
 
    pad = ImageclassGetPadding(p->inc);
-   TextDraw(p->tc, Xwin(p->win->win), 0, 0, STATE_NORMAL, p->win->name,
+   TextDraw(p->tc, p->win->win, None, 0, 0, STATE_NORMAL, p->win->name,
            pad->left, pad->top, p->w - (p->h * 5) - (pad->left + pad->right),
            p->h - (pad->top + pad->bottom), p->h - (pad->top + pad->bottom),
            TextclassGetJustification(p->tnc));
===================================================================
RCS file: /cvs/e/e16/e/src/tclass.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -3 -r1.44 -r1.45
--- tclass.c    22 Apr 2006 13:24:51 -0000      1.44
+++ tclass.c    8 May 2006 16:26:22 -0000       1.45
@@ -577,7 +577,8 @@
 
             if (!EDrawableCheck(win, 0))       /* Grab server? */
                return;
-            TextDraw(tc, win, 0, 0, state, txt, x, y, 99999, 99999, 17, 0);
+            TextDraw(tc, NULL, win, 0, 0, state, txt, x, y, 99999, 99999, 17,
+                     0);
          }
      }
    else if (!strcmp(param2, "query_size"))
===================================================================
RCS file: /cvs/e/e16/e/src/tclass.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- tclass.h    29 Apr 2006 19:39:21 -0000      1.8
+++ tclass.h    8 May 2006 16:26:22 -0000       1.9
@@ -82,15 +82,16 @@
 /* text.c */
 TextState          *TextclassGetTextState(TextClass * tclass, int state,
                                          int active, int sticky);
-void                TextstateDrawText(TextState * ts, Window win,
+void                TextstateDrawText(TextState * ts, Win win, Drawable draw,
                                      const char *text, int x, int y, int w,
                                      int h, int fsize, int justification);
 void                TextSize(TextClass * tclass, int active, int sticky,
                             int state, const char *text, int *width,
                             int *height, int fsize);
-void                TextDraw(TextClass * tclass, Drawable draw, int active,
-                            int sticky, int state, const char *text, int x,
-                            int y, int w, int h, int fsize, int justification);
+void                TextDraw(TextClass * tclass, Win win, Drawable draw,
+                            int active, int sticky, int state,
+                            const char *text, int x, int y, int w, int h,
+                            int fsize, int justification);
 
 /* ttfont.c */
 void                Efont_extents(Efont * f, const char *text,
===================================================================
RCS file: /cvs/e/e16/e/src/text.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -3 -r1.66 -r1.67
--- text.c      29 Apr 2006 19:39:21 -0000      1.66
+++ text.c      8 May 2006 16:26:22 -0000       1.67
@@ -29,11 +29,10 @@
 #define ExTextExtents XmbTextExtents
 #define ExDrawString XmbDrawString
 
-static void         TextDrawRotTo(Window win, Drawable * drawable, int x, int 
y,
-                                 int w, int h, TextState * ts);
-
-static void         TextDrawRotBack(Window win, Drawable drawable, int x, int 
y,
-                                   int w, int h, TextState * ts);
+static void         TextDrawRotTo(Win win, Drawable src, Drawable dst,
+                                 int x, int y, int w, int h, TextState * ts);
+static void         TextDrawRotBack(Win win, Drawable dst, Drawable src,
+                                   int x, int y, int w, int h, TextState * ts);
 
 TextState          *
 TextclassGetTextState(TextClass * tclass, int state, int active, int sticky)
@@ -270,8 +269,9 @@
 }
 
 void
-TextstateDrawText(TextState * ts, Window win, const char *text, int x, int y,
-                 int w, int h, int fsize __UNUSED__, int justification)
+TextstateDrawText(TextState * ts, Win win, Drawable draw, const char *text,
+                 int x, int y, int w, int h, int fsize __UNUSED__,
+                 int justification)
 {
    const char         *str;
    char              **lines;
@@ -293,8 +293,11 @@
    if (!lines)
       return;
 
+   if (draw == None)
+      draw = WinGetXwin(win);
+
    if (!gc)
-      gc = EXCreateGC(win, 0, NULL);
+      gc = EXCreateGC(draw, 0, NULL);
 
    if (ts->style.orientation == FONT_TO_RIGHT ||
        ts->style.orientation == FONT_TO_LEFT)
@@ -349,13 +352,11 @@
             xx = x + (((textwidth_limit - wid) * justification) >> 10);
 
             if (ts->style.orientation != FONT_TO_RIGHT)
-               drawable =
-                  EXCreatePixmap(win, wid + 2, ascent + descent + 2,
-                                 VRoot.depth);
+               drawable = ECreatePixmap(win, wid + 2, ascent + descent + 2, 0);
             else
-               drawable = win;
-            TextDrawRotTo(win, &drawable, xx - 1, yy - 1 - ascent, wid + 2,
-                          ascent + descent + 2, ts);
+               drawable = draw;
+            TextDrawRotTo(win, draw, drawable, xx - 1, yy - 1 - ascent,
+                          wid + 2, ascent + descent + 2, ts);
             if (ts->style.orientation == FONT_TO_RIGHT)
               {
                  offset_x = xx;
@@ -392,9 +393,9 @@
             EFont_draw_string(drawable, gc, offset_x, offset_y, lines[i],
                               ts->efont, VRoot.vis, VRoot.cmap);
 
-            TextDrawRotBack(win, drawable, xx - 1, yy - 1 - ascent, wid + 2,
-                            ascent + descent + 2, ts);
-            if (drawable != win)
+            TextDrawRotBack(win, draw, drawable, xx - 1, yy - 1 - ascent,
+                            wid + 2, ascent + descent + 2, ts);
+            if (drawable != draw)
                EFreePixmap(drawable);
             yy += ascent + descent;
          }
@@ -493,11 +494,10 @@
 
             if (ts->style.orientation != FONT_TO_RIGHT)
                drawable =
-                  EXCreatePixmap(win, ret2.width + 2, ret2.height + 2,
-                                 VRoot.depth);
+                  ECreatePixmap(win, ret2.width + 2, ret2.height + 2, 0);
             else
-               drawable = win;
-            TextDrawRotTo(win, &drawable, xx - 1,
+               drawable = draw;
+            TextDrawRotTo(win, draw, drawable, xx - 1,
                           yy - (ts->xfontset_ascent) - 1, ret2.width + 2,
                           ret2.height + 2, ts);
             if (ts->style.orientation == FONT_TO_RIGHT)
@@ -536,10 +536,10 @@
             ExDrawString(disp, drawable, ts->xfontset, gc, offset_x, offset_y,
                          lines[i], strlen(lines[i]));
 
-            TextDrawRotBack(win, drawable, xx - 1,
+            TextDrawRotBack(win, draw, drawable, xx - 1,
                             yy - (ts->xfontset_ascent) - 1, ret2.width + 2,
                             ret2.height + 2, ts);
-            if (drawable != win)
+            if (drawable != draw)
                EFreePixmap(drawable);
             yy += ret2.height;
          }
@@ -590,13 +590,11 @@
             xx = x + (((textwidth_limit - wid) * justification) >> 10);
 
             if (ts->style.orientation != FONT_TO_RIGHT)
-               drawable =
-                  EXCreatePixmap(win, wid + 2, ascent + descent + 2,
-                                 VRoot.depth);
+               drawable = ECreatePixmap(win, wid + 2, ascent + descent + 2, 0);
             else
-               drawable = win;
-            TextDrawRotTo(win, &drawable, xx - 1, yy - ascent - 1, wid + 2,
-                          ascent + descent + 2, ts);
+               drawable = draw;
+            TextDrawRotTo(win, draw, drawable, xx - 1, yy - ascent - 1,
+                          wid + 2, ascent + descent + 2, ts);
             if (ts->style.orientation == FONT_TO_RIGHT)
               {
                  offset_x = xx;
@@ -633,9 +631,9 @@
             XDrawString(disp, drawable, gc, offset_x, offset_y, lines[i],
                         strlen(lines[i]));
 
-            TextDrawRotBack(win, drawable, xx - 1, yy - 1 - ascent, wid + 2,
-                            ascent + descent + 2, ts);
-            if (drawable != win)
+            TextDrawRotBack(win, draw, drawable, xx - 1, yy - 1 - ascent,
+                            wid + 2, ascent + descent + 2, ts);
+            if (drawable != draw)
                EFreePixmap(drawable);
             yy += ts->xfont->ascent + ts->xfont->descent;
          }
@@ -688,13 +686,11 @@
             xx = x + (((textwidth_limit - wid) * justification) >> 10);
 
             if (ts->style.orientation != FONT_TO_RIGHT)
-               drawable =
-                  EXCreatePixmap(win, wid + 2, ascent + descent + 2,
-                                 VRoot.depth);
+               drawable = ECreatePixmap(win, wid + 2, ascent + descent + 2, 0);
             else
-               drawable = win;
-            TextDrawRotTo(win, &drawable, xx - 1, yy - ascent - 1, wid + 2,
-                          ascent + descent + 2, ts);
+               drawable = draw;
+            TextDrawRotTo(win, draw, drawable, xx - 1, yy - ascent - 1,
+                          wid + 2, ascent + descent + 2, ts);
             if (ts->style.orientation == FONT_TO_RIGHT)
               {
                  offset_x = xx;
@@ -731,10 +727,10 @@
             XDrawString16(disp, drawable, gc, offset_x, offset_y,
                           (XChar2b *) lines[i], strlen(lines[i]) / 2);
 
-            TextDrawRotBack(win, drawable, xx - 1, yy - 1 - ascent, wid + 2,
-                            ascent + descent + 2, ts);
-            if (drawable != win)
-               XFreePixmap(disp, drawable);
+            TextDrawRotBack(win, draw, drawable, xx - 1, yy - 1 - ascent,
+                            wid + 2, ascent + descent + 2, ts);
+            if (drawable != draw)
+               EFreePixmap(drawable);
             yy += ts->xfont->ascent + ts->xfont->descent;
          }
      }
@@ -743,8 +739,8 @@
 }
 
 void
-TextDraw(TextClass * tclass, Drawable draw, int active, int sticky, int state,
-        const char *text, int x, int y, int w, int h, int fsize,
+TextDraw(TextClass * tclass, Win win, Drawable draw, int active, int sticky,
+        int state, const char *text, int x, int y, int w, int h, int fsize,
         int justification)
 {
    TextState          *ts;
@@ -756,38 +752,35 @@
    if (!ts)
       return;
 
-   TextstateDrawText(ts, draw, text, x, y, w, h, fsize, justification);
+   TextstateDrawText(ts, win, draw, text, x, y, w, h, fsize, justification);
 }
 
-void
-TextDrawRotTo(Window win, Drawable * draw, int x, int y, int w, int h,
-             TextState * ts)
+static void
+TextDrawRotTo(Win win __UNUSED__, Drawable src, Drawable dst, int x, int y,
+             int w, int h, TextState * ts)
 {
    EImage             *im;
-   int                 win_x, win_y;
-   unsigned int        win_w, win_h, win_b, win_d;
-   Window              rr;
+   int                 win_w;
 
    switch (ts->style.orientation)
      {
      case FONT_TO_UP:
-       im = EImageGrabDrawable(win, 0, y, x, h, w, 0);
+       im = EImageGrabDrawable(src, 0, y, x, h, w, 0);
        EImageOrientate(im, 1);
-       EImageRenderOnDrawable(im, *draw, 0, 0, w, h, 0);
+       EImageRenderOnDrawable(im, dst, 0, 0, w, h, 0);
        EImageFree(im);
        break;
      case FONT_TO_DOWN:
-       XGetGeometry(disp, win, &rr, &win_x, &win_y, &win_w, &win_h,
-                    &win_b, &win_d);
-       im = EImageGrabDrawable(win, None, win_w - y - h, x, h, w, 0);
+       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, *draw, 0, 0, w, h, 0);
+       EImageRenderOnDrawable(im, dst, 0, 0, w, h, 0);
        EImageFree(im);
        break;
      case FONT_TO_LEFT:        /* Holy carumba! That's for yoga addicts, maybe 
.... */
-       im = EImageGrabDrawable(win, None, x, y, w, h, 0);
+       im = EImageGrabDrawable(src, None, x, y, w, h, 0);
        EImageOrientate(im, 2);
-       EImageRenderOnDrawable(im, *draw, 0, 0, w, h, 0);
+       EImageRenderOnDrawable(im, dst, 0, 0, w, h, 0);
        EImageFree(im);
        break;
      default:
@@ -795,35 +788,32 @@
      }
 }
 
-void
-TextDrawRotBack(Window win, Pixmap draw, int x, int y, int w, int h,
-               TextState * ts)
+static void
+TextDrawRotBack(Win win __UNUSED__, Drawable dst, Drawable src, int x, int y,
+               int w, int h, TextState * ts)
 {
    EImage             *im;
-   int                 win_x, win_y;
-   unsigned int        win_w, win_h, win_b, win_d;
-   Window              rr;
+   int                 win_w;
 
    switch (ts->style.orientation)
      {
      case FONT_TO_UP:
-       im = EImageGrabDrawable(draw, None, 0, 0, w, h, 0);
+       im = EImageGrabDrawable(src, None, 0, 0, w, h, 0);
        EImageOrientate(im, 3);
-       EImageRenderOnDrawable(im, win, y, x, h, w, 0);
+       EImageRenderOnDrawable(im, dst, y, x, h, w, 0);
        EImageFree(im);
        break;
      case FONT_TO_DOWN:
-       XGetGeometry(disp, win, &rr, &win_x, &win_y, &win_w, &win_h,
-                    &win_b, &win_d);
-       im = EImageGrabDrawable(draw, None, 0, 0, w, h, 0);
+       EXGetGeometry(dst, NULL, NULL, NULL, &win_w, NULL, NULL, NULL);
+       im = EImageGrabDrawable(src, None, 0, 0, w, h, 0);
        EImageOrientate(im, 1);
-       EImageRenderOnDrawable(im, win, win_w - y - h, x, h, w, 0);
+       EImageRenderOnDrawable(im, 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(draw, None, 0, 0, w, h, 0);
+       im = EImageGrabDrawable(src, None, 0, 0, w, h, 0);
        EImageOrientate(im, 2);
-       EImageRenderOnDrawable(im, win, x, y, w, h, 0);
+       EImageRenderOnDrawable(im, dst, x, y, w, h, 0);
        EImageFree(im);
        break;
      default:
===================================================================
RCS file: /cvs/e/e16/e/src/tooltips.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -3 -r1.102 -r1.103
--- tooltips.c  29 Apr 2006 19:39:21 -0000      1.102
+++ tooltips.c  8 May 2006 16:26:22 -0000       1.103
@@ -592,7 +592,7 @@
    xx = pad->left + iw;
 
    /* draw the ordinary tooltip text */
-   TextDraw(tt->tclass, Xwin(tt->TTWIN->win), 0, 0, STATE_NORMAL, text, xx,
+   TextDraw(tt->tclass, tt->TTWIN->win, None, 0, 0, STATE_NORMAL, text, xx,
            pad->top, headline_w, headline_h, 17, 512);
 
    /* draw the icons and labels, if any */
@@ -617,7 +617,7 @@
 
             if (ActionGetEvent(aa) == EVENT_DOUBLE_DOWN)
               {
-                 TextDraw(tt->tclass, Xwin(tt->TTWIN->win), 0, 0, STATE_NORMAL,
+                 TextDraw(tt->tclass, tt->TTWIN->win, None, 0, 0, STATE_NORMAL,
                           "2x", xx + iw - double_w, y, double_w, heights[i],
                           17, 0);
               }
@@ -669,7 +669,7 @@
                     TooltipIclassPaste(tt, "TOOLTIP_KEY_MOD5", x, y, &x);
               }
 
-            TextDraw(tt->tclass, Xwin(tt->TTWIN->win), 0, 0, STATE_NORMAL, tts,
+            TextDraw(tt->tclass, tt->TTWIN->win, None, 0, 0, STATE_NORMAL, tts,
                      pad->left + icons_width + iw, y,
                      labels_width, heights[i], 17, 0);
             y += heights[i];
===================================================================
RCS file: /cvs/e/e16/e/src/warp.c,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -3 -r1.94 -r1.95
--- warp.c      3 May 2006 20:52:15 -0000       1.94
+++ warp.c      8 May 2006 16:26:22 -0000       1.95
@@ -230,7 +230,7 @@
             iw = fw->mh;
          }
 
-       TextDraw(fw->tc, Xwin(wi->win), 0, 0, state, wi->txt,
+       TextDraw(fw->tc, wi->win, None, 0, 0, state, wi->txt,
                 pad->left + iw, pad->top, fw->tw, fw->th, 0, 0);
      }
 




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