android_led_update(struct weston_seat *seat_base, enum weston_led leds)
{
struct android_seat *seat = to_android_seat(seat_base);
- struct evdev_input_device *device;
+ struct evdev_device *device;
wl_list_for_each(device, &seat->devices_list, link)
evdev_led_update(device, leds);
static void
android_seat_open_device(struct android_seat *seat, const char *devnode)
{
- struct evdev_input_device *device;
+ struct evdev_device *device;
int fd;
/* XXX: check the Android excluded list */
return;
}
- device = evdev_input_device_create(&seat->base, devnode, fd);
+ device = evdev_device_create(&seat->base, devnode, fd);
if (!device) {
close(fd);
return;
static void
android_seat_destroy(struct android_seat *seat)
{
- struct evdev_input_device *device, *next;
+ struct evdev_device *device, *next;
wl_list_for_each_safe(device, next, &seat->devices_list, link)
- evdev_input_device_destroy(device);
+ evdev_device_destroy(device);
if (seat->base.seat.keyboard)
notify_keyboard_focus_out(&seat->base.seat);
device_added(struct udev_device *udev_device, struct drm_seat *master)
{
struct weston_compositor *c;
- struct evdev_input_device *device;
+ struct evdev_device *device;
const char *devnode;
const char *device_seat;
int fd;
devnode = udev_device_get_devnode(udev_device);
/* Use non-blocking mode so that we can loop on read on
- * evdev_input_device_data() until all events on the fd are
+ * evdev_device_data() until all events on the fd are
* read. mtdev_get() also expects this. */
fd = weston_launcher_open(c, devnode, O_RDWR | O_NONBLOCK);
if (fd < 0) {
return;
}
- device = evdev_input_device_create(&master->base, devnode, fd);
+ device = evdev_device_create(&master->base, devnode, fd);
if (!device) {
close(fd);
weston_log("not using input device '%s'.\n", devnode);
{
struct drm_seat *seat = data;
struct udev_device *udev_device;
- struct evdev_input_device *device, *next;
+ struct evdev_device *device, *next;
const char *action;
const char *devnode;
if (!strcmp(device->devnode, devnode)) {
weston_log("input device %s, %s removed\n",
device->devname, device->devnode);
- evdev_input_device_destroy(device);
+ evdev_device_destroy(device);
break;
}
}
drm_led_update(struct weston_seat *seat_base, enum weston_led leds)
{
struct drm_seat *seat = (struct drm_seat *) seat_base;
- struct evdev_input_device *device;
+ struct evdev_device *device;
wl_list_for_each(device, &seat->devices_list, link)
evdev_led_update(device, leds);
evdev_remove_devices(struct weston_seat *seat_base)
{
struct drm_seat *seat = (struct drm_seat *) seat_base;
- struct evdev_input_device *device, *next;
+ struct evdev_device *device, *next;
wl_list_for_each_safe(device, next, &seat->devices_list, link)
- evdev_input_device_destroy(device);
+ evdev_device_destroy(device);
if (seat->base.seat.keyboard)
notify_keyboard_focus_out(&seat->base.seat);
struct touchpad_dispatch {
struct evdev_dispatch base;
- struct evdev_input_device *device;
+ struct evdev_device *device;
enum touchpad_model model;
enum touchpad_state state;
};
static enum touchpad_model
-get_touchpad_model(struct evdev_input_device *device)
+get_touchpad_model(struct evdev_device *device)
{
struct input_id id;
unsigned int i;
static void
configure_touchpad(struct touchpad_dispatch *touchpad,
- struct evdev_input_device *device)
+ struct evdev_device *device)
{
struct weston_motion_filter *accel;
static inline void
process_absolute(struct touchpad_dispatch *touchpad,
- struct evdev_input_device *device,
+ struct evdev_device *device,
struct input_event *e)
{
switch (e->code) {
static inline void
process_key(struct touchpad_dispatch *touchpad,
- struct evdev_input_device *device,
+ struct evdev_device *device,
struct input_event *e,
uint32_t time)
{
static void
touchpad_process(struct evdev_dispatch *dispatch,
- struct evdev_input_device *device,
+ struct evdev_device *device,
struct input_event *e,
uint32_t time)
{
};
struct evdev_dispatch *
-evdev_touchpad_create(struct evdev_input_device *device)
+evdev_touchpad_create(struct evdev_device *device)
{
struct touchpad_dispatch *touchpad;
#include "evdev.h"
void
-evdev_led_update(struct evdev_input_device *device, enum weston_led leds)
+evdev_led_update(struct evdev_device *device, enum weston_led leds)
{
static const struct {
enum weston_led weston;
}
static inline void
-evdev_process_key(struct evdev_input_device *device,
- struct input_event *e, int time)
+evdev_process_key(struct evdev_device *device, struct input_event *e, int time)
{
if (e->value == 2)
return;
}
static void
-evdev_process_touch(struct evdev_input_device *device,
- struct input_event *e)
+evdev_process_touch(struct evdev_device *device, struct input_event *e)
{
const int screen_width = device->output->current->width;
const int screen_height = device->output->current->height;
}
static inline void
-evdev_process_absolute_motion(struct evdev_input_device *device,
+evdev_process_absolute_motion(struct evdev_device *device,
struct input_event *e)
{
const int screen_width = device->output->current->width;
}
static inline void
-evdev_process_relative(struct evdev_input_device *device,
+evdev_process_relative(struct evdev_device *device,
struct input_event *e, uint32_t time)
{
switch (e->code) {
}
static inline void
-evdev_process_absolute(struct evdev_input_device *device,
- struct input_event *e)
+evdev_process_absolute(struct evdev_device *device, struct input_event *e)
{
if (device->is_mt) {
evdev_process_touch(device, e);
}
static void
-evdev_flush_motion(struct evdev_input_device *device, uint32_t time)
+evdev_flush_motion(struct evdev_device *device, uint32_t time)
{
struct weston_seat *master = device->seat;
static void
fallback_process(struct evdev_dispatch *dispatch,
- struct evdev_input_device *device,
+ struct evdev_device *device,
struct input_event *event,
uint32_t time)
{
}
static void
-evdev_process_events(struct evdev_input_device *device,
+evdev_process_events(struct evdev_device *device,
struct input_event *ev, int count)
{
struct evdev_dispatch *dispatch = device->dispatch;
}
static int
-evdev_input_device_data(int fd, uint32_t mask, void *data)
+evdev_device_data(int fd, uint32_t mask, void *data)
{
struct weston_compositor *ec;
- struct evdev_input_device *device = data;
+ struct evdev_device *device = data;
struct input_event ev[32];
int len;
len = read(fd, &ev, sizeof ev);
if (len < 0 || len % sizeof ev[0] != 0) {
- /* FIXME: call evdev_input_device_destroy when errno is ENODEV. */
+ /* FIXME: call evdev_device_destroy when errno is ENODEV. */
return 1;
}
}
static int
-evdev_configure_device(struct evdev_input_device *device)
+evdev_configure_device(struct evdev_device *device)
{
struct input_absinfo absinfo;
unsigned long ev_bits[NBITS(EV_MAX)];
return 0;
}
-struct evdev_input_device *
-evdev_input_device_create(struct weston_seat *seat,
- const char *path, int device_fd)
+struct evdev_device *
+evdev_device_create(struct weston_seat *seat, const char *path, int device_fd)
{
- struct evdev_input_device *device;
+ struct evdev_device *device;
struct weston_compositor *ec;
char devname[256] = "unknown";
device->source = wl_event_loop_add_fd(ec->input_loop, device->fd,
WL_EVENT_READABLE,
- evdev_input_device_data, device);
+ evdev_device_data, device);
if (device->source == NULL)
goto err2;
}
void
-evdev_input_device_destroy(struct evdev_input_device *device)
+evdev_device_destroy(struct evdev_device *device)
{
struct evdev_dispatch *dispatch;
evdev_notify_keyboard_focus(struct weston_seat *seat,
struct wl_list *evdev_devices)
{
- struct evdev_input_device *device;
+ struct evdev_device *device;
struct wl_array keys;
unsigned int i, set;
char evdev_keys[(KEY_CNT + 7) / 8];
EVDEV_TOUCH = (1 << 4),
};
-struct evdev_input_device {
+struct evdev_device {
struct weston_seat *seat;
struct wl_list link;
struct wl_event_source *source;
struct evdev_dispatch_interface {
/* Process an evdev input event. */
void (*process)(struct evdev_dispatch *dispatch,
- struct evdev_input_device *device,
+ struct evdev_device *device,
struct input_event *event,
uint32_t time);
};
struct evdev_dispatch *
-evdev_touchpad_create(struct evdev_input_device *device);
+evdev_touchpad_create(struct evdev_device *device);
void
-evdev_led_update(struct evdev_input_device *device, enum weston_led leds);
+evdev_led_update(struct evdev_device *device, enum weston_led leds);
-struct evdev_input_device *
-evdev_input_device_create(struct weston_seat *seat,
- const char *path, int device_fd);
+struct evdev_device *
+evdev_device_create(struct weston_seat *seat, const char *path, int device_fd);
void
-evdev_input_device_destroy(struct evdev_input_device *device);
+evdev_device_destroy(struct evdev_device *device);
void
evdev_notify_keyboard_focus(struct weston_seat *seat,