[gnome-color-manager] trivial: add skeleton code to create a .cal file
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-color-manager] trivial: add skeleton code to create a .cal file
- Date: Mon, 28 Nov 2011 21:35:13 +0000 (UTC)
commit d311beb19db22088afdf13d3b7dc017f2e8f36b4
Author: Richard Hughes <richard hughsie com>
Date: Mon Nov 28 16:36:43 2011 +0000
trivial: add skeleton code to create a .cal file
src/gcm-calibrate-helper.c | 29 +++++++++++++++++++++++++++++
src/gcm-calibrate.c | 14 ++++++++++++++
src/gcm-calibrate.h | 5 +++++
3 files changed, 48 insertions(+), 0 deletions(-)
---
diff --git a/src/gcm-calibrate-helper.c b/src/gcm-calibrate-helper.c
index 5697d58..07bc11d 100644
--- a/src/gcm-calibrate-helper.c
+++ b/src/gcm-calibrate-helper.c
@@ -168,6 +168,35 @@ main (int argc, char **argv)
/* success */
g_print ("%s: %s\n", _("Wrote file"), argv[2]);
+ } else if (argc == 2 &&
+ g_str_has_suffix (argv[1], "cal")) {
+
+ /* setup calibration */
+ calibrate = gcm_calibrate_new ();
+ ret = gcm_calibrate_setup_sensor (client,
+ calibrate,
+ &error);
+ if (!ret)
+ goto out;
+
+ /* mark device to be profiled in colord */
+ ret = cd_device_profiling_inhibit_sync (device,
+ NULL,
+ &error);
+ if (!ret)
+ goto out;
+
+ /* create a .cal file */
+ ret = gcm_calibrate_display_calibration (calibrate,
+ argv[1],
+ device,
+ NULL, /* window */
+ &error);
+ if (!ret)
+ goto out;
+
+ /* success */
+ g_print ("%s: %s\n", _("Wrote file"), argv[1]);
} else {
ret = FALSE;
g_set_error_literal (&error, 1, 0,
diff --git a/src/gcm-calibrate.c b/src/gcm-calibrate.c
index b9f6c9d..50385e0 100644
--- a/src/gcm-calibrate.c
+++ b/src/gcm-calibrate.c
@@ -805,6 +805,20 @@ out:
return ret;
}
+
+/**
+ * gcm_calibrate_display_calibration:
+ **/
+gboolean
+gcm_calibrate_display_calibration (GcmCalibrate *calibrate,
+ const gchar *cal_fn,
+ CdDevice *device,
+ GtkWindow *window,
+ GError **error)
+{
+ return TRUE;
+}
+
/**
* gcm_calibrate_set_brightness:
**/
diff --git a/src/gcm-calibrate.h b/src/gcm-calibrate.h
index cd090f1..c5df8a0 100644
--- a/src/gcm-calibrate.h
+++ b/src/gcm-calibrate.h
@@ -170,6 +170,11 @@ gboolean gcm_calibrate_display_characterize (GcmCalibrate *calibrate,
CdDevice *device,
GtkWindow *window,
GError **error);
+gboolean gcm_calibrate_display_calibration (GcmCalibrate *calibrate,
+ const gchar *cal_fn,
+ CdDevice *device,
+ GtkWindow *window,
+ GError **error);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]