diff options
author | Peter Rice <peter@peterrice.xyz> | 2018-07-15 20:16:37 -0400 |
---|---|---|
committer | Peter Rice <peter@peterrice.xyz> | 2018-07-16 18:55:04 -0400 |
commit | 79a998849b8cedc9fccddfb31e4d1c99d1c17ff7 (patch) | |
tree | 1e2c2a54f588c4931cbf8b0cf2820029aee82bb4 /include/swaybar | |
parent | b314a8f2cc792aa59d8f12e5adb9aed2967af646 (diff) |
make hotspot callback take an x11 button id
Diffstat (limited to 'include/swaybar')
-rw-r--r-- | include/swaybar/bar.h | 15 | ||||
-rw-r--r-- | include/swaybar/status_line.h | 4 |
2 files changed, 17 insertions, 2 deletions
diff --git a/include/swaybar/bar.h b/include/swaybar/bar.h index af478f33..f1ff25b2 100644 --- a/include/swaybar/bar.h +++ b/include/swaybar/bar.h @@ -16,11 +16,24 @@ struct swaybar_pointer { int x, y; }; +enum x11_button { + NONE, + LEFT, + MIDDLE, + RIGHT, + SCROLL_UP, + SCROLL_DOWN, + SCROLL_LEFT, + SCROLL_RIGHT, + BACK, + FORWARD, +}; + struct swaybar_hotspot { struct wl_list link; int x, y, width, height; void (*callback)(struct swaybar_output *output, - int x, int y, uint32_t button, void *data); + int x, int y, enum x11_button button, void *data); void (*destroy)(void *data); void *data; }; diff --git a/include/swaybar/status_line.h b/include/swaybar/status_line.h index bf12a842..2eaf8140 100644 --- a/include/swaybar/status_line.h +++ b/include/swaybar/status_line.h @@ -72,7 +72,9 @@ bool status_handle_readable(struct status_line *status); void status_line_free(struct status_line *status); bool i3bar_handle_readable(struct status_line *status); void i3bar_block_send_click(struct status_line *status, - struct i3bar_block *block, int x, int y, uint32_t button); + struct i3bar_block *block, int x, int y, enum x11_button button); void i3bar_block_free(struct i3bar_block *block); +enum x11_button wl_button_to_x11_button(uint32_t button); +enum x11_button wl_axis_to_x11_button(uint32_t axis, wl_fixed_t value); #endif |