From 82f3934e698fc66870147920692cd37d55e00467 Mon Sep 17 00:00:00 2001 From: Evan Nemerson Date: Mon, 18 Jun 2012 10:59:11 -0700 Subject: [PATCH] Deprecate cd_color_xyz_set in favor of cd_color_set_xyz --- libcolord/Makefile.am | 2 ++ libcolord/cd-color.c | 4 ++-- libcolord/cd-color.h | 2 +- libcolord/cd-deprecated.c | 58 +++++++++++++++++++++++++++++++++++++++++++++ libcolord/cd-deprecated.h | 41 ++++++++++++++++++++++++++++++++ libcolord/cd-it8-utils.c | 2 +- libcolord/cd-it8.c | 4 ++-- libcolord/colord.h | 1 + 8 files changed, 108 insertions(+), 6 deletions(-) create mode 100644 libcolord/cd-deprecated.c create mode 100644 libcolord/cd-deprecated.h diff --git a/libcolord/Makefile.am b/libcolord/Makefile.am index 138cecb..3b3eee8 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 \ diff --git a/libcolord/cd-color.c b/libcolord/cd-color.c index a34fd01..8a61c22 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); diff --git a/libcolord/cd-color.h b/libcolord/cd-color.h index 4b5c59b..53d6b90 100644 --- a/libcolord/cd-color.h +++ b/libcolord/cd-color.h @@ -78,7 +78,7 @@ 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); diff --git a/libcolord/cd-deprecated.c b/libcolord/cd-deprecated.c new file mode 100644 index 0000000..077a458 --- /dev/null +++ b/libcolord/cd-deprecated.c @@ -0,0 +1,58 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- + * + * Copyright (C) 2010 Richard Hughes + * + * 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 +#include + +#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.23: Use cd_color_xyz_set. + **/ +void +cd_color_set_xyz (CdColorXYZ *dest, gdouble X, gdouble Y, gdouble Z) +{ + return cd_color_xyz_set (dest, X, Y, Z); +} + + +#endif /* CD_DISABLE_DEPRECATED */ diff --git a/libcolord/cd-deprecated.h b/libcolord/cd-deprecated.h new file mode 100644 index 0000000..158a05a --- /dev/null +++ b/libcolord/cd-deprecated.h @@ -0,0 +1,41 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- + * + * Copyright (C) 2010 Richard Hughes + * + * 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 can be included directly." +#endif + +#ifndef __CD_DEPRECATED_H__ +#define __CD_DEPRECATED_H__ + +#include + +#ifndef CD_DISABLE_DEPRECATED + +G_DEPRECATED_FOR(cd_color_xyz_set) +void cd_color_set_xyz (CdColorXYZ *dest, + gdouble X, + gdouble Y, + gdouble Z); + +#endif /* CD_DISABLE_DEPRECATED */ + +#endif /* __CD_DEPRECATED_H__ */ diff --git a/libcolord/cd-it8-utils.c b/libcolord/cd-it8-utils.c index bdaedf7..595823b 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++) { diff --git a/libcolord/cd-it8.c b/libcolord/cd-it8.c index eb0a1b9..9d25205 100644 --- a/libcolord/cd-it8.c +++ b/libcolord/cd-it8.c @@ -327,7 +327,7 @@ cd_it8_load_ti1 (CdIt8 *it8, cmsHANDLE it8_lcms, GError **error) rgb->B = cmsIT8GetDataRowColDbl(it8_lcms, i, 3); 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: @@ -986,7 +986,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); } 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 #include #include +#include #include #include #include -- 1.7.10.2