From 254007a142a41435ff16b1cb7859040c188ffae8 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 28 Jul 2020 16:31:54 +0200 Subject: [PATCH] gdk: Add gdk_device_tool_get_axes() Axes are actually a per-tool property, we just adapt devices to the current tool. --- docs/reference/gdk/gdk4-sections.txt | 1 + gdk/gdkdevicetool.c | 8 ++++++++ gdk/gdkdevicetool.h | 3 +++ 3 files changed, 12 insertions(+) diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt index edff521830..7e142c3310 100644 --- a/docs/reference/gdk/gdk4-sections.txt +++ b/docs/reference/gdk/gdk4-sections.txt @@ -382,6 +382,7 @@ gdk_device_get_axis gdk_device_tool_get_serial gdk_device_tool_get_tool_type gdk_device_tool_get_hardware_id +gdk_device_tool_get_axes GDK_TYPE_AXIS_USE diff --git a/gdk/gdkdevicetool.c b/gdk/gdkdevicetool.c index a56f8e4b2b..efd3a6c6a7 100644 --- a/gdk/gdkdevicetool.c +++ b/gdk/gdkdevicetool.c @@ -209,3 +209,11 @@ gdk_device_tool_get_tool_type (GdkDeviceTool *tool) return tool->type; } + +GdkAxisFlags +gdk_device_tool_get_axes (GdkDeviceTool *tool) +{ + g_return_val_if_fail (tool != NULL, 0); + + return tool->tool_axes; +} diff --git a/gdk/gdkdevicetool.h b/gdk/gdkdevicetool.h index c48ff628e4..d1e5b28e21 100644 --- a/gdk/gdkdevicetool.h +++ b/gdk/gdkdevicetool.h @@ -71,6 +71,9 @@ guint64 gdk_device_tool_get_hardware_id (GdkDeviceTool *tool); GDK_AVAILABLE_IN_ALL GdkDeviceToolType gdk_device_tool_get_tool_type (GdkDeviceTool *tool); +GDK_AVAILABLE_IN_ALL +GdkAxisFlags gdk_device_tool_get_axes (GdkDeviceTool *tool); + G_END_DECLS #endif /* __GDK_DEVICE_TOOL_H__ */