[gnome-color-manager] trivial: add lcms1 save support, which nothing uses yet



commit f36dc9d6e5e167fb1850d224bbbbfa0d3bc322d0
Author: Richard Hughes <richard hughsie com>
Date:   Wed Jan 6 12:43:40 2010 +0000

    trivial: add lcms1 save support, which nothing uses yet

 src/gcm-profile-lcms1.c |   13 +++++++++++++
 src/gcm-profile.c       |   30 ++++++++++++++++++++++++++++++
 src/gcm-profile.h       |    6 ++++++
 3 files changed, 49 insertions(+), 0 deletions(-)
---
diff --git a/src/gcm-profile-lcms1.c b/src/gcm-profile-lcms1.c
index 8f8e718..8b77d8e 100644
--- a/src/gcm-profile-lcms1.c
+++ b/src/gcm-profile-lcms1.c
@@ -409,6 +409,18 @@ out:
 }
 
 /**
+ * gcm_profile_lcms1_save:
+ **/
+static gboolean
+gcm_profile_lcms1_save (GcmProfile *profile, const gchar *filename, GError **error)
+{
+	GcmProfileLcms1 *profile_lcms1 = GCM_PROFILE_LCMS1 (profile);
+	GcmProfileLcms1Private *priv = profile_lcms1->priv;
+	_cmsSaveProfile (priv->lcms_profile, filename);
+	return TRUE;
+}
+
+/**
  * gcm_profile_lcms1_parse_data:
  **/
 static gboolean
@@ -959,6 +971,7 @@ gcm_profile_lcms1_class_init (GcmProfileLcms1Class *klass)
 	object_class->finalize = gcm_profile_lcms1_finalize;
 
 	parent_class->parse_data = gcm_profile_lcms1_parse_data;
+	parent_class->save = gcm_profile_lcms1_save;
 	parent_class->generate_vcgt = gcm_profile_lcms1_generate_vcgt;
 	parent_class->generate_curve = gcm_profile_lcms1_generate_curve;
 
diff --git a/src/gcm-profile.c b/src/gcm-profile.c
index 7c80202..00f1d78 100644
--- a/src/gcm-profile.c
+++ b/src/gcm-profile.c
@@ -155,6 +155,36 @@ out:
 }
 
 /**
+ * gcm_profile_save:
+ **/
+gboolean
+gcm_profile_save (GcmProfile *profile, const gchar *filename, GError **error)
+{
+	gboolean ret = FALSE;
+	GcmProfilePrivate *priv = profile->priv;
+	GcmProfileClass *klass = GCM_PROFILE_GET_CLASS (profile);
+
+	/* not loaded */
+	if (priv->size == 0) {
+		if (error != NULL)
+			*error = g_error_new (1, 0, "not loaded");
+		goto out;
+	}
+
+	/* do we have support */
+	if (klass->save == NULL) {
+		if (error != NULL)
+			*error = g_error_new (1, 0, "no support");
+		goto out;
+	}
+
+	/* proxy */
+	ret = klass->save (profile, filename, error);
+out:
+	return ret;
+}
+
+/**
  * gcm_profile_generate_vcgt:
  *
  * Free with g_object_unref();
diff --git a/src/gcm-profile.h b/src/gcm-profile.h
index 02de6bf..b6cbbf6 100644
--- a/src/gcm-profile.h
+++ b/src/gcm-profile.h
@@ -51,6 +51,9 @@ struct _GcmProfileClass
 						 const guint8	*data,
 						 gsize		 length,
 						 GError		**error);
+	gboolean	 (*save)		(GcmProfile	*profile,
+						 const gchar	*filename,
+						 GError		**error);
 	GcmClut		*(*generate_vcgt)	(GcmProfile	*profile,
 						 guint		 size);
 	GcmClut		*(*generate_curve)	(GcmProfile	*profile,
@@ -101,6 +104,9 @@ gboolean	 gcm_profile_parse_data			(GcmProfile	*profile,
 							 const guint8	*data,
 							 gsize		 length,
 							 GError		**error);
+gboolean	 gcm_profile_save			(GcmProfile	*profile,
+							 const gchar	*filename,
+							 GError		**error);
 GcmClut		*gcm_profile_generate_vcgt		(GcmProfile	*profile,
 							 guint		 size);
 GcmClut		*gcm_profile_generate_curve		(GcmProfile	*profile,



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