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.
This commit is contained in:
Carlos Garnacho 2016-05-13 12:18:48 +02:00
parent 1dd121002f
commit f6e471fca4
2 changed files with 22 additions and 0 deletions

View File

@ -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 */

View File

@ -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");
}