[gnome-color-manager] Do not use deprecated symbols from colord



commit fc4f84de49332c82d4b583cb2293b58438d09dcb
Author: Richard Hughes <richard hughsie com>
Date:   Thu Jan 10 22:38:08 2013 +0000

    Do not use deprecated symbols from colord

 configure.ac                  |    2 +-
 src/Makefile.am               |    1 +
 src/gcm-calibrate-argyll.c    |    8 ++++----
 src/gcm-calibrate.c           |   24 ++++++++++++------------
 src/gcm-cell-renderer-color.c |    2 +-
 src/gcm-cie-widget.c          |   16 ++++++++--------
 src/gcm-hull.c                |    6 +++---
 src/gcm-picker.c              |    4 ++--
 src/gcm-profile.c             |   38 +++++++++++++++++++-------------------
 src/gcm-self-test.c           |   14 +++++++-------
 10 files changed, 58 insertions(+), 57 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index ef2f861..636c85c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -84,7 +84,7 @@ PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 2.91.0)
 PKG_CHECK_MODULES(LCMS, lcms2 >= 2.2)
 PKG_CHECK_MODULES(X11, x11)
 PKG_CHECK_MODULES(GNOME_DESKTOP, gnome-desktop-3.0)
-PKG_CHECK_MODULES(COLORD, colord-gtk >= 0.1.20)
+PKG_CHECK_MODULES(COLORD, colord >= 0.1.27 colord-gtk >= 0.1.20)
 
 dnl **** Check for clutter ****
 AC_ARG_ENABLE(clutter, AS_HELP_STRING([--enable-clutter],[Enable clutter for 3D support]), enable_clutter=$enableval, enable_clutter=yes)
diff --git a/src/Makefile.am b/src/Makefile.am
index d82630d..128f926 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -21,6 +21,7 @@ INCLUDES =						\
 	-DLOCALEDIR=\""$(localedir)"\"			\
 	-DTESTDATADIR=\""$(top_srcdir)/data/tests"\"	\
 	-DGCM_SYSTEM_PROFILES_DIR="\"$(GCM_SYSTEM_PROFILES_DIR)"\" \
+	-DCD_DISABLE_DEPRECATED				\
 	-DGCM_DATA=\"$(pkgdatadir)\"
 
 noinst_LIBRARIES = libgcmshared.a
