summaryrefslogtreecommitdiffstats
path: root/src/color-profile.cpp
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2009-09-26 22:30:32 +0000
committerjoncruz <joncruz@users.sourceforge.net>2009-09-26 22:30:32 +0000
commit8ce51ce022794df3396d8495a50148e37f84b3fa (patch)
tree0aa965dc71295c6446a2677b6ea57a728c78d6a9 /src/color-profile.cpp
parentFixed warning (diff)
downloadinkscape-8ce51ce022794df3396d8495a50148e37f84b3fa.tar.gz
inkscape-8ce51ce022794df3396d8495a50148e37f84b3fa.zip
Fixed Win32 code for MS Windows-specific color profile location. Fixes bug #214198.
(bzr r8654)
Diffstat (limited to 'src/color-profile.cpp')
-rw-r--r--src/color-profile.cpp52
1 files changed, 32 insertions, 20 deletions
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 <cstring>
#include <string>
-// #ifdef WIN32
-// #include <windows.h>
-// #include <Icm.h>
-// #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 <windows.h>
+#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 <Icm.h>
+#endif // WIN32
using Inkscape::ColorProfile;
using Inkscape::ColorProfileClass;
@@ -604,21 +616,21 @@ std::list<Glib::ustring> 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;
}