[Xcb-commit] xcb-util/image Makefile.am, 1.3, 1.4 test_xcb_image.c, 1.4, 1.5 test_xcb_image_shm.c, 1.4, 1.5

Vincent Torri xcb-commit at lists.freedesktop.org
Sat Jan 14 03:46:44 PST 2006


Update of /cvs/xcb/xcb-util/image
In directory gabe:/tmp/cvs-serv31678/image

Modified Files:
	Makefile.am test_xcb_image.c test_xcb_image_shm.c 
Log Message:
XCBConnectBasit and XCBWaitEvent are deprecated

Index: test_xcb_image.c
===================================================================
RCS file: /cvs/xcb/xcb-util/image/test_xcb_image.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- test_xcb_image.c	15 Mar 2005 00:18:13 -0000	1.4
+++ test_xcb_image.c	14 Jan 2006 11:46:42 -0000	1.5
@@ -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 @@
 }
 
 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 @@
   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 @@
 
   XCBSync (c, 0); 
 
-  while ((e = XCBWaitEvent(c)))
+  while ((e = XCBWaitForEvent(c)))
     {
       switch (e->response_type)
 	{ 

Index: test_xcb_image_shm.c
===================================================================
RCS file: /cvs/xcb/xcb-util/image/test_xcb_image_shm.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- test_xcb_image_shm.c	15 Mar 2005 00:18:14 -0000	1.4
+++ test_xcb_image_shm.c	14 Jan 2006 11:46:42 -0000	1.5
@@ -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 @@
   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 @@
 
   XCBSync (c, 0); 
 
-  while ((e = XCBWaitEvent(c)))
+  while ((e = XCBWaitForEvent(c)))
     {
       switch (e->response_type)
 	{ 

Index: Makefile.am
===================================================================
RCS file: /cvs/xcb/xcb-util/image/Makefile.am,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Makefile.am	2 Apr 2005 13:41:27 -0000	1.3
+++ Makefile.am	14 Jan 2006 11:46:42 -0000	1.4
@@ -6,8 +6,8 @@
 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
 



More information about the xcb-commit mailing list