diff --git a/src/gcm-calibrate-argyll.c b/src/gcm-calibrate-argyll.c
index 3aa0dae..2bb402c 100644
--- a/src/gcm-calibrate-argyll.c
+++ b/src/gcm-calibrate-argyll.c
@@ -368,7 +368,7 @@ gcm_calibrate_argyll_display_neutralise (GcmCalibrateArgyll *calibrate_argyll,
 		g_ptr_array_add (array, g_strdup_printf ("-t%i", target_whitepoint));
 	g_ptr_array_add (array, g_strdup_printf ("-d%i", display));
 	g_ptr_array_add (array, g_strdup_printf ("-y%c", kind));
-	if (sensor_kind == CD_SENSOR_KIND_COLOR_MUNKI) {
+	if (sensor_kind == CD_SENSOR_KIND_COLOR_MUNKI_PHOTO) {
 		g_ptr_array_add (array, g_strdup ("-H"));
 	}
 	g_ptr_array_add (array, g_strdup ("-P 0.5,0.5,0.8"));
@@ -572,7 +572,7 @@ gcm_calibrate_argyll_display_draw_and_measure (GcmCalibrateArgyll *calibrate_arg
 	g_ptr_array_add (array, g_strdup_printf ("-y%c", kind));
 	g_ptr_array_add (array, g_strdup ("-k"));
 	g_ptr_array_add (array, g_strdup_printf ("%s.cal", basename));
-	if (sensor_kind == CD_SENSOR_KIND_COLOR_MUNKI) {
+	if (sensor_kind == CD_SENSOR_KIND_COLOR_MUNKI_PHOTO) {
 		g_ptr_array_add (array, g_strdup ("-H"));
 		g_ptr_array_add (array, g_strdup ("-N"));
 	}
@@ -1350,7 +1350,7 @@ gcm_calibrate_argyll_get_sensor_target (GcmCalibrateArgyll *calibrate_argyll)
 		return "SS";
 	if (sensor_kind == CD_SENSOR_KIND_I1_PRO)
 		return "i1";
-	if (sensor_kind == CD_SENSOR_KIND_COLOR_MUNKI)
+	if (sensor_kind == CD_SENSOR_KIND_COLOR_MUNKI_PHOTO)
 		return "CM";
 	return NULL;
 }
@@ -1409,7 +1409,7 @@ gcm_calibrate_argyll_printer_generate_targets (GcmCalibrateArgyll *calibrate_arg
 
 #ifdef USE_DOUBLE_DENSITY
 	/* use double density */
-	if (sensor_kind == CD_SENSOR_KIND_COLOR_MUNKI ||
+	if (sensor_kind == CD_SENSOR_KIND_COLOR_MUNKI_PHOTO ||
 	    sensor_kind == CD_SENSOR_KIND_SPECTRO_SCAN) {
 		g_ptr_array_add (array, g_strdup ("-h"));
 	}
diff --git a/src/gcm-calibrate.c b/src/gcm-calibrate.c
index acc611f..efe4d8c 100644
--- a/src/gcm-calibrate.c
+++ b/src/gcm-calibrate.c
@@ -388,7 +388,7 @@ gcm_calibrate_get_sensor_image_attach (GcmCalibrate *calibrate)
 	switch (cd_sensor_get_kind (calibrate->priv->sensor)) {
 	case CD_SENSOR_KIND_HUEY:
 		return "huey-attach.svg";
-	case CD_SENSOR_KIND_COLOR_MUNKI:
+	case CD_SENSOR_KIND_COLOR_MUNKI_PHOTO:
 		return "munki-attach.svg";
 	case CD_SENSOR_KIND_SPYDER:
 		return "spyder2-attach.svg";
@@ -427,7 +427,7 @@ gcm_calibrate_get_sensor_image_calibrate (GcmCalibrate *calibrate)
 	CdSensorKind sensor_kind;
 
 	sensor_kind = cd_sensor_get_kind (calibrate->priv->sensor);
-	if (sensor_kind == CD_SENSOR_KIND_COLOR_MUNKI)
+	if (sensor_kind == CD_SENSOR_KIND_COLOR_MUNKI_PHOTO)
 		return "munki-calibrate.svg";
 	return NULL;
 }
@@ -441,7 +441,7 @@ gcm_calibrate_get_sensor_image_screen (GcmCalibrate *calibrate)
 	CdSensorKind sensor_kind;
 
 	sensor_kind = cd_sensor_get_kind (calibrate->priv->sensor);
-	if (sensor_kind == CD_SENSOR_KIND_COLOR_MUNKI)
+	if (sensor_kind == CD_SENSOR_KIND_COLOR_MUNKI_PHOTO)
 		return "munki-screen.svg";
 	return NULL;
 }
@@ -650,7 +650,7 @@ gcm_calibrate_get_samples (GcmCalibrate *calibrate,
 	GcmCalibratePrivate *priv = calibrate->priv;
 
 	/* setup the measure window */
-	cd_color_set_rgb (&rgb_tmp, 1.0f, 1.0f, 1.0f);
+	cd_color_rgb_set (&rgb_tmp, 1.0f, 1.0f, 1.0f);
 	cd_sample_window_set_color (CD_SAMPLE_WINDOW (priv->sample_window), &rgb_tmp);
 	cd_sample_window_set_fraction (CD_SAMPLE_WINDOW (priv->sample_window), 0.0f);
 	gtk_window_set_modal (priv->sample_window, TRUE);
@@ -1188,27 +1188,27 @@ gcm_calibrate_get_primaries (GcmCalibrate *calibrate,
 
 	/* red */
 	rgb = cd_color_rgb_new ();
-	cd_color_set_rgb (rgb, 1.0f, 0.0f, 0.0f);
+	cd_color_rgb_set (rgb, 1.0f, 0.0f, 0.0f);
 	g_ptr_array_add (samples_rgb, rgb);
 
 	/* green */
 	rgb = cd_color_rgb_new ();
-	cd_color_set_rgb (rgb, 0.0f, 1.0f, 0.0f);
+	cd_color_rgb_set (rgb, 0.0f, 1.0f, 0.0f);
 	g_ptr_array_add (samples_rgb, rgb);
 
 	/* blue */
 	rgb = cd_color_rgb_new ();
-	cd_color_set_rgb (rgb, 0.0f, 0.0f, 1.0f);
+	cd_color_rgb_set (rgb, 0.0f, 0.0f, 1.0f);
 	g_ptr_array_add (samples_rgb, rgb);
 
 	/* white */
 	rgb = cd_color_rgb_new ();
-	cd_color_set_rgb (rgb, 1.0f, 1.0f, 1.0f);
+	cd_color_rgb_set (rgb, 1.0f, 1.0f, 1.0f);
 	g_ptr_array_add (samples_rgb, rgb);
 
 	/* black */
 	rgb = cd_color_rgb_new ();
-	cd_color_set_rgb (rgb, 0.0f, 0.0f, 0.0f);
+	cd_color_rgb_set (rgb, 0.0f, 0.0f, 0.0f);
 	g_ptr_array_add (samples_rgb, rgb);
 
 	/* measure */
@@ -1251,7 +1251,7 @@ gcm_calibrate_resize_results (GPtrArray *src_array,
 		if (reg1 == reg2) {
 			/* no interpolation reqd */
 			src1 = g_ptr_array_index (src_array, reg1);
-			cd_color_copy_rgb (src1, dest);
+			cd_color_rgb_copy (src1, dest);
 		} else {
 			amount = div - (gdouble) reg1;
 			src1 = g_ptr_array_index (src_array, reg1);
@@ -1275,7 +1275,7 @@ gcm_calibrate_array_remove_offset (GPtrArray *array)
 	guint i;
 
 	/* remove the backlight leakage */
-	cd_color_set_rgb (&offset,
+	cd_color_rgb_set (&offset,
 			  G_MAXDOUBLE,
 			  G_MAXDOUBLE,
 			  G_MAXDOUBLE);
@@ -1315,7 +1315,7 @@ gcm_calibrate_array_scale (GPtrArray *array, gdouble value)
 	guint i;
 
 	/* scale all values */
-	cd_color_set_rgb (&scale,
+	cd_color_rgb_set (&scale,
 			  G_MINDOUBLE,
 			  G_MINDOUBLE,
 			  G_MINDOUBLE);
diff --git a/src/gcm-cell-renderer-color.c b/src/gcm-cell-renderer-color.c
index 15f44f7..b6629eb 100644
--- a/src/gcm-cell-renderer-color.c
+++ b/src/gcm-cell-renderer-color.c
@@ -118,7 +118,7 @@ gcm_cell_renderer_color_set_property (GObject *object, guint param_id,
 
 	switch (param_id) {
 	case PROP_COLOR:
-		cd_color_copy_xyz (g_value_get_boxed (value), renderer->color);
+		cd_color_xyz_copy (g_value_get_boxed (value), renderer->color);
 		gcm_cell_renderer_set_color (renderer);
 		break;
 	case PROP_PROFILE:
diff --git a/src/gcm-cie-widget.c b/src/gcm-cie-widget.c
index 8fc4b85..4b4a709 100644
--- a/src/gcm-cie-widget.c
+++ b/src/gcm-cie-widget.c
@@ -439,16 +439,16 @@ gcm_cie_set_property (GObject *object, guint prop_id, const GValue *value, GPara
 		cie->priv->use_whitepoint = g_value_get_boolean (value);
 		break;
 	case PROP_RED:
-		cd_color_copy_yxy (g_value_get_boxed (value), priv->red);
+		cd_color_yxy_copy (g_value_get_boxed (value), priv->red);
 		break;
 	case PROP_GREEN:
-		cd_color_copy_yxy (g_value_get_boxed (value), priv->green);
+		cd_color_yxy_copy (g_value_get_boxed (value), priv->green);
 		break;
 	case PROP_BLUE:
-		cd_color_copy_yxy (g_value_get_boxed (value), priv->blue);
+		cd_color_yxy_copy (g_value_get_boxed (value), priv->blue);
 		break;
 	case PROP_WHITE:
-		cd_color_copy_yxy (g_value_get_boxed (value), priv->white);
+		cd_color_yxy_copy (g_value_get_boxed (value), priv->white);
 		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -530,10 +530,10 @@ gcm_cie_widget_set_from_profile (GtkWidget *widget, GcmProfile *profile)
 		      NULL);
 
 	/* copy into this widget */
-	cd_color_convert_xyz_to_yxy (white, cie->priv->white);
-	cd_color_convert_xyz_to_yxy (red, cie->priv->red);
-	cd_color_convert_xyz_to_yxy (green, cie->priv->green);
-	cd_color_convert_xyz_to_yxy (blue, cie->priv->blue);
+	cd_color_xyz_to_yxy (white, cie->priv->white);
+	cd_color_xyz_to_yxy (red, cie->priv->red);
+	cd_color_xyz_to_yxy (green, cie->priv->green);
+	cd_color_xyz_to_yxy (blue, cie->priv->blue);
 
 	/* hide if we have no data */
 	if (cie->priv->white->x > 0.001) {
diff --git a/src/gcm-hull.c b/src/gcm-hull.c
index 14257ac..2168787 100644
--- a/src/gcm-hull.c
+++ b/src/gcm-hull.c
@@ -90,8 +90,8 @@ gcm_hull_add_vertex (GcmHull *hull,
 {
 	GcmHullVertex *new;
 	new = g_slice_new (GcmHullVertex);
-	cd_color_copy_xyz (xyz, &new->xyz);
-	cd_color_copy_rgb (color, &new->color);
+	cd_color_xyz_copy (xyz, &new->xyz);
+	cd_color_rgb_copy (color, &new->color);
 	g_ptr_array_add (hull->priv->vertices, new);
 }
 
@@ -138,7 +138,7 @@ gcm_hull_export_to_ply (GcmHull *hull)
 
 	for (i=0; i<hull->priv->vertices->len; i++) {
 		vertex = g_ptr_array_index (hull->priv->vertices, i);
-		cd_color_convert_rgb_to_rgb8 (&vertex->color, &tmp);
+		cd_color_rgb_to_rgb8 (&vertex->color, &tmp);
 		g_string_append_printf (string, "%lf %lf %lf %i %i %i\n",
 					vertex->xyz.X,
 					vertex->xyz.Y,
diff --git a/src/gcm-picker.c b/src/gcm-picker.c
index 388c58a..5828942 100644
--- a/src/gcm-picker.c
+++ b/src/gcm-picker.c
@@ -114,7 +114,7 @@ gcm_picker_refresh_results (void)
 		goto out;
 
 	/* copy as we're modifying the value */
-	cd_color_copy_xyz (&last_sample, &color_xyz);
+	cd_color_xyz_copy (&last_sample, &color_xyz);
 
 	/* create new pixbuf of the right size */
 	pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, 200, 200);
@@ -290,7 +290,7 @@ gcm_picker_measure_cb (GtkWidget *widget, gpointer data)
 		g_clear_error (&error);
 		goto out_unlock;
 	}
-	cd_color_copy_xyz (tmp, &last_sample);
+	cd_color_xyz_copy (tmp, &last_sample);
 #if 0
 	/* get ambient */
 	ret = cd_sensor_get_sample_sync (sensor,
diff --git a/src/gcm-profile.c b/src/gcm-profile.c
index 7993da1..4cddd69 100644
--- a/src/gcm-profile.c
+++ b/src/gcm-profile.c
@@ -657,7 +657,7 @@ gcm_profile_calc_whitepoint (GcmProfile *profile)
 	cmsDoTransform (transform, data, &whitepoint, 1);
 
 	/* convert to lcms xyY values */
-	cd_color_set_xyz (priv->white,
+	cd_color_xyz_set (priv->white,
 			  whitepoint.X, whitepoint.Y, whitepoint.Z);
 	cmsXYZ2xyY (&tmp, &whitepoint);
 	g_debug ("whitepoint = %f,%f [%f]", tmp.x, tmp.y, tmp.Y);
@@ -733,7 +733,7 @@ gcm_profile_parse_data (GcmProfile *profile, const guint8 *data, gsize length, G
 	/* get white point */
 	ret = gcm_profile_calc_whitepoint (profile);
 	if (!ret)
-		cd_color_clear_xyz (priv->white);
+		cd_color_xyz_clear (priv->white);
 
 	/* get the profile kind */
 	profile_class = cmsGetDeviceClass (priv->lcms_profile);
@@ -807,11 +807,11 @@ gcm_profile_parse_data (GcmProfile *profile, const guint8 *data, gsize length, G
 		cie_xyz = cmsReadTag (priv->lcms_profile, cmsSigRedMatrixColumnTag);
 		if (cie_xyz != NULL) {
 			/* assume that if red is present, the green and blue are too */
-			cd_color_copy_xyz ((CdColorXYZ *) cie_xyz, (CdColorXYZ *) &cie_illum.Red);
+			cd_color_xyz_copy ((CdColorXYZ *) cie_xyz, (CdColorXYZ *) &cie_illum.Red);
 			cie_xyz = cmsReadTag (priv->lcms_profile, cmsSigGreenMatrixColumnTag);
-			cd_color_copy_xyz ((CdColorXYZ *) cie_xyz, (CdColorXYZ *) &cie_illum.Green);
+			cd_color_xyz_copy ((CdColorXYZ *) cie_xyz, (CdColorXYZ *) &cie_illum.Green);
 			cie_xyz = cmsReadTag (priv->lcms_profile, cmsSigBlueMatrixColumnTag);
-			cd_color_copy_xyz ((CdColorXYZ *) cie_xyz, (CdColorXYZ *) &cie_illum.Blue);
+			cd_color_xyz_copy ((CdColorXYZ *) cie_xyz, (CdColorXYZ *) &cie_illum.Blue);
 			got_illuminants = TRUE;
 		} else {
 			g_debug ("failed to get illuminants");
@@ -858,17 +858,17 @@ gcm_profile_parse_data (GcmProfile *profile, const guint8 *data, gsize length, G
 
 	/* we've got valid values */
 	if (got_illuminants) {
-		cd_color_set_xyz (priv->red,
+		cd_color_xyz_set (priv->red,
 				   cie_illum.Red.X, cie_illum.Red.Y, cie_illum.Red.Z);
-		cd_color_set_xyz (priv->green,
+		cd_color_xyz_set (priv->green,
 				   cie_illum.Green.X, cie_illum.Green.Y, cie_illum.Green.Z);
-		cd_color_set_xyz (priv->blue,
+		cd_color_xyz_set (priv->blue,
 				   cie_illum.Blue.X, cie_illum.Blue.Y, cie_illum.Blue.Z);
 	} else {
 		g_debug ("failed to get luminance values");
-		cd_color_clear_xyz (priv->red);
-		cd_color_clear_xyz (priv->green);
-		cd_color_clear_xyz (priv->blue);
+		cd_color_xyz_clear (priv->red);
+		cd_color_xyz_clear (priv->green);
+		cd_color_xyz_clear (priv->blue);
 	}
 
 	/* get the profile created time and date */
@@ -1009,7 +1009,7 @@ gcm_profile_set_whitepoint (GcmProfile *profile, const CdColorXYZ *whitepoint, G
 		priv->lcms_profile = cmsCreateProfilePlaceholder (NULL);
 
 	/* copy */
-	cd_color_copy_xyz (whitepoint, priv->white);
+	cd_color_xyz_copy (whitepoint, priv->white);
 
 	/* write tag */
 	ret = cmsWriteTag (priv->lcms_profile, cmsSigMediaWhitePointTag, priv->white);
@@ -1048,9 +1048,9 @@ gcm_profile_set_primaries (GcmProfile *profile,
 		priv->lcms_profile = cmsCreateProfilePlaceholder (NULL);
 
 	/* copy */
-	cd_color_copy_xyz (red, priv->red);
-	cd_color_copy_xyz (green, priv->green);
-	cd_color_copy_xyz (blue, priv->blue);
+	cd_color_xyz_copy (red, priv->red);
+	cd_color_xyz_copy (green, priv->green);
+	cd_color_xyz_copy (blue, priv->blue);
 
 	/* write tags */
 	ret = cmsWriteTag (priv->lcms_profile, cmsSigRedMatrixColumnTag, priv->red);
@@ -2251,16 +2251,16 @@ gcm_profile_set_property (GObject *object, guint prop_id, const GValue *value, G
 		gcm_profile_set_size (profile, g_value_get_uint (value));
 		break;
 	case PROP_WHITE:
-		cd_color_copy_xyz (g_value_get_boxed (value), priv->white);
+		cd_color_xyz_copy (g_value_get_boxed (value), priv->white);
 		break;
 	case PROP_RED:
-		cd_color_copy_xyz (g_value_get_boxed (value), priv->red);
+		cd_color_xyz_copy (g_value_get_boxed (value), priv->red);
 		break;
 	case PROP_GREEN:
-		cd_color_copy_xyz (g_value_get_boxed (value), priv->green);
+		cd_color_xyz_copy (g_value_get_boxed (value), priv->green);
 		break;
 	case PROP_BLUE:
-		cd_color_copy_xyz (g_value_get_boxed (value), priv->blue);
+		cd_color_xyz_copy (g_value_get_boxed (value), priv->blue);
 		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
diff --git a/src/gcm-self-test.c b/src/gcm-self-test.c
index d35b918..179344a 100644
--- a/src/gcm-self-test.c
+++ b/src/gcm-self-test.c
@@ -145,7 +145,7 @@ gcm_test_profile_func (void)
 		      "red", &xyz,
 		      NULL);
 	g_assert (xyz != NULL);
-	cd_color_convert_xyz_to_yxy (xyz, &yxy);
+	cd_color_xyz_to_yxy (xyz, &yxy);
 	g_assert_cmpfloat (fabs (yxy.x - 0.648454), <, 0.01);
 
 	cd_color_xyz_free (xyz);
@@ -437,10 +437,10 @@ gcm_test_cie_widget_func (void)
 		      NULL);
 	g_object_unref (file);
 
-	cd_color_convert_xyz_to_yxy (white, &white_Yxy);
-	cd_color_convert_xyz_to_yxy (red, &red_Yxy);
-	cd_color_convert_xyz_to_yxy (green, &green_Yxy);
-	cd_color_convert_xyz_to_yxy (blue, &blue_Yxy);
+	cd_color_xyz_to_yxy (white, &white_Yxy);
+	cd_color_xyz_to_yxy (red, &red_Yxy);
+	cd_color_xyz_to_yxy (green, &green_Yxy);
+	cd_color_xyz_to_yxy (blue, &blue_Yxy);
 
 	g_object_set (widget,
 		      "red", &red_Yxy,
@@ -698,7 +698,7 @@ gcm_test_named_color_func (void)
 	xyz = cd_color_xyz_new ();
 
 	/* use setters */
-	cd_color_set_xyz (xyz, 0.1, 0.2, 0.3);
+	cd_color_xyz_set (xyz, 0.1, 0.2, 0.3);
 	gcm_named_color_set_value (nc, xyz);
 
 	/* test getters */
@@ -709,7 +709,7 @@ gcm_test_named_color_func (void)
 	g_assert_cmpfloat (abs (xyz_new->Z - 0.3), <, 0.01);
 
 	/* overwrite using properties */
-	cd_color_set_xyz (xyz, 0.4, 0.5, 0.6);
+	cd_color_xyz_set (xyz, 0.4, 0.5, 0.6);
 	g_object_set (nc,
 		      "title", "dave",
 		      "value", xyz,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]