Rename some {cursor,keyboard}_ functions

This commit is contained in:
Johan Malm 2020-05-29 22:10:41 +01:00
parent aa294330ea
commit bc5accb089
5 changed files with 19 additions and 18 deletions

View file

@ -117,7 +117,7 @@ static void process_cursor_motion(struct server *server, uint32_t time)
}
}
void server_cursor_motion(struct wl_listener *listener, void *data)
void cursor_motion(struct wl_listener *listener, void *data)
{
/*
* This event is forwarded by the cursor when a pointer emits a
@ -139,7 +139,7 @@ void server_cursor_motion(struct wl_listener *listener, void *data)
process_cursor_motion(server, event->time_msec);
}
void server_cursor_motion_absolute(struct wl_listener *listener, void *data)
void cursor_motion_absolute(struct wl_listener *listener, void *data)
{
/*
* This event is forwarded by the cursor when a pointer emits an
@ -157,7 +157,7 @@ void server_cursor_motion_absolute(struct wl_listener *listener, void *data)
process_cursor_motion(server, event->time_msec);
}
void server_cursor_button(struct wl_listener *listener, void *data)
void cursor_button(struct wl_listener *listener, void *data)
{
/*
* This event is forwarded by the cursor when a pointer emits a button
@ -197,7 +197,7 @@ void server_cursor_button(struct wl_listener *listener, void *data)
}
}
void server_cursor_axis(struct wl_listener *listener, void *data)
void cursor_axis(struct wl_listener *listener, void *data)
{
/*
* This event is forwarded by the cursor when a pointer emits an axis
@ -212,7 +212,7 @@ void server_cursor_axis(struct wl_listener *listener, void *data)
event->delta_discrete, event->source);
}
void server_cursor_frame(struct wl_listener *listener, void *data)
void cursor_frame(struct wl_listener *listener, void *data)
{
/*
* This event is forwarded by the cursor when a pointer emits an frame

View file

@ -106,7 +106,7 @@ static void keyboard_handle_key(struct wl_listener *listener, void *data)
}
}
void server_new_keyboard(struct server *server, struct wlr_input_device *device)
void keyboard_new(struct server *server, struct wlr_input_device *device)
{
struct keyboard *keyboard = calloc(1, sizeof(struct keyboard));
keyboard->server = server;

View file

@ -140,16 +140,16 @@ int main(int argc, char *argv[])
// return 1;
//}
server.cursor_motion.notify = server_cursor_motion;
server.cursor_motion.notify = cursor_motion;
wl_signal_add(&server.cursor->events.motion, &server.cursor_motion);
server.cursor_motion_absolute.notify = server_cursor_motion_absolute;
server.cursor_motion_absolute.notify = cursor_motion_absolute;
wl_signal_add(&server.cursor->events.motion_absolute,
&server.cursor_motion_absolute);
server.cursor_button.notify = server_cursor_button;
server.cursor_button.notify = cursor_button;
wl_signal_add(&server.cursor->events.button, &server.cursor_button);
server.cursor_axis.notify = server_cursor_axis;
server.cursor_axis.notify = cursor_axis;
wl_signal_add(&server.cursor->events.axis, &server.cursor_axis);
server.cursor_frame.notify = server_cursor_frame;
server.cursor_frame.notify = cursor_frame;
wl_signal_add(&server.cursor->events.frame, &server.cursor_frame);
wl_list_init(&server.keyboards);

View file

@ -17,7 +17,7 @@ void server_new_input(struct wl_listener *listener, void *data)
struct wlr_input_device *device = data;
switch (device->type) {
case WLR_INPUT_DEVICE_KEYBOARD:
server_new_keyboard(server, device);
keyboard_new(server, device);
break;
case WLR_INPUT_DEVICE_POINTER:
server_new_pointer(server, device);