2018-10-17 19:21:27 +00:00
|
|
|
#ifndef _SWAYBAR_INPUT_H
|
|
|
|
#define _SWAYBAR_INPUT_H
|
|
|
|
|
|
|
|
#include <wayland-client.h>
|
|
|
|
#include "list.h"
|
|
|
|
|
2019-01-10 17:43:10 +00:00
|
|
|
#define SWAY_SCROLL_UP KEY_MAX + 1
|
|
|
|
#define SWAY_SCROLL_DOWN KEY_MAX + 2
|
|
|
|
#define SWAY_SCROLL_LEFT KEY_MAX + 3
|
|
|
|
#define SWAY_SCROLL_RIGHT KEY_MAX + 4
|
|
|
|
|
2018-12-15 08:21:08 +00:00
|
|
|
struct swaybar;
|
2018-10-17 19:21:27 +00:00
|
|
|
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;
|
2018-12-15 08:21:08 +00:00
|
|
|
uint32_t serial;
|
2018-10-17 19:21:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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,
|
2019-01-10 17:43:10 +00:00
|
|
|
struct swaybar_hotspot *hotspot, int x, int y, uint32_t button,
|
|
|
|
void *data);
|
2018-10-17 19:21:27 +00:00
|
|
|
void (*destroy)(void *data);
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern const struct wl_seat_listener seat_listener;
|
|
|
|
|
2018-12-15 08:21:08 +00:00
|
|
|
void update_cursor(struct swaybar *bar);
|
|
|
|
|
2018-10-17 19:21:27 +00:00
|
|
|
void free_hotspots(struct wl_list *list);
|
|
|
|
|
|
|
|
#endif
|