aboutsummaryrefslogtreecommitdiff
path: root/src/event.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/event.h')
-rw-r--r--src/event.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/event.h b/src/event.h
index 2f00c49..40466d4 100644
--- a/src/event.h
+++ b/src/event.h
@@ -21,7 +21,16 @@ typedef enum {
typedef struct {
event_type_t type;
- int x, y;
+ union {
+ struct {
+ const char *origin;
+ const char *payload;
+ } trigger;
+ struct {
+ int x;
+ int y;
+ } mouse;
+ };
} event_t;
typedef struct {
@@ -33,8 +42,14 @@ typedef struct {
const char *event_type_to_string(event_type_t type);
+void event_init_trigger(event_t *event, const char *origin, const char *payload);
+
+void event_init_mouse(event_t *event, event_type_t type, int x, int y);
+
bool event_is_trigger(event_t event);
+bool event_is_mouse(event_t event);
+
bool event_is_click(event_t event);
bool event_is_scroll(event_t event);