libei: add ei_device_get/set_user_data

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2020-08-19 11:25:03 +10:00
parent d7831fe81a
commit 2b29b6e1b9
3 changed files with 11 additions and 0 deletions

View file

@ -49,6 +49,10 @@ static
OBJECT_IMPLEMENT_PARENT(ei_device, ei);
_public_
OBJECT_IMPLEMENT_GETTER(ei_device, name, const char *);
_public_
OBJECT_IMPLEMENT_GETTER(ei_device, user_data, void *);
_public_
OBJECT_IMPLEMENT_SETTER(ei_device, user_data, void *);
_public_ struct ei*
ei_device_get_context(struct ei_device *device)

View file

@ -66,6 +66,7 @@ enum ei_device_state {
struct ei_device {
struct object object;
void *user_data;
struct list link;
uint32_t id;
enum ei_device_state state;

View file

@ -289,6 +289,12 @@ ei_device_unref(struct ei_device *device);
struct ei_device *
ei_device_new(struct ei *ei);
void
ei_device_set_user_data(struct ei_device *device, void *user_data);
void *
ei_device_get_user_data(struct ei_device *device);
/**
* Set the name for this device. This is a suggestion only, the server may
* the name and assign a different one (or none). Use ei_device_get_name()