diff options
author | Ian Osgood <iano@quirkster.com> | 2006-04-19 20:42:46 -0700 |
---|---|---|
committer | Ian Osgood <iano@quirkster.com> | 2006-04-19 20:42:46 -0700 |
commit | 2bde0221929c9774f48d5c3b3b1a28d304a9ff41 (patch) | |
tree | 317b66a45d1314f59d9f70359ba137d1cc6b0a92 | |
parent | 2b62c1acc0f968e75ae2792194230f50b69e10fd (diff) |
Enumeration and documentation for col parameter
-rw-r--r-- | neko/Makefile | 6 | ||||
-rw-r--r-- | neko/xcbneko.c | 18 |
2 files changed, 14 insertions, 10 deletions
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<h; i++, dest += bpd, src += bpl) + memcpy(dest, src, bpl); } else memcpy(buf, data, bufLen); |