/* Minimal libxcb-image stand-in: only the symbols libnsfb's X11 surface * needs. Real xcb_image is a small wrapper; these are inert. */ #include #include typedef struct xcb_connection_t xcb_connection_t; typedef struct xcb_image_t xcb_image_t; typedef unsigned int xcb_drawable_t; typedef unsigned int xcb_gcontext_t; typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef short int16_t; typedef unsigned int uint32_t; struct xcb_image_t { uint16_t width; uint16_t height; uint8_t format; uint8_t scanline_pad; uint8_t depth; uint32_t bytes_per_line; uint32_t bits_per_pixel; uint32_t red_mask; uint32_t green_mask; uint32_t blue_mask; unsigned char *data; }; xcb_image_t *xcb_image_create(uint16_t w, uint16_t h, uint8_t fmt, uint8_t pad, uint8_t depth, uint32_t bpl, uint32_t bpp, uint32_t rmask, uint32_t gmask, uint32_t bmask, unsigned char *data) { xcb_image_t *img = calloc(1, sizeof(*img)); if (!img) return NULL; img->width = w; img->height = h; img->format = fmt; img->scanline_pad = pad; img->depth = depth; img->bytes_per_line = bpl; img->bits_per_pixel = bpp; img->red_mask = rmask; img->green_mask = gmask; img->blue_mask = bmask; img->data = data; return img; } void xcb_image_destroy(xcb_image_t *img) { if (img) free(img); } void *xcb_image_shm_put(xcb_connection_t *c, xcb_drawable_t d, xcb_gcontext_t g, xcb_image_t *img, int16_t sx, int16_t sy, uint16_t sw, uint16_t sh, int16_t dx, int16_t dy, unsigned char send) { (void)c;(void)d;(void)g;(void)img;(void)sx;(void)sy;(void)sw;(void)sh;(void)dx;(void)dy;(void)send; return NULL; } void *xcb_image_put(xcb_connection_t *c, xcb_drawable_t d, xcb_gcontext_t g, xcb_image_t *img, int16_t sx, int16_t sy, uint16_t sw, uint16_t sh, int16_t dx, int16_t dy) { (void)c;(void)d;(void)g;(void)img;(void)sx;(void)sy;(void)sw;(void)sh;(void)dx;(void)dy; return NULL; } int xcb_image_get_32(xcb_connection_t *c, xcb_drawable_t d, int16_t x, int16_t y, uint16_t w, uint16_t h, uint32_t plane_mask, unsigned int format, unsigned char *dest) { (void)c;(void)d;(void)x;(void)y;(void)w;(void)h;(void)plane_mask;(void)format;(void)dest; return 0; } int xcb_image_native(xcb_connection_t *c, xcb_image_t *img, int16_t x, int16_t y, uint16_t w, uint16_t h) { (void)c;(void)img;(void)x;(void)y;(void)w;(void)h; return 0; }