From: Ian Osgood Date: Thu, 20 Apr 2006 03:42:46 +0000 (-0700) Subject: Enumeration and documentation for col parameter X-Git-Tag: 0.1~18^2 X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2bde0221929c9774f48d5c3b3b1a28d304a9ff41;p=free-sw%2Fxcb%2Fdemo Enumeration and documentation for col parameter --- diff --git a/neko/Makefile b/neko/Makefile index 089f915..7aa7abf 100644 --- a/neko/Makefile +++ b/neko/Makefile @@ -1,7 +1,5 @@ -CFLAGS = -g -Wall -Wpointer-arith -Wstrict-prototypes -LIBS = -lxcb -lXCBAux -lXCBICCCM -lXCBAtom -lXCBKeysyms +CFLAGS = `pkg-config --cflags xcb` -g -Wall -Wpointer-arith -Wstrict-prototypes +LIBS = `pkg-config --libs xcb-aux xcb-icccm xcb-atom xcb-keysyms` -lm xcbneko: xcbneko.c $(CC) $(CFLAGS) xcbneko.c $(LIBS) -o xcbneko - -all: xcbneko diff --git a/neko/xcbneko.c b/neko/xcbneko.c index ea12c6e..f254e2b 100644 --- a/neko/xcbneko.c +++ b/neko/xcbneko.c @@ -423,17 +423,23 @@ XCBPIXMAP CreatePixmapFromBitmapData( XCBConnection *c, /* must swap and pad the data if bit/byte_order isn't LSB (Mac) */ /* Mac X Server: byte_order=bit_order=MSB, unit=32, padding=32 */ - long bufLen = (w+7)/8*h; + long bpl = (w+7)/8; + long pad = XCBGetSetup(c)->bitmap_format_scanline_pad; + long bpd = ROUNDUP(w, pad)>>3; + long bufLen = bpd * h; BYTE buf[1024]; if (XCBGetSetup(c)->bitmap_format_scanline_unit == 32 && XCBGetSetup(c)->bitmap_format_bit_order == XCBImageOrderMSBFirst && XCBGetSetup(c)->image_byte_order == XCBImageOrderMSBFirst) { - long bpl = (w+7)/8; - long pad = XCBGetSetup(c)->bitmap_format_scanline_pad; - long bpd = ROUNDUP(w, pad)>>3; - SwapBits((unsigned char *)data, (unsigned char *)buf, bpl, bpl, bpd, h); - bufLen = bpd * h; + SwapBits((unsigned char *)data, buf, bpl, bpl, bpd, h); + } + else if (bpl != bpd) + { + int i; + BYTE *src = (BYTE *)data, *dest = buf; + for (i=0; i