[gnome-color-manager] trivial: remove the ability to spotread using argyllcms



commit 1d92c18193104fde4940078d5e174603e69f9070
Author: Richard Hughes <richard hughsie com>
Date:   Tue Jun 28 19:23:31 2011 +0100

    trivial: remove the ability to spotread using argyllcms

 src/gcm-calibrate-argyll.c |  103 --------------------------------------------
 src/gcm-calibrate.c        |   44 -------------------
 src/gcm-calibrate.h        |    9 ----
 3 files changed, 0 insertions(+), 156 deletions(-)
---
diff --git a/src/gcm-calibrate-argyll.c b/src/gcm-calibrate-argyll.c
index 70d9af5..b488a96 100644
--- a/src/gcm-calibrate-argyll.c
+++ b/src/gcm-calibrate-argyll.c
@@ -1373,108 +1373,6 @@ out:
 }
 
 /**
- * gcm_calibrate_argyll_spotread_read_chart:
- **/
-static gboolean
-gcm_calibrate_argyll_spotread_read_chart (GcmCalibrateArgyll *calibrate_argyll, GError **error)
-{
-	gboolean ret = TRUE;
-	GcmCalibrateArgyllPrivate *priv = calibrate_argyll->priv;
-	gchar *command = NULL;
-	gchar **argv = NULL;
-	GPtrArray *array = NULL;
-
-	/* get correct name of the command */
-	command = gcm_calibrate_argyll_get_tool_filename ("spotread", error);
-	if (command == NULL) {
-		ret = FALSE;
-		goto out;
-	}
-
-	/* TRANSLATORS: title, setting up the photospectromiter */
-	gcm_calibrate_set_title (GCM_CALIBRATE (calibrate_argyll),
-				 _("Setting up device"));
-	/* TRANSLATORS: dialog message */
-	gcm_calibrate_set_message (GCM_CALIBRATE (calibrate_argyll),
-				   _("Setting up the device to read a spot colorâ"));
-
-	/* reset flag so we exit after the single spotread */
-	priv->done_spot_read = FALSE;
-
-	/* argument array */
-	array = g_ptr_array_new_with_free_func (g_free);
-
-	/* setup the command */
-#ifdef FIXED_ARGYLL
-	g_ptr_array_add (array, g_strdup (command));
-#endif
-	g_ptr_array_add (array, g_strdup ("-v"));
-	if (priv->done_calibrate)
-		g_ptr_array_add (array, g_strdup ("-N"));
-	argv = gcm_utils_ptr_array_to_strv (array);
-	gcm_calibrate_argyll_debug_argv (command, argv);
-
-	/* start up the command */
-	ret = gcm_calibrate_argyll_fork_command (calibrate_argyll, argv, error);
-	if (!ret)
-		goto out;
-
-	/* wait until finished */
-	g_main_loop_run (priv->loop);
-
-	/* get result */
-	if (priv->response == GTK_RESPONSE_CANCEL) {
-		g_set_error_literal (error,
-				     GCM_CALIBRATE_ERROR,
-				     GCM_CALIBRATE_ERROR_USER_ABORT,
-				     "calibration was cancelled");
-		ret = FALSE;
-		goto out;
-	}
-#ifdef HAVE_VTE
-	if (priv->response == GTK_RESPONSE_REJECT) {
-		gchar *vte_text;
-		vte_text = vte_terminal_get_text (VTE_TERMINAL(priv->terminal), NULL, NULL, NULL);
-		g_set_error (error,
-			     GCM_CALIBRATE_ERROR,
-			     GCM_CALIBRATE_ERROR_INTERNAL,
-			     "command failed to run successfully: %s", vte_text);
-		g_free (vte_text);
-		ret = FALSE;
-		goto out;
-	}
-#endif
-out:
-	if (array != NULL)
-		g_ptr_array_unref (array);
-	g_free (command);
-	g_strfreev (argv);
-	return ret;
-}
-
-/**
- * gcm_calibrate_argyll_spotread:
- **/
-static gboolean
-gcm_calibrate_argyll_spotread (GcmCalibrate *calibrate, CdDevice *device, CdSensor *sensor, GtkWindow *window, GError **error)
-{
-	GcmCalibrateArgyll *calibrate_argyll = GCM_CALIBRATE_ARGYLL(calibrate);
-	gboolean ret;
-
-	/* step 3 */
-	ret = gcm_calibrate_argyll_spotread_read_chart (calibrate_argyll, error);
-	if (!ret)
-		goto out;
-
-	/* step 5 */
-	ret = gcm_calibrate_argyll_remove_temp_files (calibrate_argyll, error);
-	if (!ret)
-		goto out;
-out:
-	return ret;
-}
-
-/**
  * gcm_calibrate_argyll_interaction:
  **/
 static void
@@ -2708,7 +2606,6 @@ gcm_calibrate_argyll_class_init (GcmCalibrateArgyllClass *klass)
 	parent_class->calibrate_display = gcm_calibrate_argyll_display;
 	parent_class->calibrate_device = gcm_calibrate_argyll_device;
 	parent_class->calibrate_printer = gcm_calibrate_argyll_printer;
-	parent_class->calibrate_spotread = gcm_calibrate_argyll_spotread;
 	parent_class->interaction = gcm_calibrate_argyll_interaction;
 
 	g_type_class_add_private (klass, sizeof (GcmCalibrateArgyllPrivate));
