[gnome-color-manager] trivial: prepare to move the UDev rules file to colord



commit 2ab7cb9b568d676da89bfb1f0a1c5f297dc87b1b
Author: Richard Hughes <richard hughsie com>
Date:   Thu Mar 31 12:56:50 2011 +0100

    trivial: prepare to move the UDev rules file to colord

 rules/95-gcm-colorimeters.rules |   42 +++++++++++++++++++-------------------
 src/gcm-sensor-client.c         |    4 +-
 src/gcm-sensor.c                |   10 ++++----
 3 files changed, 28 insertions(+), 28 deletions(-)
---
diff --git a/rules/95-gcm-colorimeters.rules b/rules/95-gcm-colorimeters.rules
index bd5b4f3..dbd8dd5 100644
--- a/rules/95-gcm-colorimeters.rules
+++ b/rules/95-gcm-colorimeters.rules
@@ -11,12 +11,12 @@
 # Colorimeter devices used for profiling
 #
 # These are properties defining the behavior:
-#  GCM_COLORIMETER		Can measure color
-#  GCM_KIND			The kind of sensor
-#  GCM_TYPE_DISPLAY		Can profile a display device
-#  GCM_TYPE_PROJECTOR		Can profile a projector device
-#  GCM_TYPE_PRINTER		Can profile a printer device
-#  GCM_TYPE_SPOT		Can be used for spot measurements
+#  COLORD_SENSOR		Can measure color
+#  COLORD_SENSOR_KIND		The kind of sensor
+#  COLORD_SENSOR_CAP_DISPLAY	Can profile a display device
+#  COLORD_SENSOR_CAP_PROJECTOR	Can profile a projector device
+#  COLORD_SENSOR_CAP_PRINTER	Can profile a printer device
+#  COLORD_SENSOR_CAP_SPOT	Can be used for spot measurements
 #
 
 # Skip all this to speed things up if it'a not a usb add.
@@ -24,44 +24,44 @@ ACTION!="add", GOTO="gcm_rules_end"
 SUBSYSTEM!="usb", GOTO="gcm_rules_end"
 
 # DTP20
-ATTRS{idVendor}=="0765", ATTRS{idProduct}=="d020", ENV{GCM_COLORIMETER}="1", ENV{GCM_KIND}="dtp20", ENV{GCM_TYPE_PRINTER}="1", ENV{GCM_TYPE_SPOT}="1"
+ATTRS{idVendor}=="0765", ATTRS{idProduct}=="d020", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="dtp20", ENV{COLORD_SENSOR_CAP_PRINTER}="1", ENV{COLORD_SENSOR_CAP_SPOT}="1"
 
 # DTP92Q (not tested)
-ATTRS{idVendor}=="0765", ATTRS{idProduct}=="d092", ENV{GCM_COLORIMETER}="1", ENV{GCM_KIND}="unknown", ENV{GCM_TYPE_DISPLAY}="1"
+ATTRS{idVendor}=="0765", ATTRS{idProduct}=="d092", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="unknown", ENV{COLORD_SENSOR_CAP_DISPLAY}="1"
 
 # DTP94
-ATTRS{idVendor}=="0765", ATTRS{idProduct}=="d094", ENV{GCM_COLORIMETER}="1", ENV{GCM_KIND}="dtp94", ENV{GCM_TYPE_DISPLAY}="1"
+ATTRS{idVendor}=="0765", ATTRS{idProduct}=="d094", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="dtp94", ENV{COLORD_SENSOR_CAP_DISPLAY}="1"
 
 # MonacoOPTIX (Same as i1 Display 1)
-ATTRS{idVendor}=="0670", ATTRS{idProduct}=="0001", ENV{GCM_COLORIMETER}="1", ENV{GCM_KIND}="i1-pro", ENV{GCM_TYPE_DISPLAY}="1"
+ATTRS{idVendor}=="0670", ATTRS{idProduct}=="0001", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="i1-pro", ENV{COLORD_SENSOR_CAP_DISPLAY}="1"
 
 # i1Display
