From 8158a809b77726c33560b2159ccdd49a97f85dcd Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 6 Sep 2024 23:55:43 +0200 Subject: Move damage tracking to separate file --- include/damage.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 include/damage.h (limited to 'include/damage.h') diff --git a/include/damage.h b/include/damage.h new file mode 100644 index 0000000..8f89e1d --- /dev/null +++ b/include/damage.h @@ -0,0 +1,27 @@ +#ifndef GSR_DAMAGE_H +#define GSR_DAMAGE_H + +#include +#include + +typedef struct _XDisplay Display; +typedef union _XEvent XEvent; + +typedef struct { + Display *display; + int damage_event; + int damage_error; + uint64_t damage; + bool damaged; +} gsr_damage; + +bool gsr_damage_init(gsr_damage *self, Display *display); +void gsr_damage_deinit(gsr_damage *self); + +bool gsr_damage_set_target_window(gsr_damage *self, uint64_t window); +void gsr_damage_update(gsr_damage *self, XEvent *xev); +/* Also returns true if damage tracking is not available */ +bool gsr_damage_is_damaged(gsr_damage *self); +void gsr_damage_clear(gsr_damage *self); + +#endif /* GSR_DAMAGE_H */ -- cgit v1.2.3