color-manager: Add API to get the color device for a monitor
There is a 1-on-1 mapping between these two entities, so add a getter. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2164>
This commit is contained in:
parent
b8ddf7ad8b
commit
6403cfe170
@ -23,6 +23,7 @@
|
||||
|
||||
typedef struct _MetaBackend MetaBackend;
|
||||
|
||||
typedef struct _MetaColorDevice MetaColorDevice;
|
||||
typedef struct _MetaColorManager MetaColorManager;
|
||||
|
||||
typedef struct _MetaMonitorManager MetaMonitorManager;
|
||||
|
@ -355,3 +355,15 @@ meta_color_manager_get_cd_client (MetaColorManager *color_manager)
|
||||
|
||||
return priv->cd_client;
|
||||
}
|
||||
|
||||
MetaColorDevice *
|
||||
meta_color_manager_get_color_device (MetaColorManager *color_manager,
|
||||
MetaMonitor *monitor)
|
||||
{
|
||||
MetaColorManagerPrivate *priv =
|
||||
meta_color_manager_get_instance_private (color_manager);
|
||||
g_autofree char *monitor_id = NULL;
|
||||
|
||||
monitor_id = generate_monitor_id (monitor);
|
||||
return g_hash_table_lookup (priv->devices, monitor_id);
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "backends/meta-backend-types.h"
|
||||
#include "core/util-private.h"
|
||||
|
||||
#define META_TYPE_COLOR_MANAGER (meta_color_manager_get_type ())
|
||||
G_DECLARE_DERIVABLE_TYPE (MetaColorManager, meta_color_manager,
|
||||
@ -30,4 +31,8 @@ G_DECLARE_DERIVABLE_TYPE (MetaColorManager, meta_color_manager,
|
||||
MetaBackend *
|
||||
meta_color_manager_get_backend (MetaColorManager *color_manager);
|
||||
|
||||
META_EXPORT_TEST
|
||||
MetaColorDevice * meta_color_manager_get_color_device (MetaColorManager *color_manager,
|
||||
MetaMonitor *monitor);
|
||||
|
||||
#endif /* META_COLOR_MANAGER_H */
|
||||
|
Loading…
Reference in New Issue
Block a user