[gnome-color-manager] trivial: add a GcmXyz property to GcmCalibrate



commit 743ea2e4fe2ba8989985ac3e6f9d64a18d7dff52
Author: Richard Hughes <richard hughsie com>
Date:   Tue Apr 27 13:53:11 2010 +0100

    trivial: add a GcmXyz property to GcmCalibrate

 src/gcm-calibrate.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/src/gcm-calibrate.c b/src/gcm-calibrate.c
index 508978c..47b38cb 100644
--- a/src/gcm-calibrate.c
+++ b/src/gcm-calibrate.c
@@ -35,6 +35,7 @@
 #include <gconf/gconf-client.h>
 
 #include "gcm-calibrate.h"
+#include "gcm-xyz.h"
 #include "gcm-dmi.h"
 #include "gcm-device-xrandr.h"
 #include "gcm-utils.h"
@@ -64,6 +65,7 @@ struct _GcmCalibratePrivate
 	GcmColorimeterKind		 colorimeter_kind;
 	GcmCalibrateDialog		*calibrate_dialog;
 	GcmDeviceKind			 device_kind;
+	GcmXyz				*xyz;
 	gchar				*output_name;
 	gchar				*filename_source;
 	gchar				*filename_reference;
@@ -97,6 +99,7 @@ enum {
 	PROP_FILENAME_RESULT,
 	PROP_WORKING_PATH,
 	PROP_PRECISION,
+	PROP_XYZ,
 	PROP_LAST
 };
 
@@ -1226,6 +1229,9 @@ gcm_calibrate_get_property (GObject *object, guint prop_id, GValue *value, GPara
 	case PROP_PRECISION:
 		g_value_set_uint (value, priv->precision);
 		break;
+	case PROP_XYZ:
+		g_value_set_object (value, priv->xyz);
+		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 		break;
@@ -1316,6 +1322,11 @@ gcm_calibrate_set_property (GObject *object, guint prop_id, const GValue *value,
 		g_free (priv->working_path);
 		priv->working_path = g_strdup (g_value_get_string (value));
 		break;
+	case PROP_XYZ:
+		if (priv->xyz != NULL)
+			g_object_unref (priv->xyz);
+		priv->xyz = g_value_dup_object (value);
+		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 		break;
@@ -1470,6 +1481,14 @@ gcm_calibrate_class_init (GcmCalibrateClass *klass)
 				   G_PARAM_READABLE);
 	g_object_class_install_property (object_class, PROP_PRECISION, pspec);
 
+	/**
+	 * GcmCalibrate:xyz:
+	 */
+	pspec = g_param_spec_object ("xyz", NULL, NULL,
+				     GCM_TYPE_XYZ,
+				     G_PARAM_READWRITE);
+	g_object_class_install_property (object_class, PROP_XYZ, pspec);
+
 	g_type_class_add_private (klass, sizeof (GcmCalibratePrivate));
 }
 
@@ -1490,6 +1509,7 @@ gcm_calibrate_init (GcmCalibrate *calibrate)
 	calibrate->priv->description = NULL;
 	calibrate->priv->device = NULL;
 	calibrate->priv->serial = NULL;
+	calibrate->priv->xyz = gcm_xyz_new ();
 	calibrate->priv->working_path = NULL;
 	calibrate->priv->calibrate_device_kind = GCM_CALIBRATE_DEVICE_KIND_UNKNOWN;
 	calibrate->priv->print_kind = GCM_CALIBRATE_PRINT_KIND_UNKNOWN;
@@ -1531,6 +1551,8 @@ gcm_calibrate_finalize (GObject *object)
 	g_free (priv->serial);
 	g_free (priv->working_path);
 	g_signal_handlers_disconnect_by_func (calibrate->priv->colorimeter, G_CALLBACK (gcm_prefs_colorimeter_changed_cb), calibrate);
+	if (priv->xyz != NULL)
+		g_object_unref (priv->xyz);
 	g_object_unref (priv->colorimeter);
 	g_object_unref (priv->dmi);
 	g_object_unref (priv->calibrate_dialog);



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