diff --git a/src/gcm-calibrate.c b/src/gcm-calibrate.c
index 6828fad..a362909 100644
--- a/src/gcm-calibrate.c
+++ b/src/gcm-calibrate.c
@@ -26,7 +26,6 @@ struct _GcmCalibratePrivate
 	GcmCalibrateReferenceKind	 reference_kind;
 	CdSensor			*sensor;
 	CdDeviceKind			 device_kind;
-	CdColorXYZ			*xyz;
 	gchar				*output_name;
 	gchar				*filename_source;
 	gchar				*filename_reference;
@@ -63,7 +62,6 @@ enum {
 	PROP_FILENAME_RESULT,
 	PROP_WORKING_PATH,
 	PROP_PRECISION,
-	PROP_XYZ,
 	PROP_TARGET_WHITEPOINT,
 	PROP_LAST
 };
@@ -433,32 +431,6 @@ gcm_calibrate_set_working_path (GcmCalibrate *calibrate, GError **error)
 }
 
 /**
- * gcm_calibrate_spotread:
- **/
-gboolean
-gcm_calibrate_spotread (GcmCalibrate *calibrate, CdDevice *device, GtkWindow *window, GError **error)
-{
-	GcmCalibrateClass *klass = GCM_CALIBRATE_GET_CLASS (calibrate);
-	GcmCalibratePrivate *priv = calibrate->priv;
-	gboolean ret;
-
-	/* coldplug source */
-	if (klass->calibrate_spotread == NULL) {
-		ret = FALSE;
-		g_set_error_literal (error,
-				     GCM_CALIBRATE_ERROR,
-				     GCM_CALIBRATE_ERROR_INTERNAL,
-				     "no klass support");
-		goto out;
-	}
-
-	/* proxy */
-	ret = klass->calibrate_spotread (calibrate, device, priv->sensor, window, error);
-out:
-	return ret;
-}
-
-/**
  * gcm_calibrate_interaction:
  **/
 void
@@ -930,9 +902,6 @@ 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_boxed (value, g_boxed_copy (CD_TYPE_COLOR_XYZ, priv->xyz));
-		break;
 	case PROP_TARGET_WHITEPOINT:
 		g_value_set_uint (value, priv->target_whitepoint);
 		break;
@@ -1007,11 +976,6 @@ 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)
-			cd_color_xyz_free (priv->xyz);
-		priv->xyz = g_boxed_copy (CD_TYPE_COLOR_XYZ, value);
-		break;
 	case PROP_TARGET_WHITEPOINT:
 		priv->target_whitepoint = g_value_get_uint (value);
 		break;
@@ -1118,11 +1082,6 @@ gcm_calibrate_class_init (GcmCalibrateClass *klass)
 				   G_PARAM_READWRITE);
 	g_object_class_install_property (object_class, PROP_PRECISION, pspec);
 
-	pspec = g_param_spec_boxed ("xyz", NULL, NULL,
-				    CD_TYPE_COLOR_XYZ,
-				    G_PARAM_READWRITE);
-	g_object_class_install_property (object_class, PROP_XYZ, pspec);
-
 	pspec = g_param_spec_uint ("target-whitepoint", NULL, NULL,
 				   0, G_MAXUINT, 0,
 				   G_PARAM_READWRITE);
@@ -1163,8 +1122,6 @@ static void
 gcm_calibrate_init (GcmCalibrate *calibrate)
 {
 	calibrate->priv = GCM_CALIBRATE_GET_PRIVATE (calibrate);
-	calibrate->priv->xyz = cd_color_xyz_new ();
-
 	calibrate->priv->print_kind = GCM_CALIBRATE_PRINT_KIND_UNKNOWN;
 	calibrate->priv->reference_kind = GCM_CALIBRATE_REFERENCE_KIND_UNKNOWN;
 	calibrate->priv->precision = GCM_CALIBRATE_PRECISION_UNKNOWN;
@@ -1195,7 +1152,6 @@ gcm_calibrate_finalize (GObject *object)
 	g_free (priv->device);
 	g_free (priv->serial);
 	g_free (priv->working_path);
-	cd_color_xyz_free (priv->xyz);
 	g_ptr_array_unref (calibrate->priv->old_title);
 	g_ptr_array_unref (calibrate->priv->old_message);
 
diff --git a/src/gcm-calibrate.h b/src/gcm-calibrate.h
index 34ad2fd..caa6c68 100644
--- a/src/gcm-calibrate.h
+++ b/src/gcm-calibrate.h
@@ -64,11 +64,6 @@ struct _GcmCalibrateClass
 							 CdSensor	*sensor,
 							 GtkWindow	*window,
 							 GError		**error);
-	gboolean	 (*calibrate_spotread)		(GcmCalibrate	*calibrate,
-							 CdDevice	*device,
-							 CdSensor	*sensor,
-							 GtkWindow	*window,
-							 GError		**error);
 	void		 (*interaction)			(GcmCalibrate	*calibrate,
 							 GtkResponseType response);
 
@@ -144,10 +139,6 @@ gboolean	 gcm_calibrate_printer			(GcmCalibrate	*calibrate,
 							 CdDevice	*device,
 							 GtkWindow	*window,
 							 GError		**error);
-gboolean	 gcm_calibrate_spotread			(GcmCalibrate	*calibrate,
-							 CdDevice	*device,
-							 GtkWindow	*window,
-							 GError		**error);
 void		 gcm_calibrate_set_content_widget	(GcmCalibrate	*calibrate,
 							 GtkWidget	*widget);
 void		 gcm_calibrate_interaction		(GcmCalibrate	*calibrate,



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