diff --git a/src/core/device-map.c b/src/core/device-map.c index aed7ad3dc..e79449aeb 100644 --- a/src/core/device-map.c +++ b/src/core/device-map.c @@ -291,6 +291,28 @@ meta_device_map_get_display (MetaDeviceMap *device_map) return priv->display; } +/** + * meta_device_map_list_devices: + * @device_map: a #MetaDeviceMap + * + * Returns the list of devices that @device_map holds. + * + * Returns: (element-type Meta.Device) (transfer container): the list + * of devices, the contained objects are owned by @device_map + * and should not be unref'ed. The list must be freed with + * g_list_free(). + **/ +GList * +meta_device_map_list_devices (MetaDeviceMap *device_map) +{ + MetaDeviceMapPrivate *priv; + + g_return_val_if_fail (META_IS_DEVICE_MAP (device_map), NULL); + + priv = device_map->priv; + return g_hash_table_get_values (priv->devices); +} + gboolean meta_device_map_grab_key (MetaDeviceMap *device_map, Window xwindow, diff --git a/src/meta/device-map.h b/src/meta/device-map.h index 102980f06..cc4042634 100644 --- a/src/meta/device-map.h +++ b/src/meta/device-map.h @@ -41,5 +41,6 @@ MetaDevice * meta_device_map_lookup (MetaDeviceMap *device_map, gint device_id); MetaDisplay * meta_device_map_get_display (MetaDeviceMap *device_map); +GList * meta_device_map_list_devices (MetaDeviceMap *device_map); #endif