feat: implement keyboard and mouse input, pattern placement, and HiDPI scaling
Add configurable key bindings (TOML), modifier-aware dispatch, mouse-driven pattern placement with preview and rotation, cell grid storage/rendering, and fractional/integer HiDPI scaling. Archive the input-and-placement change and sync its specs to main specs. Tests: Hashtable, Config, Grid, Pattern (4/4 pass).
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
#include <wayland-cursor.h>
|
||||
|
||||
|
||||
typedef void (*pointer_button_handler_t)(uint32_t button, uint32_t state, double x, double y, void *user_data);
|
||||
|
||||
struct pointer_data {
|
||||
struct wl_cursor_theme *cursor_theme;
|
||||
struct wl_pointer *pointer;
|
||||
@@ -12,10 +14,18 @@ struct pointer_data {
|
||||
struct wl_cursor *cursor;
|
||||
struct wl_cursor_image *cursor_image;
|
||||
struct wl_buffer *cursor_buffer;
|
||||
|
||||
double x;
|
||||
double y;
|
||||
|
||||
pointer_button_handler_t button_handler;
|
||||
void *user_data;
|
||||
};
|
||||
|
||||
extern const struct wl_pointer_listener pointer_listener;
|
||||
|
||||
void pointer_init_cursor(struct pointer_data *pointer_data, struct wl_compositor *compositor, struct wl_shm *shm);
|
||||
|
||||
void pointer_set_button_handler(struct pointer_data *pointer_data, pointer_button_handler_t handler, void *user_data);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user