mirror of
https://github.com/cage-kiosk/cage.git
synced 2025-11-26 07:00:00 -05:00
input: add seat and cursor implementations
This commit is contained in:
parent
0489045405
commit
b4f832d501
5 changed files with 298 additions and 0 deletions
51
input/cursor.h
Normal file
51
input/cursor.h
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
#ifndef CG_CURSOR_H
|
||||
#define CG_CURSOR_H
|
||||
|
||||
#include <wayland-server-core.h>
|
||||
#include <wlr/types/wlr_cursor.h>
|
||||
#include <wlr/types/wlr_seat.h>
|
||||
#include <wlr/types/wlr_xcursor_manager.h>
|
||||
|
||||
#define DEFAULT_XCURSOR "left_ptr"
|
||||
#define XCURSOR_SIZE 24
|
||||
|
||||
struct cg_cursor {
|
||||
struct wlr_cursor *wlr_cursor;
|
||||
struct wlr_xcursor_manager *xcursor_manager;
|
||||
struct wlr_seat *wlr_seat;
|
||||
|
||||
struct wl_listener cursor_motion;
|
||||
struct wl_listener cursor_motion_absolute;
|
||||
struct wl_listener cursor_button;
|
||||
struct wl_listener cursor_axis;
|
||||
struct wl_listener cursor_frame;
|
||||
|
||||
struct wl_listener request_set_cursor;
|
||||
struct wl_listener surface_destroy;
|
||||
|
||||
struct {
|
||||
/**
|
||||
* Proxy wlr_cursor's motion and motion_absolute signals to the compositor.
|
||||
* Note that cg_cursor has already taken care of calling the respective
|
||||
* wlr_cursor functions; only the compositor-specific handling such as
|
||||
* focus changing need to be implemented. This signal is emitted for both
|
||||
* relative and absolute cursor motion.
|
||||
*/
|
||||
struct wl_signal motion;
|
||||
|
||||
/**
|
||||
* Proxy wlr_cursor's button signal to the compositor. Note that cg_cursor
|
||||
* has already taken care of calling the respective wlr_cursor functions;
|
||||
* only the compositor-specific handling such as focus changing needs to
|
||||
* be implemented.
|
||||
*/
|
||||
struct wl_signal button;
|
||||
} events;
|
||||
};
|
||||
|
||||
void cage_cursor_set_image(struct cg_cursor *cursor, const char *path);
|
||||
void cage_cursor_init(struct cg_cursor *cursor, struct wlr_cursor *wlr_cursor,
|
||||
struct wlr_xcursor_manager *xcursor_manager, struct wlr_seat *wlr_seat);
|
||||
void cage_cursor_fini(struct cg_cursor *cursor);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue