aboutsummaryrefslogtreecommitdiff
path: root/src/x.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/x.h')
-rw-r--r--src/x.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/x.h b/src/x.h
index e01aa0a..3b8787c 100644
--- a/src/x.h
+++ b/src/x.h
@@ -87,6 +87,10 @@ struct xvisual_info {
#define log_fatal_x_error(e, fmt, ...) \
LOG(FATAL, fmt " (%s)", ##__VA_ARGS__, x_strerror(e))
+// xcb-render specific macros
+#define XFIXED_TO_DOUBLE(value) (((double)(value)) / 65536)
+#define DOUBLE_TO_XFIXED(value) ((xcb_render_fixed_t)(((double)(value)) * 65536))
+
/// Wraps x_new_id. abort the program if x_new_id returns error
static inline uint32_t x_new_id(xcb_connection_t *c) {
auto ret = xcb_generate_id(c);