1
1
mirror of https://github.com/swaywm/sway synced 2024-09-29 16:31:21 +02:00
sway/include/swaybar/input.h
Hristo Venev 24e8ba048a Add relative coordinates in JSON for i3bar click events
Compatibility with i3 commit 161db6f17d734ac9deb0a20e81b78d4b2a92ce68.
2018-12-04 12:49:21 +02:00

51 lines
943 B
C

#ifndef _SWAYBAR_INPUT_H
#define _SWAYBAR_INPUT_H
#include <wayland-client.h>
#include "list.h"
struct swaybar_output;
struct swaybar_pointer {
struct wl_pointer *pointer;
struct wl_cursor_theme *cursor_theme;
struct wl_cursor_image *cursor_image;
struct wl_surface *cursor_surface;
struct swaybar_output *current;
int x, y;
};
enum x11_button {
NONE,
LEFT,
MIDDLE,
RIGHT,
SCROLL_UP,
SCROLL_DOWN,
SCROLL_LEFT,
SCROLL_RIGHT,
BACK,
FORWARD,
};
enum hotspot_event_handling {
HOTSPOT_IGNORE,
HOTSPOT_PROCESS,
};
struct swaybar_hotspot {
struct wl_list link; // swaybar_output::hotspots
int x, y, width, height;
enum hotspot_event_handling (*callback)(struct swaybar_output *output,
struct swaybar_hotspot *hotspot, int x, int y,
enum x11_button button, void *data);
void (*destroy)(void *data);
void *data;
};
extern const struct wl_seat_listener seat_listener;
void free_hotspots(struct wl_list *list);
#endif