Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        backgrounds.c cursors.c iclass.c text.c 


Log Message:
Fix X-font color when colormap changes.

===================================================================
RCS file: /cvs/e/e16/e/src/backgrounds.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -3 -r1.74 -r1.75
--- backgrounds.c       13 May 2006 13:25:30 -0000      1.74
+++ backgrounds.c       14 May 2006 16:01:17 -0000      1.75
@@ -579,7 +579,7 @@
    if (!hasbg && !hasfg)
      {
        /* Solid color only */
-       EAllocColor(&bg->bg_solid);
+       EAllocColor(VRoot.cmap, &bg->bg_solid);
 
        if (!is_win)
          {
===================================================================
RCS file: /cvs/e/e16/e/src/cursors.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- cursors.c   29 Apr 2006 19:39:20 -0000      1.33
+++ cursors.c   14 May 2006 16:01:17 -0000      1.34
@@ -77,8 +77,8 @@
             return NULL;
          }
 
-       EAllocColor(fg);
-       EAllocColor(bg);
+       EAllocColor(VRoot.cmap, fg);
+       EAllocColor(VRoot.cmap, bg);
 
        curs = 0;
        curs = XCreatePixmapCursor(disp, pmap, mask, fg, bg, xh, yh);
===================================================================
RCS file: /cvs/e/e16/e/src/iclass.c,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -3 -r1.103 -r1.104
--- iclass.c    13 May 2006 13:25:30 -0000      1.103
+++ iclass.c    14 May 2006 16:01:17 -0000      1.104
@@ -237,11 +237,12 @@
    if (!is)
       return;
 
-   EAllocColor(&is->bg);
-   EAllocColor(&is->hi);
-   EAllocColor(&is->lo);
-   EAllocColor(&is->hihi);
-   EAllocColor(&is->lolo);
+   /* FIXME - Should be done elsewhere (ImagestateDrawBevel?) */
+   EAllocColor(VRoot.cmap, &is->bg);
+   EAllocColor(VRoot.cmap, &is->hi);
+   EAllocColor(VRoot.cmap, &is->lo);
+   EAllocColor(VRoot.cmap, &is->hihi);
+   EAllocColor(VRoot.cmap, &is->lolo);
 }
 
 static void
===================================================================
RCS file: /cvs/e/e16/e/src/text.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -3 -r1.69 -r1.70
--- text.c      13 May 2006 17:03:22 -0000      1.69
+++ text.c      14 May 2006 16:01:17 -0000      1.70
@@ -290,6 +290,13 @@
    return gc;
 }
 
+static void
+_set_gc_color(Win win, GC gc, XColor * pxc)
+{
+   EAllocColor(WinGetCmap(win), pxc);
+   XSetForeground(disp, gc, pxc->pixel);
+}
+
 void
 TextstateDrawText(TextState * ts, Win win, Drawable draw, const char *text,
                  int x, int y, int w, int h, int fsize __UNUSED__,
@@ -534,15 +541,13 @@
 
             if (ts->effect == 1)
               {
-                 EAllocColor(&ts->bg_col);
-                 XSetForeground(disp, gc, ts->bg_col.pixel);
+                 _set_gc_color(win, gc, &ts->bg_col);
                  ExDrawString(disp, drawable, ts->xfontset, gc, offset_x + 1,
                               offset_y + 1, lines[i], strlen(lines[i]));
               }
             else if (ts->effect == 2)
               {
-                 EAllocColor(&ts->bg_col);
-                 XSetForeground(disp, gc, ts->bg_col.pixel);
+                 _set_gc_color(win, gc, &ts->bg_col);
                  ExDrawString(disp, drawable, ts->xfontset, gc, offset_x - 1,
                               offset_y, lines[i], strlen(lines[i]));
                  ExDrawString(disp, drawable, ts->xfontset, gc, offset_x + 1,
@@ -552,8 +557,7 @@
                  ExDrawString(disp, drawable, ts->xfontset, gc, offset_x,
                               offset_y + 1, lines[i], strlen(lines[i]));
               }
-            EAllocColor(&ts->fg_col);
-            XSetForeground(disp, gc, ts->fg_col.pixel);
+            _set_gc_color(win, gc, &ts->fg_col);
             ExDrawString(disp, drawable, ts->xfontset, gc, offset_x, offset_y,
                          lines[i], strlen(lines[i]));
 
@@ -631,15 +635,13 @@
 
             if (ts->effect == 1)
               {
-                 EAllocColor(&ts->bg_col);
-                 XSetForeground(disp, gc, ts->bg_col.pixel);
+                 _set_gc_color(win, gc, &ts->bg_col);
                  XDrawString(disp, drawable, gc, offset_x + 1, offset_y + 1,
                              lines[i], strlen(lines[i]));
               }
             else if (ts->effect == 2)
               {
-                 EAllocColor(&ts->bg_col);
-                 XSetForeground(disp, gc, ts->bg_col.pixel);
+                 _set_gc_color(win, gc, &ts->bg_col);
                  XDrawString(disp, drawable, gc, offset_x - 1, offset_y,
                              lines[i], strlen(lines[i]));
                  XDrawString(disp, drawable, gc, offset_x + 1, offset_y,
@@ -649,8 +651,7 @@
                  XDrawString(disp, drawable, gc, offset_x, offset_y + 1,
                              lines[i], strlen(lines[i]));
               }
-            EAllocColor(&ts->fg_col);
-            XSetForeground(disp, gc, ts->fg_col.pixel);
+            _set_gc_color(win, gc, &ts->fg_col);
             XDrawString(disp, drawable, gc, offset_x, offset_y, lines[i],
                         strlen(lines[i]));
 
@@ -729,15 +730,13 @@
 
             if (ts->effect == 1)
               {
-                 EAllocColor(&ts->bg_col);
-                 XSetForeground(disp, gc, ts->bg_col.pixel);
+                 _set_gc_color(win, gc, &ts->bg_col);
                  XDrawString16(disp, drawable, gc, offset_x + 1, offset_y + 1,
                                (XChar2b *) lines[i], strlen(lines[i]) / 2);
               }
             else if (ts->effect == 2)
               {
-                 EAllocColor(&ts->bg_col);
-                 XSetForeground(disp, gc, ts->bg_col.pixel);
+                 _set_gc_color(win, gc, &ts->bg_col);
                  XDrawString16(disp, drawable, gc, offset_x - 1, offset_y,
                                (XChar2b *) lines[i], strlen(lines[i]) / 2);
                  XDrawString16(disp, drawable, gc, offset_y + 1, offset_y,
@@ -747,8 +746,7 @@
                  XDrawString16(disp, drawable, gc, offset_x, offset_y + 1,
                                (XChar2b *) lines[i], strlen(lines[i]) / 2);
               }
-            EAllocColor(&ts->fg_col);
-            XSetForeground(disp, gc, ts->fg_col.pixel);
+            _set_gc_color(win, gc, &ts->fg_col);
             XDrawString16(disp, drawable, gc, offset_x, offset_y,
                           (XChar2b *) lines[i], strlen(lines[i]) / 2);
 




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