[gnome-color-manager] Add support for 100% gray colorspaces
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-color-manager] Add support for 100% gray colorspaces
- Date: Wed, 22 Sep 2010 16:56:09 +0000 (UTC)
commit e81ac44dbe8d0b9a508f6b9cc82abe44d5e3742f
Author: Richard Hughes <richard hughsie com>
Date: Wed Sep 22 17:56:26 2010 +0100
Add support for 100% gray colorspaces
data/gcm-prefs.ui | 41 ++++++++++++++++++++++++++++++
data/org.gnome.color-manager.gschema.xml | 5 +++
src/cc-color-panel.c | 10 +++++++
src/gcm-session.c | 2 +
src/gcm-utils.h | 1 +
src/org.gnome.ColorManager.xml | 11 ++++++++
6 files changed, 70 insertions(+), 0 deletions(-)
---
diff --git a/data/gcm-prefs.ui b/data/gcm-prefs.ui
index 86f5025..a3043a1 100644
--- a/data/gcm-prefs.ui
+++ b/data/gcm-prefs.ui
@@ -8,6 +8,7 @@
<widget name="combobox_rendering_display"/>
<widget name="combobox_space_cmyk"/>
<widget name="combobox_space_rgb"/>
+ <widget name="combobox_space_gray"/>
</widgets>
</object>
<object class="GtkSizeGroup" id="sizegroup_devices">
@@ -22,6 +23,7 @@
<widgets>
<widget name="hbox43"/>
<widget name="hbox46"/>
+ <widget name="hbox6"/>
<widget name="hbox15"/>
<widget name="hbox17"/>
</widgets>
@@ -1357,6 +1359,45 @@
<property name="position">2</property>
</packing>
</child>
+ <child>
+ <object class="GtkHBox" id="hbox5">
+ <property name="visible">True</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkHBox" id="hbox6">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkLabel" id="label_space_gray">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes" comments="Technical color word for softproof rendering intent">Gray:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="combobox_space_gray">
+ <property name="visible">True</property>
+ <property name="tooltip_text" translatable="yes">This is the default gray working space to use in applications</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">3</property>
+ </packing>
+ </child>
</object>
</child>
</object>
diff --git a/data/org.gnome.color-manager.gschema.xml b/data/org.gnome.color-manager.gschema.xml
index d39632b..06c3de9 100644
--- a/data/org.gnome.color-manager.gschema.xml
+++ b/data/org.gnome.color-manager.gschema.xml
@@ -70,6 +70,11 @@
<summary>The default CMYK profile</summary>
<description>The CMYK profile filename to be used by applications by default.</description>
</key>
+ <key name="colorspace-gray" type="s">
+ <default>'/usr/share/color/icc/Argyll/Gray.icc'</default>
+ <summary>The default gray profile</summary>
+ <description>The gray profile filename to be used by applications by default.</description>
+ </key>
<key name="calibration-length" enum="org.gnome.color-manager.CalibrationLength">
<default>'ask'</default>
<summary>The default calibration length</summary>
diff --git a/src/cc-color-panel.c b/src/cc-color-panel.c
index d8f8e4c..2788c59 100644
--- a/src/cc-color-panel.c
+++ b/src/cc-color-panel.c
@@ -2314,6 +2314,7 @@ cc_color_panel_startup_idle_cb (CcColorPanel *panel)
GError *error = NULL;
gchar *colorspace_rgb;
gchar *colorspace_cmyk;
+ gchar *colorspace_gray;
gint intent_display = -1;
gint intent_softproof = -1;
GcmProfileSearchFlags search_flags = GCM_PROFILE_STORE_SEARCH_ALL;
@@ -2345,6 +2346,15 @@ cc_color_panel_startup_idle_cb (CcColorPanel *panel)
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (cc_color_panel_space_combo_changed_cb), panel);
+ /* setup gray combobox */
+ widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "combobox_space_gray"));
+ colorspace_gray = g_settings_get_string (panel->priv->settings, GCM_SETTINGS_COLORSPACE_GRAY);
+ cc_color_panel_set_combo_simple_text (widget);
+ cc_color_panel_setup_space_combobox (panel, widget, GCM_COLORSPACE_GRAY, colorspace_gray);
+ g_object_set_data (G_OBJECT(widget), "GCM:GSettingsKey", (gpointer) GCM_SETTINGS_COLORSPACE_GRAY);
+ g_signal_connect (G_OBJECT (widget), "changed",
+ G_CALLBACK (cc_color_panel_space_combo_changed_cb), panel);
+
/* setup rendering lists */
widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "combobox_rendering_display"));
cc_color_panel_set_combo_simple_text (widget);
diff --git a/src/gcm-session.c b/src/gcm-session.c
index eef3dcd..9e1ad51 100644
--- a/src/gcm-session.c
+++ b/src/gcm-session.c
@@ -589,6 +589,8 @@ gcm_session_handle_get_property (GDBusConnection *connection_, const gchar *send
retval = g_settings_get_value (settings, GCM_SETTINGS_COLORSPACE_RGB);
} else if (g_strcmp0 (property_name, "ColorspaceCmyk") == 0) {
retval = g_settings_get_value (settings, GCM_SETTINGS_COLORSPACE_CMYK);
+ } else if (g_strcmp0 (property_name, "ColorspaceGray") == 0) {
+ retval = g_settings_get_value (settings, GCM_SETTINGS_COLORSPACE_GRAY);
}
/* reset time */
diff --git a/src/gcm-utils.h b/src/gcm-utils.h
index a2bcd97..9eac806 100644
--- a/src/gcm-utils.h
+++ b/src/gcm-utils.h
@@ -42,6 +42,7 @@
#define GCM_SETTINGS_RENDERING_INTENT_SOFTPROOF "rendering-intent-softproof"
#define GCM_SETTINGS_COLORSPACE_RGB "colorspace-rgb"
#define GCM_SETTINGS_COLORSPACE_CMYK "colorspace-cmyk"
+#define GCM_SETTINGS_COLORSPACE_GRAY "colorspace-gray"
#define GCM_SETTINGS_USE_PROFILES_FROM_VOLUMES "use-profiles-from-volumes"
#define GCM_SETTINGS_CALIBRATION_LENGTH "calibration-length"
#define GCM_SETTINGS_SHOW_FINE_TUNING "show-fine-tuning"
diff --git a/src/org.gnome.ColorManager.xml b/src/org.gnome.ColorManager.xml
index 7af0b90..ce5122b 100644
--- a/src/org.gnome.ColorManager.xml
+++ b/src/org.gnome.ColorManager.xml
@@ -70,6 +70,17 @@
</property>
<!--*****************************************************************************************-->
+ <property name='ColorspaceGray' type='s' access='read'>
+ <doc:doc>
+ <doc:description>
+ <doc:para>
+ The default colorspace filename for gray files.
+ </doc:para>
+ </doc:description>
+ </doc:doc>
+ </property>
+
+ <!--*****************************************************************************************-->
<method name='GetProfilesForDevice'>
<annotation name='org.freedesktop.DBus.GLib.Async' value=''/>
<doc:doc>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]