2021-11-13 21:56:53 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2021-08-29 14:22:49 -04:00
|
|
|
#ifndef __LABWC_MOUSEBIND_H
|
|
|
|
|
#define __LABWC_MOUSEBIND_H
|
|
|
|
|
|
2021-08-30 18:42:38 -04:00
|
|
|
#include "ssd.h"
|
2021-08-29 14:22:49 -04:00
|
|
|
#include <wayland-util.h>
|
|
|
|
|
|
2021-09-06 21:54:00 +01:00
|
|
|
enum mouse_event {
|
|
|
|
|
MOUSE_ACTION_NONE = 0,
|
2021-08-29 14:22:49 -04:00
|
|
|
MOUSE_ACTION_DOUBLECLICK,
|
2021-11-01 20:32:14 -04:00
|
|
|
MOUSE_ACTION_CLICK,
|
|
|
|
|
MOUSE_ACTION_PRESS,
|
|
|
|
|
MOUSE_ACTION_RELEASE,
|
2021-08-29 14:22:49 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct mousebind {
|
2021-09-06 21:54:00 +01:00
|
|
|
enum ssd_part_type context;
|
2021-08-31 17:43:49 -04:00
|
|
|
|
|
|
|
|
/* ex: BTN_LEFT, BTN_RIGHT from linux/input_event_codes.h */
|
|
|
|
|
uint32_t button;
|
|
|
|
|
|
2021-12-01 02:32:24 +00:00
|
|
|
/* ex: WLR_MODIFIER_SHIFT | WLR_MODIFIER_LOGO */
|
|
|
|
|
uint32_t modifiers;
|
|
|
|
|
|
2021-09-06 21:54:00 +01:00
|
|
|
/* ex: doubleclick, press, drag */
|
|
|
|
|
enum mouse_event mouse_event;
|
2022-01-05 09:11:24 +01:00
|
|
|
struct wl_list actions;
|
2021-09-06 21:54:00 +01:00
|
|
|
|
|
|
|
|
struct wl_list link; /* rcxml::mousebinds */
|
2021-11-01 20:32:14 -04:00
|
|
|
bool pressed_in_context; /* used in click events */
|
2021-08-29 14:22:49 -04:00
|
|
|
};
|
|
|
|
|
|
2021-09-06 21:54:00 +01:00
|
|
|
enum mouse_event mousebind_event_from_str(const char *str);
|
2021-12-01 02:32:24 +00:00
|
|
|
uint32_t mousebind_button_from_str(const char *str, uint32_t *modifiers);
|
2021-09-06 21:54:00 +01:00
|
|
|
struct mousebind *mousebind_create(const char *context);
|
2021-08-29 14:22:49 -04:00
|
|
|
|
|
|
|
|
#endif /* __LABWC_MOUSEBIND_H */
|