From: joncruz Date: Sat, 1 Apr 2006 18:58:38 +0000 (+0000) Subject: Introducing optional LittleCms use. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ac57bf96045ac2c465a3b9df5daba43e03e8b3e1;p=inkscape.git Introducing optional LittleCms use. --- diff --git a/ChangeLog b/ChangeLog index 9b6579cb2..f10be2c81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-03-28 Jon A. Cruz + + * configure.ca, src/interface.cpp, src/dialogs/swatches.cpp: + + Introducing optional LittleCms use. + 2006-03-31 MenTaLguY * src/dyna-draw-context.cpp, src/dyna-draw-context.cpp: diff --git a/src/dialogs/swatches.cpp b/src/dialogs/swatches.cpp index ab4fa35ad..a4b9a0d7d 100644 --- a/src/dialogs/swatches.cpp +++ b/src/dialogs/swatches.cpp @@ -97,8 +97,10 @@ typedef enum { } colorFlavorType; static const GtkTargetEntry sourceColorEntries[] = { +#if ENABLE_LCMS // {"application/x-inkscape-color-id", GTK_TARGET_SAME_APP, APP_X_INKY_COLOR_ID}, {"application/x-inkscape-color", 0, APP_X_INKY_COLOR}, +#endif // ENABLE_LCMS {"application/x-color", 0, APP_X_COLOR}, {"text/plain", 0, TEXT_DATA}, }; @@ -231,8 +233,10 @@ static void dieDieDie( GtkObject *obj, gpointer user_data ) } static const GtkTargetEntry destColorTargets[] = { +#if ENABLE_LCMS // {"application/x-inkscape-color-id", GTK_TARGET_SAME_APP, APP_X_INKY_COLOR_ID}, {"application/x-inkscape-color", 0, APP_X_INKY_COLOR}, +#endif // ENABLE_LCMS {"application/x-color", 0, APP_X_COLOR}, }; diff --git a/src/interface.cpp b/src/interface.cpp index 3ff25c8fb..212a7b9a0 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -54,6 +54,9 @@ #include "message-context.h" // Added for color drag-n-drop +#if ENABLE_LCMS +#include "lcms.h" +#endif // ENABLE_LCMS #include "display/sp-canvas.h" #include "color.h" #include "svg/svg-color.h" @@ -85,7 +88,9 @@ static GtkTargetEntry ui_drop_target_entries [] = { {"image/svg", 0, SVG_DATA}, {"image/png", 0, PNG_DATA}, {"image/jpeg", 0, JPEG_DATA}, +#if ENABLE_LCMS {"application/x-inkscape-color", 0, APP_X_INKY_COLOR}, +#endif // ENABLE_LCMS {"application/x-color", 0, APP_X_COLOR} }; @@ -976,6 +981,7 @@ sp_ui_drag_data_received(GtkWidget *widget, gpointer user_data) { switch (info) { +#if ENABLE_LCMS case APP_X_INKY_COLOR: { SPDesktop *desktop = SP_ACTIVE_DESKTOP; @@ -988,6 +994,8 @@ sp_ui_drag_data_received(GtkWidget *widget, if ( item ) { if ( data->length >= 8 ) { + cmsHPROFILE srgbProf = cmsCreate_sRGBProfile(); + gchar c[64] = {0}; // Careful about endian issues. guint16* dataVals = (guint16*)data->data; @@ -1032,10 +1040,15 @@ sp_ui_drag_data_received(GtkWidget *widget, SPDocument *doc = SP_ACTIVE_DOCUMENT; sp_document_done( doc ); + + if ( srgbProf ) { + cmsCloseProfile( srgbProf ); + } } } } break; +#endif // ENABLE_LCMS case APP_X_COLOR: {