Xnest: replace XCreatePixmapFromBitmapData() by xcb_put_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
4a7a6cfb8d
commit
2cd8b6c285
|
@ -187,7 +187,7 @@ xnestOpenDisplay(int argc, char *argv[])
|
|||
(char *) icon_bits, icon_width, icon_height);
|
||||
|
||||
xnestScreenSaverPixmap =
|
||||
XCreatePixmapFromBitmapData(xnestDisplay,
|
||||
xnestCreatePixmapFromBitmapData(xnestUpstreamInfo.conn,
|
||||
xnestUpstreamInfo.screenInfo->root,
|
||||
(char *) screensaver_bits,
|
||||
screensaver_width,
|
||||
|
|
|
@ -206,3 +206,44 @@ uint32_t xnestCreateBitmapFromData(
|
|||
xcb_free_gc(conn, gc);
|
||||
return pix;
|
||||
}
|
||||
|
||||
uint32_t xnestCreatePixmapFromBitmapData(
|
||||
xcb_connection_t *conn,
|
||||
uint32_t drawable,
|
||||
const char *data,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
uint32_t fg,
|
||||
uint32_t bg,
|
||||
uint16_t depth)
|
||||
{
|
||||
uint32_t pix = xcb_generate_id(xnestUpstreamInfo.conn);
|
||||
xcb_create_pixmap(conn, depth, pix, drawable, width, height);
|
||||
|
||||
uint32_t gc = xcb_generate_id(xnestUpstreamInfo.conn);
|
||||
xcb_create_gc(conn, gc, pix, 0, NULL);
|
||||
|
||||
XnGCValues gcv = {
|
||||
.foreground = fg,
|
||||
.background = bg
|
||||
};
|
||||
|
||||
xnChangeGC(conn, gc, gcv, XCB_GC_FOREGROUND | XCB_GC_BACKGROUND);
|
||||
|
||||
const int leftPad = 0;
|
||||
xcb_put_image(conn,
|
||||
XYBitmap,
|
||||
pix,
|
||||
gc,
|
||||
width,
|
||||
height,
|
||||
0 /* dst_x */,
|
||||
0 /* dst_y */,
|
||||
leftPad,
|
||||
1 /* depth */,
|
||||
BitmapBytePad(width + leftPad) * height,
|
||||
(uint8_t*)data);
|
||||
|
||||
xcb_free_gc(conn, gc);
|
||||
return pix;
|
||||
}
|
||||
|
|
|
@ -100,4 +100,8 @@ void xnestWMColormapWindows(xcb_connection_t *conn, xcb_window_t w, xcb_window_t
|
|||
uint32_t xnestCreateBitmapFromData(xcb_connection_t *conn, uint32_t drawable,
|
||||
const char *data, uint32_t width, uint32_t height);
|
||||
|
||||
uint32_t xnestCreatePixmapFromBitmapData(xcb_connection_t *conn, uint32_t drawable,
|
||||
const char *data, uint32_t width, uint32_t height,
|
||||
uint32_t fg, uint32_t bg, uint16_t depth);
|
||||
|
||||
#endif /* __XNEST__XCB_H */
|
||||
|
|
Loading…
Reference in New Issue