Port more stuff to xcb

To avoid interoperability issues between xcb and xlib.
This commit is contained in:
Yuxuan Shui
2018-09-23 19:10:46 +01:00
parent 7af815a0aa
commit 209b751b25
10 changed files with 380 additions and 398 deletions

31
src/x.h
View File

@ -1,6 +1,9 @@
#pragma once
#include <stdbool.h>
#include <X11/Xlib.h>
#include <xcb/xcb.h>
#include <xcb/render.h>
#include <xcb/xcb_renderutil.h>
typedef struct session session_t;
typedef struct winprop winprop_t;
/**
@ -35,3 +38,31 @@ wid_get_prop_window(session_t *ps, Window wid, Atom aprop);
*/
bool wid_get_text_prop(session_t *ps, Window wid, Atom prop,
char ***pstrlst, int *pnstr);
xcb_render_pictforminfo_t *x_get_pictform_for_visual(session_t *, xcb_visualid_t);
xcb_render_picture_t x_create_picture_with_pictfmt_and_pixmap(
session_t *ps, xcb_render_pictforminfo_t *pictfmt,
xcb_pixmap_t pixmap, unsigned long valuemask,
const xcb_render_create_picture_value_list_t *attr)
__attribute__((nonnull(1, 2)));
xcb_render_picture_t x_create_picture_with_visual_and_pixmap(
session_t *ps, xcb_visualid_t visual,
xcb_pixmap_t pixmap, unsigned long valuemask,
const xcb_render_create_picture_value_list_t *attr)
__attribute__((nonnull(1)));
xcb_render_picture_t x_create_picture_with_standard_and_pixmap(
session_t *ps, xcb_pict_standard_t standard,
xcb_pixmap_t pixmap, unsigned long valuemask,
const xcb_render_create_picture_value_list_t *attr)
__attribute__((nonnull(1)));
/**
* Create an picture.
*/
xcb_render_picture_t
x_create_picture(session_t *ps, int wid, int hei,
xcb_render_pictforminfo_t *pictfmt, unsigned long valuemask,
const xcb_render_create_picture_value_list_t *attr);