diff --git a/meson.build b/meson.build index e383be77c..cbfc8946a 100644 --- a/meson.build +++ b/meson.build @@ -13,6 +13,7 @@ mutter_srcdir = meson.current_source_dir() mutter_builddir = meson.current_build_dir() # generic version requirements +lcms2_req = '>= 2.6' colord_req = '>= 1.4.5' fribidi_req = '>= 1.0.0' glib_req = '>= 2.69.0' @@ -126,6 +127,7 @@ atk_dep = dependency('atk', version: atk_req) libcanberra_dep = dependency('libcanberra', version: libcanberra_req) dbus_dep = dependency('dbus-1') colord_dep = dependency('colord', version: colord_req) +lcms2_dep = dependency('lcms2', version: lcms2_req) have_wayland = get_option('wayland') # For now always require X11 support diff --git a/src/backends/meta-color-manager-private.h b/src/backends/meta-color-manager-private.h index ae33ae1ca..b358a359a 100644 --- a/src/backends/meta-color-manager-private.h +++ b/src/backends/meta-color-manager-private.h @@ -19,6 +19,7 @@ #define META_COLOR_MANAGER_PRIVATE_H #include +#include #include "backends/meta-color-manager.h" @@ -35,4 +36,6 @@ gboolean meta_color_manager_is_ready (MetaColorManager *color_manager); META_EXPORT_TEST int meta_color_manager_get_num_color_devices (MetaColorManager *color_manager); +cmsContext meta_color_manager_get_lcms_context (MetaColorManager *color_manager); + #endif /* META_COLOR_MANAGER_PRIVATE_H */ diff --git a/src/backends/meta-color-manager.c b/src/backends/meta-color-manager.c index 696c2b337..cae3d923c 100644 --- a/src/backends/meta-color-manager.c +++ b/src/backends/meta-color-manager.c @@ -68,6 +68,8 @@ typedef struct _MetaColorManagerPrivate { MetaBackend *backend; + cmsContext lcms_context; + CdClient *cd_client; GCancellable *cancellable; @@ -243,6 +245,8 @@ meta_color_manager_constructed (GObject *object) MetaColorManagerPrivate *priv = meta_color_manager_get_instance_private (color_manager); + priv->lcms_context = cmsCreateContext (NULL, NULL); + priv->cancellable = g_cancellable_new (); priv->cd_client = cd_client_new (); @@ -270,6 +274,7 @@ meta_color_manager_finalize (GObject *object) g_clear_object (&priv->cancellable); g_clear_pointer (&priv->devices, g_hash_table_unref); g_clear_object (&priv->gsd_color); + g_clear_pointer (&priv->lcms_context, cmsDeleteContext); G_OBJECT_CLASS (meta_color_manager_parent_class)->finalize (object); } @@ -389,3 +394,12 @@ meta_color_manager_get_num_color_devices (MetaColorManager *color_manager) return g_hash_table_size (priv->devices); } + +cmsContext +meta_color_manager_get_lcms_context (MetaColorManager *color_manager) +{ + MetaColorManagerPrivate *priv = + meta_color_manager_get_instance_private (color_manager); + + return priv->lcms_context; +} diff --git a/src/meson.build b/src/meson.build index adcfbad95..0b5d6c4fc 100644 --- a/src/meson.build +++ b/src/meson.build @@ -23,6 +23,7 @@ mutter_pkg_deps = [ mutter_pkg_private_deps = [ colord_dep, + lcms2_dep, gmodule_no_export_dep, gnome_settings_daemon_dep, json_glib_dep,