reis: duplicate the device capabilities

Let's keep the three libraries properly separated.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2021-08-26 09:52:11 +10:00
parent 6768b8170b
commit 4376e8da88
2 changed files with 19 additions and 14 deletions

View file

@ -133,13 +133,13 @@ reis_set_cap_policy_deny(struct reis *reis)
}
_public_ int
reis_allow_cap(struct reis *reis, enum eis_device_capability cap)
reis_allow_cap(struct reis *reis, enum reis_device_capability cap)
{
switch (cap) {
case EIS_DEVICE_CAP_POINTER:
case EIS_DEVICE_CAP_POINTER_ABSOLUTE:
case EIS_DEVICE_CAP_KEYBOARD:
case EIS_DEVICE_CAP_TOUCH:
case REIS_DEVICE_CAP_POINTER:
case REIS_DEVICE_CAP_POINTER_ABSOLUTE:
case REIS_DEVICE_CAP_KEYBOARD:
case REIS_DEVICE_CAP_TOUCH:
reis->allow |= bit(cap);
return 0;
}
@ -147,13 +147,13 @@ reis_allow_cap(struct reis *reis, enum eis_device_capability cap)
}
_public_ int
reis_deny_cap(struct reis *reis, enum eis_device_capability cap)
reis_deny_cap(struct reis *reis, enum reis_device_capability cap)
{
switch (cap) {
case EIS_DEVICE_CAP_POINTER:
case EIS_DEVICE_CAP_POINTER_ABSOLUTE:
case EIS_DEVICE_CAP_KEYBOARD:
case EIS_DEVICE_CAP_TOUCH:
case REIS_DEVICE_CAP_POINTER:
case REIS_DEVICE_CAP_POINTER_ABSOLUTE:
case REIS_DEVICE_CAP_KEYBOARD:
case REIS_DEVICE_CAP_TOUCH:
reis->deny |= bit(cap);
return 0;
}

View file

@ -23,8 +23,6 @@
#pragma once
#include <libeis.h>
/**
* REIS is the library for Restrictions for EIS. This library is used by
* intermediaries between EI and EIS to reduce the capabilities that an EI
@ -40,6 +38,13 @@
struct reis;
enum reis_device_capability {
REIS_DEVICE_CAP_POINTER = 1,
REIS_DEVICE_CAP_POINTER_ABSOLUTE,
REIS_DEVICE_CAP_KEYBOARD,
REIS_DEVICE_CAP_TOUCH,
};
struct reis *
reis_new(void);
@ -111,7 +116,7 @@ reis_set_cap_policy_deny(struct reis *reis);
* and once with just keyboard caps results in just keyboard caps.
*/
int
reis_allow_cap(struct reis *reis, enum eis_device_capability cap);
reis_allow_cap(struct reis *reis, enum reis_device_capability cap);
/**
* Explicitly deny the given capability.
@ -126,4 +131,4 @@ reis_allow_cap(struct reis *reis, enum eis_device_capability cap);
* caps denied.
*/
int
reis_deny_cap(struct reis *reis, enum eis_device_capability cap);
reis_deny_cap(struct reis *reis, enum reis_device_capability cap);