summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/Makefile.am1
-rw-r--r--contrib/session-helper/Makefile.am1
-rw-r--r--contrib/session-helper/cd-example.c5
-rw-r--r--contrib/session-helper/cd-main.c24
-rw-r--r--libcolord/Makefile.am4
-rw-r--r--libcolord/cd-color.c44
-rw-r--r--libcolord/cd-color.h22
-rw-r--r--libcolord/cd-deprecated.c208
-rw-r--r--libcolord/cd-deprecated.h74
-rw-r--r--libcolord/cd-it8-utils.c4
-rw-r--r--libcolord/cd-it8.c12
-rw-r--r--libcolord/cd-math.h1
-rw-r--r--libcolord/cd-self-test.c6
-rw-r--r--libcolord/colord.h1
-rw-r--r--src/Makefile.am1
-rw-r--r--src/plugins/Makefile.am1
-rw-r--r--src/sensors/Makefile.am1
17 files changed, 350 insertions, 60 deletions
diff --git a/client/Makefile.am b/client/Makefile.am
index 769398d..4f0b2f8 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -5,6 +5,7 @@ INCLUDES = \
-I$(top_srcdir)/libcolord \
-DG_LOG_DOMAIN=\"Cd\" \
-DCD_COMPILATION \
+ -DCD_DISABLE_DEPRECATED \
-DLIBEXECDIR=\"$(libexecdir)\" \
-DDATADIR=\"$(datadir)\" \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
diff --git a/contrib/session-helper/Makefile.am b/contrib/session-helper/Makefile.am
index 3b1b073..ba8286e 100644
--- a/contrib/session-helper/Makefile.am
+++ b/contrib/session-helper/Makefile.am
@@ -11,6 +11,7 @@ INCLUDES = \
-I$(top_srcdir)/libcolord \
-I$(top_srcdir)/src \
-DCD_COMPILATION \
+ -DCD_DISABLE_DEPRECATED \
-DG_LOG_DOMAIN=\"Cd\" \
-DLIBEXECDIR=\"$(libexecdir)\" \
-DLIBDIR=\"$(libdir)\" \
diff --git a/contrib/session-helper/cd-example.c b/contrib/session-helper/cd-example.c
index 203173f..b4063b3 100644
--- a/contrib/session-helper/cd-example.c
+++ b/contrib/session-helper/cd-example.c
@@ -21,6 +21,7 @@
#include "config.h"
+#include <cd-color.h>
#include <colord-gtk.h>
#include <gio/gio.h>
#include <glib.h>
@@ -126,7 +127,7 @@ cd_example_calib_set_output_gamma (CdExamplePrivate *priv,
red = g_new (guint16, priv->gamma_size);
green = g_new (guint16, priv->gamma_size);
blue = g_new (guint16, priv->gamma_size);
- cd_color_set_rgb (&result, 1.0, 1.0, 1.0);
+ cd_color_rgb_set (&result, 1.0, 1.0, 1.0);
for (i = 0; i < priv->gamma_size; i++) {
mix = (gdouble) (array->len - 1) /
(gdouble) (priv->gamma_size - 1) *
@@ -310,7 +311,7 @@ cd_example_signal_cb (GDBusProxy *proxy,
&color.G,
&color.B)) {
color_tmp = cd_color_rgb_new ();
- cd_color_copy_rgb (&color, color_tmp);
+ cd_color_rgb_copy (&color, color_tmp);
g_ptr_array_add (array, color_tmp);
}
g_variant_iter_free (iter);
diff --git a/contrib/session-helper/cd-main.c b/contrib/session-helper/cd-main.c
index f282f10..143b102 100644
--- a/contrib/session-helper/cd-main.c
+++ b/contrib/session-helper/cd-main.c
@@ -385,7 +385,7 @@ cd_main_calib_get_sample (CdMainPrivate *priv,
ret = FALSE;
goto out;
}
- cd_color_copy_xyz (xyz_tmp, xyz);
+ cd_color_xyz_copy (xyz_tmp, xyz);
out:
if (xyz_tmp != NULL)
cd_color_xyz_free (xyz_tmp);
@@ -448,7 +448,7 @@ cd_main_calib_try_item (CdMainPrivate *priv,
error_tmp = sqrt (lab.a * lab.a + lab.b * lab.b);
g_debug ("%f\t%f\t%f = %f", lab.L, lab.a, lab.b, error_tmp);
if (error_tmp < item->error) {
- cd_color_copy_rgb (&item->color, &item->best_so_far);
+ cd_color_rgb_copy (&item->color, &item->best_so_far);
item->error = error_tmp;
if (new_best != NULL)
*new_best = TRUE;
@@ -485,7 +485,7 @@ cd_main_calib_process_item (CdMainPrivate *priv,
goto out;
/* copy the current color balance as the best */
- cd_color_copy_rgb (&item->color, &item->best_so_far);
+ cd_color_rgb_copy (&item->color, &item->best_so_far);
/* get a baseline error */
ret = cd_main_calib_try_item (priv, item, NULL, error);
@@ -522,7 +522,7 @@ cd_main_calib_process_item (CdMainPrivate *priv,
}
/* blue */
- cd_color_copy_rgb (&item->best_so_far, &item->color);
+ cd_color_rgb_copy (&item->best_so_far, &item->color);
if (item->best_so_far.B > interval) {
item->color.B = item->best_so_far.B - interval;
ret = cd_main_calib_try_item (priv, item, &new_best, error);
@@ -547,7 +547,7 @@ cd_main_calib_process_item (CdMainPrivate *priv,
}
/* red */
- cd_color_copy_rgb (&item->best_so_far, &item->color);
+ cd_color_rgb_copy (&item->best_so_far, &item->color);
if (item->best_so_far.R > interval) {
item->color.R = item->best_so_far.R - interval;
ret = cd_main_calib_try_item (priv, item, &new_best, error);
@@ -572,7 +572,7 @@ cd_main_calib_process_item (CdMainPrivate *priv,
}
/* green */
- cd_color_copy_rgb (&item->best_so_far, &item->color);
+ cd_color_rgb_copy (&item->best_so_far, &item->color);
if (item->best_so_far.G > interval) {
item->color.G = item->best_so_far.G - interval;
ret = cd_main_calib_try_item (priv, item, &new_best, error);
@@ -613,7 +613,7 @@ cd_main_calib_process_item (CdMainPrivate *priv,
}
/* save this */
- cd_color_copy_rgb (&item->best_so_far,
+ cd_color_rgb_copy (&item->best_so_far,
&item->color);
/* done */
@@ -648,7 +648,7 @@ cd_main_calib_interpolate_up (CdMainPrivate *priv,
p1 = g_ptr_array_index (priv->array, i);
result = g_new (CdMainCalibrateItem, 1);
result->error = p1->error;
- cd_color_copy_rgb (&p1->color, &result->color);
+ cd_color_rgb_copy (&p1->color, &result->color);
g_ptr_array_add (old_array, result);
}
@@ -662,7 +662,7 @@ cd_main_calib_interpolate_up (CdMainPrivate *priv,
p2 = g_ptr_array_index (old_array, (guint) ceil (mix));
result = g_new (CdMainCalibrateItem, 1);
result->error = G_MAXDOUBLE;
- cd_color_set_rgb (&result->color, 1.0, 1.0, 1.0);
+ cd_color_rgb_set (&result->color, 1.0, 1.0, 1.0);
cd_color_rgb_interpolate (&p1->color,
&p2->color,
mix - (gint) mix,
@@ -708,11 +708,11 @@ cd_main_calib_process (CdMainPrivate *priv,
priv->array = g_ptr_array_new_with_free_func (g_free);
item = g_new0 (CdMainCalibrateItem, 1);
item->error = G_MAXDOUBLE;
- cd_color_set_rgb (&item->color, 0.0, 0.0, 0.0);
+ cd_color_rgb_set (&item->color, 0.0, 0.0, 0.0);
g_ptr_array_add (priv->array, item);
item = g_new0 (CdMainCalibrateItem, 1);
item->error = G_MAXDOUBLE;
- cd_color_set_rgb (&item->color, 1.0, 1.0, 1.0);
+ cd_color_rgb_set (&item->color, 1.0, 1.0, 1.0);
g_ptr_array_add (priv->array, item);
cd_main_emit_update_gamma (priv, priv->array);
@@ -752,7 +752,7 @@ cd_main_calib_process (CdMainPrivate *priv,
cd_color_get_blackbody_rgb (6500 - (priv->native_whitepoint - priv->target_whitepoint), &tmp);
g_debug ("Seeding with %f,%f,%f",
tmp.R, tmp.G, tmp.B);
- cd_color_copy_rgb (&tmp, &item->color);
+ cd_color_rgb_copy (&tmp, &item->color);
}
/* process the last item in the array (255,255,255) */
diff --git a/libcolord/Makefile.am b/libcolord/Makefile.am
index 138cecb..9c4f4ba 100644
--- a/libcolord/Makefile.am
+++ b/libcolord/Makefile.am
@@ -38,6 +38,7 @@ libcolordbase_include_HEADERS = \
cd-client.h \
cd-client-sync.h \
cd-color.h \
+ cd-deprecated.h \
cd-device.h \
cd-device-sync.h \
cd-enum.h \
@@ -54,6 +55,7 @@ libcolord_la_SOURCES = \
cd-client.c \
cd-client-sync.c \
cd-color.c \
+ cd-deprecated.c \
cd-device.c \
cd-device-sync.c \
cd-enum.c \
@@ -111,7 +113,7 @@ introspection_sources = \
Colord-1.0.gir: libcolord.la
Colord_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0
-Colord_1_0_gir_CFLAGS = $(INCLUDES)
+Colord_1_0_gir_CFLAGS = $(INCLUDES) -DCD_DISABLE_DEPRECATED
Colord_1_0_gir_SCANNERFLAGS = --identifier-prefix=Cd \
--symbol-prefix=cd \
--warn-all \
diff --git a/libcolord/cd-color.c b/libcolord/cd-color.c
index d0519fa..79f64b1 100644
--- a/libcolord/cd-color.c
+++ b/libcolord/cd-color.c
@@ -132,7 +132,7 @@ cd_color_yxy_get_type (void)
}
/**
- * cd_color_set_xyz:
+ * cd_color_xyz_set:
* @dest: the destination color
* @X: component value
* @Y: component value
@@ -141,7 +141,7 @@ cd_color_yxy_get_type (void)
* Initialises a color value.
**/
void
-cd_color_set_xyz (CdColorXYZ *dest, gdouble X, gdouble Y, gdouble Z)
+cd_color_xyz_set (CdColorXYZ *dest, gdouble X, gdouble Y, gdouble Z)
{
g_return_if_fail (dest != NULL);
@@ -151,13 +151,13 @@ cd_color_set_xyz (CdColorXYZ *dest, gdouble X, gdouble Y, gdouble Z)
}
/**
- * cd_color_clear_xyz:
+ * cd_color_xyz_clear:
* @dest: the destination color
*
* Initialises a color value.
**/
void
-cd_color_clear_xyz (CdColorXYZ *dest)
+cd_color_xyz_clear (CdColorXYZ *dest)
{
g_return_if_fail (dest != NULL);
@@ -167,7 +167,7 @@ cd_color_clear_xyz (CdColorXYZ *dest)
}
/**
- * cd_color_set_rgb:
+ * cd_color_rgb_set:
* @dest: the destination color
* @R: component value
* @G: component value
@@ -176,7 +176,7 @@ cd_color_clear_xyz (CdColorXYZ *dest)
* Initialises a color value.
**/
void
-cd_color_set_rgb (CdColorRGB *dest, gdouble R, gdouble G, gdouble B)
+cd_color_rgb_set (CdColorRGB *dest, gdouble R, gdouble G, gdouble B)
{
g_return_if_fail (dest != NULL);
@@ -186,7 +186,7 @@ cd_color_set_rgb (CdColorRGB *dest, gdouble R, gdouble G, gdouble B)
}
/**
- * cd_color_set_yxy:
+ * cd_color_yxy_set:
* @dest: the destination color
* @Y: component value
* @x: component value
@@ -195,7 +195,7 @@ cd_color_set_rgb (CdColorRGB *dest, gdouble R, gdouble G, gdouble B)
* Initialises a color value.
**/
void
-cd_color_set_yxy (CdColorYxy *dest, gdouble Y, gdouble x, gdouble y)
+cd_color_yxy_set (CdColorYxy *dest, gdouble Y, gdouble x, gdouble y)
{
g_return_if_fail (dest != NULL);
@@ -205,14 +205,14 @@ cd_color_set_yxy (CdColorYxy *dest, gdouble Y, gdouble x, gdouble y)
}
/**
- * cd_color_copy_xyz:
+ * cd_color_xyz_copy:
* @src: the source color
* @dest: the destination color
*
* Deep copies a color value.
**/
void
-cd_color_copy_xyz (const CdColorXYZ *src, CdColorXYZ *dest)
+cd_color_xyz_copy (const CdColorXYZ *src, CdColorXYZ *dest)
{
g_return_if_fail (src != NULL);
g_return_if_fail (dest != NULL);
@@ -223,14 +223,14 @@ cd_color_copy_xyz (const CdColorXYZ *src, CdColorXYZ *dest)
}
/**
- * cd_color_copy_yxy:
+ * cd_color_yxy_copy:
* @src: the source color
* @dest: the destination color
*
* Deep copies a color value.
**/
void
-cd_color_copy_yxy (const CdColorYxy *src, CdColorYxy *dest)
+cd_color_yxy_copy (const CdColorYxy *src, CdColorYxy *dest)
{
g_return_if_fail (src != NULL);
g_return_if_fail (dest != NULL);
@@ -241,14 +241,14 @@ cd_color_copy_yxy (const CdColorYxy *src, CdColorYxy *dest)
}
/**
- * cd_color_copy_rgb:
+ * cd_color_rgb_copy:
* @src: the source color
* @dest: the destination color
*
* Deep copies a color value.
**/
void
-cd_color_copy_rgb (const CdColorRGB *src, CdColorRGB *dest)
+cd_color_rgb_copy (const CdColorRGB *src, CdColorRGB *dest)
{
g_return_if_fail (src != NULL);
g_return_if_fail (dest != NULL);
@@ -259,14 +259,14 @@ cd_color_copy_rgb (const CdColorRGB *src, CdColorRGB *dest)
}
/**
- * cd_color_convert_rgb8_to_rgb:
+ * cd_color_rgb8_to_rgb:
* @src: the source color
* @dest: the destination color
*
* Convert from one color format to another.
**/
void
-cd_color_convert_rgb8_to_rgb (const CdColorRGB8 *src, CdColorRGB *dest)
+cd_color_rgb8_to_rgb (const CdColorRGB8 *src, CdColorRGB *dest)
{
g_return_if_fail (src != NULL);
g_return_if_fail (dest != NULL);
@@ -290,14 +290,14 @@ cd_color_value_double_to_uint8 (gdouble value)
}
/**
- * cd_color_convert_rgb_to_rgb8:
+ * cd_color_rgb_to_rgb8:
* @src: the source color
* @dest: the destination color
*
* Convert from one color format to another.
**/
void
-cd_color_convert_rgb_to_rgb8 (const CdColorRGB *src, CdColorRGB8 *dest)
+cd_color_rgb_to_rgb8 (const CdColorRGB *src, CdColorRGB8 *dest)
{
g_return_if_fail (src != NULL);
g_return_if_fail (dest != NULL);
@@ -309,14 +309,14 @@ cd_color_convert_rgb_to_rgb8 (const CdColorRGB *src, CdColorRGB8 *dest)
}
/**
- * cd_color_convert_yxy_to_xyz:
+ * cd_color_yxy_to_xyz:
* @src: the source color
* @dest: the destination color
*
* Convert from one color format to another.
**/
void
-cd_color_convert_yxy_to_xyz (const CdColorYxy *src, CdColorXYZ *dest)
+cd_color_yxy_to_xyz (const CdColorYxy *src, CdColorXYZ *dest)
{
g_return_if_fail (src != NULL);
g_return_if_fail (dest != NULL);
@@ -342,14 +342,14 @@ cd_color_convert_yxy_to_xyz (const CdColorYxy *src, CdColorXYZ *dest)
}
/**
- * cd_color_convert_xyz_to_yxy:
+ * cd_color_xyz_to_yxy:
* @src: the source color
* @dest: the destination color
*
* Convert from one color format to another.
**/
void
-cd_color_convert_xyz_to_yxy (const CdColorXYZ *src, CdColorYxy *dest)
+cd_color_xyz_to_yxy (const CdColorXYZ *src, CdColorYxy *dest)
{
gdouble sum;
diff --git a/libcolord/cd-color.h b/libcolord/cd-color.h
index 475c623..1eb2cd5 100644
--- a/libcolord/cd-color.h
+++ b/libcolord/cd-color.h
@@ -78,32 +78,32 @@ CdColorXYZ *cd_color_xyz_dup (const CdColorXYZ *src);
CdColorRGB *cd_color_rgb_dup (const CdColorRGB *src);
CdColorYxy *cd_color_yxy_dup (const CdColorYxy *src);
-void cd_color_set_xyz (CdColorXYZ *dest,
+void cd_color_xyz_set (CdColorXYZ *dest,
gdouble X,
gdouble Y,
gdouble Z);
-void cd_color_set_rgb (CdColorRGB *dest,
+void cd_color_rgb_set (CdColorRGB *dest,
gdouble R,
gdouble G,
gdouble B);
-void cd_color_set_yxy (CdColorYxy *dest,
+void cd_color_yxy_set (CdColorYxy *dest,
gdouble Y,
gdouble x,
gdouble y);
-void cd_color_copy_xyz (const CdColorXYZ *src,
+void cd_color_xyz_copy (const CdColorXYZ *src,
CdColorXYZ *dest);
-void cd_color_copy_yxy (const CdColorYxy *src,
+void cd_color_yxy_copy (const CdColorYxy *src,
CdColorYxy *dest);
-void cd_color_clear_xyz (CdColorXYZ *dest);
-void cd_color_copy_rgb (const CdColorRGB *src,
+void cd_color_xyz_clear (CdColorXYZ *dest);
+void cd_color_rgb_copy (const CdColorRGB *src,
CdColorRGB *dest);
-void cd_color_convert_rgb8_to_rgb (const CdColorRGB8 *src,
+void cd_color_rgb8_to_rgb (const CdColorRGB8 *src,
CdColorRGB *dest);
-void cd_color_convert_rgb_to_rgb8 (const CdColorRGB *src,
+void cd_color_rgb_to_rgb8 (const CdColorRGB *src,
CdColorRGB8 *dest);
-void cd_color_convert_yxy_to_xyz (const CdColorYxy *src,
+void cd_color_yxy_to_xyz (const CdColorYxy *src,
CdColorXYZ *dest);
-void cd_color_convert_xyz_to_yxy (const CdColorXYZ *src,
+void cd_color_xyz_to_yxy (const CdColorXYZ *src,
CdColorYxy *dest);
void cd_color_get_blackbody_rgb (guint temp,
CdColorRGB *result);
diff --git a/libcolord/cd-deprecated.c b/libcolord/cd-deprecated.c
new file mode 100644
index 0000000..a1ccac1
--- /dev/null
+++ b/libcolord/cd-deprecated.c
@@ -0,0 +1,208 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2010 Richard Hughes <richard@hughsie.com>
+ *
+ * Licensed under the GNU Lesser General Public License Version 2.1
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * SECTION:cd-deprecated
+ * @short_description: Deprecated functionality
+ *
+ * Functions which have been deprecated.
+ */
+
+#include "config.h"
+
+#include <glib.h>
+
+#include "cd-color.h"
+#include "cd-deprecated.h"
+
+#ifndef CD_DISABLE_DEPRECATED
+
+/**
+ * cd_color_set_xyz:
+ * @dest: the destination color
+ * @X: component value
+ * @Y: component value
+ * @Z: component value
+ *
+ * Initialises a color value.
+ *
+ * Deprecated: 0.1.27: Use cd_color_xyz_set.
+ **/
+void
+cd_color_set_xyz (CdColorXYZ *dest, gdouble X, gdouble Y, gdouble Z)
+{
+ cd_color_xyz_set (dest, X, Y, Z);
+}
+
+/**
+ * cd_color_clear_xyz:
+ * @dest: the destination color
+ *
+ * Initialises a color value.
+ *
+ * Deprecated: 0.1.27: Use cd_color_xyz_clear.
+ **/
+void
+cd_color_clear_xyz (CdColorXYZ *dest)
+{
+ cd_color_xyz_clear (dest);
+}
+
+/**
+ * cd_color_set_rgb:
+ * @dest: the destination color
+ * @R: component value
+ * @G: component value
+ * @B: component value
+ *
+ * Initialises a color value.
+ *
+ * Deprecated: 0.1.27: Use cd_color_rgb_set.
+ **/
+void
+cd_color_set_rgb (CdColorRGB *dest, gdouble R, gdouble G, gdouble B)
+{
+ cd_color_rgb_set (dest, R, G, B);
+}
+
+/**
+ * cd_color_set_yxy:
+ * @dest: the destination color
+ * @Y: component value
+ * @x: component value
+ * @y: component value
+ *
+ * Initialises a color value.
+ *
+ * Deprecated: 0.1.27: Use cd_color_yxy_set.
+ **/
+void
+cd_color_set_yxy (CdColorYxy *dest, gdouble Y, gdouble x, gdouble y)
+{
+ cd_color_yxy_set (dest, Y, x, y);
+}
+
+/**
+ * cd_color_copy_xyz:
+ * @src: the source color
+ * @dest: the destination color
+ *
+ * Deep copies a color value.
+ *
+ * Deprecated: 0.1.27: Use cd_color_xyz_copy.
+ **/
+void
+cd_color_copy_xyz (const CdColorXYZ *src, CdColorXYZ *dest)
+{
+ cd_color_xyz_copy (src, dest);
+}
+
+/**
+ * cd_color_copy_yxy:
+ * @src: the source color
+ * @dest: the destination color
+ *
+ * Deep copies a color value.
+ *
+ * Deprecated: 0.1.27: Use cd_color_yxy_copy.
+ **/
+void
+cd_color_copy_yxy (const CdColorYxy *src, CdColorYxy *dest)
+{
+ cd_color_yxy_copy (src, dest);
+}
+
+/**
+ * cd_color_copy_rgb:
+ * @src: the source color
+ * @dest: the destination color
+ *
+ * Deep copies a color value.
+ *
+ * Deprecated: 0.1.27: Use cd_color_rgb_copy.
+ **/
+void
+cd_color_copy_rgb (const CdColorRGB *src, CdColorRGB *dest)
+{
+ cd_color_rgb_copy (src, dest);
+}
+
+/**
+ * cd_color_convert_rgb8_to_rgb:
+ * @src: the source color
+ * @dest: the destination color
+ *
+ * Convert from one color format to another.
+ *
+ * Deprecated: 0.1.27: Use cd_color_convert_rgb8_to_rgb.
+ **/
+void
+cd_color_convert_rgb8_to_rgb (const CdColorRGB8 *src, CdColorRGB *dest)
+{
+ cd_color_rgb8_to_rgb (src, dest);
+}
+
+/**
+ * cd_color_convert_rgb_to_rgb8:
+ * @src: the source color
+ * @dest: the destination color
+ *
+ * Convert from one color format to another.
+ *
+ * Deprecated: 0.1.27: Use cd_color_rgb_to_rgb8.
+ **/
+void
+cd_color_convert_rgb_to_rgb8 (const CdColorRGB *src, CdColorRGB8 *dest)
+{
+ cd_color_rgb_to_rgb8 (src, dest);
+}
+
+/**
+ * cd_color_convert_yxy_to_xyz:
+ * @src: the source color
+ * @dest: the destination color
+ *
+ * Convert from one color format to another.
+ *
+ * Deprecated: 0.1.27: Use cd_color_yxy_to_xyz.
+ **/
+void
+cd_color_convert_yxy_to_xyz (const CdColorYxy *src, CdColorXYZ *dest)
+{
+ cd_color_yxy_to_xyz (src, dest);
+}
+
+/**
+ * cd_color_convert_xyz_to_yxy:
+ * @src: the source color
+ * @dest: the destination color
+ *
+ * Convert from one color format to another.
+ *
+ * Deprecated: 0.1.27: Use cd_color_xyz_to_yxy.
+ **/
+void
+cd_color_convert_xyz_to_yxy (const CdColorXYZ *src, CdColorYxy *dest)
+{
+ cd_color_xyz_to_yxy (src, dest);
+}
+
+#endif /* CD_DISABLE_DEPRECATED */
diff --git a/libcolord/cd-deprecated.h b/libcolord/cd-deprecated.h
new file mode 100644
index 0000000..60b118b
--- /dev/null
+++ b/libcolord/cd-deprecated.h
@@ -0,0 +1,74 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2010 Richard Hughes <richard@hughsie.com>
+ *
+ * Licensed under the GNU Lesser General Public License Version 2.1
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#if !defined (__COLORD_H_INSIDE__) && !defined (CD_COMPILATION)
+#error "Only <colord.h> can be included directly."
+#endif
+
+#ifndef __CD_DEPRECATED_H__
+#define __CD_DEPRECATED_H__
+
+#include <glib-object.h>
+
+#ifndef CD_DISABLE_DEPRECATED
+
+G_DEPRECATED_FOR(cd_color_xyz_set)
+void cd_color_set_xyz (CdColorXYZ *dest,
+ gdouble X,
+ gdouble Y,
+ gdouble Z);
+G_DEPRECATED_FOR(cd_color_rgb_set)
+void cd_color_set_rgb (CdColorRGB *dest,
+ gdouble R,
+ gdouble G,
+ gdouble B);
+G_DEPRECATED_FOR(cd_color_yxy_set)
+void cd_color_set_yxy (CdColorYxy *dest,
+ gdouble Y,
+ gdouble x,
+ gdouble y);
+G_DEPRECATED_FOR(cd_color_xyz_copy)
+void cd_color_copy_xyz (const CdColorXYZ *src,
+ CdColorXYZ *dest);
+G_DEPRECATED_FOR(cd_color_yxy_set)
+void cd_color_copy_yxy (const CdColorYxy *src,
+ CdColorYxy *dest);
+G_DEPRECATED_FOR(cd_color_xyz_clear)
+void cd_color_clear_xyz (CdColorXYZ *dest);
+G_DEPRECATED_FOR(cd_color_rgb_copy)
+void cd_color_copy_rgb (const CdColorRGB *src,
+ CdColorRGB *dest);
+G_DEPRECATED_FOR(cd_color_rgb8_to_rgb)
+void cd_color_convert_rgb8_to_rgb (const CdColorRGB8 *src,
+ CdColorRGB *dest);
+G_DEPRECATED_FOR(cd_color_rgb_to_rgb8)
+void cd_color_convert_rgb_to_rgb8 (const CdColorRGB *src,
+ CdColorRGB8 *dest);
+G_DEPRECATED_FOR(cd_color_yxy_to_xyz)
+void cd_color_convert_yxy_to_xyz (const CdColorYxy *src,
+ CdColorXYZ *dest);
+G_DEPRECATED_FOR(cd_color_xyz_to_yxy)
+void cd_color_convert_xyz_to_yxy (const CdColorXYZ *src,
+ CdColorYxy *dest);
+
+#endif /* CD_DISABLE_DEPRECATED */
+
+#endif /* __CD_DEPRECATED_H__ */
diff --git a/libcolord/cd-it8-utils.c b/libcolord/cd-it8-utils.c
index bdaedf7..e62d1ff 100644
--- a/libcolord/cd-it8-utils.c
+++ b/libcolord/cd-it8-utils.c
@@ -62,7 +62,7 @@ ch_it8_utils_4color_read_data (CdIt8 *it8,
/* find patches */
for (j = 0; j < 5; j++)
- cd_color_set_xyz (&ave_XYZ[j], 0.0f, 0.0f, 0.0f);
+ cd_color_xyz_set (&ave_XYZ[j], 0.0f, 0.0f, 0.0f);
for (i = 0; i < len; i += 5) {
/* black, white, red, green, blue */
for (j = 0; j < 5; j++) {
@@ -92,7 +92,7 @@ ch_it8_utils_4color_read_data (CdIt8 *it8,
/* Convert XYZ to Yxy */
for (j = 0; j < 5; j++)
- cd_color_convert_xyz_to_yxy (&ave_XYZ[j], &tmp_Yxy[j]);
+ cd_color_xyz_to_yxy (&ave_XYZ[j], &tmp_Yxy[j]);
/* create chroma of M_RGB */
mat_xyz->m00 = tmp_Yxy[2].x;
diff --git a/libcolord/cd-it8.c b/libcolord/cd-it8.c
index 21469db..72d5647 100644
--- a/libcolord/cd-it8.c
+++ b/libcolord/cd-it8.c
@@ -337,7 +337,7 @@ cd_it8_load_ti1_cal (CdIt8 *it8, cmsHANDLE it8_lcms, GError **error)
}
g_ptr_array_add (it8->priv->array_rgb, rgb);
xyz = cd_color_xyz_new ();
- cd_color_set_xyz (xyz, 0.0, 0.0, 0.0);
+ cd_color_xyz_set (xyz, 0.0, 0.0, 0.0);
g_ptr_array_add (it8->priv->array_xyz, xyz);
}
out:
@@ -638,7 +638,7 @@ cd_it8_save_to_file_ti1_ti3 (CdIt8 *it8, cmsHANDLE it8_lcms, GError **error)
guint luminance_samples = 0;
/* calculate the absolute XYZ in candelas per meter squared */
- cd_color_clear_xyz (&lumi_xyz);
+ cd_color_xyz_clear (&lumi_xyz);
if (it8->priv->normalized) {
for (i = 0; i < it8->priv->array_rgb->len; i++) {
rgb_tmp = g_ptr_array_index (it8->priv->array_rgb, i);
@@ -1077,7 +1077,7 @@ cd_it8_add_data (CdIt8 *it8, const CdColorRGB *rgb, const CdColorXYZ *xyz)
rgb_tmp = cd_color_rgb_dup (rgb);
} else {
rgb_tmp = cd_color_rgb_new ();
- cd_color_set_rgb (rgb_tmp, 0.0f, 0.0f, 0.0f);
+ cd_color_rgb_set (rgb_tmp, 0.0f, 0.0f, 0.0f);
}
g_ptr_array_add (it8->priv->array_rgb, rgb_tmp);
@@ -1086,7 +1086,7 @@ cd_it8_add_data (CdIt8 *it8, const CdColorRGB *rgb, const CdColorXYZ *xyz)
xyz_tmp = cd_color_xyz_dup (xyz);
} else {
xyz_tmp = cd_color_xyz_new ();
- cd_color_set_xyz (xyz_tmp, 0.0f, 0.0f, 0.0f);
+ cd_color_xyz_set (xyz_tmp, 0.0f, 0.0f, 0.0f);
}
g_ptr_array_add (it8->priv->array_xyz, xyz_tmp);
}
@@ -1134,11 +1134,11 @@ cd_it8_get_data_item (CdIt8 *it8, guint idx, CdColorRGB *rgb, CdColorXYZ *xyz)
return FALSE;
if (rgb != NULL) {
rgb_tmp = g_ptr_array_index (it8->priv->array_rgb, idx);
- cd_color_copy_rgb (rgb_tmp, rgb);
+ cd_color_rgb_copy (rgb_tmp, rgb);
}
if (xyz != NULL) {
xyz_tmp = g_ptr_array_index (it8->priv->array_xyz, idx);
- cd_color_copy_xyz (xyz_tmp, xyz);
+ cd_color_xyz_copy (xyz_tmp, xyz);
}
return TRUE;
}
diff --git a/libcolord/cd-math.h b/libcolord/cd-math.h
index 86d1c1e..37297bb 100644
--- a/libcolord/cd-math.h
+++ b/libcolord/cd-math.h
@@ -77,7 +77,6 @@ void cd_mat33_normalize (const CdMat3x3 *src,
void cd_mat33_copy (const CdMat3x3 *src,
CdMat3x3 *dest);
-
#undef __CD_MATH_H_INSIDE__
#endif /* __CD_MATH_H__ */
diff --git a/libcolord/cd-self-test.c b/libcolord/cd-self-test.c
index 8b7c176..2287a96 100644
--- a/libcolord/cd-self-test.c
+++ b/libcolord/cd-self-test.c
@@ -1170,12 +1170,12 @@ colord_color_func (void)
g_assert (xyz != NULL);
/* nothing set */
- cd_color_convert_xyz_to_yxy (xyz, &yxy);
+ cd_color_xyz_to_yxy (xyz, &yxy);
g_assert_cmpfloat (fabs (yxy.x - 0.0f), <, 0.001f);
/* set dummy values */
- cd_color_set_xyz (xyz, 0.125, 0.25, 0.5);
- cd_color_convert_xyz_to_yxy (xyz, &yxy);
+ cd_color_xyz_set (xyz, 0.125, 0.25, 0.5);
+ cd_color_xyz_to_yxy (xyz, &yxy);
g_assert_cmpfloat (fabs (yxy.x - 0.142857143f), <, 0.001f);
g_assert_cmpfloat (fabs (yxy.y - 0.285714286f), <, 0.001f);
diff --git a/libcolord/colord.h b/libcolord/colord.h
index 786ae0b..8062ea5 100644
--- a/libcolord/colord.h
+++ b/libcolord/colord.h
@@ -37,6 +37,7 @@
#include <colord/cd-client.h>
#include <colord/cd-client-sync.h>
#include <colord/cd-color.h>
+#include <colord/cd-deprecated.h>
#include <colord/cd-device.h>
#include <colord/cd-device-sync.h>
#include <colord/cd-enum.h>
diff --git a/src/Makefile.am b/src/Makefile.am
index 88ea209..71721c5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -26,6 +26,7 @@ INCLUDES = \
-DVERSION="\"$(VERSION)\"" \
-DDAEMON_USER="\"$(daemon_user)\"" \
-DCD_COMPILATION \
+ -DCD_DISABLE_DEPRECATED \
-DG_UDEV_API_IS_SUBJECT_TO_CHANGE \
-DCD_SYSTEM_PROFILES_DIR="\"$(CD_SYSTEM_PROFILES_DIR)"\" \
-DLOCALEDIR=\""$(localedir)"\"
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index 90ebe88..8dba000 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -10,6 +10,7 @@ INCLUDES = \
$(GUDEV_CFLAGS) \
-DG_LOG_DOMAIN=\"Cd\" \
-DCD_COMPILATION \
+ -DCD_DISABLE_DEPRECATED \
-I$(top_srcdir)/src
# plugins
diff --git a/src/sensors/Makefile.am b/src/sensors/Makefile.am
index c8ce564..07388fc 100644
--- a/src/sensors/Makefile.am
+++ b/src/sensors/Makefile.am
@@ -16,6 +16,7 @@ INCLUDES = \
-DLOCALSTATEDIR=\""$(localstatedir)"\" \
-DVERSION="\"$(VERSION)\"" \
-DCD_COMPILATION \
+ -DCD_DISABLE_DEPRECATED \
-DG_UDEV_API_IS_SUBJECT_TO_CHANGE \
-DG_USB_API_IS_SUBJECT_TO_CHANGE \
-DLOCALEDIR=\""$(localedir)"\"