mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-04 23:20:29 +01:00
tablet: Add libinput_tool_get/set_user_data()
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
78b474ee37
commit
11e0558f91
3 changed files with 37 additions and 0 deletions
|
|
@ -109,6 +109,7 @@ struct libinput_tool {
|
|||
uint32_t serial;
|
||||
enum libinput_tool_type type;
|
||||
int refcount;
|
||||
void *user_data;
|
||||
};
|
||||
|
||||
typedef void (*libinput_source_dispatch_t)(void *data);
|
||||
|
|
|
|||
|
|
@ -599,6 +599,19 @@ libinput_tool_get_serial(struct libinput_tool *tool)
|
|||
return tool->serial;
|
||||
}
|
||||
|
||||
LIBINPUT_EXPORT void
|
||||
libinput_tool_set_user_data(struct libinput_tool *tool,
|
||||
void *user_data)
|
||||
{
|
||||
tool->user_data = user_data;
|
||||
}
|
||||
|
||||
LIBINPUT_EXPORT void *
|
||||
libinput_tool_get_user_data(struct libinput_tool *tool)
|
||||
{
|
||||
return tool->user_data;
|
||||
}
|
||||
|
||||
LIBINPUT_EXPORT struct libinput_tool *
|
||||
libinput_tool_ref(struct libinput_tool *tool)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1034,6 +1034,29 @@ libinput_tool_unref(struct libinput_tool *tool);
|
|||
uint32_t
|
||||
libinput_tool_get_serial(struct libinput_tool *tool);
|
||||
|
||||
/**
|
||||
* @ingroup event_tablet
|
||||
*
|
||||
* Return the user data associated with a tool object.
|
||||
*
|
||||
* @param tool The libinput tool
|
||||
* @return The user data associated with the tool object
|
||||
*/
|
||||
void *
|
||||
libinput_tool_get_user_data(struct libinput_tool *tool);
|
||||
|
||||
/**
|
||||
* @ingroup event_tablet
|
||||
*
|
||||
* Set the user data associated with a tool object.
|
||||
*
|
||||
* @param tool The libinput tool
|
||||
* @param user_data The user data to associate with the tool object
|
||||
*/
|
||||
void
|
||||
libinput_tool_set_user_data(struct libinput_tool *tool,
|
||||
void *user_data);
|
||||
|
||||
/**
|
||||
* @defgroup base Initialization and manipulation of libinput contexts
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue