ecore-wl2: store names for inputs and add api for retrieving name

@feature
This commit is contained in:
Mike Blumenkrantz 2017-05-12 12:08:32 -04:00
parent 6fc8ea3c4b
commit 8afe0a7a6c
3 changed files with 18 additions and 0 deletions

View File

@ -943,6 +943,14 @@ EAPI Ecore_Wl2_Seat_Capabilities ecore_wl2_input_seat_capabilities_get(Ecore_Wl2
*/
EAPI unsigned int ecore_wl2_input_seat_id_get(Ecore_Wl2_Input *input);
/**
* Get the name of an input
* @param input The input
* @return The name
* @since 1.20
*/
EAPI Eina_Stringshare *ecore_wl2_input_name_get(Ecore_Wl2_Input *input);
/**
* @defgroup Ecore_Wl2_Dnd_Group Wayland Library Drag-n-Drop Functions
* @ingroup Ecore_Wl2_Group

View File

@ -1281,6 +1281,7 @@ _seat_cb_name(void *data, struct wl_seat *seat EINA_UNUSED, const char *name)
Ecore_Wl2_Input *input;
input = data;
eina_stringshare_replace(&input->name, name);
ev = calloc(1, sizeof(Ecore_Wl2_Event_Seat_Name));
EINA_SAFETY_ON_NULL_RETURN(ev);
@ -1518,6 +1519,7 @@ _ecore_wl2_input_del(Ecore_Wl2_Input *input)
EINA_INLIST_FOREACH(display->windows, window)
if (window->input == input) window->input = NULL;
eina_stringshare_replace(&input->name, NULL);
free(input);
}
@ -1593,6 +1595,13 @@ ecore_wl2_input_seat_capabilities_get(Ecore_Wl2_Input *input)
return cap;
}
EAPI Eina_Stringshare *
ecore_wl2_input_name_get(Ecore_Wl2_Input *input)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(input, NULL);
return input->name;
}
EAPI unsigned int
ecore_wl2_input_seat_id_get(Ecore_Wl2_Input *input)
{

View File

@ -419,6 +419,7 @@ struct _Ecore_Wl2_Input
unsigned int seat_version;
unsigned int id;
Eina_Stringshare *name;
Ecore_Event_Handler *dev_add_handler;
Ecore_Event_Handler *dev_remove_handler;