From: joncruz Date: Sat, 26 Sep 2009 22:30:32 +0000 (+0000) Subject: Fixed Win32 code for MS Windows-specific color profile location. Fixes bug #214198. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f768d41da941d9f7aa2c9cff18f62eb746f4d1a6;p=inkscape.git Fixed Win32 code for MS Windows-specific color profile location. Fixes bug #214198. --- diff --git a/build.xml b/build.xml index 195643751..384251fc6 100644 --- a/build.xml +++ b/build.xml @@ -499,6 +499,7 @@ -lgc -lws2_32 -lintl -lgdi32 -lcomdlg32 -lm -lgomp -lpthreadGC2 -laspell + -lmscms @@ -553,6 +554,7 @@ -lgc -lws2_32 -lintl -lgdi32 -lcomdlg32 -lm -lgomp -lpthreadGC2 + -lmscms @@ -604,6 +606,7 @@ -lgc -lws2_32 -lintl -lgdi32 -lcomdlg32 -lm -lgomp -lpthreadGC2 + -lmscms diff --git a/src/color-profile.cpp b/src/color-profile.cpp index 5868a9582..6e180ab4f 100644 --- a/src/color-profile.cpp +++ b/src/color-profile.cpp @@ -1,4 +1,6 @@ - +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif //#define DEBUG_LCMS @@ -12,10 +14,17 @@ #include #include -// #ifdef WIN32 -// #include -// #include -// #endif + +#ifdef WIN32 +#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. +#define _WIN32_WINDOWS 0x0410 +#endif +#if ENABLE_LCMS +#else +#include +#endif // ENABLE_LCMS +#endif + #include "xml/repr.h" #include "color-profile.h" #include "color-profile-fns.h" @@ -27,6 +36,9 @@ #include "dom/uri.h" #include "dom/util/digest.h" +#ifdef WIN32 +#include +#endif // WIN32 using Inkscape::ColorProfile; using Inkscape::ColorProfileClass; @@ -604,21 +616,21 @@ std::list ColorProfile::getProfileDirs() { } -// #ifdef WIN32 -// wchar_t pathBuf[MAX_PATH + 1]; -// pathBuf[0] = 0; -// DWORD pathSize = sizeof(pathBuf); -// g_assert(sizeof(wchar_t) == sizeof(gunichar2)); -// if ( GetColorDirectoryW( NULL, &pathBuf, &pathSize ) ) { -// gchar * utf8Path = g_utf16_to_utf8( (gunichar2*)(&pathBuf[0]), -1, NULL, NULL, NULL ); -// if ( !g_utf8_validate(utf8Path, -1, NULL) ) { -// g_warning( "GetColorDirectoryW() resulted in invalid UTF-8" ); -// } else { -// sources.pushback(utf8Path); -// } -// g_free( utf8Path ); -// } -// #endif // WIN32 +#ifdef WIN32 + wchar_t pathBuf[MAX_PATH + 1]; + pathBuf[0] = 0; + DWORD pathSize = sizeof(pathBuf); + g_assert(sizeof(wchar_t) == sizeof(gunichar2)); + if ( GetColorDirectoryW( NULL, pathBuf, &pathSize ) ) { + gchar * utf8Path = g_utf16_to_utf8( (gunichar2*)(&pathBuf[0]), -1, NULL, NULL, NULL ); + if ( !g_utf8_validate(utf8Path, -1, NULL) ) { + g_warning( "GetColorDirectoryW() resulted in invalid UTF-8" ); + } else { + sources.push_back(utf8Path); + } + g_free( utf8Path ); + } +#endif // WIN32 return sources; }