Enlightenment CVS committal

Author  : doursse
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/modules/engines/software_xcb


Modified Files:
        Evas_Engine_Software_Xcb.h evas_engine.c evas_engine.h 
        evas_outbuf.c evas_xcb_buffer.c evas_xcb_color.c 


Log Message:
don't use X.h constants, but XCB ones. fix the last leak. fix potential bugs. 
The last version of xcb is needed

===================================================================
RCS file: 
/cvs/e/e17/libs/evas/src/modules/engines/software_xcb/Evas_Engine_Software_Xcb.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- Evas_Engine_Software_Xcb.h  2 May 2006 18:01:41 -0000       1.3
+++ Evas_Engine_Software_Xcb.h  2 May 2006 22:00:51 -0000       1.4
@@ -18,16 +18,16 @@
       XCBDRAWABLE     mask;
       XCBVISUALTYPE  *visual;
       XCBCOLORMAP     colormap;
-      int       depth;
-      int       rotation;
+      int             depth;
+      int             rotation;
 
-      int       alloc_grayscale : 1;
-      int       debug : 1;
-      int       shape_dither : 1;
-      int       destination_alpha : 1;
-      int       track_mask_changes : 1;
+      int             alloc_grayscale : 1;
+      int             debug : 1;
+      int             shape_dither : 1;
+      int             destination_alpha : 1;
+      int             track_mask_changes : 1;
 
