diff --git a/src/libei-device.c b/src/libei-device.c index a8d5f55..5cbc48c 100644 --- a/src/libei-device.c +++ b/src/libei-device.c @@ -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) diff --git a/src/libei.h b/src/libei.h index 840888c..d11c82c 100644 --- a/src/libei.h +++ b/src/libei.h @@ -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);