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,