-ATTRS{idVendor}=="0971", ATTRS{idProduct}=="2003", ENV{GCM_COLORIMETER}="1", ENV{GCM_KIND}="i1-pro", ENV{GCM_TYPE_DISPLAY}="1"
+ATTRS{idVendor}=="0971", ATTRS{idProduct}=="2003", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="i1-pro", ENV{COLORD_SENSOR_CAP_DISPLAY}="1"
 
 # i1Monitor
-ATTRS{idVendor}=="0971", ATTRS{idProduct}=="2001", ENV{GCM_COLORIMETER}="1", ENV{GCM_KIND}="i1-pro", ENV{GCM_TYPE_DISPLAY}="1"
+ATTRS{idVendor}=="0971", ATTRS{idProduct}=="2001", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="i1-pro", ENV{COLORD_SENSOR_CAP_DISPLAY}="1"
 
 # i1Pro
-ATTRS{idVendor}=="0971", ATTRS{idProduct}=="2000", ENV{GCM_COLORIMETER}="1", ENV{GCM_KIND}="i1-pro", ENV{GCM_TYPE_DISPLAY}="1", ENV{GCM_TYPE_PROJECTOR}="1", ENV{GCM_TYPE_PRINTER}="1"
+ATTRS{idVendor}=="0971", ATTRS{idProduct}=="2000", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="i1-pro", ENV{COLORD_SENSOR_CAP_DISPLAY}="1", ENV{COLORD_SENSOR_CAP_PROJECTOR}="1", ENV{COLORD_SENSOR_CAP_PRINTER}="1"
 
 # ColorMunki
-ATTRS{idVendor}=="0971", ATTRS{idProduct}=="2007", ENV{GCM_COLORIMETER}="1", ENV{GCM_KIND}="color-munki", ENV{GCM_TYPE_DISPLAY}="1", ENV{GCM_TYPE_PROJECTOR}="1", ENV{GCM_TYPE_PRINTER}="1", ENV{GCM_TYPE_SPOT}="1"
+ATTRS{idVendor}=="0971", ATTRS{idProduct}=="2007", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="color-munki", ENV{COLORD_SENSOR_CAP_DISPLAY}="1", ENV{COLORD_SENSOR_CAP_PROJECTOR}="1", ENV{COLORD_SENSOR_CAP_PRINTER}="1", ENV{COLORD_SENSOR_CAP_SPOT}="1"
 
 # Colorimtre HCFR
-ATTRS{idVendor}=="04db", ATTRS{idProduct}=="005b", ENV{GCM_COLORIMETER}="1", ENV{GCM_KIND}="colorimtre-hcfr", ENV{GCM_TYPE_PROJECTOR}="1"
+ATTRS{idVendor}=="04db", ATTRS{idProduct}=="005b", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="colorimtre-hcfr", ENV{COLORD_SENSOR_CAP_PROJECTOR}="1"
 
 # Spyder 2
-ATTRS{idVendor}=="085c", ATTRS{idProduct}=="0200", ENV{GCM_COLORIMETER}="1", ENV{GCM_KIND}="spyder", ENV{GCM_TYPE_DISPLAY}="1"
+ATTRS{idVendor}=="085c", ATTRS{idProduct}=="0200", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="spyder", ENV{COLORD_SENSOR_CAP_DISPLAY}="1"
 
 # Spyder 3
-ATTRS{idVendor}=="085c", ATTRS{idProduct}=="0300", ENV{GCM_COLORIMETER}="1", ENV{GCM_KIND}="spyder", ENV{GCM_TYPE_DISPLAY}="1"
+ATTRS{idVendor}=="085c", ATTRS{idProduct}=="0300", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="spyder", ENV{COLORD_SENSOR_CAP_DISPLAY}="1"
 
 # Huey
-ATTRS{idVendor}=="0971", ATTRS{idProduct}=="2005", ENV{GCM_COLORIMETER}="1", ENV{GCM_KIND}="huey", ENV{GCM_TYPE_DISPLAY}="1"
+ATTRS{idVendor}=="0971", ATTRS{idProduct}=="2005", ENV{COLORD_SENSOR}="1", ENV{COLORD_SENSOR_KIND}="huey", ENV{COLORD_SENSOR_CAP_DISPLAY}="1"
 
 # color calibration device
-ENV{GCM_COLORIMETER}=="*?", ENV{COLOR_MEASUREMENT_DEVICE}="1"
-ENV{GCM_COLORIMETER}=="*?", ENV{ID_MODEL}=="", IMPORT{program}="usb_id --export %p"
-ENV{GCM_COLORIMETER}=="*?", ENV{ID_MODEL_FROM_DATABASE}=="", IMPORT{program}="usb-db %p"
+ENV{COLORD_SENSOR}=="*?", ENV{COLOR_MEASUREMENT_DEVICE}="1"
+ENV{COLORD_SENSOR}=="*?", ENV{ID_MODEL}=="", IMPORT{program}="usb_id --export %p"
+ENV{COLORD_SENSOR}=="*?", ENV{ID_MODEL_FROM_DATABASE}=="", IMPORT{program}="usb-db %p"
 
 LABEL="gcm_rules_end"
diff --git a/src/gcm-sensor-client.c b/src/gcm-sensor-client.c
index dbda4a3..7db578d 100644
--- a/src/gcm-sensor-client.c
+++ b/src/gcm-sensor-client.c
@@ -163,12 +163,12 @@ gcm_sensor_client_device_add (GcmSensorClient *sensor_client, GUdevDevice *devic
 	GcmSensorClientPrivate *priv = sensor_client->priv;
 
 	/* interesting device? */
-	ret = g_udev_device_get_property_as_boolean (device, "GCM_COLORIMETER");
+	ret = g_udev_device_get_property_as_boolean (device, "COLORD_SENSOR");
 	if (!ret)
 		goto out;
 
 	/* is it a sensor we have a internal native driver for? */
-	kind_str = g_udev_device_get_property (device, "GCM_KIND");
+	kind_str = g_udev_device_get_property (device, "COLORD_SENSOR_KIND");
 	kind = gcm_sensor_kind_from_string (kind_str);
 	if (kind == GCM_SENSOR_KIND_HUEY) {
 		g_debug ("creating native sensor device");
diff --git a/src/gcm-sensor.c b/src/gcm-sensor.c
index a4d880a..1fe7aa7 100644
--- a/src/gcm-sensor.c
+++ b/src/gcm-sensor.c
@@ -370,16 +370,16 @@ gcm_sensor_set_from_device (GcmSensor *sensor, GUdevDevice *device, GError **err
 		priv->model = g_strdup (g_udev_device_get_sysfs_attr (device, "product"));
 
 	/* try to get type */
-	kind_str = g_udev_device_get_property (device, "GCM_KIND");
+	kind_str = g_udev_device_get_property (device, "COLORD_SENSOR_KIND");
 	if (priv->kind == GCM_SENSOR_KIND_UNKNOWN)
 		priv->kind = gcm_sensor_kind_from_string (kind_str);
 	if (priv->kind == GCM_SENSOR_KIND_UNKNOWN)
 		g_warning ("Failed to recognize color device: %s", priv->model);
 
-	priv->supports_display = g_udev_device_get_property_as_boolean (device, "GCM_TYPE_DISPLAY");
-	priv->supports_projector = g_udev_device_get_property_as_boolean (device, "GCM_TYPE_PROJECTOR");
-	priv->supports_printer = g_udev_device_get_property_as_boolean (device, "GCM_TYPE_PRINTER");
-	priv->supports_spot = g_udev_device_get_property_as_boolean (device, "GCM_TYPE_SPOT");
+	priv->supports_display = g_udev_device_get_property_as_boolean (device, "COLORD_SENSOR_CAP_DISPLAY");
+	priv->supports_projector = g_udev_device_get_property_as_boolean (device, "COLORD_SENSOR_CAP_PROJECTOR");
+	priv->supports_printer = g_udev_device_get_property_as_boolean (device, "COLORD_SENSOR_CAP_PRINTER");
+	priv->supports_spot = g_udev_device_get_property_as_boolean (device, "COLORD_SENSOR_CAP_SPOT");
 	return TRUE;
 }
 



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