diff options
author | Vincent Torri <Vincent.Torri@iecn.u-nancy.fr> | 2006-01-14 11:46:42 +0000 |
---|---|---|
committer | Vincent Torri <Vincent.Torri@iecn.u-nancy.fr> | 2006-01-14 11:46:42 +0000 |
commit | 2155dba25f2c79207e09822b020938d82274cf8e (patch) | |
tree | ebca57713cc3161b95c7dd77970bbe7e6761b635 | |
parent | 15dad71e7869a2db31465d93ce5ae68ae6b07b0c (diff) |
XCBConnectBasit and XCBWaitEvent are deprecated
-rw-r--r-- | xcb-util/image/Makefile.am | 4 | ||||
-rw-r--r-- | xcb-util/image/test_xcb_image.c | 33 | ||||
-rw-r--r-- | xcb-util/image/test_xcb_image_shm.c | 32 |
3 files changed, 14 insertions, 55 deletions
diff --git a/xcb-util/image/Makefile.am b/xcb-util/image/Makefile.am index 4859719..738949d 100644 --- a/xcb-util/image/Makefile.am +++ b/xcb-util/image/Makefile.am @@ -6,8 +6,8 @@ lib_LTLIBRARIES = libXCBImage.la xcbinclude_HEADERS = xcb_image.h AM_CFLAGS = -Wall -INCLUDES = $(XCB_CFLAGS) -LDADD = $(XCB_LIBS) +INCLUDES = $(XCB_CFLAGS) -I../convenient +LDADD = $(XCB_LIBS) -L../convenient -lXCBAux libXCBImage_la_SOURCES = xcb_image.c diff --git a/xcb-util/image/test_xcb_image.c b/xcb-util/image/test_xcb_image.c index aa94443..726c3fa 100644 --- a/xcb-util/image/test_xcb_image.c +++ b/xcb-util/image/test_xcb_image.c @@ -7,6 +7,7 @@ #include <X11/XCB/shm.h> #include <X11/Xlib.h> +#include "xcb_aux.h" #include "xcb_image.h" #define W_W 4 @@ -107,29 +108,6 @@ reflect_window (XCBConnection *c, } int -get_depth(XCBConnection *c, - XCBSCREEN *root) -{ - XCBDRAWABLE drawable = { root->root }; - XCBGetGeometryRep *geom; - geom = XCBGetGeometryReply(c, XCBGetGeometry(c, drawable), 0); - int depth; - - if(!geom) - { - perror("GetGeometry(root) failed"); - exit (0); - } - - depth = geom->depth; - fprintf(stderr, "Root 0x%lx: %dx%dx%d\n", - root->root.xid, geom->width, geom->height, geom->depth); - free(geom); - - return depth; -} - -int main (int argc, char *argv[]) { XCBConnection *c; @@ -144,12 +122,13 @@ main (int argc, char *argv[]) CARD32 valgc[2]; CARD32 valwin[3]; int depth; + int screen_nbr; XCBGenericEvent *e; /* Open the connexion to the X server and get the first screen */ - c = XCBConnectBasic (); - screen = XCBConnSetupSuccessRepRootsIter (XCBGetSetup (c)).data; - depth = get_depth (c, screen); + c = XCBConnect (NULL, &screen_nbr); + screen = XCBAuxGetScreen (c, screen_nbr); + depth = XCBAuxGetDepth (c, screen); /* Create a black graphic context for drawing in the foreground */ win.window = screen->root; @@ -230,7 +209,7 @@ main (int argc, char *argv[]) XCBSync (c, 0); - while ((e = XCBWaitEvent(c))) + while ((e = XCBWaitForEvent(c))) { switch (e->response_type) { diff --git a/xcb-util/image/test_xcb_image_shm.c b/xcb-util/image/test_xcb_image_shm.c index 5410d6d..4975fe5 100644 --- a/xcb-util/image/test_xcb_image_shm.c +++ b/xcb-util/image/test_xcb_image_shm.c @@ -8,34 +8,13 @@ #include <X11/XCB/shm.h> #include <X11/Xlib.h> +#include "xcb_aux.h" #include "xcb_image.h" #define W_W 40 #define W_H 40 -int -get_depth(XCBConnection *c, - XCBSCREEN *root) -{ - XCBDRAWABLE drawable = { root->root }; - XCBGetGeometryRep *geom; - geom = XCBGetGeometryReply(c, XCBGetGeometry(c, drawable), 0); - int depth; - - if(!geom) - { - perror("GetGeometry(root) failed"); - exit (0); - } - - depth = geom->depth; - fprintf(stderr, "Root 0x%lx: %dx%dx%d\n", - root->root.xid, geom->width, geom->height, geom->depth); - free(geom); - - return depth; -} int main (int argc, char *argv[]) @@ -51,12 +30,13 @@ main (int argc, char *argv[]) CARD32 valgc[2]; CARD32 valwin[3]; int depth; + int screen_nbr; XCBGenericEvent *e; /* Open the connexion to the X server and get the first screen */ - c = XCBConnectBasic (); - screen = XCBConnSetupSuccessRepRootsIter (XCBGetSetup (c)).data; - depth = get_depth (c, screen); + c = XCBConnect (NULL, &screen_nbr); + screen = XCBAuxGetScreen (c, screen_nbr); + depth = XCBAuxGetDepth (c, screen); /* Create a black graphic context for drawing in the foreground */ win.window = screen->root; @@ -163,7 +143,7 @@ main (int argc, char *argv[]) XCBSync (c, 0); - while ((e = XCBWaitEvent(c))) + while ((e = XCBWaitForEvent(c))) { switch (e->response_type) { |