mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-20 18:30:06 +01:00
plugin: add internal api to notify plugins of tool configuration
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1218>
This commit is contained in:
parent
4ef14e14e4
commit
42c0bff29b
4 changed files with 28 additions and 0 deletions
|
|
@ -1193,6 +1193,10 @@ apply_pressure_range_configuration(struct tablet_dispatch *tablet,
|
|||
|
||||
tool->pressure.range.min = tool->pressure.wanted_range.min;
|
||||
tool->pressure.range.max = tool->pressure.wanted_range.max;
|
||||
|
||||
struct libinput *libinput = tablet_libinput_context(tablet);
|
||||
libinput_plugin_system_notify_tablet_tool_configured(&libinput->plugin_system,
|
||||
tool);
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
|
|
|||
|
|
@ -82,6 +82,10 @@ void
|
|||
libinput_plugin_system_notify_device_ignored(struct libinput_plugin_system *system,
|
||||
struct libinput_device *device);
|
||||
|
||||
void
|
||||
libinput_plugin_system_notify_tablet_tool_configured(struct libinput_plugin_system *system,
|
||||
struct libinput_tablet_tool *tool);
|
||||
|
||||
void
|
||||
libinput_plugin_system_notify_evdev_frame(struct libinput_plugin_system *system,
|
||||
struct libinput_device *device,
|
||||
|
|
|
|||
|
|
@ -433,6 +433,18 @@ libinput_plugin_system_notify_device_ignored(struct libinput_plugin_system *syst
|
|||
libinput_plugin_system_drop_unregistered_plugins(system);
|
||||
}
|
||||
|
||||
void
|
||||
libinput_plugin_system_notify_tablet_tool_configured(struct libinput_plugin_system *system,
|
||||
struct libinput_tablet_tool *tool)
|
||||
{
|
||||
struct libinput_plugin *plugin;
|
||||
list_for_each_safe(plugin, &system->plugins, link) {
|
||||
if (plugin->interface->tool_configured)
|
||||
plugin->interface->tool_configured(plugin, tool);
|
||||
}
|
||||
libinput_plugin_system_drop_unregistered_plugins(system);
|
||||
}
|
||||
|
||||
static void
|
||||
libinput_plugin_process_frame(struct libinput_plugin *plugin,
|
||||
struct libinput_device *device,
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
struct evdev_frame;
|
||||
struct libinput;
|
||||
struct libinput_device;
|
||||
struct libinput_tablet_tool;
|
||||
struct libinput_plugin;
|
||||
enum libinput_log_priority;
|
||||
|
||||
|
|
@ -98,6 +99,13 @@ struct libinput_plugin_interface {
|
|||
void (*evdev_frame)(struct libinput_plugin *plugin,
|
||||
struct libinput_device *device,
|
||||
struct evdev_frame *frame);
|
||||
|
||||
/**
|
||||
* Notification that a configuration option on a tool
|
||||
* was modified.
|
||||
*/
|
||||
void (*tool_configured)(struct libinput_plugin *plugin,
|
||||
struct libinput_tablet_tool *tool);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue