The event type names should be prefixed with `ds_{submodule}_event_`.
Change-Id: I72dd9ee5df04042dd061a9c5a0641a6c120dca22
static void
pointer_handle_motion_absolute(struct wl_listener *listener, void *data)
{
- struct ds_event_pointer_motion_absolute *event = data;
+ struct ds_pointer_event_motion_absolute *event = data;
ds_inf("Pointer device(%p): motion absolute (%f, %f) time(%d ms)",
event->device, event->x, event->y, event->time_msec);
static void
pointer_handle_button(struct wl_listener *listener, void *data)
{
- struct ds_event_pointer_button *event = data;
+ struct ds_pointer_event_button *event = data;
ds_inf("Pointer Device(%p): button(%d) state(%d) time(%d ms)",
event->device, event->button, event->state, event->time_msec);
static void
keyboard_handle_key(struct wl_listener *listener, void *data)
{
- struct ds_event_keyboard_key *event = data;
+ struct ds_keyboard_event_key *event = data;
struct keyboard_device *keyboard;
struct xkb_state *xkb_state;
const xkb_keysym_t *syms;
static void
keyboard_handle_key(struct wl_listener *listener, void *data)
{
- struct ds_event_keyboard_key *event = data;
+ struct ds_keyboard_event_key *event = data;
struct keyboard_device *keyboard;
keyboard = wl_container_of(listener, keyboard, key);
static void
pointer_handle_motion(struct wl_listener *listener, void *data)
{
- struct ds_event_pointer_motion *event = data;
+ struct ds_pointer_event_motion *event = data;
struct pointer_device *pointer;
pointer = wl_container_of(listener, pointer, motion);
static void
pointer_handle_button(struct wl_listener *listener, void *data)
{
- struct ds_event_pointer_button *event = data;
+ struct ds_pointer_event_button *event = data;
struct pointer_device *pointer;
pointer = wl_container_of(listener, pointer, button);
static void
touch_handle_down(struct wl_listener *listener, void *data)
{
- struct ds_event_touch_down *event = data;
+ struct ds_touch_event_down *event = data;
struct touch_device *touch;
touch = wl_container_of(listener, touch, down);
static void
touch_handle_up(struct wl_listener *listener, void *data)
{
- struct ds_event_touch_up *event = data;
+ struct ds_touch_event_up *event = data;
struct touch_device *touch;
touch = wl_container_of(listener, touch, up);
static void
touch_handle_motion(struct wl_listener *listener, void *data)
{
- struct ds_event_touch_motion *event = data;
+ struct ds_touch_event_motion *event = data;
struct touch_device *touch;
touch = wl_container_of(listener, touch, motion);
static void
server_handle_request_set_selection(struct wl_listener *listener, void *data)
{
- struct ds_event_request_set_selection *event = data;
+ struct ds_data_device_manager_event_request_set_selection *event = data;
ds_seat_set_selection(event->seat, event->source, event->serial);
}
static void
server_handle_request_start_drag(struct wl_listener *listener, void *data)
{
- struct ds_event_request_start_drag *event = data;
+ struct ds_data_device_manager_event_request_start_drag *event = data;
ds_drag_start_pointer_drag(event->drag, event->serial);
}
static void
server_handle_request_data_offer_receive(struct wl_listener *listener, void *data)
{
- struct ds_event_request_data_offer_receive *event = data;
+ struct ds_data_device_manager_event_request_data_offer_receive *event = data;
ds_data_offer_send(event->offer, event->mime_type, event->fd);
}
keyboard_handle_key(struct wl_listener *listener, void *data)
{
struct tinyds_keyboard *kbd;
- struct ds_event_keyboard_key *event = data;
+ struct ds_keyboard_event_key *event = data;
struct ds_keyboard *ds_keyboard;
struct xkb_state *xkb_state;
const xkb_keysym_t *syms;
pointer_handle_motion_absolute(struct wl_listener *listener, void *data)
{
struct tinyds_pointer *pointer;
- struct ds_event_pointer_motion_absolute *event = data;
+ struct ds_pointer_event_motion_absolute *event = data;
struct tinyds_view *view;
double sx, sy;
pointer_handle_button(struct wl_listener *listener, void *data)
{
struct tinyds_pointer *pointer;
- struct ds_event_pointer_button *event = data;
+ struct ds_pointer_event_button *event = data;
struct tinyds_view *view;
pointer = wl_container_of(listener, pointer, button);
struct ds_touch_point;
-struct ds_event_request_set_selection
+struct ds_data_device_manager_event_request_set_selection
{
struct ds_seat *seat;
struct ds_data_source *source;
uint32_t serial;
};
-struct ds_event_request_start_drag
+struct ds_data_device_manager_event_request_start_drag
{
struct ds_seat *seat;
struct ds_surface *origin;
uint32_t serial;
};
-struct ds_event_request_data_offer_receive
+struct ds_data_device_manager_event_request_data_offer_receive
{
struct ds_data_offer *offer;
const char *mime_type;
int32_t fd;
};
-struct ds_event_drag_motion {
+struct ds_drag_event_motion {
struct ds_drag *drag;
uint32_t time;
double sx, sy;
};
-struct ds_event_drag_drop {
+struct ds_drag_event_drop {
struct ds_drag *drag;
uint32_t time;
};
void ds_keyboard_destroy(struct ds_keyboard *keyboard);
void ds_keyboard_notify_key(struct ds_keyboard *keyboard,
- struct ds_event_keyboard_key *event);
+ struct ds_keyboard_event_key *event);
void ds_keyboard_notify_modifiers(struct ds_keyboard *keyboard,
uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked,
xkb_mod_mask_t group;
};
-struct ds_event_keyboard_key
+struct ds_keyboard_event_key
{
uint32_t time_msec;
uint32_t keycode;
struct ds_pointer;
-struct ds_event_pointer_motion_absolute
+struct ds_pointer_event_motion_absolute
{
struct ds_input_device *device;
uint32_t time_msec;
double x, y;
};
-struct ds_event_pointer_motion
+struct ds_pointer_event_motion
{
struct ds_input_device *device;
uint32_t time_msec;
double delta_x, delta_y;
};
-struct ds_event_pointer_button
+struct ds_pointer_event_button
{
struct ds_input_device *device;
uint32_t time_msec;
DS_AXIS_SOURCE_WHEEL_TILT,
};
-struct ds_event_seat_pointer_focus_change
+struct ds_seat_pointer_event_focus_change
{
struct ds_seat *seat;
struct ds_surface *old_surface, *new_surface;
double sx, sy;
};
-struct ds_event_seat_keyboard_focus_change
+struct ds_seat_keyboard_event_focus_change
{
struct ds_seat *seat;
struct ds_surface *old_surface, *new_surface;
struct ds_touch;
-struct ds_event_touch_down
+struct ds_touch_event_down
{
struct ds_input_device *device;
uint32_t time_msec;
double x, y;
};
-struct ds_event_touch_up
+struct ds_touch_event_up
{
struct ds_input_device *device;
uint32_t time_msec;
uint32_t id;
};
-struct ds_event_touch_motion
+struct ds_touch_event_motion
{
struct ds_input_device *device;
uint32_t time_msec;
uint32_t key;
enum libinput_key_state li_state;
enum wl_keyboard_key_state state = WL_KEYBOARD_KEY_STATE_PRESSED;
- struct ds_event_keyboard_key ds_event = {0};
+ struct ds_keyboard_event_key ds_event = {0};
kbevent = libinput_event_get_keyboard_event(event);
{
struct libinput_event_pointer *pevent;
double delta_x, delta_y;
- struct ds_event_pointer_motion ds_event = { 0 };
+ struct ds_pointer_event_motion ds_event = { 0 };
pevent = libinput_event_get_pointer_event(event);
{
struct libinput_event_pointer *pevent;
double x, y;
- struct ds_event_pointer_motion_absolute ds_event = { 0 };
+ struct ds_pointer_event_motion_absolute ds_event = { 0 };
pevent = libinput_event_get_pointer_event(event);
uint32_t button;
enum libinput_button_state li_state = LIBINPUT_BUTTON_STATE_PRESSED;
enum ds_button_state state = DS_BUTTON_PRESSED;
- struct ds_event_pointer_button ds_event = { 0 };
+ struct ds_pointer_event_button ds_event = { 0 };
pevent = libinput_event_get_pointer_event(event);
struct libinput_event_touch *tevent;
uint32_t touch_id;
double x, y;
- struct ds_event_touch_down ds_event = { 0 };
+ struct ds_touch_event_down ds_event = { 0 };
tevent = libinput_event_get_touch_event(event);
{
struct libinput_event_touch *tevent;
uint32_t touch_id;
- struct ds_event_touch_up ds_event = { 0 };
+ struct ds_touch_event_up ds_event = { 0 };
tevent = libinput_event_get_touch_event(event);
struct libinput_event_touch *tevent;
uint32_t touch_id;
double x, y;
- struct ds_event_touch_motion ds_event = { 0 };
+ struct ds_touch_event_motion ds_event = { 0 };
tevent = libinput_event_get_touch_event(event);
ds_output = &seat->output->base;
// FIXME take size size of a output into account
- struct ds_event_pointer_motion_absolute event = {
+ struct ds_pointer_event_motion_absolute event = {
.device = seat->pointer_dev,
.time_msec = time,
.x = wl_fixed_to_double(sx) / ds_output->width,
if (!seat->output)
return;
- struct ds_event_pointer_button event = {
+ struct ds_pointer_event_button event = {
.device = seat->pointer_dev,
.button = button,
.state = state,
time = get_current_time_msec();
wl_array_for_each(keycode_ptr, keys) {
- struct ds_event_keyboard_key event = {
+ struct ds_keyboard_event_key event = {
.keycode = *keycode_ptr,
.state = WL_KEYBOARD_KEY_STATE_PRESSED,
.time_msec = time,
for (size_t i = 0; i < num_keycodes; i++) {
keycode = pressed[i];
- struct ds_event_keyboard_key event = {
+ struct ds_keyboard_event_key event = {
.keycode = keycode,
.state = WL_KEYBOARD_KEY_STATE_RELEASED,
.time_msec = time,
ds_dbg("wl_keyboard: key");
- struct ds_event_keyboard_key event = {
+ struct ds_keyboard_event_key event = {
.keycode = key,
.state = state,
.time_msec = time,
ds_dbg("wl_touch: down");
- struct ds_event_touch_down event = {
+ struct ds_touch_event_down event = {
.device = seat->touch_dev,
.id = id,
.x = fixed_x,
ds_dbg("wl_touch: up");
- struct ds_event_touch_up event = {
+ struct ds_touch_event_up event = {
.device = seat->touch_dev,
.id = id,
};
if (source_client)
source_client->finalized = true;
- struct ds_event_request_start_drag event = {
+ struct ds_data_device_manager_event_request_start_drag event = {
.seat = data_device->seat,
.drag = drag,
.origin = ds_surface_from_resource(origin_resource),
source->finalized = true;
}
- struct ds_event_request_set_selection event = {
+ struct ds_data_device_manager_event_request_set_selection event = {
.seat = data_device->seat,
.source = &source->base,
.serial = serial,
if (!offer)
return;
- struct ds_event_request_data_offer_receive event = {
+ struct ds_data_device_manager_event_request_data_offer_receive event = {
.offer = offer,
.mime_type = mime_type,
.fd = fd,
if (data_device)
data_device_send_drag_motion(data_device, time, sx, sy);
- struct ds_event_drag_motion event = {
+ struct ds_drag_event_motion event = {
.drag = drag,
.time = time,
.sx = sx,
if (drag->source)
ds_data_source_dnd_drop(drag->source);
- struct ds_event_drag_drop event = {
+ struct ds_drag_event_drop event = {
.drag = drag,
.time = time,
};
static bool keyboard_modifier_update(struct ds_keyboard *keyboard);
static void keyboard_key_update(struct ds_keyboard *keyboard,
- struct ds_event_keyboard_key *event);
+ struct ds_keyboard_event_key *event);
static void keyboard_led_update(struct ds_keyboard *keyboard);
WL_EXPORT bool
WL_EXPORT void
ds_keyboard_notify_key(struct ds_keyboard *keyboard,
- struct ds_event_keyboard_key *event)
+ struct ds_keyboard_event_key *event)
{
uint32_t keycode;
enum xkb_key_direction dir;
}
static void keyboard_key_update(struct ds_keyboard *keyboard,
- struct ds_event_keyboard_key *event)
+ struct ds_keyboard_event_key *event)
{
// TODO
}
seat_keyboard_emit_focus_change(struct ds_seat_keyboard *keyboard,
struct ds_surface *old_surface, struct ds_surface *new_surface)
{
- struct ds_event_seat_keyboard_focus_change event = {
+ struct ds_seat_keyboard_event_focus_change event = {
.seat = keyboard->seat,
.old_surface = old_surface,
.new_surface = new_surface,
struct ds_surface *old_surface, struct ds_surface *new_surface,
double sx, double sy)
{
- struct ds_event_seat_pointer_focus_change event = {
+ struct ds_seat_pointer_event_focus_change event = {
.seat = pointer->seat,
.new_surface = new_surface,
.old_surface = old_surface,