-      int       alloc_colors_max;
+      int             alloc_colors_max;
    } info;
    /* engine specific function calls to query stuff about the destination */
    /* engine (what visual & colormap & depth to use, performance info etc. */
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_xcb/evas_engine.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- evas_engine.c       25 Apr 2006 04:00:21 -0000      1.10
+++ evas_engine.c       2 May 2006 22:00:51 -0000       1.11
@@ -121,7 +121,7 @@
 static XCBVISUALTYPE *
 _best_visual_get(XCBConnection *conn, int screen)
 {
-   XCBSCREEN        *scr;
+   XCBSCREEN *scr;
 
    if (!conn) return NULL;
    scr = XCBAuxGetScreen(conn, screen);
@@ -133,7 +133,7 @@
 static XCBCOLORMAP
 _best_colormap_get(XCBConnection *conn, int screen)
 {
-   XCBSCREEN *scr;
+   XCBSCREEN  *scr;
    XCBCOLORMAP c;
 
    c.xid = 0;
@@ -271,7 +271,7 @@
                                                  info->info.visual,
                                                  info->info.colormap,
                                                  info->info.depth,
-                                                 
evas_software_xcb_outbuf_perf_restore_x(info->info.conn,    
info->info.drawable, info->info.visual, info->info.colormap, info->info.depth),
+                                                 
evas_software_xcb_outbuf_perf_restore_x(info->info.conn, info->info.drawable, 
info->info.visual, info->info.colormap, info->info.depth),
                                                  info->info.alloc_grayscale,
                                                  info->info.alloc_colors_max,
                                                  info->info.mask,
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_xcb/evas_engine.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- evas_engine.h       23 Apr 2006 15:38:23 -0000      1.3
+++ evas_engine.h       2 May 2006 22:00:51 -0000       1.4
@@ -4,8 +4,9 @@
 #include <sys/ipc.h>
 #include <sys/shm.h>
 
+#define X_H   /* make sure we aren't using symbols from X.h */
+
 #include <X11/XCB/xcb.h>
-#include <X11/XCB/shm.h>
 #include <X11/XCB/xcb_aux.h>
 #include <X11/XCB/xcb_image.h>
 
@@ -48,6 +49,7 @@
         XCBGCONTEXT     gc;
         XCBGCONTEXT     gcm;
         int             swap : 1;
+        unsigned char  bit_swap : 1;
       } x;
       struct {
         DATA32    r, g, b;
@@ -113,7 +115,8 @@
 void               evas_software_xcb_x_init                    (void);
 
 /* buffer */
-void               evas_software_xcb_x_write_mask_line         
(Xcb_Output_Buffer *xcbob,
+void               evas_software_xcb_x_write_mask_line         (Outbuf         
   *buf,
+                                                                
Xcb_Output_Buffer *xcbob,
                                                                DATA32          
  *src,
                                                                int             
   w,
                                                                int             
   y);
@@ -136,6 +139,7 @@
                                                                int             
  *bytes_per_line_ret);
 int                evas_software_xcb_x_output_buffer_depth     
(Xcb_Output_Buffer *xcbob);
 int                
evas_software_xcb_x_output_buffer_byte_order(Xcb_Output_Buffer *xcbob);
+int                evas_software_xcb_x_output_buffer_bit_order 
(Xcb_Output_Buffer *xcbob);
 
 
 /* color */
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_xcb/evas_outbuf.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- evas_outbuf.c       23 Apr 2006 15:38:23 -0000      1.4
+++ evas_outbuf.c       2 May 2006 22:00:51 -0000       1.5
@@ -87,13 +87,18 @@
       if (xcbob)
        {
 #ifdef WORDS_BIGENDIAN
-          if (evas_software_xcb_x_output_buffer_byte_order(xcbob) == LSBFirst)
+          if (evas_software_xcb_x_output_buffer_byte_order(xcbob) == 
XCBImageOrderLSBFirst)
             buf->priv.x.swap = 1;
+          if (evas_software_xcb_x_output_buffer_bit_order(xcbob) == 
XCBImageOrderLSBFirst)
+            buf->priv.x.bit_swap = 1;
 #else
-          if (evas_software_xcb_x_output_buffer_byte_order(xcbob) == MSBFirst)
+          if (evas_software_xcb_x_output_buffer_byte_order(xcbob) == 
XCBImageOrderMSBFirst)
             buf->priv.x.swap = 1;
+          if (evas_software_xcb_x_output_buffer_bit_order(xcbob) == 
XCBImageOrderMSBFirst)
+            buf->priv.x.bit_swap = 1;
 #endif
-          if ((vis->_class == TrueColor) || (vis->_class == DirectColor))
+          if ((vis->_class == XCBVisualClassTrueColor) ||
+               (vis->_class == XCBVisualClassDirectColor))
             {
                buf->priv.mask.r = (DATA32) vis->red_mask;
                buf->priv.mask.g = (DATA32) vis->green_mask;
@@ -105,13 +110,15 @@
                     SWAP32(buf->priv.mask.b);
                  }
             }
-          else if ((vis->_class == PseudoColor) ||
-                   (vis->_class == StaticColor) ||
-                   (vis->_class == GrayScale) || (vis->_class == StaticGray))
+          else if ((vis->_class == XCBVisualClassStaticGray)  ||
+                   (vis->_class == XCBVisualClassGrayScale)   ||
+                   (vis->_class == XCBVisualClassStaticColor) ||
+                   (vis->_class == XCBVisualClassPseudoColor))
             {
                Convert_Pal_Mode pm = PAL_MODE_RGB332;
 
-               if ((vis->_class == GrayScale) || (vis->_class == StaticGray))
+               if ((vis->_class == XCBVisualClassGrayScale) ||
+                    (vis->_class == XCBVisualClassStaticGray))
                   grayscale = 1;
                if (grayscale)
                  {
@@ -492,8 +499,8 @@
          conv_func(src_data, data,
                    0,
                    bpl /
-                   ((evas_software_xcb_x_output_buffer_depth(obr->xcbob) /
-                     8)) - obr->w, obr->w, obr->h, x, y,
+                   ((evas_software_xcb_x_output_buffer_depth(obr->xcbob) / 8)) 
- obr->w,
+                    obr->w, obr->h, x, y,
                    buf->priv.pal->lookup);
      }
    else
@@ -504,8 +511,8 @@
          conv_func(src_data, data,
                    0,
                    bpl /
-                   ((evas_software_xcb_x_output_buffer_depth(obr->xcbob) /
-                     8)) - obr->w, obr->w, obr->h, x, y, NULL);
+                   ((evas_software_xcb_x_output_buffer_depth(obr->xcbob) / 8)) 
- obr->w,
+                    obr->w, obr->h, x, y, NULL);
        /* FIXME: this is evil - but it makes ARGB targets look correct */
        if ((buf->priv.destination_alpha) && (!obr->mxcbob) &&
            (evas_software_xcb_x_output_buffer_depth(obr->xcbob) == 32))
@@ -531,9 +538,10 @@
    if (obr->mxcbob)
      {
        for (yy = 0; yy < obr->h; yy++)
-         evas_software_xcb_x_write_mask_line(obr->mxcbob,
-                                             src_data +
-                                             (yy * obr->w), obr->w, yy);
+         evas_software_xcb_x_write_mask_line(buf,
+                                              obr->mxcbob,
+                                             src_data + (yy * obr->w),
+                                              obr->w, yy);
      }
 }
 
@@ -637,7 +645,7 @@
       free (geom);
       geom = XCBGetGeometryReply (buf->priv.x.conn, XCBGetGeometry 
(buf->priv.x.conn, root), 0);
 
-      i = XCBConnSetupSuccessRepRootsIter((XCBConnSetupSuccessRep 
*)XCBGetSetup(buf->priv.x.conn));
+      i = XCBSetupRootsIter((XCBSetup *)XCBGetSetup(buf->priv.x.conn));
       for (; i.rem; XCBSCREENNext(&i))
         if (i.data->root.xid == geom->root.xid)
            {
@@ -653,23 +661,23 @@
        CARD32        mask;
        CARD32        value[2];
 
-       mask = GCForeground | GCGraphicsExposures;
+       mask = XCBGCForeground | XCBGCGraphicsExposures;
        value[0] = screen->black_pixel;
-       value[1] = 0; /* no graphics exposures */
+       value[1] = XCBExposuresNotAllowed; /* no graphics exposures allowed */
        XCBChangeGC(buf->priv.x.conn, buf->priv.x.gc, mask, value);
        XCBPolyFillRectangle (buf->priv.x.conn, draw, buf->priv.x.gc, 1, &rect);
        XCBSync(buf->priv.x.conn, 0);
-       image = XCBImageGet(buf->priv.x.conn, draw, x, y, w, h, 0xffffffff, 
ZPixmap);
+       image = XCBImageGet(buf->priv.x.conn, draw, x, y, w, h, XCBAllPlanes, 
XCBImageFormatZPixmap);
        if (image)
           XCBImageDestroy(image);
        XCBSync(buf->priv.x.conn, 0);
-       mask = GCForeground | GCGraphicsExposures;
+       mask = XCBGCForeground | XCBGCGraphicsExposures;
        value[0] = screen->white_pixel;
-       value[1] = 0; /* no graphics exposures */
+       value[1] = XCBExposuresNotAllowed; /* no graphics exposures allowed */
        XCBChangeGC(buf->priv.x.conn, buf->priv.x.gc, mask, value);
        XCBPolyFillRectangle (buf->priv.x.conn, draw, buf->priv.x.gc, 1, &rect);
        XCBSync(buf->priv.x.conn, 0);
-       image = XCBImageGet(buf->priv.x.conn, draw, x, y, w, h, 0xffffffff, 
ZPixmap);
+       image = XCBImageGet(buf->priv.x.conn, draw, x, y, w, h, XCBAllPlanes, 
XCBImageFormatZPixmap);
        if (image)
           XCBImageDestroy(image);
        XCBSync(buf->priv.x.conn, 0);
@@ -755,7 +763,8 @@
 
    perf->x.conn = conn;
 
-   root.window = XCBConnSetupSuccessRepRootsIter ((XCBConnSetupSuccessRep 
*)XCBGetSetup (conn)).data->root;
+   /* FIXME: should use the default screen */
+   root.window = XCBSetupRootsIter ((XCBSetup *)XCBGetSetup (conn)).data->root;
    if (draw.window.xid)
      {
        XCBGetGeometryRep *geom;
@@ -770,7 +779,7 @@
        perf->x.h = (int)geom->height;
 
        perf->x.screen_num = 0;
-       i = XCBConnSetupSuccessRepRootsIter((XCBConnSetupSuccessRep 
*)XCBGetSetup(conn));
+       i = XCBSetupRootsIter((XCBSetup *)XCBGetSetup(conn));
        for (cur = 0; i.rem; XCBSCREENNext(&i), ++cur)
          if (i.data->root.xid == geom->root.xid)
            {
@@ -782,11 +791,11 @@
    perf->x.root = root;
 
    perf->x.display      = strdup (":0"); /* FIXME: 
strdup(DisplayString(disp)); in XCB ? */
-   perf->x.vendor       = 
strdup(XCBConnSetupSuccessRepVendor((XCBConnSetupSuccessRep 
*)XCBGetSetup(conn)));
-   perf->x.version      = (int)((XCBConnSetupSuccessRep 
*)XCBGetSetup(conn))->protocol_major_version;
-   perf->x.revision     = (int)((XCBConnSetupSuccessRep 
*)XCBGetSetup(conn))->protocol_minor_version;
-   perf->x.release      = (int)((XCBConnSetupSuccessRep 
*)XCBGetSetup(conn))->release_number;
-   perf->x.screen_count = 
XCBConnSetupSuccessRepRootsIter((XCBConnSetupSuccessRep 
*)XCBGetSetup(conn)).rem;
+   perf->x.vendor       = strdup(XCBSetupVendor((XCBSetup 
*)XCBGetSetup(conn)));
+   perf->x.version      = (int)((XCBSetup 
*)XCBGetSetup(conn))->protocol_major_version;
+   perf->x.revision     = (int)((XCBSetup 
*)XCBGetSetup(conn))->protocol_minor_version;
+   perf->x.release      = (int)((XCBSetup *)XCBGetSetup(conn))->release_number;
+   perf->x.screen_count = XCBSetupRootsIter((XCBSetup *)XCBGetSetup(conn)).rem;
    perf->x.depth        = x_depth;
 
    perf->min_shm_image_pixel_count = 200 * 200;        /* default hard-coded */
@@ -911,10 +920,10 @@
    format = STRING;
 
    str = evas_software_xcb_outbuf_perf_serialize_x(perf);
-   XCBChangeProperty(perf->x.conn, PropModeReplace, perf->x.root.window,
+   XCBChangeProperty(perf->x.conn, XCBPropModeReplace, perf->x.root.window,
                     type, format, 8,
                     strlen(str), str);
-/*    XSync(perf->x.disp, False); */
+   XCBSync(perf->x.conn, 0);
    free(str);
    free (rep);
 }
@@ -943,8 +952,12 @@
                                               strlen (type_str),
                                               type_str),
                                 NULL);
+   if (!type_rep)
+     return perf;
+
    type = type_rep->atom;
    format = STRING;
+   free(type_rep);
 
    cookie = XCBGetProperty(conn, 0, perf->x.root.window,
                           type, format,
@@ -994,21 +1007,22 @@
    XCBDRAWABLE    win;
    CARD32         mask;
    CARD32         value[7];
+   CARD32         value2[1];
    int            w, h;
    int            do_shm = 0;
 
    perf = evas_software_xcb_outbuf_perf_new_x(conn, draw, vis, cmap, x_depth);
 
-   mask = CWBackingStore | CWColormap |
-     CWBackPixmap | CWBorderPixel |
-     CWBitGravity | CWEventMask | CWOverrideRedirect;
-   value[0] = Always;
-   value[1] = cmap.xid;
-   value[2] = None;
-   value[3] = 0;
-   value[4] = ForgetGravity;
-   value[5] = 0;
-   value[6] = 1;
+   mask = XCBCWBackPixmap | XCBCWBorderPixel |
+     XCBCWBitGravity | XCBCWBackingStore |
+     XCBCWOverrideRedirect | XCBCWEventMask | XCBCWColormap;
+   value[0] = XCBBackPixmapNone;
+   value[1] = 0;
+   value[2] = XCBGravityBitForget;
+   value[3] = XCBBackingStoreAlways;
+   value[4] = 1;
+   value[5] = XCBEventMaskNoEvent;
+   value[6] = cmap.xid;
    w = perf->x.w;
    h = perf->x.h;
    win.window = XCBWINDOWNew (conn);
@@ -1017,11 +1031,14 @@
                    0, 0,
                    w, h,
                    0,
-                   InputOutput,
+                   XCBWindowClassInputOutput,
                    vis->visual_id,
                    mask, value);
    XCBSync(conn, 0);
-   XCBMapWindow (conn, win.window);
+   mask = XCBConfigWindowStackMode;
+   value[0] = XCBStackModeAbove;
+   XCBConfigureWindow (conn, win.window, mask, value2);
+/*    XCBMapWindow (conn, win.window); */
 
    do_shm = evas_software_xcb_x_can_do_shm(conn);
 
@@ -1032,7 +1049,6 @@
      {
        Xcb_Output_Buffer  *xcbob;
        XCBGCONTEXT         gc;
-       CARD32              gcv;
        int                 i;
        int                 max;
        int                 error;
@@ -1044,7 +1060,7 @@
        if (w > h)
           max = h;
        gc = XCBGCONTEXTNew (conn);
-       XCBCreateGC (conn, gc, win, 0, &gcv);
+       XCBCreateGC (conn, gc, win, 0, NULL);
        for (i = 16; i < max; i += 16)
          {
             int                 l;
===================================================================
RCS file: 
/cvs/e/e17/libs/evas/src/modules/engines/software_xcb/evas_xcb_buffer.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- evas_xcb_buffer.c   10 Mar 2006 07:44:23 -0000      1.2
+++ evas_xcb_buffer.c   2 May 2006 22:00:51 -0000       1.3
@@ -4,7 +4,8 @@
 static int _xcb_err = 0;
 
 void
-evas_software_xcb_x_write_mask_line(Xcb_Output_Buffer *xcbob,
+evas_software_xcb_x_write_mask_line(Outbuf            *buf,
+                                    Xcb_Output_Buffer *xcbob,
                                    DATA32            *src,
                                    int                w,
                                    int                y)
@@ -17,20 +18,40 @@
    src_ptr = src;
    dst_ptr = evas_software_xcb_x_output_buffer_data(xcbob, &bpl);
    dst_ptr = dst_ptr + (bpl * y);
-   for (x = 0; x < w; x += 8)
-      {
-        *dst_ptr =
-          ((A_VAL(&(src_ptr[0])) >> 7) << 0) |
-          ((A_VAL(&(src_ptr[1])) >> 7) << 1) |
-          ((A_VAL(&(src_ptr[2])) >> 7) << 2) |
-          ((A_VAL(&(src_ptr[3])) >> 7) << 3) |
-          ((A_VAL(&(src_ptr[4])) >> 7) << 4) |
-          ((A_VAL(&(src_ptr[5])) >> 7) << 5) |
-          ((A_VAL(&(src_ptr[6])) >> 7) << 6) |
-          ((A_VAL(&(src_ptr[7])) >> 7) << 7);
-        src_ptr += 8;
-        dst_ptr++;
-      }
+   if (buf->priv.x.bit_swap)
+     {
+       for (x = 0; x < w; x += 8)
+         {
+            *dst_ptr =
+              ((A_VAL(&(src_ptr[0])) >> 7) << 7) |
+              ((A_VAL(&(src_ptr[1])) >> 7) << 6) |
+              ((A_VAL(&(src_ptr[2])) >> 7) << 5) |
+              ((A_VAL(&(src_ptr[3])) >> 7) << 4) |
+              ((A_VAL(&(src_ptr[4])) >> 7) << 3) |
+              ((A_VAL(&(src_ptr[5])) >> 7) << 2) |
+              ((A_VAL(&(src_ptr[6])) >> 7) << 1) |
+              ((A_VAL(&(src_ptr[7])) >> 7) << 0);
+            src_ptr += 8;
+            dst_ptr++;
+         }
+     }
+   else
+     {
+       for (x = 0; x < w; x += 8)
+         {
+            *dst_ptr =
+              ((A_VAL(&(src_ptr[0])) >> 7) << 0) |
+              ((A_VAL(&(src_ptr[1])) >> 7) << 1) |
+              ((A_VAL(&(src_ptr[2])) >> 7) << 2) |
+              ((A_VAL(&(src_ptr[3])) >> 7) << 3) |
+              ((A_VAL(&(src_ptr[4])) >> 7) << 4) |
+              ((A_VAL(&(src_ptr[5])) >> 7) << 5) |
+              ((A_VAL(&(src_ptr[6])) >> 7) << 6) |
+              ((A_VAL(&(src_ptr[7])) >> 7) << 7);
+            src_ptr += 8;
+            dst_ptr++;
+         }
+     }
    for (; x < w; x ++)
       {
         XCBImagePutPixel(xcbob->image, x, y, A_VAL(src_ptr) >> 7);
@@ -45,7 +66,7 @@
    XCBDRAWABLE        drawable;
    int                depth;
 
-   drawable.window = XCBConnSetupSuccessRepRootsIter 
(XCBGetSetup(c)).data->root;
+   drawable.window = XCBSetupRootsIter (XCBGetSetup(c)).data->root;
    geom = XCBGetGeometryReply (c, XCBGetGeometry(c, drawable), 0);
    if(!geom)
      return 0;
@@ -100,16 +121,11 @@
 
    if (try_shm > 0)
      {
-       const XCBQueryExtensionRep *rep;
-
-       rep = XCBGetExtensionData(c, &XCBShmId);
-       if (rep && rep->present)
-         {
             xcbob->shm_info = malloc(sizeof(XCBShmSegmentInfo));
             if (xcbob->shm_info)
               {
                  xcbob->shm_info->shmseg = XCBShmSEGNew(c);
-                 xcbob->image = XCBImageSHMCreate(c, depth, ZPixmap, NULL, w, 
h);
+                 xcbob->image = XCBImageSHMCreate(c, depth, 
XCBImageFormatZPixmap, NULL, w, h);
                  if (xcbob->image)
                    {
                       xcbob->shm_info->shmid = shmget(IPC_PRIVATE,
@@ -152,12 +168,11 @@
                  if (xcbob->shm_info) free(xcbob->shm_info);
                  xcbob->shm_info = NULL;
               }
-         }
      }
 
    if (try_shm > 1) return NULL;
 
-   xcbob->image = XCBImageCreate(c, depth, ZPixmap, 0, data, w, h, 32, 0);
+   xcbob->image = XCBImageCreate(c, depth, XCBImageFormatZPixmap, 0, data, w, 
h, 32, 0);
    if (!xcbob->image)
      {
        free(xcbob);
@@ -246,4 +261,10 @@
 evas_software_xcb_x_output_buffer_byte_order(Xcb_Output_Buffer *xcbob)
 {
    return xcbob->image->image_byte_order;
+}
+
+int
+evas_software_xcb_x_output_buffer_bit_order(Xcb_Output_Buffer *xcbob)
+{
+   return xcbob->image->bitmap_format_bit_order;
 }
===================================================================
RCS file: 
/cvs/e/e17/libs/evas/src/modules/engines/software_xcb/evas_xcb_color.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- evas_xcb_color.c    10 Mar 2006 07:44:23 -0000      1.2
+++ evas_xcb_color.c    2 May 2006 22:00:51 -0000       1.3
@@ -51,6 +51,7 @@
    i = 0;
    color_lut = malloc((nr) * (ng) * (nb));
    if (!color_lut) return NULL;
+   /* FIXME: remove the round-trip */
    for (r = 0; r < (nr); r++)
      {
        for (g = 0; g < (ng); g++)
@@ -63,11 +64,11 @@
                  XCBAllocColorRep *rep;
 
                   val = (int)((((double)r) / ((nr) - 1)) * 65535);
-                 xcl.red = (unsigned short)(val);
+                 xcl.red = (CARD16)(val);
                  val = (int)((((double)g) / ((ng) - 1)) * 65535);
-                 xcl.green = (unsigned short)(val);
+                 xcl.green = (CARD16)(val);
                  val = (int)((((double)b) / ((nb) - 1)) * 65535);
-                 xcl.blue = (unsigned short)(val);
+                 xcl.blue = (CARD16)(val);
                  xcl_in = xcl;
                  rep = XCBAllocColorReply(conn,
                                           XCBAllocColor(conn, cmap,
@@ -83,13 +84,13 @@
                      ((xcl_in.green & sig_mask) != (xcl.green & sig_mask)) ||
                      ((xcl_in.blue  & sig_mask) != (xcl.blue  & sig_mask)))
                    {
-                      unsigned long pixels[256];
+                      CARD32 pixels[256];
                       int j;
 
                       if (i > 0)
                         {
                            for(j = 0; j < i; j++)
-                             pixels[j] = (unsigned long)color_lut[j];
+                             pixels[j] = (CARD32)color_lut[j];
                            XCBFreeColors(conn, cmap, 0, i, pixels);
                         }
                       free(color_lut);
@@ -127,9 +128,9 @@
        XCBAllocColorRep *rep;
 
        val = (int)((((double)g) / ((ng) - 1)) * 65535);
-       xcl.red = (unsigned short)(val);
-       xcl.green = (unsigned short)(val);
-       xcl.blue = (unsigned short)(val);
+       xcl.red = (CARD16)(val);
+       xcl.green = (CARD16)(val);
+       xcl.blue = (CARD16)(val);
        xcl_in = xcl;
        rep = XCBAllocColorReply(conn,
                                 XCBAllocColor(conn, cmap,
@@ -145,19 +146,19 @@
            ((xcl_in.green & sig_mask) != (xcl.green & sig_mask)) ||
            ((xcl_in.blue  & sig_mask) != (xcl.blue  & sig_mask)))
          {
-            unsigned long pixels[256];
+            CARD32 pixels[256];
             int j;
 
             if (i > 0)
               {
                  for(j = 0; j < i; j++)
-                   pixels[j] = (unsigned long) color_lut[j];
+                   pixels[j] = (CARD32) color_lut[j];
                  XCBFreeColors(conn, cmap, 0, i, pixels);
               }
             free(color_lut);
             return NULL;
          }
-       color_lut[i] = xcl.pixel;
+       color_lut[i] = rep->pixel;
        i++;
        free(rep);
      }
@@ -373,15 +374,15 @@
                                     XCBVISUALTYPE *vis,
                                     Convert_Pal   *pal)
 {
-   unsigned long pixels[256];
-   int           j;
+   CARD32 pixels[256];
+   int    j;
 
    pal->references--;
    if (pal->references > 0) return;
    if (pal->lookup)
      {
        for(j = 0; j < pal->count; j++)
-         pixels[j] = (unsigned long) pal->lookup[j];
+         pixels[j] = (CARD32) pal->lookup[j];
        XCBFreeColors(conn, cmap, 0, pal->count, pixels);
        free(pal->lookup);
      }




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