mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
monitor: Add hash function
Will be used to keep a monitor spec as a hash table key. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1712>
This commit is contained in:
parent
fcbeae5f60
commit
4615da2122
@ -127,6 +127,17 @@ meta_monitor_spec_clone (MetaMonitorSpec *monitor_spec)
|
||||
return new_monitor_spec;
|
||||
}
|
||||
|
||||
guint
|
||||
meta_monitor_spec_hash (gconstpointer key)
|
||||
{
|
||||
const MetaMonitorSpec *monitor_spec = key;
|
||||
|
||||
return (g_str_hash (monitor_spec->connector) +
|
||||
g_str_hash (monitor_spec->vendor) +
|
||||
g_str_hash (monitor_spec->product) +
|
||||
g_str_hash (monitor_spec->serial));
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_monitor_spec_equals (MetaMonitorSpec *monitor_spec,
|
||||
MetaMonitorSpec *other_monitor_spec)
|
||||
|
@ -262,6 +262,8 @@ gboolean meta_monitor_mode_should_be_advertised (MetaMonitorMode *monitor_mode);
|
||||
META_EXPORT_TEST
|
||||
MetaMonitorSpec * meta_monitor_spec_clone (MetaMonitorSpec *monitor_id);
|
||||
|
||||
guint meta_monitor_spec_hash (gconstpointer key);
|
||||
|
||||
META_EXPORT_TEST
|
||||
gboolean meta_monitor_spec_equals (MetaMonitorSpec *monitor_id,
|
||||
MetaMonitorSpec *other_monitor_id);
|
||||
|
Loading…
Reference in New Issue
Block a user