2 * Image Color Management
4 * Copyright 2004 Marcus Meissner
5 * Copyright 2008 Hans Leidekker
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
32 #include "wine/debug.h"
33 #include "wine/unicode.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(icm
);
38 /***********************************************************************
39 * EnumICMProfilesA (GDI32.@)
41 INT WINAPI
EnumICMProfilesA(HDC hdc
, ICMENUMPROCA func
, LPARAM lparam
)
43 FIXME("%p, %p, 0x%08lx stub\n", hdc
, func
, lparam
);
47 /***********************************************************************
48 * EnumICMProfilesW (GDI32.@)
50 INT WINAPI
EnumICMProfilesW(HDC hdc
, ICMENUMPROCW func
, LPARAM lparam
)
52 FIXME("%p, %p, 0x%08lx stub\n", hdc
, func
, lparam
);
56 /**********************************************************************
57 * GetICMProfileA (GDI32.@)
59 * Returns the filename of the specified device context's color
60 * management profile, even if color management is not enabled
64 * TRUE if filename is copied successfully.
65 * FALSE if the buffer length pointed to by size is too small.
68 * How does Windows assign these? Some registry key?
70 BOOL WINAPI
GetICMProfileA(HDC hdc
, LPDWORD size
, LPSTR filename
)
72 WCHAR filenameW
[MAX_PATH
];
73 DWORD buflen
= MAX_PATH
;
76 TRACE("%p, %p, %p\n", hdc
, size
, filename
);
78 if (!hdc
|| !size
|| !filename
) return FALSE
;
80 if (GetICMProfileW(hdc
, &buflen
, filenameW
))
82 int len
= WideCharToMultiByte(CP_ACP
, 0, filenameW
, -1, NULL
, 0, NULL
, NULL
);
85 WideCharToMultiByte(CP_ACP
, 0, filenameW
, -1, filename
, *size
, NULL
, NULL
);
88 else SetLastError(ERROR_INSUFFICIENT_BUFFER
);
94 /**********************************************************************
95 * GetICMProfileW (GDI32.@)
97 BOOL WINAPI
GetICMProfileW(HDC hdc
, LPDWORD size
, LPWSTR filename
)
100 WCHAR systemdir
[MAX_PATH
];
101 static const WCHAR profile
[] =
102 {'\\','s','p','o','o','l','\\','d','r','i','v','e','r','s',
103 '\\','c','o','l','o','r','\\','s','R','G','B',' ','C','o','l','o','r',' ',
104 'S','p','a','c','e',' ','P','r','o','f','i','l','e','.','i','c','m',0};
106 TRACE("%p, %p, %p\n", hdc
, size
, filename
);
108 if (!hdc
|| !size
) return FALSE
;
110 required
= GetSystemDirectoryW(systemdir
, MAX_PATH
);
111 required
+= sizeof(profile
) / sizeof(WCHAR
);
113 if (*size
< required
)
116 SetLastError(ERROR_INSUFFICIENT_BUFFER
);
121 strcpyW(filename
, systemdir
);
122 strcatW(filename
, profile
);
124 if (GetFileAttributesW(filename
) == INVALID_FILE_ATTRIBUTES
)
125 WARN("color profile not found\n");
131 /**********************************************************************
132 * GetLogColorSpaceA (GDI32.@)
134 BOOL WINAPI
GetLogColorSpaceA(HCOLORSPACE colorspace
, LPLOGCOLORSPACEA buffer
, DWORD size
)
136 FIXME("%p %p 0x%08x stub\n", colorspace
, buffer
, size
);
140 /**********************************************************************
141 * GetLogColorSpaceW (GDI32.@)
143 BOOL WINAPI
GetLogColorSpaceW(HCOLORSPACE colorspace
, LPLOGCOLORSPACEW buffer
, DWORD size
)
145 FIXME("%p %p 0x%08x stub\n", colorspace
, buffer
, size
);
149 /**********************************************************************
150 * SetICMProfileA (GDI32.@)
152 BOOL WINAPI
SetICMProfileA(HDC hdc
, LPSTR filename
)
154 FIXME("%p %s stub\n", hdc
, debugstr_a(filename
));
158 /**********************************************************************
159 * SetICMProfileW (GDI32.@)
161 BOOL WINAPI
SetICMProfileW(HDC hdc
, LPWSTR filename
)
163 FIXME("%p %s stub\n", hdc
, debugstr_w(filename
));
167 /**********************************************************************
168 * UpdateICMRegKeyA (GDI32.@)
170 BOOL WINAPI
UpdateICMRegKeyA(DWORD reserved
, LPSTR cmid
, LPSTR filename
, UINT command
)
172 FIXME("0x%08x, %s, %s, 0x%08x stub\n", reserved
, debugstr_a(cmid
), debugstr_a(filename
), command
);
176 /**********************************************************************
177 * UpdateICMRegKeyW (GDI32.@)
179 BOOL WINAPI
UpdateICMRegKeyW(DWORD reserved
, LPWSTR cmid
, LPWSTR filename
, UINT command
)
181 FIXME("0x%08x, %s, %s, 0x%08x stub\n", reserved
, debugstr_w(cmid
), debugstr_w(filename
), command
);