[gnome-color-manager] Add convenience helpers for the profile enums



commit 1d9c5515c5a1b6647ca2f889b564699f6f012970
Author: Richard Hughes <richard hughsie com>
Date:   Fri Dec 4 17:38:53 2009 +0000

    Add convenience helpers for the profile enums

 src/gcm-prefs.c   |    2 +-
 src/gcm-profile.c |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/gcm-profile.h |    2 ++
 3 files changed, 55 insertions(+), 1 deletions(-)
---
diff --git a/src/gcm-prefs.c b/src/gcm-prefs.c
index 673eba5..ff2c71d 100644
--- a/src/gcm-prefs.c
+++ b/src/gcm-prefs.c
@@ -1330,7 +1330,7 @@ gcm_prefs_profile_type_to_text (GcmProfileType type)
  * gcm_prefs_profile_colorspace_to_text:
  **/
 static gchar *
-gcm_prefs_profile_colorspace_to_text (GcmProfileType type)
+gcm_prefs_profile_colorspace_to_text (GcmProfileColorspace type)
 {
 	if (type == GCM_PROFILE_COLORSPACE_XYZ) {
 		/* TRANSLATORS: this the ICC colorspace type */
diff --git a/src/gcm-profile.c b/src/gcm-profile.c
index 2d98579..09465f5 100644
--- a/src/gcm-profile.c
+++ b/src/gcm-profile.c
@@ -1203,6 +1203,58 @@ out:
 }
 
 /**
+ * gcm_profile_type_to_text:
+ **/
+const gchar *
+gcm_profile_type_to_text (GcmProfileType type)
+{
+	if (type == GCM_PROFILE_TYPE_INPUT_DEVICE)
+		return "input-device";
+	if (type == GCM_PROFILE_TYPE_DISPLAY_DEVICE)
+		return "display-device";
+	if (type == GCM_PROFILE_TYPE_OUTPUT_DEVICE)
+		return "output-device";
+	if (type == GCM_PROFILE_TYPE_DEVICELINK)
+		return "devicelink";
+	if (type == GCM_PROFILE_TYPE_COLORSPACE_CONVERSION)
+		return "colorspace-conversion";
+	if (type == GCM_PROFILE_TYPE_ABSTRACT)
+		return "abstract";
+	if (type == GCM_PROFILE_TYPE_NAMED_COLOUR)
+		return "named-color";
+	return "unknown";
+}
+
+/**
+ * gcm_profile_colorspace_to_text:
+ **/
+const gchar *
+gcm_profile_colorspace_to_text (GcmProfileColorspace type)
+{
+	if (type == GCM_PROFILE_COLORSPACE_XYZ)
+		return "xyz";
+	if (type == GCM_PROFILE_COLORSPACE_LAB)
+		return "lab";
+	if (type == GCM_PROFILE_COLORSPACE_LUV)
+		return "luv";
+	if (type == GCM_PROFILE_COLORSPACE_YCBCR)
+		return "ycbcr";
+	if (type == GCM_PROFILE_COLORSPACE_YXY)
+		return "yxy";
+	if (type == GCM_PROFILE_COLORSPACE_RGB)
+		return "rgb";
+	if (type == GCM_PROFILE_COLORSPACE_GRAY)
+		return "gray";
+	if (type == GCM_PROFILE_COLORSPACE_HSV)
+		return "hsv";
+	if (type == GCM_PROFILE_COLORSPACE_CMYK)
+		return "cmyk";
+	if (type == GCM_PROFILE_COLORSPACE_CMY)
+		return "cmy";
+	return "unknown";
+}
+
+/**
  * gcm_profile_get_property:
  **/
 static void
diff --git a/src/gcm-profile.h b/src/gcm-profile.h
index e01cba5..f03eef7 100644
--- a/src/gcm-profile.h
+++ b/src/gcm-profile.h
@@ -91,6 +91,8 @@ gboolean	 gcm_profile_parse_data			(GcmProfile	*profile,
 							 GError		**error);
 GcmClutData	*gcm_profile_generate			(GcmProfile	*profile,
 							 guint		 size);
+const gchar	*gcm_profile_type_to_text		(GcmProfileType	 type);
+const gchar	*gcm_profile_colorspace_to_text		(GcmProfileColorspace type);
 
 G_END_DECLS
 



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