ei: implement ei_device_get_width/height

This commit is contained in:
Peter Hutterer 2023-02-20 13:43:04 +10:00
parent 17dfb4580d
commit 866a754223
2 changed files with 18 additions and 2 deletions

View file

@ -100,6 +100,8 @@ _public_
OBJECT_IMPLEMENT_GETTER(ei_device, user_data, void *);
_public_
OBJECT_IMPLEMENT_SETTER(ei_device, user_data, void *);
OBJECT_IMPLEMENT_GETTER(ei_device, width, uint32_t);
OBJECT_IMPLEMENT_GETTER(ei_device, height, uint32_t);
_public_ struct ei_seat *
ei_device_get_seat(struct ei_device *device)

View file

@ -145,8 +145,8 @@ struct ei_region;
* within the device's specified physical size. Physical devices do not have
* regions.
*
* @see eis_device_get_width
* @see eis_device_get_height
* @see ei_device_get_width
* @see ei_device_get_height
*/
enum ei_device_type {
EI_DEVICE_TYPE_VIRTUAL = 1,
@ -780,6 +780,20 @@ ei_device_set_user_data(struct ei_device *device, void *user_data);
void *
ei_device_get_user_data(struct ei_device *device);
/**
* Return the width of the device in mm if the device is of type @ref
* EI_DEVICE_TYPE_PHYSICAL, otherwise zero.
*/
uint32_t
ei_device_get_width(struct ei_device *device);
/**
* Return the height of the device in mm if the device is of type @ref
* EI_DEVICE_TYPE_PHYSICAL, otherwise zero.
*/
uint32_t
ei_device_get_height(struct ei_device *device);
struct ei_keymap *
ei_device_get_keymap(struct ei_device *device);