[Xcb-commit] 4 commits - xcb xcb-demo xcb-util
Jamey Sharp
jamey at kemper.freedesktop.org
Thu Apr 27 10:58:46 PDT 2006
xcb-demo/Makefile.am | 14 ++++++++------
xcb-demo/configure.ac | 3 +++
xcb-demo/rendertest.c | 2 +-
xcb-demo/xdpyinfo.c | 8 ++++----
xcb-util/convenient/xcb_aux.c | 2 +-
xcb-util/image/xcb_image.c | 22 +++++++++++-----------
xcb-util/property/prop.c | 2 +-
xcb-util/wm/manage.c | 2 +-
xcb-util/wm/xcbwm-test.c | 2 +-
xcb/src/c-client.xsl | 8 ++++----
10 files changed, 35 insertions(+), 30 deletions(-)
New commits:
diff-tree 0ed3e721ab504e06ab1da084da3bafd23b8b01fb (from d94a7cdfb5f856e31009ae9769128634f6b714b0)
Author: Jamey Sharp <jamey at minilop.net>
Date: Thu Apr 27 10:55:46 2006 -0700
Update xcb-demo for ConnSetup renaming and constness fixes.
diff --git a/xcb-demo/rendertest.c b/xcb-demo/rendertest.c
index 73b0ef3..1daf5a7 100644
--- a/xcb-demo/rendertest.c
+++ b/xcb-demo/rendertest.c
@@ -126,7 +126,7 @@ int draw_window(XCBConnection *conn, XCB
XCBRenderPOINTFIX trifans[9];
int index;
- root = XCBConnSetupSuccessRepRootsIter(XCBGetSetup(c)).data;
+ root = XCBSetupRootsIter(XCBGetSetup(c)).data;
root_drawable.window = root->root;
/* Setting query so that it will search for an 8 bit alpha surface. */
diff --git a/xcb-demo/xdpyinfo.c b/xcb-demo/xdpyinfo.c
index ba45862..55c9ff3 100644
--- a/xcb-demo/xdpyinfo.c
+++ b/xcb-demo/xdpyinfo.c
@@ -46,7 +46,7 @@ void print_setup()
{
printf("version number: %d.%d", XCBGetSetup(c)->protocol_major_version, XCBGetSetup(c)->protocol_minor_version);
fputs("\n" "vendor string: ", stdout);
- fwrite(XCBConnSetupSuccessRepVendor(XCBGetSetup(c)), 1, XCBConnSetupSuccessRepVendorLength(XCBGetSetup(c)), stdout);
+ fwrite(XCBSetupVendor(XCBGetSetup(c)), 1, XCBSetupVendorLength(XCBGetSetup(c)), stdout);
printf("\n" "vendor release number: %d", (int) XCBGetSetup(c)->release_number);
/* "\n" "XFree86 version: %d.%d.%d.%d" */
printf("\n" "maximum request size: %d bytes", XCBGetSetup(c)->maximum_request_length * 4);
@@ -61,8 +61,8 @@ void print_setup()
void print_formats()
{
- int i = XCBConnSetupSuccessRepPixmapFormatsLength(XCBGetSetup(c));
- XCBFORMAT *p = XCBConnSetupSuccessRepPixmapFormats(XCBGetSetup(c));
+ int i = XCBSetupPixmapFormatsLength(XCBGetSetup(c));
+ XCBFORMAT *p = XCBSetupPixmapFormats(XCBGetSetup(c));
printf("\n" "number of supported pixmap formats: %d", i);
fputs("\n" "supported pixmap formats:", stdout);
for(--i; i >= 0; --i, ++p)
@@ -136,7 +136,7 @@ void list_screens()
XCBSCREENIter i;
int cur;
- i = XCBConnSetupSuccessRepRootsIter(XCBGetSetup(c));
+ i = XCBSetupRootsIter(XCBGetSetup(c));
printf("\n" "number of screens: %d" "\n", i.rem);
for(cur = 1; i.rem; XCBSCREENNext(&i), ++cur)
{
diff-tree d94a7cdfb5f856e31009ae9769128634f6b714b0 (from dca8b742f87cb6f04176fe40748441f1fb2f700a)
Author: Jamey Sharp <jamey at minilop.net>
Date: Thu Apr 27 10:51:47 2006 -0700
Update demos to find DPMS, RENDER, and RANDR using pkg-config.
diff --git a/xcb-demo/Makefile.am b/xcb-demo/Makefile.am
index 321124b..67b6a44 100644
--- a/xcb-demo/Makefile.am
+++ b/xcb-demo/Makefile.am
@@ -11,21 +11,23 @@ LDADD = $(XCB_LIBS)
bin_PROGRAMS = hypnomoire xdpyinfo xcb-test dpms rendertest xcbrandr
hypnomoire_CFLAGS = $(XCBAUX_CFLAGS)
-hypnomoire_LDADD = $(LDADD) $(XCBAUX_LIBS) -lm -lpthread
+hypnomoire_LDADD = $(XCBAUX_LIBS) -lm -lpthread
hypnomoire_SOURCES = hypnomoire.c reply_formats.c
xdpyinfo_SOURCES = xdpyinfo.c
xcb_test_CFLAGS = $(XCBAUX_CFLAGS)
-xcb_test_LDADD = $(LDADD) $(XCBAUX_LIBS) -lpthread
+xcb_test_LDADD = $(XCBAUX_LIBS) -lpthread
xcb_test_SOURCES = main.c reply_formats.c
+dpms_CFLAGS = $(XCBDPMS_CFLAGS)
+dpms_LDADD = $(XCBDPMS_LIBS)
dpms_SOURCES = dpms.c
-rendertest_CFLAGS = $(XCBAUX_CFLAGS)
-rendertest_LDADD = $(XCBAUX_LIBS)
+rendertest_CFLAGS = $(XCBAUX_CFLAGS) $(XCBRENDER_CFLAGS)
+rendertest_LDADD = $(XCBAUX_LIBS) $(XCBRENDER_LIBS)
rendertest_SOURCES = rendertest.c
-xcbrandr_CFLAGS = $(XCBAUX_CFLAGS)
-xcbrandr_LDADD = $(XCBAUX_LIBS)
+xcbrandr_CFLAGS = $(XCBAUX_CFLAGS) $(XCBRANDR_CFLAGS)
+xcbrandr_LDADD = $(XCBAUX_LIBS) $(XCBRANDR_LIBS)
xcbrandr_SOURCES = xcbrandr.c
diff --git a/xcb-demo/configure.ac b/xcb-demo/configure.ac
index 8b512ea..69fbe55 100644
--- a/xcb-demo/configure.ac
+++ b/xcb-demo/configure.ac
@@ -14,5 +14,8 @@ PKG_CHECK_MODULES(XCB, xcb)
PKG_CHECK_MODULES(XCBAUX, xcb-aux)
PKG_CHECK_MODULES(XCBIMAGE, xcb-image)
PKG_CHECK_MODULES(XCBICCCM, xcb-icccm)
+PKG_CHECK_MODULES(XCBDPMS, xcb-dpms)
+PKG_CHECK_MODULES(XCBRENDER, xcb-render)
+PKG_CHECK_MODULES(XCBRANDR, xcb-randr)
AC_OUTPUT([Makefile tests/Makefile])
diff-tree dca8b742f87cb6f04176fe40748441f1fb2f700a (from cc96805378195a8cba7b509eb2a9b67d70f41052)
Author: Jamey Sharp <jamey at minilop.net>
Date: Thu Apr 27 10:35:54 2006 -0700
Update xcb-util for ConnSetup renaming and constness fixes.
diff --git a/xcb-util/convenient/xcb_aux.c b/xcb-util/convenient/xcb_aux.c
index 3241e49..608d83e 100644
--- a/xcb-util/convenient/xcb_aux.c
+++ b/xcb-util/convenient/xcb_aux.c
@@ -32,7 +32,7 @@ XCBSCREEN *
XCBAuxGetScreen (XCBConnection *c,
int screen)
{
- XCBSCREENIter i = XCBConnSetupSuccessRepRootsIter((XCBConnSetupSuccessRep *)XCBGetSetup(c));
+ XCBSCREENIter i = XCBSetupRootsIter(XCBGetSetup(c));
for (; i.rem; --screen, XCBSCREENNext(&i))
if (screen == 0)
return i.data;
diff --git a/xcb-util/image/xcb_image.c b/xcb-util/image/xcb_image.c
index 40e4b2a..43906cb 100644
--- a/xcb-util/image/xcb_image.c
+++ b/xcb-util/image/xcb_image.c
@@ -36,8 +36,8 @@ static unsigned int Ones(
static CARD8
xcb_bits_per_pixel (XCBConnection *c, CARD8 depth)
{
- XCBFORMAT *fmt = XCBConnSetupSuccessRepPixmapFormats(XCBGetSetup(c));
- XCBFORMAT *fmtend = fmt + XCBConnSetupSuccessRepPixmapFormatsLength(XCBGetSetup(c));
+ XCBFORMAT *fmt = XCBSetupPixmapFormats(XCBGetSetup(c));
+ XCBFORMAT *fmtend = fmt + XCBSetupPixmapFormatsLength(XCBGetSetup(c));
for(; fmt != fmtend; ++fmt)
if(fmt->depth == depth)
@@ -62,8 +62,8 @@ static CARD8
xcb_scanline_pad_get (XCBConnection *conn,
CARD8 depth)
{
- XCBFORMAT *fmt = XCBConnSetupSuccessRepPixmapFormats(XCBGetSetup(conn));
- XCBFORMAT *fmtend = fmt + XCBConnSetupSuccessRepPixmapFormatsLength(XCBGetSetup(conn));
+ XCBFORMAT *fmt = XCBSetupPixmapFormats(XCBGetSetup(conn));
+ XCBFORMAT *fmtend = fmt + XCBSetupPixmapFormatsLength(XCBGetSetup(conn));
for(; fmt != fmtend; ++fmt)
if(fmt->depth == depth)
@@ -105,9 +105,9 @@ XCBImageCreate (XCBConnection *conn,
CARD8 xpad,
CARD32 bytes_per_line)
{
- XCBImage *image;
- XCBConnSetupSuccessRep *rep;
- CARD8 bpp = 1; /* bits per pixel */
+ XCBImage *image;
+ const XCBSetup *rep;
+ CARD8 bpp = 1; /* bits per pixel */
if (format_invalid(depth, format, xpad))
return (XCBImage *) NULL;
@@ -308,7 +308,7 @@ XCBImagePut (XCBConnection *conn,
dest_bits_per_pixel = image->bits_per_pixel;
dest_scanline_pad = image->bitmap_format_scanline_pad;
left_pad = 0;
- iter = XCBConnSetupSuccessRepPixmapFormatsIter (XCBGetSetup (conn));
+ iter = XCBSetupPixmapFormatsIter (XCBGetSetup (conn));
for (; iter.rem ; XCBFORMATNext (&iter))
if (iter.data->depth == image->depth)
{
@@ -319,7 +319,7 @@ XCBImagePut (XCBConnection *conn,
if (dest_bits_per_pixel != image->bits_per_pixel) {
XCBImage img;
register INT32 i, j;
- XCBConnSetupSuccessRep *rep;
+ const XCBSetup *rep;
/* XXX slow, but works */
rep = XCBGetSetup (conn);
@@ -382,8 +382,8 @@ XCBImageSHMCreate (XCBConnection *conn,
CARD16 width,
CARD16 height)
{
- XCBImage *image;
- XCBConnSetupSuccessRep *rep;
+ XCBImage *image;
+ const XCBSetup *rep;
image = (XCBImage *)malloc (sizeof (XCBImage));
if (!image)
diff --git a/xcb-util/property/prop.c b/xcb-util/property/prop.c
index cb857ca..cbe2ec8 100644
--- a/xcb-util/property/prop.c
+++ b/xcb-util/property/prop.c
@@ -118,7 +118,7 @@ int SetDefaultPropertyHandler(PropertyHa
int rootOfScreen(XCBConnection *c, int screen, XCBWINDOW *root)
{
- XCBSCREENIter i = XCBConnSetupSuccessRepRootsIter(XCBGetSetup(c));
+ XCBSCREENIter i = XCBSetupRootsIter(XCBGetSetup(c));
if(screen >= i.rem)
return 0;
for(; screen && i.rem; --screen, XCBSCREENNext(&i))
diff --git a/xcb-util/wm/manage.c b/xcb-util/wm/manage.c
index 68d85a8..8c5a29c 100644
--- a/xcb-util/wm/manage.c
+++ b/xcb-util/wm/manage.c
@@ -74,7 +74,7 @@ int handleUnmapNotifyEvent(void *data, X
return 0;
}
- root = XCBConnSetupSuccessRepRootsIter(XCBGetSetup(c)).data->root;
+ root = XCBSetupRootsIter(XCBGetSetup(c)).data->root;
printf("child of 0x%08lx.\n", client->parent.xid);
XCBReparentWindow(c, client->child, root, 0, 0);
XCBDestroyWindow(c, client->parent);
diff --git a/xcb-util/wm/xcbwm-test.c b/xcb-util/wm/xcbwm-test.c
index c2455a2..0f09823 100644
--- a/xcb-util/wm/xcbwm-test.c
+++ b/xcb-util/wm/xcbwm-test.c
@@ -81,7 +81,7 @@ void reparentWindow(XCBConnection *c, XC
XCBDRAWABLE drawable;
CARD32 mask = 0;
CARD32 values[3];
- XCBSCREEN *root = XCBConnSetupSuccessRepRootsIter(XCBGetSetup(c)).data;
+ XCBSCREEN *root = XCBSetupRootsIter(XCBGetSetup(c)).data;
XCBGCONTEXT titlegc;
w = XCBWINDOWNew(c);
diff-tree cc96805378195a8cba7b509eb2a9b67d70f41052 (from 355de481813b560353d011f79f95b9fe6cd78f8b)
Author: Jamey Sharp <jamey at minilop.net>
Date: Thu Apr 27 10:34:22 2006 -0700
Declare arguments const in the various structure accessors, so XCBGetSetup is not so painful to use.
diff --git a/xcb/src/c-client.xsl b/xcb/src/c-client.xsl
index 56dbaac..6049bac 100644
--- a/xcb/src/c-client.xsl
+++ b/xcb/src/c-client.xsl
@@ -711,7 +711,7 @@ authorization from the authors.
/*[self::valueparam or self::list]" />
<xsl:if test="not($is-variable)">
<function type="{@type} *" name="{$ref}{$field-name}">
- <field type="{$ref}{$kind} *" name="R" />
+ <field type="const {$ref}{$kind} *" name="R" />
<xsl:choose>
<xsl:when test="$is-first">
<l>return (<xsl:value-of select="@type" /> *) <!--
@@ -728,7 +728,7 @@ authorization from the authors.
</function>
</xsl:if>
<function type="int" name="{$ref}{$field-name}Length">
- <field type="{$ref}{$kind} *" name="R" />
+ <field type="const {$ref}{$kind} *" name="R" />
<l>return <xsl:apply-templates mode="output-expression">
<xsl:with-param name="field-prefix" select="'R->'" />
</xsl:apply-templates>;</l>
@@ -736,7 +736,7 @@ authorization from the authors.
<xsl:choose>
<xsl:when test="substring(@type, 1, 3) = 'XCB'">
<function type="{@type}Iter" name="{$ref}{$field-name}Iter">
- <field type="{$ref}{$kind} *" name="R" />
+ <field type="const {$ref}{$kind} *" name="R" />
<l><xsl:value-of select="@type" />Iter i;</l>
<xsl:choose>
<xsl:when test="$is-first">
@@ -766,7 +766,7 @@ authorization from the authors.
</xsl:choose>
</xsl:variable>
<function type="XCBGenericIter" name="{$ref}{$field-name}End">
- <field type="{$ref}{$kind} *" name="R" />
+ <field type="const {$ref}{$kind} *" name="R" />
<l>XCBGenericIter i;</l>
<xsl:choose>
<xsl:when test="$is-first">
More information about the xcb-commit
mailing list