summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2011-07-10 07:13:05 +0000
committerJon A. Cruz <jon@joncruz.org>2011-07-10 07:13:05 +0000
commitdf7bda1a8b9d4a1c6f0fd4b82cdeb614eb1ea8d2 (patch)
tree7e530343b12dd9ec752c6171c82f6108714c9acf /src/widgets
parentMerge upstream GDL: GNOME_2_30_0 (diff)
downloadinkscape-df7bda1a8b9d4a1c6f0fd4b82cdeb614eb1ea8d2.tar.gz
inkscape-df7bda1a8b9d4a1c6f0fd4b82cdeb614eb1ea8d2.zip
Refactored to abstract lcms usage more. Added CMSSystem class.
(bzr r10437)
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/desktop-widget.cpp8
-rw-r--r--src/widgets/sp-color-icc-selector.cpp10
-rw-r--r--src/widgets/sp-color-notebook.cpp10
3 files changed, 16 insertions, 12 deletions
diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp
index 52008625a..34c3ab75a 100644
--- a/src/widgets/desktop-widget.cpp
+++ b/src/widgets/desktop-widget.cpp
@@ -28,7 +28,7 @@
#include <gtk/gtk.h>
#include "box3d-context.h"
-#include "color-profile-fns.h"
+#include "cms-system.h"
#include "conn-avoid-ref.h"
#include "desktop-events.h"
#include "desktop-handles.h"
@@ -193,7 +193,7 @@ void CMSPrefWatcher::hook(EgeColorProfTracker */*tracker*/, gint screen, gint mo
guint len = 0;
ege_color_prof_tracker_get_profile_for( screen, monitor, reinterpret_cast<gpointer*>(&buf), &len );
- Glib::ustring id = Inkscape::colorprofile_set_display_per( buf, len, screen, monitor );
+ Glib::ustring id = Inkscape::CMSSystem::setDisplayPer( buf, len, screen, monitor );
#endif // ENABLE_LCMS
}
@@ -540,7 +540,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
#if ENABLE_LCMS
bool fromDisplay = prefs->getBool( "/options/displayprofile/from_display");
if ( fromDisplay ) {
- Glib::ustring id = Inkscape::colorprofile_get_display_id( 0, 0 );
+ Glib::ustring id = Inkscape::CMSSystem::getDisplayId( 0, 0 );
bool enabled = false;
if ( dtw->canvas->cms_key ) {
@@ -805,7 +805,7 @@ void sp_dtw_color_profile_event(EgeColorProfTracker */*tracker*/, SPDesktopWidge
GdkScreen* screen = gtk_widget_get_screen(GTK_WIDGET(dtw));
gint screenNum = gdk_screen_get_number(screen);
gint monitor = gdk_screen_get_monitor_at_window(screen, gtk_widget_get_toplevel(GTK_WIDGET(dtw))->window);
- Glib::ustring id = Inkscape::colorprofile_get_display_id( screenNum, monitor );
+ Glib::ustring id = Inkscape::CMSSystem::getDisplayId( screenNum, monitor );
bool enabled = false;
if ( dtw->canvas->cms_key ) {
*(dtw->canvas->cms_key) = id;
diff --git a/src/widgets/sp-color-icc-selector.cpp b/src/widgets/sp-color-icc-selector.cpp
index 9e5291cc4..888cc2629 100644
--- a/src/widgets/sp-color-icc-selector.cpp
+++ b/src/widgets/sp-color-icc-selector.cpp
@@ -15,9 +15,9 @@
#define noDEBUG_LCMS
#if ENABLE_LCMS
-#include "color-profile-fns.h"
-#include "color-profile-cms-fns.h"
#include "color-profile.h"
+#include "cms-system.h"
+#include "color-profile-cms-fns.h"
#ifdef DEBUG_LCMS
#include "preferences.h"
@@ -259,6 +259,12 @@ void getThings( DWORD space, gchar const**& namers, gchar const**& tippies, guin
tippies = tips[index];
scalies = scales[index];
}
+
+
+void getThings( Inkscape::ColorProfile *prof, gchar const**& namers, gchar const**& tippies, guint const*& scalies ) {
+ getThings( asICColorSpaceSig(prof->getColorSpace()), namers, tippies, scalies );
+}
+
#endif // ENABLE_LCMS
diff --git a/src/widgets/sp-color-notebook.cpp b/src/widgets/sp-color-notebook.cpp
index 546f7838b..1324e0b16 100644
--- a/src/widgets/sp-color-notebook.cpp
+++ b/src/widgets/sp-color-notebook.cpp
@@ -36,11 +36,9 @@
#include "../document.h"
#include "../profile-manager.h"
#include "color-profile.h"
-#include "color-profile-fns.h"
-#if ENABLE_LCMS
-//#include "lcms.h"
-//#include "color-profile-cms-fns.h"
-#endif // ENABLE_LCMS
+#include "cms-system.h"
+
+using Inkscape::CMSSystem;
struct SPColorNotebookTracker {
const gchar* name;
@@ -540,7 +538,7 @@ void ColorNotebook::_updateRgbaEntry( const SPColor& color, gfloat alpha )
gtk_widget_set_sensitive (_box_toomuchink, false);
if (color.icc){
Inkscape::ColorProfile* prof = SP_ACTIVE_DOCUMENT->profileManager->find(color.icc->colorProfile.c_str());
- if ( prof && colorprofile_isPrintColorSpace(prof) ) {
+ if ( prof && CMSSystem::isPrintColorSpace(prof) ) {
gtk_widget_show(GTK_WIDGET(_box_toomuchink));
double ink_sum = 0;
for (unsigned int i=0; i<color.icc->colors.size(); i++){