From 323c608b0cdd2492efa70c0f5a54940fbfb637f8 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 29 Jun 2016 13:49:20 +0200 Subject: [PATCH] backends: Export call to retrieve the base GSettings for a tablet --- src/backends/meta-input-settings-private.h | 2 ++ src/backends/meta-input-settings.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/backends/meta-input-settings-private.h b/src/backends/meta-input-settings-private.h index 82f58f91d..e34dddf42 100644 --- a/src/backends/meta-input-settings-private.h +++ b/src/backends/meta-input-settings-private.h @@ -103,6 +103,8 @@ GType meta_input_settings_get_type (void) G_GNUC_CONST; MetaInputSettings * meta_input_settings_create (void); +GSettings * meta_input_settings_get_tablet_settings (MetaInputSettings *settings, + ClutterInputDevice *device); GDesktopTabletMapping meta_input_settings_get_tablet_mapping (MetaInputSettings *settings, ClutterInputDevice *device); diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c index f7e39df38..559d92d93 100644 --- a/src/backends/meta-input-settings.c +++ b/src/backends/meta-input-settings.c @@ -1278,6 +1278,22 @@ meta_input_settings_create (void) return NULL; } +GSettings * +meta_input_settings_get_tablet_settings (MetaInputSettings *settings, + ClutterInputDevice *device) +{ + MetaInputSettingsPrivate *priv; + DeviceMappingInfo *info; + + g_return_val_if_fail (META_IS_INPUT_SETTINGS (settings), NULL); + g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), NULL); + + priv = meta_input_settings_get_instance_private (settings); + info = g_hash_table_lookup (priv->mappable_devices, device); + + return info ? g_object_ref (info->settings) : NULL; +} + GDesktopTabletMapping meta_input_settings_get_tablet_mapping (MetaInputSettings *settings, ClutterInputDevice *device)