Commit c3c66683 authored by Olivier Fourdan's avatar Olivier Fourdan

monitor-manager: Add `get_vendor_name` API

The monitor manager keeps the list of PnP Ids, add a new API to get the
vendor name from a given PnP ID.

#645
parent 70de90eb
......@@ -385,4 +385,7 @@ void meta_monitor_manager_clear_crtc (MetaCrtc *crtc);
gboolean meta_monitor_has_aspect_as_size (MetaMonitor *monitor);
char * meta_monitor_manager_get_vendor_name (MetaMonitorManager *manager,
const char *vendor);
#endif /* META_MONITOR_MANAGER_PRIVATE_H */
......@@ -3189,3 +3189,23 @@ meta_monitor_manager_get_config_manager (MetaMonitorManager *manager)
{
return manager->config_manager;
}
/**
* meta_monitor_manager_get_vendor_name:
* @manager: A #MetaMonitorManager object
* @vendor: the PNP ID of the monitor
*
* Find the full vendor name from the given monitor PNP ID.
*
* Returns: (transfer full): A string containing the vendor name,
* or NULL when not found.
*/
char *
meta_monitor_manager_get_vendor_name (MetaMonitorManager *manager,
const char *vendor)
{
if (!manager->pnp_ids)
manager->pnp_ids = gnome_pnp_ids_new ();
return gnome_pnp_ids_get_pnp_id (manager->pnp_ids, vendor);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment