2018-10-17 21:21:27 +02:00
|
|
|
#ifndef _SWAYBAR_INPUT_H
|
|
|
|
#define _SWAYBAR_INPUT_H
|
|
|
|
|
|
|
|
#include <wayland-client.h>
|
|
|
|
#include "list.h"
|
|
|
|
|
2019-01-10 18:43:10 +01: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 09:21:08 +01:00
|
|
|
struct swaybar;
|
2018-10-17 21:21:27 +02: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;
|
2020-02-01 18:58:13 +01:00
|
|
|
double x, y;
|
2018-12-15 09:21:08 +01:00
|
|
|
uint32_t serial;
|
2018-10-17 21:21:27 +02:00
|
|
|
};
|
|
|
|
|
2019-02-17 16:13:11 +01:00
|
|
|
struct touch_slot {
|
|
|
|
int32_t id;
|
|
|
|
uint32_t time;
|
|
|
|
struct swaybar_output *output;
|
|
|
|
double start_x, start_y;
|
|
|
|
double x, y;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct swaybar_touch {
|
|
|
|
struct wl_touch *touch;
|
|
|
|
struct touch_slot slots[16];
|
|
|
|
};
|
|
|
|
|
2018-10-17 21:21:27 +02:00
|
|
|
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,
|
2020-02-01 18:08:00 +01:00
|
|
|
struct swaybar_hotspot *hotspot, double x, double y, uint32_t button,
|
2019-01-10 18:43:10 +01:00
|
|
|
void *data);
|
2018-10-17 21:21:27 +02:00
|
|
|
void (*destroy)(void *data);
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
2019-04-24 05:40:00 +02:00
|
|
|
struct swaybar_seat {
|
|
|
|
struct swaybar *bar;
|
|
|
|
uint32_t wl_name;
|
|
|
|
struct wl_seat *wl_seat;
|
|
|
|
struct swaybar_pointer pointer;
|
|
|
|
struct swaybar_touch touch;
|
|
|
|
struct wl_list link; // swaybar_seat:link
|
|
|
|
};
|
|
|
|
|
2018-10-17 21:21:27 +02:00
|
|
|
extern const struct wl_seat_listener seat_listener;
|
|
|
|
|
2019-04-24 05:40:00 +02:00
|
|
|
void update_cursor(struct swaybar_seat *seat);
|
2018-12-15 09:21:08 +01:00
|
|
|
|
2019-01-16 03:25:28 +01:00
|
|
|
uint32_t event_to_x11_button(uint32_t event);
|
|
|
|
|
2018-10-17 21:21:27 +02:00
|
|
|
void free_hotspots(struct wl_list *list);
|
|
|
|
|
2019-04-24 05:40:00 +02:00
|
|
|
void swaybar_seat_free(struct swaybar_seat *seat);
|
|
|
|
|
2018-10-17 21:21:27 +02:00
|
|
|
#endif
|