[gnome-color-manager] trivial: add gcm_profile_kind_from_string



commit cdd3848e2973fb9c401fbfd19bed8fb13dfa7f5c
Author: Richard Hughes <richard hughsie com>
Date:   Fri Jun 25 12:09:41 2010 +0100

    trivial: add gcm_profile_kind_from_string

 src/gcm-enum.c |   23 +++++++++++++++++++++++
 src/gcm-enum.h |    1 +
 2 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/src/gcm-enum.c b/src/gcm-enum.c
index 2175969..e6c3930 100644
--- a/src/gcm-enum.c
+++ b/src/gcm-enum.c
@@ -60,6 +60,29 @@ gcm_intent_from_string (const gchar *intent)
 }
 
 /**
+ * gcm_intent_from_string:
+ **/
+GcmProfileKind
+gcm_profile_kind_from_string (const gchar *profile_kind)
+{
+	if (g_strcmp0 (profile_kind, "input-device") == 0)
+		return GCM_PROFILE_KIND_INPUT_DEVICE;
+	if (g_strcmp0 (profile_kind, "display-device") == 0)
+		return GCM_PROFILE_KIND_DISPLAY_DEVICE;
+	if (g_strcmp0 (profile_kind, "output-device") == 0)
+		return GCM_PROFILE_KIND_OUTPUT_DEVICE;
+	if (g_strcmp0 (profile_kind, "devicelink") == 0)
+		return GCM_PROFILE_KIND_DEVICELINK;
+	if (g_strcmp0 (profile_kind, "colorspace-conversion") == 0)
+		return GCM_PROFILE_KIND_COLORSPACE_CONVERSION;
+	if (g_strcmp0 (profile_kind, "abstract") == 0)
+		return GCM_PROFILE_KIND_ABSTRACT;
+	if (g_strcmp0 (profile_kind, "named-color") == 0)
+		return GCM_PROFILE_KIND_NAMED_COLOR;
+	return GCM_PROFILE_KIND_UNKNOWN;
+}
+
+/**
  * gcm_profile_kind_to_string:
  **/
 const gchar *
diff --git a/src/gcm-enum.h b/src/gcm-enum.h
index 5738b05..fff75f4 100644
--- a/src/gcm-enum.h
+++ b/src/gcm-enum.h
@@ -71,6 +71,7 @@ typedef enum {
 
 GcmIntent	 gcm_intent_from_string			(const gchar		*intent);
 const gchar	*gcm_intent_to_string			(GcmIntent		 intent);
+GcmProfileKind	 gcm_profile_kind_from_string		(const gchar		*profile_kind);
 const gchar	*gcm_profile_kind_to_string		(GcmProfileKind		 profile_kind);
 const gchar	*gcm_colorspace_to_string		(GcmColorspace		 colorspace);
 const gchar	*gcm_colorspace_to_localised_string	(GcmColorspace	 colorspace);



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