aboutsummaryrefslogtreecommitdiff
path: root/src/x.h
diff options
context:
space:
mode:
authorallusive-dev <[email protected]>2023-10-30 15:12:21 +1100
committerallusive-dev <[email protected]>2023-10-30 15:12:21 +1100
commitac33357e7ce7c474aeaffc92e381020289d767a2 (patch)
tree7f05fa79b3ccd7834f85cc65a07fbd4f8030eb94 /src/x.h
parentCreate FUNDING.yml (diff)
downloadcompfy-1.0.0.tar.xz
compfy-1.0.0.zip
Version 1.01.0.0
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);