[mutter/wip/tablet-protocol-v2: 111/149] backends: Add function to lookup the mapping for a given tablet



commit 59be5bf3b198cd8bb5350b7431fb4a60b217fcc7
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri May 13 12:18:48 2016 +0200

    backends: Add function to lookup the mapping for a given tablet
    
    At least for wayland, this needs implementing within mutter. So add
    a function to look this setting up.

 src/backends/meta-input-settings-private.h |    3 +++
 src/backends/meta-input-settings.c         |   19 +++++++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/src/backends/meta-input-settings-private.h b/src/backends/meta-input-settings-private.h
index 2375574..a7e6ea0 100644
--- a/src/backends/meta-input-settings-private.h
+++ b/src/backends/meta-input-settings-private.h
@@ -99,4 +99,7 @@ GType meta_input_settings_get_type (void) G_GNUC_CONST;
 
 MetaInputSettings * meta_input_settings_create (void);
 
+GDesktopTabletMapping meta_input_settings_get_tablet_mapping (MetaInputSettings  *settings,
+                                                              ClutterInputDevice *device);
+
 #endif /* META_INPUT_SETTINGS_PRIVATE_H */
diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c
index 3aeb09c..51f45d5 100644
--- a/src/backends/meta-input-settings.c
+++ b/src/backends/meta-input-settings.c
@@ -1018,3 +1018,22 @@ meta_input_settings_create (void)
 
   return NULL;
 }
+
+GDesktopTabletMapping
+meta_input_settings_get_tablet_mapping (MetaInputSettings  *settings,
+                                        ClutterInputDevice *device)
+{
+  MetaInputSettingsPrivate *priv;
+  DeviceMappingInfo *info;
+
+  g_return_val_if_fail (META_IS_INPUT_SETTINGS (settings),
+                        G_DESKTOP_TABLET_MAPPING_ABSOLUTE);
+  g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device),
+                        G_DESKTOP_TABLET_MAPPING_ABSOLUTE);
+
+  priv = meta_input_settings_get_instance_private (settings);
+  info = g_hash_table_lookup (priv->mappable_devices, device);
+  g_return_val_if_fail (info != NULL, G_DESKTOP_TABLET_MAPPING_ABSOLUTE);
+
+  return g_settings_get_enum (info->settings, "mapping");
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]