[Xcb-commit] xcb xcb-util
Ian Osgood
iano at kemper.freedesktop.org
Sat Jul 1 08:49:38 PDT 2006
xcb-util/image/test_formats.c | 12 ++++++------
xcb-util/image/test_xcb_image.c | 24 ++++++++++++------------
xcb-util/image/test_xcb_image_shm.c | 20 ++++++++++----------
xcb/src/xcb.h | 1 -
4 files changed, 28 insertions(+), 29 deletions(-)
New commits:
diff-tree 9fe4adbe24571c06e1aebe8873689c5da029d366 (from 27cca19cbd0576648c65844ac75d53c122e61cab)
Author: Ian Osgood <iano at quirkster.com>
Date: Sat Jul 1 00:55:08 2006 -0700
Finally remove X.h from xcb.h, fix broken image tests.
diff --git a/xcb-util/image/test_formats.c b/xcb-util/image/test_formats.c
index 009d185..eb25d66 100644
--- a/xcb-util/image/test_formats.c
+++ b/xcb-util/image/test_formats.c
@@ -34,7 +34,7 @@ static XCBImage *create_image(XCBConnect
printf("ImageCreate failed.\n");
return 0;
}
- im->data = malloc(im->bytes_per_line * HEIGHT * (format == ZPixmap ? 1 : depth));
+ im->data = malloc(im->bytes_per_line * HEIGHT * (format == XCBImageFormatZPixmap ? 1 : depth));
if(!im->data)
{
XCBImageDestroy(im);
@@ -53,10 +53,10 @@ static XCBImage *create_image(XCBConnect
static XCBWINDOW create_window(XCBConnection *c, XCBSCREEN *root)
{
static const CARD32 mask = XCBCWEventMask;
- static const CARD32 values[] = { ExposureMask };
+ static const CARD32 values[] = { XCBEventMaskExposure };
unsigned int seq;
XCBWINDOW w = XCBWINDOWNew(c);
- seq = XCBCreateWindow(c, root->root_depth, w, root->root, 30, 30, WIDTH, HEIGHT, 0, InputOutput, root->root_visual, mask, values).sequence;
+ seq = XCBCreateWindow(c, root->root_depth, w, root->root, 30, 30, WIDTH, HEIGHT, 0, XCBWindowClassInputOutput, root->root_visual, mask, values).sequence;
printf("CreateWindow sequence %d, depth %d\n", seq, root->root_depth);
seq = XCBMapWindow(c, w).sequence;
printf("MapWindow sequence %d\n", seq);
@@ -74,7 +74,7 @@ static XCBPIXMAP create_pixmap(XCBConnec
static XCBGCONTEXT create_gcontext(XCBConnection *c, XCBSCREEN *root)
{
- static const CARD32 mask = GCForeground | GCBackground;
+ static const CARD32 mask = XCBGCForeground | XCBGCBackground;
const CARD32 values[] = { root->black_pixel, root->white_pixel };
const XCBDRAWABLE d = { root->root };
unsigned int seq;
@@ -86,7 +86,7 @@ static XCBGCONTEXT create_gcontext(XCBCo
int main(int argc, char **argv)
{
- int screen, depth, format = ZPixmap;
+ int screen, depth, format = XCBImageFormatZPixmap;
XCBSCREEN *root;
XCBImage *im;
XCBDRAWABLE d, w = { { 0 } };
@@ -101,7 +101,7 @@ int main(int argc, char **argv)
root = XCBAuxGetScreen(c, screen);
if(argc > 1)
format = atoi(argv[1]);
- if(format == XYBitmap || argc > 2)
+ if(format == XCBImageFormatXYBitmap || argc > 2)
depth = 1;
else
depth = root->root_depth;
diff --git a/xcb-util/image/test_xcb_image.c b/xcb-util/image/test_xcb_image.c
index cd16c50..4816672 100644
--- a/xcb-util/image/test_xcb_image.c
+++ b/xcb-util/image/test_xcb_image.c
@@ -29,7 +29,7 @@ reflect_window (XCBConnection *c,
int i, j;
int format;
- format = ZPixmap;
+ format = XCBImageFormatZPixmap;
printf ("get_image %d %d\n", width, height);
image = XCBImageGet (c, win,
@@ -132,13 +132,13 @@ main (int argc, char *argv[])
win.window = screen->root;
fgcolor = XCBGCONTEXTNew(c);
- mask = GCForeground | GCGraphicsExposures;
+ mask = XCBGCForeground | XCBGCGraphicsExposures;
valgc[0] = screen->black_pixel;
valgc[1] = 0; /* no graphics exposures */
XCBCreateGC(c, fgcolor, win, mask, valgc);
bgcolor = XCBGCONTEXTNew(c);
- mask = GCForeground | GCGraphicsExposures;
+ mask = XCBGCForeground | XCBGCGraphicsExposures;
valgc[0] = screen->white_pixel;
valgc[1] = 0; /* no graphics exposures */
XCBCreateGC(c, bgcolor, win, mask, valgc);
@@ -149,8 +149,8 @@ main (int argc, char *argv[])
/* Create the window */
mask = XCBCWBackPixel | XCBCWEventMask | XCBCWDontPropagate;
valwin[0] = screen->white_pixel;
- valwin[1] = KeyPressMask | ButtonReleaseMask | ExposureMask;
- valwin[2] = ButtonPressMask;
+ valwin[1] = XCBEventMaskKeyPress | XCBEventMaskButtonRelease | XCBEventMaskExposure;
+ valwin[2] = XCBEventMaskButtonPress;
XCBCreateWindow (c, /* Connection */
0, /* depth */
win.window, /* window Id */
@@ -158,7 +158,7 @@ main (int argc, char *argv[])
0, 0, /* x, y */
W_W, W_H, /* width, height */
10, /* border_width */
- InputOutput, /* class */
+ XCBWindowClassInputOutput,/* class */
screen->root_visual, /* visual */
mask, valwin); /* masks, not used yet */
@@ -173,7 +173,7 @@ main (int argc, char *argv[])
points[0].y = 0;
points[1].x = 1;
points[1].y = 1;
- XCBPolyLine(c, CoordModeOrigin, rect, fgcolor, 2, points);
+ XCBPolyLine(c, XCBCoordModeOrigin, rect, fgcolor, 2, points);
/* points[0].x = 10; */
/* points[0].y = 10; */
/* points[1].x = 10; */
@@ -186,8 +186,8 @@ main (int argc, char *argv[])
/* Create the window */
mask = XCBCWBackPixel | XCBCWEventMask | XCBCWDontPropagate;
valwin[0] = screen->white_pixel;
- valwin[1] = KeyPressMask | ButtonReleaseMask | ExposureMask;
- valwin[2] = ButtonPressMask;
+ valwin[1] = XCBEventMaskKeyPress | XCBEventMaskButtonRelease | XCBEventMaskExposure;
+ valwin[2] = XCBEventMaskButtonPress;
XCBCreateWindow (c, /* Connection */
0, /* depth */
new_win.window, /* window Id */
@@ -195,7 +195,7 @@ main (int argc, char *argv[])
0, 0, /* x, y */
W_W, W_H, /* width, height */
10, /* border_width */
- InputOutput, /* class */
+ XCBWindowClassInputOutput,/* class */
screen->root_visual, /* visual */
mask, valwin); /* masks, not used yet */
@@ -205,7 +205,7 @@ main (int argc, char *argv[])
XCBMapWindow (c, new_win.window);
- XCBSync (c, 0);
+ XCBFlush (c);
while ((e = XCBWaitForEvent(c)))
{
@@ -218,7 +218,7 @@ main (int argc, char *argv[])
reflect_window (c, win, new_win,
fgcolor,
W_W, W_H);
- XCBSync (c, 0);
+ XCBFlush (c);
break;
}
}
diff --git a/xcb-util/image/test_xcb_image_shm.c b/xcb-util/image/test_xcb_image_shm.c
index 6e15be3..3a068c0 100644
--- a/xcb-util/image/test_xcb_image_shm.c
+++ b/xcb-util/image/test_xcb_image_shm.c
@@ -41,13 +41,13 @@ main (int argc, char *argv[])
win.window = screen->root;
fgcolor = XCBGCONTEXTNew(c);
- mask = GCForeground | GCGraphicsExposures;
+ mask = XCBGCForeground | XCBGCGraphicsExposures;
valgc[0] = screen->black_pixel;
valgc[1] = 0; /* no graphics exposures */
XCBCreateGC(c, fgcolor, win, mask, valgc);
bgcolor = XCBGCONTEXTNew(c);
- mask = GCForeground | GCGraphicsExposures;
+ mask = XCBGCForeground | XCBGCGraphicsExposures;
valgc[0] = screen->white_pixel;
valgc[1] = 0; /* no graphics exposures */
XCBCreateGC(c, bgcolor, win, mask, valgc);
@@ -108,8 +108,8 @@ main (int argc, char *argv[])
/* Create the window */
mask = XCBCWBackPixel | XCBCWEventMask | XCBCWDontPropagate;
valwin[0] = screen->white_pixel;
- valwin[1] = KeyPressMask | ButtonReleaseMask | ExposureMask;
- valwin[2] = ButtonPressMask;
+ valwin[1] = XCBEventMaskKeyPress | XCBEventMaskButtonRelease | XCBEventMaskExposure;
+ valwin[2] = XCBEventMaskButtonPress;
XCBCreateWindow (c, /* Connection */
0, /* depth */
win.window, /* window Id */
@@ -117,9 +117,9 @@ main (int argc, char *argv[])
0, 0, /* x, y */
W_W, W_H, /* width, height */
10, /* border_width */
- InputOutput, /* class */
+ XCBWindowClassInputOutput,/* class */
screen->root_visual, /* visual */
- mask, valwin); /* masks, not used yet */
+ mask, valwin); /* masks, not used yet */
/* Map the window on the screen */
XCBMapWindow (c, win.window);
@@ -132,15 +132,15 @@ main (int argc, char *argv[])
points[0].y = 0;
points[1].x = 1;
points[1].y = 1;
- XCBPolyLine(c, CoordModeOrigin, rect, fgcolor, 2, points);
+ XCBPolyLine(c, XCBCoordModeOrigin, rect, fgcolor, 2, points);
/* points[0].x = 10; */
/* points[0].y = 10; */
/* points[1].x = 10; */
/* points[1].y = 40; */
-/* XCBPolyLine(c, CoordModeOrigin, rect, fgcolor, 2, points); */
+/* XCBPolyLine(c, XCBCoordModeOrigin, rect, fgcolor, 2, points); */
- XCBSync (c, 0);
+ XCBFlush (c);
while ((e = XCBWaitForEvent(c)))
{
@@ -155,7 +155,7 @@ main (int argc, char *argv[])
img, shminfo,
0, 0, 0, 0, W_W,W_H,
0);
- XCBSync (c, 0);
+ XCBFlush (c);
break;
}
}
diff --git a/xcb/src/xcb.h b/xcb/src/xcb.h
index ca58e3d..639f583 100644
--- a/xcb/src/xcb.h
+++ b/xcb/src/xcb.h
@@ -44,7 +44,6 @@ typedef int16_t INT16;
typedef int32_t INT32;
#endif /* XMD_H */
-#include <X11/X.h>
#include <sys/uio.h>
#include <pthread.h>
More information about the xcb-commit
mailing list