summaryrefslogtreecommitdiffstats
path: root/src/widgets/sp-color-notebook.cpp
diff options
context:
space:
mode:
authorFelipe Corr??a da Silva Sanches <juca@members.fsf.org>2009-12-05 23:30:37 +0000
committerFelipe C. da S. Sanches <juca@members.fsf.org>2009-12-05 23:30:37 +0000
commit34c82e4c01d1f782e6fca1ced0c00b1085a28e07 (patch)
tree846871959b79999d28c93f2b827c0dc3a43d20f8 /src/widgets/sp-color-notebook.cpp
parentadd cxxtests for marker_loc enum. code depends on the exact values of the enu... (diff)
parentUpdating to current trunk (diff)
downloadinkscape-34c82e4c01d1f782e6fca1ced0c00b1085a28e07.tar.gz
inkscape-34c82e4c01d1f782e6fca1ced0c00b1085a28e07.zip
merging gsoc 2009 color management work by Felipe Sanches (a.k.a. JucaBlues)
(bzr r8869)
Diffstat (limited to 'src/widgets/sp-color-notebook.cpp')
-rw-r--r--src/widgets/sp-color-notebook.cpp41
1 files changed, 39 insertions, 2 deletions
diff --git a/src/widgets/sp-color-notebook.cpp b/src/widgets/sp-color-notebook.cpp
index 779895de4..be41f5f0f 100644
--- a/src/widgets/sp-color-notebook.cpp
+++ b/src/widgets/sp-color-notebook.cpp
@@ -32,6 +32,10 @@
#include "sp-color-scales.h"
#include "sp-color-icc-selector.h"
#include "sp-color-wheel-selector.h"
+#include "svg/svg-icc-color.h"
+#include "../inkscape.h"
+#include "../document.h"
+#include "../profile-manager.h"
struct SPColorNotebookTracker {
const gchar* name;
@@ -324,9 +328,29 @@ void ColorNotebook::init()
row++;
- /* Create RGBA entry and color preview */
GtkWidget *rgbabox = gtk_hbox_new (FALSE, 0);
+#if ENABLE_LCMS
+ /* Create color management icons */
+ _box_colormanaged = gtk_event_box_new ();
+ GtkWidget *colormanaged = gtk_image_new_from_icon_name ("color-management-icon", GTK_ICON_SIZE_SMALL_TOOLBAR);
+ gtk_container_add (GTK_CONTAINER (_box_colormanaged), colormanaged);
+ GtkTooltips *tooltips_colormanaged = gtk_tooltips_new ();
+ gtk_tooltips_set_tip (tooltips_colormanaged, _box_colormanaged, _("Color Managed"), "");
+ gtk_widget_set_sensitive (_box_colormanaged, false);
+ gtk_box_pack_start(GTK_BOX(rgbabox), _box_colormanaged, FALSE, FALSE, 2);
+
+ _box_outofgamut = gtk_event_box_new ();
+ GtkWidget *outofgamut = gtk_image_new_from_icon_name ("out-of-gamut-icon", GTK_ICON_SIZE_SMALL_TOOLBAR);
+ gtk_container_add (GTK_CONTAINER (_box_outofgamut), outofgamut);
+ GtkTooltips *tooltips_outofgamut = gtk_tooltips_new ();
+ gtk_tooltips_set_tip (tooltips_outofgamut, _box_outofgamut, _("Out of gamut!"), "");
+ gtk_widget_set_sensitive (_box_outofgamut, false);
+ gtk_box_pack_start(GTK_BOX(rgbabox), _box_outofgamut, FALSE, FALSE, 2);
+
+#endif //ENABLE_LCMS
+
+ /* Create RGBA entry and color preview */
_rgbal = gtk_label_new_with_mnemonic (_("RGBA_:"));
gtk_misc_set_alignment (GTK_MISC (_rgbal), 1.0, 0.5);
gtk_box_pack_start(GTK_BOX(rgbabox), _rgbal, TRUE, TRUE, 2);
@@ -341,7 +365,7 @@ void ColorNotebook::init()
sp_set_font_size_smaller (rgbabox);
gtk_widget_show_all (rgbabox);
- gtk_table_attach (GTK_TABLE (table), rgbabox, 1, 2, row, row + 1, GTK_FILL, GTK_SHRINK, XPAD, YPAD);
+ gtk_table_attach (GTK_TABLE (table), rgbabox, 0, 2, row, row + 1, GTK_FILL, GTK_SHRINK, XPAD, YPAD);
#ifdef SPCS_PREVIEW
_p = sp_color_preview_new (0xffffffff);
@@ -485,6 +509,19 @@ void ColorNotebook::_updateRgbaEntry( const SPColor& color, gfloat alpha )
{
g_return_if_fail( ( 0.0 <= alpha ) && ( alpha <= 1.0 ) );
+#if ENABLE_LCMS
+ /* update color management icon*/
+ gtk_widget_set_sensitive (_box_colormanaged, color.icc != NULL);
+
+ /* update out-of-gamut icon */
+ gtk_widget_set_sensitive (_box_outofgamut, false);
+ if (color.icc){
+ Inkscape::ColorProfile* target_profile = SP_ACTIVE_DOCUMENT->profileManager->find(color.icc->colorProfile.c_str());
+ if ( target_profile )
+ gtk_widget_set_sensitive (_box_outofgamut, target_profile->GamutCheck(color));
+ }
+#endif //ENABLE_LCMS
+
if ( !_updatingrgba )
{
gchar s[32];