2021-10-25 04:50:02 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2021 Red Hat Inc.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2023-07-21 09:37:20 -04:00
|
|
|
#pragma once
|
2021-10-25 04:50:02 -04:00
|
|
|
|
color-manager: Take over color device management from gsd-color
Previously, gsd-color handled adding color devices. It got information
about those via the GnomeRR API, which is part of libgnome-desktop.
libgnome-desktop itself got this information from the
org.gnome.Mutter.DisplayConfig.GetResources() D-Bus method, implemented
by mutter.
Now, mutter itself will add all the monitor color devices itself,
without having to go via gsd-color.
We sometimes need to delete colord devices synchronously, in certain
race conditions when we add and remove devices very quickly (e.g. in
tests). However, we cannot use libcolord's 'sync' API variants, as it
has a nested takes-all main loop as a way to invoke the sync call. This
effectively means we end up sometimes not return from this function in a
timely manner, causing wierd issues.
Instead, create our own sync helper, that uses a separate context that
we temporarly push as the thread-default one.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2141>
2021-10-27 16:47:06 -04:00
|
|
|
#include <colord.h>
|
2022-07-27 07:30:15 -04:00
|
|
|
#include <lcms2.h>
|
color-manager: Take over color device management from gsd-color
Previously, gsd-color handled adding color devices. It got information
about those via the GnomeRR API, which is part of libgnome-desktop.
libgnome-desktop itself got this information from the
org.gnome.Mutter.DisplayConfig.GetResources() D-Bus method, implemented
by mutter.
Now, mutter itself will add all the monitor color devices itself,
without having to go via gsd-color.
We sometimes need to delete colord devices synchronously, in certain
race conditions when we add and remove devices very quickly (e.g. in
tests). However, we cannot use libcolord's 'sync' API variants, as it
has a nested takes-all main loop as a way to invoke the sync call. This
effectively means we end up sometimes not return from this function in a
timely manner, causing wierd issues.
Instead, create our own sync helper, that uses a separate context that
we temporarly push as the thread-default one.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2141>
2021-10-27 16:47:06 -04:00
|
|
|
|
2021-11-29 14:44:56 -05:00
|
|
|
#include "backends/meta-backend-types.h"
|
2021-10-25 04:50:02 -04:00
|
|
|
#include "backends/meta-color-manager.h"
|
|
|
|
|
|
|
|
struct _MetaColorManagerClass
|
|
|
|
{
|
|
|
|
GObjectClass parent_class;
|
|
|
|
};
|
|
|
|
|
color-manager: Take over color device management from gsd-color
Previously, gsd-color handled adding color devices. It got information
about those via the GnomeRR API, which is part of libgnome-desktop.
libgnome-desktop itself got this information from the
org.gnome.Mutter.DisplayConfig.GetResources() D-Bus method, implemented
by mutter.
Now, mutter itself will add all the monitor color devices itself,
without having to go via gsd-color.
We sometimes need to delete colord devices synchronously, in certain
race conditions when we add and remove devices very quickly (e.g. in
tests). However, we cannot use libcolord's 'sync' API variants, as it
has a nested takes-all main loop as a way to invoke the sync call. This
effectively means we end up sometimes not return from this function in a
timely manner, causing wierd issues.
Instead, create our own sync helper, that uses a separate context that
we temporarly push as the thread-default one.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2141>
2021-10-27 16:47:06 -04:00
|
|
|
CdClient * meta_color_manager_get_cd_client (MetaColorManager *color_manager);
|
|
|
|
|
2022-09-13 12:28:41 -04:00
|
|
|
META_EXPORT_TEST
|
2021-11-29 14:44:56 -05:00
|
|
|
MetaColorStore * meta_color_manager_get_color_store (MetaColorManager *color_manager);
|
|
|
|
|
2021-11-30 02:22:33 -05:00
|
|
|
META_EXPORT_TEST
|
|
|
|
gboolean meta_color_manager_is_ready (MetaColorManager *color_manager);
|
|
|
|
|
2021-11-29 11:27:27 -05:00
|
|
|
META_EXPORT_TEST
|
|
|
|
int meta_color_manager_get_num_color_devices (MetaColorManager *color_manager);
|
|
|
|
|
2022-07-27 07:30:15 -04:00
|
|
|
cmsContext meta_color_manager_get_lcms_context (MetaColorManager *color_manager);
|