parent
b74c4cf974
commit
2280928bb2
@ -0,0 +1,54 @@
|
|||||||
|
#ifndef _ROOTSTON_CURSOR_H
|
||||||
|
#define _ROOTSTON_CURSOR_H
|
||||||
|
|
||||||
|
#include "rootston/seat.h"
|
||||||
|
|
||||||
|
struct roots_cursor {
|
||||||
|
struct roots_seat *seat;
|
||||||
|
struct wlr_cursor *cursor;
|
||||||
|
|
||||||
|
struct wl_listener motion;
|
||||||
|
struct wl_listener motion_absolute;
|
||||||
|
struct wl_listener button;
|
||||||
|
struct wl_listener axis;
|
||||||
|
|
||||||
|
struct wl_listener touch_down;
|
||||||
|
struct wl_listener touch_up;
|
||||||
|
struct wl_listener touch_motion;
|
||||||
|
|
||||||
|
struct wl_listener tool_axis;
|
||||||
|
struct wl_listener tool_tip;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct roots_cursor *roots_cursor_create(struct roots_seat *seat);
|
||||||
|
|
||||||
|
void roots_cursor_destroy(struct roots_cursor *cursor);
|
||||||
|
|
||||||
|
void roots_cursor_handle_motion(struct roots_cursor *cursor,
|
||||||
|
struct wlr_event_pointer_motion *event);
|
||||||
|
|
||||||
|
void roots_cursor_handle_motion_absolute(struct roots_cursor *cursor,
|
||||||
|
struct wlr_event_pointer_motion_absolute *event);
|
||||||
|
|
||||||
|
void roots_cursor_handle_button(struct roots_cursor *cursor,
|
||||||
|
struct wlr_event_pointer_button *event);
|
||||||
|
|
||||||
|
void roots_cursor_handle_axis(struct roots_cursor *cursor,
|
||||||
|
struct wlr_event_pointer_axis *event);
|
||||||
|
|
||||||
|
void roots_cursor_handle_touch_down(struct roots_cursor *cursor,
|
||||||
|
struct wlr_event_touch_down *event);
|
||||||
|
|
||||||
|
void roots_cursor_handle_touch_up(struct roots_cursor *cursor,
|
||||||
|
struct wlr_event_touch_up *event);
|
||||||
|
|
||||||
|
void roots_cursor_handle_touch_motion(struct roots_cursor *cursor,
|
||||||
|
struct wlr_event_touch_motion *event);
|
||||||
|
|
||||||
|
void roots_cursor_handle_tool_axis(struct roots_cursor *cursor,
|
||||||
|
struct wlr_event_tablet_tool_axis *event);
|
||||||
|
|
||||||
|
void roots_cursor_handle_tool_tip(struct roots_cursor *cursor,
|
||||||
|
struct wlr_event_tablet_tool_tip *event);
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,65 @@
|
|||||||
|
#include <stdlib.h>
|
||||||
|
#include <wlr/util/log.h>
|
||||||
|
#include "rootston/cursor.h"
|
||||||
|
|
||||||
|
struct roots_cursor *roots_cursor_create(struct roots_seat *seat) {
|
||||||
|
struct roots_cursor *cursor = calloc(1, sizeof(struct roots_cursor));
|
||||||
|
if (!cursor) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
cursor->cursor = wlr_cursor_create();
|
||||||
|
if (!cursor->cursor) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return cursor;
|
||||||
|
}
|
||||||
|
|
||||||
|
void roots_cursor_destroy(struct roots_cursor *cursor) {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void roots_cursor_handle_motion(struct roots_cursor *cursor,
|
||||||
|
struct wlr_event_pointer_motion *event) {
|
||||||
|
wlr_log(L_DEBUG, "TODO: cursor handle motion");
|
||||||
|
}
|
||||||
|
|
||||||
|
void roots_cursor_handle_motion_absolute(struct roots_cursor *cursor,
|
||||||
|
struct wlr_event_pointer_motion_absolute *event) {
|
||||||
|
wlr_log(L_DEBUG, "TODO: cursor handle motion absolute");
|
||||||
|
}
|
||||||
|
|
||||||
|
void roots_cursor_handle_button(struct roots_cursor *cursor,
|
||||||
|
struct wlr_event_pointer_button *event) {
|
||||||
|
wlr_log(L_DEBUG, "TODO: cursor handle button");
|
||||||
|
}
|
||||||
|
|
||||||
|
void roots_cursor_handle_axis(struct roots_cursor *cursor,
|
||||||
|
struct wlr_event_pointer_axis *event) {
|
||||||
|
wlr_log(L_DEBUG, "TODO: cursor handle axis");
|
||||||
|
}
|
||||||
|
|
||||||
|
void roots_cursor_handle_touch_down(struct roots_cursor *cursor,
|
||||||
|
struct wlr_event_touch_down *event) {
|
||||||
|
wlr_log(L_DEBUG, "TODO: cursor handle touch down");
|
||||||
|
}
|
||||||
|
|
||||||
|
void roots_cursor_handle_touch_up(struct roots_cursor *cursor,
|
||||||
|
struct wlr_event_touch_up *event) {
|
||||||
|
wlr_log(L_DEBUG, "TODO: cursor handle touch up");
|
||||||
|
}
|
||||||
|
|
||||||
|
void roots_cursor_handle_touch_motion(struct roots_cursor *cursor,
|
||||||
|
struct wlr_event_touch_motion *event) {
|
||||||
|
wlr_log(L_DEBUG, "TODO: cursor handle touch motion");
|
||||||
|
}
|
||||||
|
|
||||||
|
void roots_cursor_handle_tool_axis(struct roots_cursor *cursor,
|
||||||
|
struct wlr_event_tablet_tool_axis *event) {
|
||||||
|
wlr_log(L_DEBUG, "TODO: cursor handle tool axis");
|
||||||
|
}
|
||||||
|
|
||||||
|
void roots_cursor_handle_tool_tip(struct roots_cursor *cursor,
|
||||||
|
struct wlr_event_tablet_tool_tip *event) {
|
||||||
|
wlr_log(L_DEBUG, "TODO: cursor handle tool tip");
|
||||||
|
}
|
Loading…
Reference in new issue