mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-05-01 02:17:59 +02:00
eis: namespace the internal event handlers
We will need eis_device_foo() for the actual event API soon, so let's move the internal handlers out of the way by namespacing them. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
86488fdc5a
commit
6f0172a179
3 changed files with 60 additions and 59 deletions
|
|
@ -273,7 +273,7 @@ client_msg_start_emulating(struct eis_client *client, uint32_t deviceid)
|
|||
struct eis_device *device = eis_client_find_device(client, deviceid);
|
||||
|
||||
if (device)
|
||||
eis_device_start_emulating(device);
|
||||
eis_device_event_start_emulating(device);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -284,7 +284,7 @@ client_msg_stop_emulating(struct eis_client *client, uint32_t deviceid)
|
|||
struct eis_device *device = eis_client_find_device(client, deviceid);
|
||||
|
||||
if (device)
|
||||
eis_device_stop_emulating(device);
|
||||
eis_device_event_stop_emulating(device);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -295,12 +295,11 @@ client_msg_frame(struct eis_client *client, uint32_t deviceid)
|
|||
struct eis_device *device = eis_client_find_device(client, deviceid);
|
||||
|
||||
if (device)
|
||||
return eis_device_frame(device);
|
||||
return eis_device_event_frame(device);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
client_msg_pointer_rel(struct eis_client *client, uint32_t deviceid,
|
||||
double x, double y)
|
||||
|
|
@ -308,7 +307,7 @@ client_msg_pointer_rel(struct eis_client *client, uint32_t deviceid,
|
|||
struct eis_device *device = eis_client_find_device(client, deviceid);
|
||||
|
||||
if (device)
|
||||
return eis_device_pointer_rel(device, x, y);
|
||||
return eis_device_event_pointer_rel(device, x, y);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -320,7 +319,7 @@ client_msg_pointer_abs(struct eis_client *client, uint32_t deviceid,
|
|||
struct eis_device *device = eis_client_find_device(client, deviceid);
|
||||
|
||||
if (device)
|
||||
return eis_device_pointer_abs(device, x, y);
|
||||
return eis_device_event_pointer_abs(device, x, y);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -332,7 +331,7 @@ client_msg_pointer_button(struct eis_client *client, uint32_t deviceid,
|
|||
struct eis_device *device = eis_client_find_device(client, deviceid);
|
||||
|
||||
if (device)
|
||||
return eis_device_pointer_button(device, button, state);
|
||||
return eis_device_event_pointer_button(device, button, state);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -344,7 +343,7 @@ client_msg_pointer_scroll(struct eis_client *client, uint32_t deviceid,
|
|||
struct eis_device *device = eis_client_find_device(client, deviceid);
|
||||
|
||||
if (device)
|
||||
return eis_device_pointer_scroll(device, x, y);
|
||||
return eis_device_event_pointer_scroll(device, x, y);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -356,7 +355,7 @@ client_msg_pointer_scroll_discrete(struct eis_client *client, uint32_t deviceid,
|
|||
struct eis_device *device = eis_client_find_device(client, deviceid);
|
||||
|
||||
if (device)
|
||||
return eis_device_pointer_scroll_discrete(device, x, y);
|
||||
return eis_device_event_pointer_scroll_discrete(device, x, y);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -369,9 +368,9 @@ client_msg_pointer_scroll_stop(struct eis_client *client, uint32_t deviceid,
|
|||
|
||||
if (device) {
|
||||
if (is_cancel)
|
||||
return eis_device_pointer_scroll_cancel(device, x, y);
|
||||
return eis_device_event_pointer_scroll_cancel(device, x, y);
|
||||
else
|
||||
return eis_device_pointer_scroll_stop(device, x, y);
|
||||
return eis_device_event_pointer_scroll_stop(device, x, y);
|
||||
}
|
||||
|
||||
return -EINVAL;
|
||||
|
|
@ -384,7 +383,7 @@ client_msg_keyboard_key(struct eis_client *client, uint32_t deviceid,
|
|||
struct eis_device *device = eis_client_find_device(client, deviceid);
|
||||
|
||||
if (device)
|
||||
return eis_device_keyboard_key(device, key, state);
|
||||
return eis_device_event_keyboard_key(device, key, state);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -396,7 +395,7 @@ client_msg_touch_down(struct eis_client *client, uint32_t deviceid,
|
|||
struct eis_device *device = eis_client_find_device(client, deviceid);
|
||||
|
||||
if (device)
|
||||
return eis_device_touch_down(device, touchid, x, y);
|
||||
return eis_device_event_touch_down(device, touchid, x, y);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -408,7 +407,7 @@ client_msg_touch_motion(struct eis_client *client, uint32_t deviceid,
|
|||
struct eis_device *device = eis_client_find_device(client, deviceid);
|
||||
|
||||
if (device)
|
||||
return eis_device_touch_motion(device, touchid, x, y);
|
||||
return eis_device_event_touch_motion(device, touchid, x, y);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -419,7 +418,7 @@ client_msg_touch_up(struct eis_client *client, uint32_t deviceid, uint32_t touch
|
|||
struct eis_device *device = eis_client_find_device(client, deviceid);
|
||||
|
||||
if (device)
|
||||
return eis_device_touch_up(device, touchid);
|
||||
return eis_device_event_touch_up(device, touchid);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ eis_device_has_capability(struct eis_device *device,
|
|||
}
|
||||
|
||||
int
|
||||
eis_device_frame(struct eis_device *device)
|
||||
eis_device_event_frame(struct eis_device *device)
|
||||
{
|
||||
if (device->state != EIS_DEVICE_STATE_RESUMED)
|
||||
return -EINVAL;
|
||||
|
|
@ -272,8 +272,8 @@ eis_device_frame(struct eis_device *device)
|
|||
}
|
||||
|
||||
int
|
||||
eis_device_pointer_rel(struct eis_device *device,
|
||||
double x, double y)
|
||||
eis_device_event_pointer_rel(struct eis_device *device,
|
||||
double x, double y)
|
||||
{
|
||||
if (!eis_device_has_capability(device, EIS_DEVICE_CAP_POINTER)) {
|
||||
log_bug_client(eis_device_get_context(device),
|
||||
|
|
@ -303,8 +303,8 @@ eis_device_in_region(struct eis_device *device, double x, double y)
|
|||
}
|
||||
|
||||
int
|
||||
eis_device_pointer_abs(struct eis_device *device,
|
||||
double x, double y)
|
||||
eis_device_event_pointer_abs(struct eis_device *device,
|
||||
double x, double y)
|
||||
{
|
||||
if (!eis_device_has_capability(device, EIS_DEVICE_CAP_POINTER_ABSOLUTE)) {
|
||||
log_bug_client(eis_device_get_context(device),
|
||||
|
|
@ -324,8 +324,8 @@ eis_device_pointer_abs(struct eis_device *device,
|
|||
}
|
||||
|
||||
int
|
||||
eis_device_pointer_button(struct eis_device *device,
|
||||
uint32_t button, bool is_press)
|
||||
eis_device_event_pointer_button(struct eis_device *device,
|
||||
uint32_t button, bool is_press)
|
||||
{
|
||||
if (!eis_device_has_capability(device, EIS_DEVICE_CAP_POINTER)) {
|
||||
log_bug_client(eis_device_get_context(device),
|
||||
|
|
@ -342,8 +342,8 @@ eis_device_pointer_button(struct eis_device *device,
|
|||
}
|
||||
|
||||
int
|
||||
eis_device_pointer_scroll(struct eis_device *device,
|
||||
double x, double y)
|
||||
eis_device_event_pointer_scroll(struct eis_device *device,
|
||||
double x, double y)
|
||||
{
|
||||
if (!eis_device_has_capability(device, EIS_DEVICE_CAP_POINTER) &&
|
||||
!eis_device_has_capability(device, EIS_DEVICE_CAP_POINTER_ABSOLUTE)) {
|
||||
|
|
@ -361,8 +361,8 @@ eis_device_pointer_scroll(struct eis_device *device,
|
|||
}
|
||||
|
||||
int
|
||||
eis_device_pointer_scroll_discrete(struct eis_device *device,
|
||||
int32_t x, int32_t y)
|
||||
eis_device_event_pointer_scroll_discrete(struct eis_device *device,
|
||||
int32_t x, int32_t y)
|
||||
{
|
||||
if (!eis_device_has_capability(device, EIS_DEVICE_CAP_POINTER) &&
|
||||
!eis_device_has_capability(device, EIS_DEVICE_CAP_POINTER_ABSOLUTE)) {
|
||||
|
|
@ -380,7 +380,7 @@ eis_device_pointer_scroll_discrete(struct eis_device *device,
|
|||
}
|
||||
|
||||
int
|
||||
eis_device_pointer_scroll_stop(struct eis_device *device, bool x, bool y)
|
||||
eis_device_event_pointer_scroll_stop(struct eis_device *device, bool x, bool y)
|
||||
{
|
||||
if (!eis_device_has_capability(device, EIS_DEVICE_CAP_POINTER) &&
|
||||
!eis_device_has_capability(device, EIS_DEVICE_CAP_POINTER_ABSOLUTE)) {
|
||||
|
|
@ -398,7 +398,7 @@ eis_device_pointer_scroll_stop(struct eis_device *device, bool x, bool y)
|
|||
}
|
||||
|
||||
int
|
||||
eis_device_pointer_scroll_cancel(struct eis_device *device, bool x, bool y)
|
||||
eis_device_event_pointer_scroll_cancel(struct eis_device *device, bool x, bool y)
|
||||
{
|
||||
if (!eis_device_has_capability(device, EIS_DEVICE_CAP_POINTER) &&
|
||||
!eis_device_has_capability(device, EIS_DEVICE_CAP_POINTER_ABSOLUTE)) {
|
||||
|
|
@ -416,8 +416,8 @@ eis_device_pointer_scroll_cancel(struct eis_device *device, bool x, bool y)
|
|||
}
|
||||
|
||||
int
|
||||
eis_device_keyboard_key(struct eis_device *device,
|
||||
uint32_t key, bool is_press)
|
||||
eis_device_event_keyboard_key(struct eis_device *device,
|
||||
uint32_t key, bool is_press)
|
||||
{
|
||||
if (!eis_device_has_capability(device, EIS_DEVICE_CAP_KEYBOARD)) {
|
||||
log_bug_client(eis_device_get_context(device),
|
||||
|
|
@ -434,7 +434,7 @@ eis_device_keyboard_key(struct eis_device *device,
|
|||
}
|
||||
|
||||
int
|
||||
eis_device_touch_down(struct eis_device *device, uint32_t touchid, double x, double y)
|
||||
eis_device_event_touch_down(struct eis_device *device, uint32_t touchid, double x, double y)
|
||||
{
|
||||
if (!eis_device_has_capability(device, EIS_DEVICE_CAP_TOUCH)) {
|
||||
log_bug_client(eis_device_get_context(device),
|
||||
|
|
@ -451,7 +451,7 @@ eis_device_touch_down(struct eis_device *device, uint32_t touchid, double x, dou
|
|||
}
|
||||
|
||||
int
|
||||
eis_device_touch_motion(struct eis_device *device, uint32_t touchid, double x, double y)
|
||||
eis_device_event_touch_motion(struct eis_device *device, uint32_t touchid, double x, double y)
|
||||
{
|
||||
if (!eis_device_has_capability(device, EIS_DEVICE_CAP_TOUCH)) {
|
||||
log_bug_client(eis_device_get_context(device),
|
||||
|
|
@ -468,7 +468,7 @@ eis_device_touch_motion(struct eis_device *device, uint32_t touchid, double x, d
|
|||
}
|
||||
|
||||
int
|
||||
eis_device_touch_up(struct eis_device *device, uint32_t touchid)
|
||||
eis_device_event_touch_up(struct eis_device *device, uint32_t touchid)
|
||||
{
|
||||
if (!eis_device_has_capability(device, EIS_DEVICE_CAP_TOUCH)) {
|
||||
log_bug_client(eis_device_get_context(device),
|
||||
|
|
@ -505,7 +505,7 @@ eis_device_closed_by_client(struct eis_device *device)
|
|||
}
|
||||
|
||||
void
|
||||
eis_device_start_emulating(struct eis_device *device)
|
||||
eis_device_event_start_emulating(struct eis_device *device)
|
||||
{
|
||||
switch (device->state) {
|
||||
case EIS_DEVICE_STATE_DEAD:
|
||||
|
|
@ -523,7 +523,7 @@ eis_device_start_emulating(struct eis_device *device)
|
|||
}
|
||||
|
||||
void
|
||||
eis_device_stop_emulating(struct eis_device *device)
|
||||
eis_device_event_stop_emulating(struct eis_device *device)
|
||||
{
|
||||
switch (device->state) {
|
||||
case EIS_DEVICE_STATE_DEAD:
|
||||
|
|
|
|||
|
|
@ -263,54 +263,56 @@ eis_device_set_client_keymap(struct eis_device *device,
|
|||
enum eis_keymap_type type,
|
||||
int keymap_fd, size_t size);
|
||||
int
|
||||
eis_device_frame(struct eis_device *device);
|
||||
eis_device_event_frame(struct eis_device *device);
|
||||
|
||||
int
|
||||
eis_device_pointer_rel(struct eis_device *device,
|
||||
double x, double y);
|
||||
eis_device_event_pointer_rel(struct eis_device *device,
|
||||
double x, double y);
|
||||
|
||||
int
|
||||
eis_device_pointer_abs(struct eis_device *device,
|
||||
double x, double y);
|
||||
eis_device_event_pointer_abs(struct eis_device *device,
|
||||
double x, double y);
|
||||
|
||||
int
|
||||
eis_device_pointer_button(struct eis_device *device,
|
||||
uint32_t button, bool state);
|
||||
eis_device_event_pointer_button(struct eis_device *device,
|
||||
uint32_t button, bool state);
|
||||
|
||||
int
|
||||
eis_device_pointer_scroll(struct eis_device *device,
|
||||
double x, double y);
|
||||
eis_device_event_pointer_scroll(struct eis_device *device,
|
||||
double x, double y);
|
||||
|
||||
int
|
||||
eis_device_pointer_scroll_discrete(struct eis_device *device,
|
||||
int32_t x, int32_t y);
|
||||
eis_device_event_pointer_scroll_discrete(struct eis_device *device,
|
||||
int32_t x, int32_t y);
|
||||
int
|
||||
eis_device_pointer_scroll_stop(struct eis_device *device, bool x, bool y);
|
||||
eis_device_event_pointer_scroll_stop(struct eis_device *device, bool x, bool y);
|
||||
|
||||
int
|
||||
eis_device_pointer_scroll_cancel(struct eis_device *device, bool x, bool y);
|
||||
eis_device_event_pointer_scroll_cancel(struct eis_device *device, bool x, bool y);
|
||||
|
||||
int
|
||||
eis_device_keyboard_key(struct eis_device *device,
|
||||
uint32_t key, bool state);
|
||||
eis_device_event_keyboard_key(struct eis_device *device,
|
||||
uint32_t key, bool state);
|
||||
int
|
||||
eis_device_touch_down(struct eis_device *device, uint32_t touchid, double x, double y);
|
||||
eis_device_event_touch_down(struct eis_device *device, uint32_t touchid,
|
||||
double x, double y);
|
||||
|
||||
int
|
||||
eis_device_touch_motion(struct eis_device *device, uint32_t touchid, double x, double y);
|
||||
eis_device_event_touch_motion(struct eis_device *device, uint32_t touchid,
|
||||
double x, double y);
|
||||
|
||||
int
|
||||
eis_device_touch_up(struct eis_device *device, uint32_t touchid);
|
||||
eis_device_event_touch_up(struct eis_device *device, uint32_t touchid);
|
||||
|
||||
void
|
||||
eis_device_event_start_emulating(struct eis_device *device);
|
||||
|
||||
void
|
||||
eis_device_event_stop_emulating(struct eis_device *device);
|
||||
|
||||
void
|
||||
eis_device_closed_by_client(struct eis_device *device);
|
||||
|
||||
void
|
||||
eis_device_start_emulating(struct eis_device *device);
|
||||
|
||||
void
|
||||
eis_device_stop_emulating(struct eis_device *device);
|
||||
|
||||
bool
|
||||
eis_region_contains(struct eis_region *r, double x, double y);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue