[gnome-color-manager: 70/80] trivial: move GcmColorimeter to libcolor-glib and rename to GcmSensorClient
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-color-manager: 70/80] trivial: move GcmColorimeter to libcolor-glib and rename to GcmSensorClient
- Date: Mon, 19 Jul 2010 11:38:20 +0000 (UTC)
commit fe83e9b2e507d57f1bad99cb2f7b79be8b20d9f4
Author: Richard Hughes <richard hughsie com>
Date: Sun Jul 18 14:15:28 2010 +0100
trivial: move GcmColorimeter to libcolor-glib and rename to GcmSensorClient
libcolor-glib/Makefile.am | 4 +
.../gcm-sensor-client.c | 149 ++++++++++----------
.../gcm-sensor-client.h | 38 +++---
libcolor-glib/gcm-sensor-dummy.c | 2 +-
libcolor-glib/gcm-sensor-huey.c | 2 +-
libcolor-glib/libcolor-glib.h | 1 +
libcolor-glib/libcolor-glib.pc.in | 2 +-
po/POTFILES.in | 2 +-
src/Makefile.am | 2 -
src/cc-color-panel.c | 24 ++--
src/gcm-calibrate-argyll.c | 90 ++++++------
src/gcm-calibrate.c | 48 +++---
src/gcm-picker.c | 32 ++--
13 files changed, 199 insertions(+), 197 deletions(-)
---
diff --git a/libcolor-glib/Makefile.am b/libcolor-glib/Makefile.am
index a34f1d6..3b4ad98 100644
--- a/libcolor-glib/Makefile.am
+++ b/libcolor-glib/Makefile.am
@@ -9,6 +9,7 @@ INCLUDES = \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS) \
$(LCMS_CFLAGS) \
+ $(GUDEV_CFLAGS) \
$(USB_CFLAGS) \
-I$(top_srcdir)/libcolor-glib \
-I$(top_builddir)/libcolor-glib \
@@ -55,6 +56,8 @@ libcolor_glib_la_SOURCES = \
gcm-common.h \
gcm-sensor.c \
gcm-sensor.h \
+ gcm-sensor-client.c \
+ gcm-sensor-client.h \
gcm-sensor-huey.c \
gcm-sensor-huey.h \
gcm-sensor-dummy.c \
@@ -94,6 +97,7 @@ libcolor_glib_la_LIBADD = \
$(USB_LIBS) \
$(LCMS_LIBS) \
$(GLIB_LIBS) \
+ $(GUDEV_LIBS) \
$(GTK_LIBS) \
-lm
diff --git a/src/gcm-colorimeter.c b/libcolor-glib/gcm-sensor-client.c
similarity index 55%
rename from src/gcm-colorimeter.c
rename to libcolor-glib/gcm-sensor-client.c
index c628c16..07609d9 100644
--- a/src/gcm-colorimeter.c
+++ b/libcolor-glib/gcm-sensor-client.c
@@ -20,8 +20,8 @@
*/
/**
- * SECTION:gcm-colorimeter
- * @short_description: Colorimeter device abstraction
+ * SECTION:gcm-sensor-client
+ * @short_description: SensorClient device abstraction
*
* This object allows the programmer to detect a color sensor device.
*/
@@ -32,21 +32,20 @@
#include <gudev/gudev.h>
#include <gtk/gtk.h>
-#include "gcm-colorimeter.h"
-#include "gcm-utils.h"
+#include "gcm-sensor-client.h"
#include "egg-debug.h"
-static void gcm_colorimeter_finalize (GObject *object);
+static void gcm_sensor_client_finalize (GObject *object);
-#define GCM_COLORIMETER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GCM_TYPE_COLORIMETER, GcmColorimeterPrivate))
+#define GCM_SENSOR_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GCM_TYPE_SENSOR_CLIENT, GcmSensorClientPrivate))
/**
- * GcmColorimeterPrivate:
+ * GcmSensorClientPrivate:
*
- * Private #GcmColorimeter data
+ * Private #GcmSensorClient data
**/
-struct _GcmColorimeterPrivate
+struct _GcmSensorClientPrivate
{
gboolean present;
GUdevClient *client;
@@ -65,18 +64,18 @@ enum {
};
static guint signals[SIGNAL_LAST] = { 0 };
-static gpointer gcm_colorimeter_object = NULL;
+static gpointer gcm_sensor_client_object = NULL;
-G_DEFINE_TYPE (GcmColorimeter, gcm_colorimeter, G_TYPE_OBJECT)
+G_DEFINE_TYPE (GcmSensorClient, gcm_sensor_client, G_TYPE_OBJECT)
/**
- * gcm_colorimeter_get_property:
+ * gcm_sensor_client_get_property:
**/
static void
-gcm_colorimeter_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+gcm_sensor_client_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
- GcmColorimeter *colorimeter = GCM_COLORIMETER (object);
- GcmColorimeterPrivate *priv = colorimeter->priv;
+ GcmSensorClient *sensor_client = GCM_SENSOR_CLIENT (object);
+ GcmSensorClientPrivate *priv = sensor_client->priv;
switch (prop_id) {
case PROP_PRESENT:
@@ -89,10 +88,10 @@ gcm_colorimeter_get_property (GObject *object, guint prop_id, GValue *value, GPa
}
/**
- * gcm_colorimeter_set_property:
+ * gcm_sensor_client_set_property:
**/
static void
-gcm_colorimeter_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+gcm_sensor_client_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
switch (prop_id) {
default:
@@ -102,19 +101,19 @@ gcm_colorimeter_set_property (GObject *object, guint prop_id, const GValue *valu
}
/**
- * gcm_colorimeter_class_init:
+ * gcm_sensor_client_class_init:
**/
static void
-gcm_colorimeter_class_init (GcmColorimeterClass *klass)
+gcm_sensor_client_class_init (GcmSensorClientClass *klass)
{
GParamSpec *pspec;
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->finalize = gcm_colorimeter_finalize;
- object_class->get_property = gcm_colorimeter_get_property;
- object_class->set_property = gcm_colorimeter_set_property;
+ object_class->finalize = gcm_sensor_client_finalize;
+ object_class->get_property = gcm_sensor_client_get_property;
+ object_class->set_property = gcm_sensor_client_set_property;
/**
- * GcmColorimeter:present:
+ * GcmSensorClient:present:
*/
pspec = g_param_spec_boolean ("present", NULL, NULL,
FALSE,
@@ -122,51 +121,51 @@ gcm_colorimeter_class_init (GcmColorimeterClass *klass)
g_object_class_install_property (object_class, PROP_PRESENT, pspec);
/**
- * GcmColorimeter::changed:
+ * GcmSensorClient::changed:
**/
signals[SIGNAL_CHANGED] =
g_signal_new ("changed",
G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GcmColorimeterClass, changed),
+ G_STRUCT_OFFSET (GcmSensorClientClass, changed),
NULL, NULL, g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- g_type_class_add_private (klass, sizeof (GcmColorimeterPrivate));
+ g_type_class_add_private (klass, sizeof (GcmSensorClientPrivate));
}
/**
- * gcm_colorimeter_get_sensor:
+ * gcm_sensor_client_get_sensor:
**/
GcmSensor *
-gcm_colorimeter_get_sensor (GcmColorimeter *colorimeter)
+gcm_sensor_client_get_sensor (GcmSensorClient *sensor_client)
{
- return colorimeter->priv->sensor;
+ return sensor_client->priv->sensor;
}
/**
- * gcm_colorimeter_get_present:
+ * gcm_sensor_client_get_present:
**/
gboolean
-gcm_colorimeter_get_present (GcmColorimeter *colorimeter)
+gcm_sensor_client_get_present (GcmSensorClient *sensor_client)
{
- return colorimeter->priv->present;
+ return sensor_client->priv->present;
}
/**
- * gcm_colorimeter_device_add:
+ * gcm_sensor_client_device_add:
**/
static gboolean
-gcm_colorimeter_device_add (GcmColorimeter *colorimeter, GUdevDevice *device)
+gcm_sensor_client_device_add (GcmSensorClient *sensor_client, GUdevDevice *device)
{
const gchar *vendor;
const gchar *model;
- GcmSensorKind colorimeter_kind;
+ GcmSensorKind sensor_client_kind;
gboolean ret;
const gchar *kind_str;
- GcmColorimeterPrivate *priv = colorimeter->priv;
+ 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, "GCM_SENSOR_CLIENT");
if (!ret)
goto out;
@@ -191,8 +190,8 @@ gcm_colorimeter_device_add (GcmColorimeter *colorimeter, GUdevDevice *device)
/* try to get type */
kind_str = g_udev_device_get_property (device, "GCM_KIND");
- colorimeter_kind = gcm_sensor_kind_from_string (kind_str);
- if (colorimeter_kind == GCM_SENSOR_KIND_UNKNOWN)
+ sensor_client_kind = gcm_sensor_kind_from_string (kind_str);
+ if (sensor_client_kind == GCM_SENSOR_KIND_UNKNOWN)
egg_warning ("Failed to recognize color device: %s", model);
g_object_set (priv->sensor,
@@ -202,27 +201,27 @@ gcm_colorimeter_device_add (GcmColorimeter *colorimeter, GUdevDevice *device)
"supports-projector",g_udev_device_get_property_as_boolean (device, "GCM_TYPE_PROJECTOR"),
"supports-printer", g_udev_device_get_property_as_boolean (device, "GCM_TYPE_PRINTER"),
"supports-spot", g_udev_device_get_property_as_boolean (device, "GCM_TYPE_SPOT"),
- "kind", colorimeter_kind,
+ "kind", sensor_client_kind,
NULL);
/* signal the addition */
egg_debug ("emit: changed");
- g_signal_emit (colorimeter, signals[SIGNAL_CHANGED], 0);
+ g_signal_emit (sensor_client, signals[SIGNAL_CHANGED], 0);
out:
return ret;
}
/**
- * gcm_colorimeter_device_remove:
+ * gcm_sensor_client_device_remove:
**/
static gboolean
-gcm_colorimeter_device_remove (GcmColorimeter *colorimeter, GUdevDevice *device)
+gcm_sensor_client_device_remove (GcmSensorClient *sensor_client, GUdevDevice *device)
{
gboolean ret;
- GcmColorimeterPrivate *priv = colorimeter->priv;
+ 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, "GCM_SENSOR_CLIENT");
if (!ret)
goto out;
@@ -235,26 +234,26 @@ gcm_colorimeter_device_remove (GcmColorimeter *colorimeter, GUdevDevice *device)
/* signal the removal */
egg_debug ("emit: changed");
- g_signal_emit (colorimeter, signals[SIGNAL_CHANGED], 0);
+ g_signal_emit (sensor_client, signals[SIGNAL_CHANGED], 0);
out:
return ret;
}
/**
- * gcm_colorimeter_coldplug:
+ * gcm_sensor_client_coldplug:
**/
static gboolean
-gcm_colorimeter_coldplug (GcmColorimeter *colorimeter)
+gcm_sensor_client_coldplug (GcmSensorClient *sensor_client)
{
GList *devices;
GList *l;
gboolean ret = FALSE;
- GcmColorimeterPrivate *priv = colorimeter->priv;
+ GcmSensorClientPrivate *priv = sensor_client->priv;
/* get all USB devices */
devices = g_udev_client_query_by_subsystem (priv->client, "usb");
for (l = devices; l != NULL; l = l->next) {
- ret = gcm_colorimeter_device_add (colorimeter, l->data);
+ ret = gcm_sensor_client_device_add (sensor_client, l->data);
if (ret) {
egg_debug ("found color management device");
break;
@@ -267,68 +266,68 @@ gcm_colorimeter_coldplug (GcmColorimeter *colorimeter)
}
/**
- * gcm_colorimeter_uevent_cb:
+ * gcm_sensor_client_uevent_cb:
**/
static void
-gcm_colorimeter_uevent_cb (GUdevClient *client, const gchar *action, GUdevDevice *device, GcmColorimeter *colorimeter)
+gcm_sensor_client_uevent_cb (GUdevClient *client, const gchar *action, GUdevDevice *device, GcmSensorClient *sensor_client)
{
egg_debug ("uevent %s", action);
if (g_strcmp0 (action, "add") == 0) {
- gcm_colorimeter_device_add (colorimeter, device);
+ gcm_sensor_client_device_add (sensor_client, device);
} else if (g_strcmp0 (action, "remove") == 0) {
- gcm_colorimeter_device_remove (colorimeter, device);
+ gcm_sensor_client_device_remove (sensor_client, device);
}
}
/**
- * gcm_colorimeter_init:
+ * gcm_sensor_client_init:
**/
static void
-gcm_colorimeter_init (GcmColorimeter *colorimeter)
+gcm_sensor_client_init (GcmSensorClient *sensor_client)
{
const gchar *subsystems[] = {"usb", NULL};
- colorimeter->priv = GCM_COLORIMETER_GET_PRIVATE (colorimeter);
+ sensor_client->priv = GCM_SENSOR_CLIENT_GET_PRIVATE (sensor_client);
/* use GUdev to find the calibration device */
- colorimeter->priv->client = g_udev_client_new (subsystems);
- g_signal_connect (colorimeter->priv->client, "uevent",
- G_CALLBACK (gcm_colorimeter_uevent_cb), colorimeter);
+ sensor_client->priv->client = g_udev_client_new (subsystems);
+ g_signal_connect (sensor_client->priv->client, "uevent",
+ G_CALLBACK (gcm_sensor_client_uevent_cb), sensor_client);
/* coldplug */
- gcm_colorimeter_coldplug (colorimeter);
+ gcm_sensor_client_coldplug (sensor_client);
}
/**
- * gcm_colorimeter_finalize:
+ * gcm_sensor_client_finalize:
**/
static void
-gcm_colorimeter_finalize (GObject *object)
+gcm_sensor_client_finalize (GObject *object)
{
- GcmColorimeter *colorimeter = GCM_COLORIMETER (object);
- GcmColorimeterPrivate *priv = colorimeter->priv;
+ GcmSensorClient *sensor_client = GCM_SENSOR_CLIENT (object);
+ GcmSensorClientPrivate *priv = sensor_client->priv;
g_object_unref (priv->client);
if (priv->sensor != NULL)
g_object_unref (priv->sensor);
- G_OBJECT_CLASS (gcm_colorimeter_parent_class)->finalize (object);
+ G_OBJECT_CLASS (gcm_sensor_client_parent_class)->finalize (object);
}
/**
- * gcm_colorimeter_new:
+ * gcm_sensor_client_new:
*
- * Return value: a new GcmColorimeter object.
+ * Return value: a new GcmSensorClient object.
**/
-GcmColorimeter *
-gcm_colorimeter_new (void)
+GcmSensorClient *
+gcm_sensor_client_new (void)
{
- if (gcm_colorimeter_object != NULL) {
- g_object_ref (gcm_colorimeter_object);
+ if (gcm_sensor_client_object != NULL) {
+ g_object_ref (gcm_sensor_client_object);
} else {
- gcm_colorimeter_object = g_object_new (GCM_TYPE_COLORIMETER, NULL);
- g_object_add_weak_pointer (gcm_colorimeter_object, &gcm_colorimeter_object);
+ gcm_sensor_client_object = g_object_new (GCM_TYPE_SENSOR_CLIENT, NULL);
+ g_object_add_weak_pointer (gcm_sensor_client_object, &gcm_sensor_client_object);
}
- return GCM_COLORIMETER (gcm_colorimeter_object);
+ return GCM_SENSOR_CLIENT (gcm_sensor_client_object);
}
diff --git a/src/gcm-colorimeter.h b/libcolor-glib/gcm-sensor-client.h
similarity index 52%
rename from src/gcm-colorimeter.h
rename to libcolor-glib/gcm-sensor-client.h
index 5650d8b..8730c80 100644
--- a/src/gcm-colorimeter.h
+++ b/libcolor-glib/gcm-sensor-client.h
@@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __GCM_COLORIMETER_H
-#define __GCM_COLORIMETER_H
+#ifndef __GCM_SENSOR_CLIENT_H
+#define __GCM_SENSOR_CLIENT_H
#include <glib-object.h>
@@ -28,24 +28,24 @@
G_BEGIN_DECLS
-#define GCM_TYPE_COLORIMETER (gcm_colorimeter_get_type ())
-#define GCM_COLORIMETER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GCM_TYPE_COLORIMETER, GcmColorimeter))
-#define GCM_COLORIMETER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GCM_TYPE_COLORIMETER, GcmColorimeterClass))
-#define GCM_IS_COLORIMETER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GCM_TYPE_COLORIMETER))
-#define GCM_IS_COLORIMETER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GCM_TYPE_COLORIMETER))
-#define GCM_COLORIMETER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GCM_TYPE_COLORIMETER, GcmColorimeterClass))
+#define GCM_TYPE_SENSOR_CLIENT (gcm_sensor_client_get_type ())
+#define GCM_SENSOR_CLIENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GCM_TYPE_SENSOR_CLIENT, GcmSensorClient))
+#define GCM_SENSOR_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GCM_TYPE_SENSOR_CLIENT, GcmSensorClientClass))
+#define GCM_IS_SENSOR_CLIENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GCM_TYPE_SENSOR_CLIENT))
+#define GCM_IS_SENSOR_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GCM_TYPE_SENSOR_CLIENT))
+#define GCM_SENSOR_CLIENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GCM_TYPE_SENSOR_CLIENT, GcmSensorClientClass))
-typedef struct _GcmColorimeterPrivate GcmColorimeterPrivate;
-typedef struct _GcmColorimeter GcmColorimeter;
-typedef struct _GcmColorimeterClass GcmColorimeterClass;
+typedef struct _GcmSensorClientPrivate GcmSensorClientPrivate;
+typedef struct _GcmSensorClient GcmSensorClient;
+typedef struct _GcmSensorClientClass GcmSensorClientClass;
-struct _GcmColorimeter
+struct _GcmSensorClient
{
GObject parent;
- GcmColorimeterPrivate *priv;
+ GcmSensorClientPrivate *priv;
};
-struct _GcmColorimeterClass
+struct _GcmSensorClientClass
{
GObjectClass parent_class;
void (* changed) (void);
@@ -57,14 +57,14 @@ struct _GcmColorimeterClass
void (*_gcm_reserved5) (void);
};
-GType gcm_colorimeter_get_type (void);
-GcmColorimeter *gcm_colorimeter_new (void);
+GType gcm_sensor_client_get_type (void);
+GcmSensorClient *gcm_sensor_client_new (void);
/* accessors */
-GcmSensor *gcm_colorimeter_get_sensor (GcmColorimeter *colorimeter);
-gboolean gcm_colorimeter_get_present (GcmColorimeter *colorimeter);
+GcmSensor *gcm_sensor_client_get_sensor (GcmSensorClient *sensor_client);
+gboolean gcm_sensor_client_get_present (GcmSensorClient *sensor_client);
G_END_DECLS
-#endif /* __GCM_COLORIMETER_H */
+#endif /* __GCM_SENSOR_CLIENT_H */
diff --git a/libcolor-glib/gcm-sensor-dummy.c b/libcolor-glib/gcm-sensor-dummy.c
index 1032251..fe5c2ce 100644
--- a/libcolor-glib/gcm-sensor-dummy.c
+++ b/libcolor-glib/gcm-sensor-dummy.c
@@ -21,7 +21,7 @@
/**
* SECTION:gcm-sensor-dummy
- * @short_description: functionality to talk to a dummy colorimeter.
+ * @short_description: functionality to talk to a dummy sensor_client.
*
* This object contains all the low level logic for imaginary hardware.
*/
diff --git a/libcolor-glib/gcm-sensor-huey.c b/libcolor-glib/gcm-sensor-huey.c
index 994d2ed..d22c5f9 100644
--- a/libcolor-glib/gcm-sensor-huey.c
+++ b/libcolor-glib/gcm-sensor-huey.c
@@ -21,7 +21,7 @@
/**
* SECTION:gcm-sensor-huey
- * @short_description: functionality to talk to the HUEY colorimeter.
+ * @short_description: functionality to talk to the HUEY sensor_client.
*
* This object contains all the low level logic for the HUEY hardware.
*/
diff --git a/libcolor-glib/libcolor-glib.h b/libcolor-glib/libcolor-glib.h
index 0427218..f3f887c 100644
--- a/libcolor-glib/libcolor-glib.h
+++ b/libcolor-glib/libcolor-glib.h
@@ -36,6 +36,7 @@
#include <gcm-sensor.h>
#include <gcm-sensor-huey.h>
#include <gcm-sensor-dummy.h>
+#include <gcm-sensor-client.h>
#include <gcm-edid.h>
#include <gcm-profile.h>
#include <gcm-enum.h>
diff --git a/libcolor-glib/libcolor-glib.pc.in b/libcolor-glib/libcolor-glib.pc.in
index 3c0b029..8e7ac7f 100644
--- a/libcolor-glib/libcolor-glib.pc.in
+++ b/libcolor-glib/libcolor-glib.pc.in
@@ -7,6 +7,6 @@ Name: libcolor-glib
Description: libcolor-glib is a userspace color library.
Version: @VERSION@
Requires.private: gthread-2.0
-Requires: glib-2.0, gobject-2.0, libusb-1.0 lcms2
+Requires: glib-2.0, gobject-2.0, libusb-1.0 lcms2 gudev-1.0
Libs: -L${libdir} -llibcolor-glib
Cflags: -I${includedir}/libcolor-glib
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 4e08590..80246ff 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -13,7 +13,6 @@ src/gcm-calibrate-dialog.c
src/gcm-calibrate-manual.c
src/gcm-cell-renderer-profile.c
src/gcm-client.c
-src/gcm-colorimeter.c
src/gcm-device-xrandr.c
src/gcm-dump-edid.c
src/gcm-dump-profile.c
@@ -25,6 +24,7 @@ src/gcm-picker.c
src/gcm-viewer.c
src/gcm-session.c
src/gcm-utils.c
+libcolor-glib/gcm-sensor-client.c
libcolor-glib/gcm-profile.c
[type: gettext/glade]data/gcm-calibrate.ui
[type: gettext/glade]data/gcm-picker.ui
diff --git a/src/Makefile.am b/src/Makefile.am
index cacd24a..4edb75f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -52,8 +52,6 @@ libgcmshared_a_SOURCES = \
gcm-utils.h \
gcm-client.c \
gcm-client.h \
- gcm-colorimeter.c \
- gcm-colorimeter.h \
gcm-device.c \
gcm-device.h \
gcm-device-xrandr.c \
diff --git a/src/cc-color-panel.c b/src/cc-color-panel.c
index 3972d17..dacca20 100644
--- a/src/cc-color-panel.c
+++ b/src/cc-color-panel.c
@@ -35,7 +35,7 @@
#include "gcm-calibrate-argyll.h"
#include "gcm-cie-widget.h"
#include "gcm-client.h"
-#include "gcm-colorimeter.h"
+#include "gcm-sensor-client.h"
#include "gcm-device-xrandr.h"
#include "gcm-device-virtual.h"
#include "gcm-exif.h"
@@ -56,7 +56,7 @@ struct _CcColorPanelPrivate {
GcmDevice *current_device;
GcmProfileStore *profile_store;
GcmClient *gcm_client;
- GcmColorimeter *colorimeter;
+ GcmSensorClient *sensor_client;
gboolean setting_up_device;
GtkWidget *main_window;
GtkWidget *info_bar_loading;
@@ -1418,7 +1418,7 @@ cc_color_panel_set_calibrate_button_sensitivity (CcColorPanel *panel)
}
/* find whether we have hardware installed */
- ret = gcm_colorimeter_get_present (panel->priv->colorimeter);
+ ret = gcm_sensor_client_get_present (panel->priv->sensor_client);
if (!ret) {
/* TRANSLATORS: this is when the button is insensitive */
tooltip = _("Cannot create profile: The measuring instrument is not plugged in");
@@ -1433,7 +1433,7 @@ cc_color_panel_set_calibrate_button_sensitivity (CcColorPanel *panel)
} else if (kind == GCM_DEVICE_KIND_PRINTER) {
/* find whether we have hardware installed */
- ret = gcm_colorimeter_get_present (panel->priv->colorimeter);
+ ret = gcm_sensor_client_get_present (panel->priv->sensor_client);
if (!ret) {
/* TRANSLATORS: this is when the button is insensitive */
tooltip = _("Cannot create profile: The measuring instrument is not plugged in");
@@ -1441,7 +1441,7 @@ cc_color_panel_set_calibrate_button_sensitivity (CcColorPanel *panel)
}
/* find whether we have hardware installed */
- ret = gcm_sensor_supports_printer (gcm_colorimeter_get_sensor (panel->priv->colorimeter));
+ ret = gcm_sensor_supports_printer (gcm_sensor_client_get_sensor (panel->priv->sensor_client));
if (!ret) {
/* TRANSLATORS: this is when the button is insensitive */
tooltip = _("Cannot create profile: The measuring instrument does not support printer profiling");
@@ -1954,16 +1954,16 @@ out:
}
/**
- * cc_color_panel_colorimeter_changed_cb:
+ * cc_color_panel_sensor_client_changed_cb:
**/
static void
-cc_color_panel_colorimeter_changed_cb (GcmColorimeter *colorimeter, CcColorPanel *panel)
+cc_color_panel_sensor_client_changed_cb (GcmSensorClient *sensor_client, CcColorPanel *panel)
{
gboolean present;
const gchar *event_id;
const gchar *message;
- present = gcm_colorimeter_get_present (colorimeter);
+ present = gcm_sensor_client_get_present (sensor_client);
if (present) {
/* TRANSLATORS: this is a sound description */
@@ -2603,8 +2603,8 @@ cc_color_panel_finalize (GObject *object)
if (panel->priv->current_device != NULL)
g_object_unref (panel->priv->current_device);
- if (panel->priv->colorimeter != NULL)
- g_object_unref (panel->priv->colorimeter);
+ if (panel->priv->sensor_client != NULL)
+ g_object_unref (panel->priv->sensor_client);
if (panel->priv->settings != NULL)
g_object_unref (panel->priv->settings);
if (panel->priv->builder != NULL)
@@ -2809,8 +2809,8 @@ cc_color_panel_init (CcColorPanel *panel)
G_CALLBACK (cc_color_panel_client_notify_loading_cb), panel);
/* use the color device */
- panel->priv->colorimeter = gcm_colorimeter_new ();
- g_signal_connect (panel->priv->colorimeter, "changed", G_CALLBACK (cc_color_panel_colorimeter_changed_cb), panel);
+ panel->priv->sensor_client = gcm_sensor_client_new ();
+ g_signal_connect (panel->priv->sensor_client, "changed", G_CALLBACK (cc_color_panel_sensor_client_changed_cb), panel);
/* use infobar */
panel->priv->info_bar_loading = gtk_info_bar_new ();
diff --git a/src/gcm-calibrate-argyll.c b/src/gcm-calibrate-argyll.c
index fa3e5c0..33978fb 100644
--- a/src/gcm-calibrate-argyll.c
+++ b/src/gcm-calibrate-argyll.c
@@ -41,7 +41,7 @@
#include <canberra-gtk.h>
#include "gcm-calibrate-argyll.h"
-#include "gcm-colorimeter.h"
+#include "gcm-sensor-client.h"
#include "gcm-utils.h"
#include "gcm-screen.h"
#include "gcm-print.h"
@@ -158,12 +158,12 @@ static guint
gcm_calibrate_argyll_printer_get_patches (GcmCalibrateArgyll *calibrate_argyll)
{
guint patches = 180;
- GcmSensorKind colorimeter_kind;
+ GcmSensorKind sensor_client_kind;
GcmCalibratePrecision precision;
/* we care about the kind */
g_object_get (calibrate_argyll,
- "colorimeter-kind", &colorimeter_kind,
+ "sensor_client-kind", &sensor_client_kind,
"precision", &precision,
NULL);
@@ -176,8 +176,8 @@ gcm_calibrate_argyll_printer_get_patches (GcmCalibrateArgyll *calibrate_argyll)
#ifdef USE_DOUBLE_DENSITY
/* using double density, so we can double the patch count */
- if (colorimeter_kind == GCM_SENSOR_KIND_COLOR_MUNKI ||
- colorimeter_kind == GCM_SENSOR_KIND_SPECTRO_SCAN) {
+ if (sensor_client_kind == GCM_SENSOR_KIND_COLOR_MUNKI ||
+ sensor_client_kind == GCM_SENSOR_KIND_SPECTRO_SCAN) {
patches *= 2;
}
#endif
@@ -187,51 +187,51 @@ gcm_calibrate_argyll_printer_get_patches (GcmCalibrateArgyll *calibrate_argyll)
#ifdef HAVE_VTE
/**
- * gcm_calibrate_argyll_get_colorimeter_image_attach:
+ * gcm_calibrate_argyll_get_sensor_client_image_attach:
**/
static const gchar *
-gcm_calibrate_argyll_get_colorimeter_image_attach (GcmCalibrateArgyll *calibrate_argyll)
+gcm_calibrate_argyll_get_sensor_client_image_attach (GcmCalibrateArgyll *calibrate_argyll)
{
- GcmSensorKind colorimeter_kind;
+ GcmSensorKind sensor_client_kind;
- g_object_get (calibrate_argyll, "colorimeter-kind", &colorimeter_kind, NULL);
- if (colorimeter_kind == GCM_SENSOR_KIND_HUEY)
+ g_object_get (calibrate_argyll, "sensor_client-kind", &sensor_client_kind, NULL);
+ if (sensor_client_kind == GCM_SENSOR_KIND_HUEY)
return "huey-attach.svg";
- if (colorimeter_kind == GCM_SENSOR_KIND_COLOR_MUNKI)
+ if (sensor_client_kind == GCM_SENSOR_KIND_COLOR_MUNKI)
return "munki-attach.svg";
- if (colorimeter_kind == GCM_SENSOR_KIND_SPYDER)
+ if (sensor_client_kind == GCM_SENSOR_KIND_SPYDER)
return "spyder-attach.svg";
- if (colorimeter_kind == GCM_SENSOR_KIND_COLORIMTRE_HCFR)
+ if (sensor_client_kind == GCM_SENSOR_KIND_COLORIMTRE_HCFR)
return "hcfr-attach.svg";
- if (colorimeter_kind == GCM_SENSOR_KIND_I1_PRO)
+ if (sensor_client_kind == GCM_SENSOR_KIND_I1_PRO)
return "i1-attach.svg";
return NULL;
}
/**
- * gcm_calibrate_argyll_get_colorimeter_image_calibrate:
+ * gcm_calibrate_argyll_get_sensor_client_image_calibrate:
**/
static const gchar *
-gcm_calibrate_argyll_get_colorimeter_image_calibrate (GcmCalibrateArgyll *calibrate_argyll)
+gcm_calibrate_argyll_get_sensor_client_image_calibrate (GcmCalibrateArgyll *calibrate_argyll)
{
- GcmSensorKind colorimeter_kind;
+ GcmSensorKind sensor_client_kind;
- g_object_get (calibrate_argyll, "colorimeter-kind", &colorimeter_kind, NULL);
- if (colorimeter_kind == GCM_SENSOR_KIND_COLOR_MUNKI)
+ g_object_get (calibrate_argyll, "sensor_client-kind", &sensor_client_kind, NULL);
+ if (sensor_client_kind == GCM_SENSOR_KIND_COLOR_MUNKI)
return "munki-calibrate.svg";
return NULL;
}
/**
- * gcm_calibrate_argyll_get_colorimeter_image_screen:
+ * gcm_calibrate_argyll_get_sensor_client_image_screen:
**/
static const gchar *
-gcm_calibrate_argyll_get_colorimeter_image_screen (GcmCalibrateArgyll *calibrate_argyll)
+gcm_calibrate_argyll_get_sensor_client_image_screen (GcmCalibrateArgyll *calibrate_argyll)
{
- GcmSensorKind colorimeter_kind;
+ GcmSensorKind sensor_client_kind;
- g_object_get (calibrate_argyll, "colorimeter-kind", &colorimeter_kind, NULL);
- if (colorimeter_kind == GCM_SENSOR_KIND_COLOR_MUNKI)
+ g_object_get (calibrate_argyll, "sensor_client-kind", &sensor_client_kind, NULL);
+ if (sensor_client_kind == GCM_SENSOR_KIND_COLOR_MUNKI)
return "munki-screen.svg";
return NULL;
}
@@ -1553,30 +1553,30 @@ out:
}
/**
- * gcm_calibrate_argyll_get_colorimeter_target:
+ * gcm_calibrate_argyll_get_sensor_client_target:
**/
static const gchar *
-gcm_calibrate_argyll_get_colorimeter_target (GcmCalibrateArgyll *calibrate_argyll)
+gcm_calibrate_argyll_get_sensor_client_target (GcmCalibrateArgyll *calibrate_argyll)
{
- GcmSensorKind colorimeter_kind;
+ GcmSensorKind sensor_client_kind;
g_object_get (calibrate_argyll,
- "colorimeter-kind", &colorimeter_kind,
+ "sensor_client-kind", &sensor_client_kind,
NULL);
- if (colorimeter_kind == GCM_SENSOR_KIND_DTP20)
+ if (sensor_client_kind == GCM_SENSOR_KIND_DTP20)
return "20";
- if (colorimeter_kind == GCM_SENSOR_KIND_DTP22)
+ if (sensor_client_kind == GCM_SENSOR_KIND_DTP22)
return "22";
- if (colorimeter_kind == GCM_SENSOR_KIND_DTP41)
+ if (sensor_client_kind == GCM_SENSOR_KIND_DTP41)
return "41";
- if (colorimeter_kind == GCM_SENSOR_KIND_DTP51)
+ if (sensor_client_kind == GCM_SENSOR_KIND_DTP51)
return "51";
- if (colorimeter_kind == GCM_SENSOR_KIND_SPECTRO_SCAN)
+ if (sensor_client_kind == GCM_SENSOR_KIND_SPECTRO_SCAN)
return "SS";
- if (colorimeter_kind == GCM_SENSOR_KIND_I1_PRO)
+ if (sensor_client_kind == GCM_SENSOR_KIND_I1_PRO)
return "i1";
- if (colorimeter_kind == GCM_SENSOR_KIND_COLOR_MUNKI)
+ if (sensor_client_kind == GCM_SENSOR_KIND_COLOR_MUNKI)
return "CM";
return NULL;
}
@@ -1595,12 +1595,12 @@ gcm_calibrate_argyll_display_generate_targets (GcmCalibrateArgyll *calibrate_arg
gchar *basename = NULL;
const gchar *title;
const gchar *message;
- GcmSensorKind colorimeter_kind;
+ GcmSensorKind sensor_client_kind;
/* get shared data */
g_object_get (calibrate_argyll,
"basename", &basename,
- "colorimeter-kind", &colorimeter_kind,
+ "sensor_client-kind", &sensor_client_kind,
NULL);
/* get correct name of the command */
@@ -1631,12 +1631,12 @@ gcm_calibrate_argyll_display_generate_targets (GcmCalibrateArgyll *calibrate_arg
g_ptr_array_add (array, g_strdup ("-v"));
/* target instrument */
- g_ptr_array_add (array, g_strdup_printf ("-i%s", gcm_calibrate_argyll_get_colorimeter_target (calibrate_argyll)));
+ g_ptr_array_add (array, g_strdup_printf ("-i%s", gcm_calibrate_argyll_get_sensor_client_target (calibrate_argyll)));
#ifdef USE_DOUBLE_DENSITY
/* use double density */
- if (colorimeter_kind == GCM_SENSOR_KIND_COLOR_MUNKI ||
- colorimeter_kind == GCM_SENSOR_KIND_SPECTRO_SCAN) {
+ if (sensor_client_kind == GCM_SENSOR_KIND_COLOR_MUNKI ||
+ sensor_client_kind == GCM_SENSOR_KIND_SPECTRO_SCAN) {
g_ptr_array_add (array, g_strdup ("-h"));
}
#endif
@@ -2278,7 +2278,7 @@ gcm_calibrate_argyll_interaction_attach (GcmCalibrateArgyll *calibrate_argyll)
title = _("Please attach instrument");
/* get the image, if we have one */
- filename = gcm_calibrate_argyll_get_colorimeter_image_attach (calibrate_argyll);
+ filename = gcm_calibrate_argyll_get_sensor_client_image_attach (calibrate_argyll);
/* different messages with or without image */
if (filename != NULL) {
@@ -2336,7 +2336,7 @@ gcm_calibrate_argyll_interaction_calibrate (GcmCalibrateArgyll *calibrate_argyll
egg_debug ("blocking waiting for user input: %s", title);
/* get the image, if we have one */
- filename = gcm_calibrate_argyll_get_colorimeter_image_calibrate (calibrate_argyll);
+ filename = gcm_calibrate_argyll_get_sensor_client_image_calibrate (calibrate_argyll);
if (filename != NULL) {
/* TRANSLATORS: this is when the user has to change a setting on the sensor, and we're showing a picture */
@@ -2391,7 +2391,7 @@ gcm_calibrate_argyll_interaction_surface (GcmCalibrateArgyll *calibrate_argyll)
egg_debug ("blocking waiting for user input: %s", title);
/* get the image, if we have one */
- filename = gcm_calibrate_argyll_get_colorimeter_image_screen (calibrate_argyll);
+ filename = gcm_calibrate_argyll_get_sensor_client_image_screen (calibrate_argyll);
if (filename != NULL) {
/* TRANSLATORS: this is when the user has to change a setting on the sensor, and we're showing a picture */
@@ -2551,7 +2551,7 @@ gcm_calibrate_argyll_process_output_cmd (GcmCalibrateArgyll *calibrate_argyll, c
/* TRANSLATORS: message, the sensor got no readings */
message = _("The measuring instrument got no valid readings. Please ensure the aperture is fully open.");
} else if (g_strstr_len (line, -1, "Device or resource busy") != NULL) {
- /* TRANSLATORS: message, the colorimeter has got confused */
+ /* TRANSLATORS: message, the sensor_client has got confused */
message = _("The measuring instrument is busy and is not starting up. Please remove the USB plug and re-insert before trying to use this device.");
} else {
message = found + 8;
@@ -2693,7 +2693,7 @@ gcm_calibrate_argyll_process_output_cmd (GcmCalibrateArgyll *calibrate_argyll, c
string = g_string_new ("");
/* TRANSLATORS: dialog message, just follow the hardware instructions */
- g_string_append (string, _("Place the colorimeter on the area of white next to the letter and click and hold the measure switch."));
+ g_string_append (string, _("Place the sensor_client on the area of white next to the letter and click and hold the measure switch."));
g_string_append (string, "\n\n");
/* TRANSLATORS: dialog message, just follow the hardware instructions */
diff --git a/src/gcm-calibrate.c b/src/gcm-calibrate.c
index 6f9be4b..589e220 100644
--- a/src/gcm-calibrate.c
+++ b/src/gcm-calibrate.c
@@ -37,7 +37,7 @@
#include "gcm-device-xrandr.h"
#include "gcm-utils.h"
#include "gcm-brightness.h"
-#include "gcm-colorimeter.h"
+#include "gcm-sensor-client.h"
#include "gcm-calibrate-dialog.h"
#include "gcm-exif.h"
@@ -55,12 +55,12 @@ static void gcm_calibrate_finalize (GObject *object);
struct _GcmCalibratePrivate
{
GcmDmi *dmi;
- GcmColorimeter *colorimeter;
+ GcmSensorClient *sensor_client;
GcmCalibrateReferenceKind reference_kind;
GcmCalibrateDeviceKind calibrate_device_kind;
GcmCalibratePrintKind print_kind;
GcmCalibratePrecision precision;
- GcmSensorKind colorimeter_kind;
+ GcmSensorKind sensor_client_kind;
GcmCalibrateDialog *calibrate_dialog;
GcmDeviceKind device_kind;
GcmXyz *xyz;
@@ -90,7 +90,7 @@ enum {
PROP_CALIBRATE_DEVICE_KIND,
PROP_PRINT_KIND,
PROP_DEVICE_KIND,
- PROP_COLORIMETER_KIND,
+ PROP_SENSOR_CLIENT_KIND,
PROP_OUTPUT_NAME,
PROP_FILENAME_SOURCE,
PROP_FILENAME_REFERENCE,
@@ -418,7 +418,7 @@ gcm_calibrate_get_display_kind (GcmCalibrate *calibrate, GtkWindow *window, GErr
/* can this device support projectors? */
if (priv->calibrate_device_kind == GCM_CALIBRATE_DEVICE_KIND_PROJECTOR &&
- !gcm_sensor_supports_projector (gcm_colorimeter_get_sensor (priv->colorimeter))) {
+ !gcm_sensor_supports_projector (gcm_sensor_client_get_sensor (priv->sensor_client))) {
/* TRANSLATORS: title, the hardware calibration device does not support projectors */
title = _("Could not calibrate and profile using this color measuring instrument");
@@ -594,7 +594,7 @@ gcm_calibrate_display (GcmCalibrate *calibrate, GtkWindow *window, GError **erro
}
/* get calibration device model */
- hardware_device = gcm_sensor_get_model (gcm_colorimeter_get_sensor (priv->colorimeter));
+ hardware_device = gcm_sensor_get_model (gcm_sensor_client_get_sensor (priv->sensor_client));
/* get device, harder */
if (hardware_device == NULL) {
@@ -1203,8 +1203,8 @@ gcm_calibrate_get_property (GObject *object, guint prop_id, GValue *value, GPara
case PROP_CALIBRATE_DEVICE_KIND:
g_value_set_uint (value, priv->calibrate_device_kind);
break;
- case PROP_COLORIMETER_KIND:
- g_value_set_uint (value, priv->colorimeter_kind);
+ case PROP_SENSOR_CLIENT_KIND:
+ g_value_set_uint (value, priv->sensor_client_kind);
break;
case PROP_OUTPUT_NAME:
g_value_set_string (value, priv->output_name);
@@ -1267,17 +1267,17 @@ gcm_calibrate_guess_kind (GcmCalibrate *calibrate)
}
/**
- * gcm_prefs_colorimeter_changed_cb:
+ * gcm_prefs_sensor_client_changed_cb:
**/
static void
-gcm_prefs_colorimeter_changed_cb (GcmColorimeter *_colorimeter, GcmCalibrate *calibrate)
+gcm_prefs_sensor_client_changed_cb (GcmSensorClient *_sensor_client, GcmCalibrate *calibrate)
{
GcmSensor *sensor;
- calibrate->priv->colorimeter_kind = GCM_SENSOR_KIND_UNKNOWN;
- sensor = gcm_colorimeter_get_sensor (_colorimeter);
+ calibrate->priv->sensor_client_kind = GCM_SENSOR_KIND_UNKNOWN;
+ sensor = gcm_sensor_client_get_sensor (_sensor_client);
if (sensor != NULL)
- calibrate->priv->colorimeter_kind = gcm_sensor_get_kind (sensor);
- g_object_notify (G_OBJECT (calibrate), "colorimeter-kind");
+ calibrate->priv->sensor_client_kind = gcm_sensor_get_kind (sensor);
+ g_object_notify (G_OBJECT (calibrate), "sensor_client-kind");
}
/**
@@ -1395,12 +1395,12 @@ gcm_calibrate_class_init (GcmCalibrateClass *klass)
g_object_class_install_property (object_class, PROP_DEVICE_KIND, pspec);
/**
- * GcmCalibrate:colorimeter-kind:
+ * GcmCalibrate:sensor_client-kind:
*/
- pspec = g_param_spec_uint ("colorimeter-kind", NULL, NULL,
+ pspec = g_param_spec_uint ("sensor_client-kind", NULL, NULL,
0, G_MAXUINT, 0,
G_PARAM_READABLE);
- g_object_class_install_property (object_class, PROP_COLORIMETER_KIND, pspec);
+ g_object_class_install_property (object_class, PROP_SENSOR_CLIENT_KIND, pspec);
/**
* GcmCalibrate:output-name:
@@ -1534,7 +1534,7 @@ gcm_calibrate_init (GcmCalibrate *calibrate)
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;
- calibrate->priv->colorimeter = gcm_colorimeter_new ();
+ calibrate->priv->sensor_client = gcm_sensor_client_new ();
calibrate->priv->dmi = gcm_dmi_new ();
calibrate->priv->calibrate_dialog = gcm_calibrate_dialog_new ();
@@ -1545,12 +1545,12 @@ gcm_calibrate_init (GcmCalibrate *calibrate)
calibrate->priv->settings = g_settings_new (GCM_SETTINGS_SCHEMA);
/* coldplug, and watch for changes */
- calibrate->priv->colorimeter_kind = GCM_SENSOR_KIND_UNKNOWN;
- sensor = gcm_colorimeter_get_sensor (calibrate->priv->colorimeter);
+ calibrate->priv->sensor_client_kind = GCM_SENSOR_KIND_UNKNOWN;
+ sensor = gcm_sensor_client_get_sensor (calibrate->priv->sensor_client);
if (sensor != NULL)
- calibrate->priv->colorimeter_kind = gcm_sensor_get_kind (sensor);
+ calibrate->priv->sensor_client_kind = gcm_sensor_get_kind (sensor);
- g_signal_connect (calibrate->priv->colorimeter, "changed", G_CALLBACK (gcm_prefs_colorimeter_changed_cb), calibrate);
+ g_signal_connect (calibrate->priv->sensor_client, "changed", G_CALLBACK (gcm_prefs_sensor_client_changed_cb), calibrate);
}
/**
@@ -1573,10 +1573,10 @@ gcm_calibrate_finalize (GObject *object)
g_free (priv->device);
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);
+ g_signal_handlers_disconnect_by_func (calibrate->priv->sensor_client, G_CALLBACK (gcm_prefs_sensor_client_changed_cb), calibrate);
if (priv->xyz != NULL)
g_object_unref (priv->xyz);
- g_object_unref (priv->colorimeter);
+ g_object_unref (priv->sensor_client);
g_object_unref (priv->dmi);
g_object_unref (priv->calibrate_dialog);
g_object_unref (priv->settings);
diff --git a/src/gcm-picker.c b/src/gcm-picker.c
index 5049868..45ab5cd 100644
--- a/src/gcm-picker.c
+++ b/src/gcm-picker.c
@@ -33,7 +33,7 @@
#include "egg-debug.h"
#include "gcm-calibrate-argyll.h"
-#include "gcm-colorimeter.h"
+#include "gcm-sensor-client.h"
#include "gcm-profile-store.h"
#include "gcm-utils.h"
#include "gcm-xyz.h"
@@ -256,10 +256,10 @@ gcm_picker_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
}
/**
- * gcm_picker_colorimeter_setup_ui:
+ * gcm_picker_sensor_client_setup_ui:
**/
static void
-gcm_picker_colorimeter_setup_ui (GcmColorimeter *colorimeter)
+gcm_picker_sensor_client_setup_ui (GcmSensorClient *sensor_client)
{
gboolean present;
gboolean supports_spot;
@@ -267,21 +267,21 @@ gcm_picker_colorimeter_setup_ui (GcmColorimeter *colorimeter)
GtkWidget *widget;
/* no present */
- present = gcm_colorimeter_get_present (colorimeter);
+ present = gcm_sensor_client_get_present (sensor_client);
if (!present) {
/* TRANSLATORS: this is displayed the user has not got suitable hardware */
- gtk_label_set_label (GTK_LABEL (info_bar_hardware_label), _("No colorimeter is attached."));
+ gtk_label_set_label (GTK_LABEL (info_bar_hardware_label), _("No sensor_client is attached."));
goto out;
}
/* no support */
- supports_spot = gcm_sensor_supports_spot (gcm_colorimeter_get_sensor (colorimeter));
+ supports_spot = gcm_sensor_supports_spot (gcm_sensor_client_get_sensor (sensor_client));
ret = (present && supports_spot);
/* change the label */
if (present && !supports_spot) {
/* TRANSLATORS: this is displayed the user has not got suitable hardware */
- gtk_label_set_label (GTK_LABEL (info_bar_hardware_label), _("The attached colorimeter is not capable of reading a spot color."));
+ gtk_label_set_label (GTK_LABEL (info_bar_hardware_label), _("The attached sensor_client is not capable of reading a spot color."));
} else if (!present) {
}
@@ -294,12 +294,12 @@ out:
}
/**
- * gcm_picker_colorimeter_changed_cb:
+ * gcm_picker_sensor_client_changed_cb:
**/
static void
-gcm_picker_colorimeter_changed_cb (GcmColorimeter *colorimeter, gpointer user_data)
+gcm_picker_sensor_client_changed_cb (GcmSensorClient *sensor_client, gpointer user_data)
{
- gcm_picker_colorimeter_setup_ui (colorimeter);
+ gcm_picker_sensor_client_setup_ui (sensor_client);
}
/**
@@ -478,7 +478,7 @@ main (int argc, char *argv[])
GtkWidget *main_window;
GtkWidget *widget;
guint xid = 0;
- GcmColorimeter *colorimeter = NULL;
+ GcmSensorClient *sensor_client = NULL;
const GOptionEntry options[] = {
{ "parent-window", 'p', 0, G_OPTION_ARG_INT, &xid,
@@ -546,8 +546,8 @@ main (int argc, char *argv[])
GCM_DATA G_DIR_SEPARATOR_S "icons");
/* use the color device */
- colorimeter = gcm_colorimeter_new ();
- g_signal_connect (colorimeter, "changed", G_CALLBACK (gcm_picker_colorimeter_changed_cb), NULL);
+ sensor_client = gcm_sensor_client_new ();
+ g_signal_connect (sensor_client, "changed", G_CALLBACK (gcm_picker_sensor_client_changed_cb), NULL);
/* set the parent window if it is specified */
if (xid != 0) {
@@ -573,7 +573,7 @@ main (int argc, char *argv[])
gtk_box_pack_start (GTK_BOX(widget), info_bar_hardware, FALSE, FALSE, 0);
/* disable some ui if no hardware */
- gcm_picker_colorimeter_setup_ui (colorimeter);
+ gcm_picker_sensor_client_setup_ui (sensor_client);
/* maintain a list of profiles */
profile_store = gcm_profile_store_new ();
@@ -603,8 +603,8 @@ out:
g_object_unref (application);
if (profile_store != NULL)
g_object_unref (profile_store);
- if (colorimeter != NULL)
- g_object_unref (colorimeter);
+ if (sensor_client != NULL)
+ g_object_unref (sensor_client);
if (calibrate != NULL)
g_object_unref (calibrate);
if (builder != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]