ReactOS 0.4.15-dev-7942-gd23573b
icm.c File Reference
#include <precomp.h>
#include <debug.h>
Include dependency graph for icm.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

HCOLORSPACE FASTCALL IntCreateColorSpaceW (LPLOGCOLORSPACEW lplcpw, BOOL Ascii)
 
HCOLORSPACE WINAPI CreateColorSpaceW (LPLOGCOLORSPACEW lplcpw)
 
HCOLORSPACE WINAPI CreateColorSpaceA (LPLOGCOLORSPACEA lplcpa)
 
HCOLORSPACE WINAPI GetColorSpace (HDC hDC)
 
HCOLORSPACE WINAPI SetColorSpace (HDC hDC, HCOLORSPACE hCS)
 
BOOL WINAPI GetICMProfileA (HDC hdc, LPDWORD pBufSize, LPSTR pszFilename)
 
BOOL WINAPI GetICMProfileW (HDC hdc, LPDWORD size, LPWSTR filename)
 
BOOL WINAPI SetICMProfileA (HDC a0, LPSTR a1)
 
BOOL WINAPI SetICMProfileW (HDC a0, LPWSTR a1)
 
int WINAPI EnumICMProfilesA (HDC a0, ICMENUMPROCA a1, LPARAM a2)
 
int WINAPI EnumICMProfilesW (HDC hDC, ICMENUMPROCW lpEnumICMProfilesFunc, LPARAM lParam)
 
BOOL WINAPI UpdateICMRegKeyA (DWORD a0, LPSTR a1, LPSTR a2, UINT a3)
 
BOOL WINAPI UpdateICMRegKeyW (DWORD a0, LPWSTR a1, LPWSTR a2, UINT a3)
 
int WINAPI SetICMMode (HDC hdc, int iEnableICM)
 
HBITMAP WINAPI GdiConvertBitmapV5 (HBITMAP in_format_BitMap, HBITMAP src_BitMap, INT bpp, INT unuse)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 3 of file icm.c.

Function Documentation

◆ CreateColorSpaceA()

HCOLORSPACE WINAPI CreateColorSpaceA ( LPLOGCOLORSPACEA  lplcpa)

Definition at line 46 of file icm.c.

49{
50 LOGCOLORSPACEW lcpw;
51
52 if ((lplcpa->lcsSignature != LCS_SIGNATURE) ||
53 (lplcpa->lcsVersion != 0x400) ||
54 (lplcpa->lcsSize != sizeof(LOGCOLORSPACEA)))
55 {
57 return NULL;
58 }
59
60 lcpw.lcsSignature = lplcpa->lcsSignature;
61 lcpw.lcsVersion = lplcpa->lcsVersion;
62 lcpw.lcsSize = sizeof(LOGCOLORSPACEW);
63 lcpw.lcsCSType = lplcpa->lcsCSType;
64 lcpw.lcsIntent = lplcpa->lcsIntent;
65 lcpw.lcsEndpoints = lplcpa->lcsEndpoints;
66 lcpw.lcsGammaRed = lplcpa->lcsGammaRed;
67 lcpw.lcsGammaGreen = lplcpa->lcsGammaGreen;
68 lcpw.lcsGammaBlue = lplcpa->lcsGammaBlue;
69
72 NULL,
73 lplcpa->lcsFilename,
74 strlen(lplcpa->lcsFilename) + 1);
75
76 return IntCreateColorSpaceW(&lcpw, FALSE);
77}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define SetLastError(x)
Definition: compat.h:752
#define MAX_PATH
Definition: compat.h:34
_Use_decl_annotations_ NTSTATUS NTAPI RtlMultiByteToUnicodeN(_Out_ PWCH UnicodeString, _In_ ULONG UnicodeSize, _Out_opt_ PULONG ResultSize, _In_ PCCH MbString, _In_ ULONG MbSize)
Definition: nlsboot.c:62
LCSGAMUTMATCH lcsIntent
Definition: wingdi.h:1769
CIEXYZTRIPLE lcsEndpoints
Definition: wingdi.h:1770
DWORD lcsGammaGreen
Definition: wingdi.h:1772
DWORD lcsVersion
Definition: wingdi.h:1766
CHAR lcsFilename[MAX_PATH]
Definition: wingdi.h:1774
LCSCSTYPE lcsCSType
Definition: wingdi.h:1768
DWORD lcsGammaRed
Definition: wingdi.h:1771
DWORD lcsGammaBlue
Definition: wingdi.h:1773
DWORD lcsSignature
Definition: wingdi.h:1765
LCSGAMUTMATCH lcsIntent
Definition: wingdi.h:1781
DWORD lcsGammaBlue
Definition: wingdi.h:1785
LCSCSTYPE lcsCSType
Definition: wingdi.h:1780
DWORD lcsSignature
Definition: wingdi.h:1777
DWORD lcsGammaGreen
Definition: wingdi.h:1784
WCHAR lcsFilename[MAX_PATH]
Definition: wingdi.h:1786
DWORD lcsGammaRed
Definition: wingdi.h:1783
CIEXYZTRIPLE lcsEndpoints
Definition: wingdi.h:1782
DWORD lcsVersion
Definition: wingdi.h:1778
HCOLORSPACE FASTCALL IntCreateColorSpaceW(LPLOGCOLORSPACEW lplcpw, BOOL Ascii)
Definition: icm.c:9
#define ERROR_INVALID_COLORSPACE
Definition: winerror.h:1192
struct tagLOGCOLORSPACEW LOGCOLORSPACEW
#define LCS_SIGNATURE
Definition: wingdi.h:1104

◆ CreateColorSpaceW()

HCOLORSPACE WINAPI CreateColorSpaceW ( LPLOGCOLORSPACEW  lplcpw)

Definition at line 33 of file icm.c.

36{
37 return IntCreateColorSpaceW(lplcpw, FALSE);
38}

◆ EnumICMProfilesA()

int WINAPI EnumICMProfilesA ( HDC  a0,
ICMENUMPROCA  a1,
LPARAM  a2 
)

Definition at line 228 of file icm.c.

233{
234 /*
235 * FIXME - call NtGdiEnumICMProfiles with NULL for lpstrBuffer
236 * to find out how big a buffer we need. Then allocate that buffer
237 * and call NtGdiEnumICMProfiles again to have the buffer filled.
238 *
239 * Finally, step through the buffer ( MULTI-SZ recommended for format ),
240 * and convert each string to ANSI, calling the user's callback function
241 * until we run out of strings or the user returns FALSE
242 */
243
246 return 0;
247}
#define UNIMPLEMENTED
Definition: debug.h:115
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102

◆ EnumICMProfilesW()

int WINAPI EnumICMProfilesW ( HDC  hDC,
ICMENUMPROCW  lpEnumICMProfilesFunc,
LPARAM  lParam 
)

Definition at line 255 of file icm.c.

260{
261 /*
262 * FIXME - call NtGdiEnumICMProfiles with NULL for lpstrBuffer
263 * to find out how big a buffer we need. Then allocate that buffer
264 * and call NtGdiEnumICMProfiles again to have the buffer filled.
265 *
266 * Finally, step through the buffer ( MULTI-SZ recommended for format ),
267 * and call the user's callback function until we run out of strings or
268 * the user returns FALSE
269 */
272 return 0;
273}

◆ GdiConvertBitmapV5()

HBITMAP WINAPI GdiConvertBitmapV5 ( HBITMAP  in_format_BitMap,
HBITMAP  src_BitMap,
INT  bpp,
INT  unuse 
)

Definition at line 337 of file icm.c.

342{
343 /* FIXME guessing the prototypes */
344
345 /*
346 * it have create a new bitmap with desired in format,
347 * then convert it src_bitmap to new format
348 * and return it as HBITMAP
349 */
350
351 return FALSE;
352}

◆ GetColorSpace()

HCOLORSPACE WINAPI GetColorSpace ( HDC  hDC)

Definition at line 84 of file icm.c.

85{
86 PDC_ATTR pDc_Attr;
87
89 {
91 return NULL;
92 }
93 return pDc_Attr->hColorSpace;
94}
static HDC hDC
Definition: 3dtext.c:33
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define GDI_OBJECT_TYPE_DC
Definition: gdi.h:46
PVOID GdiGetHandleUserData(_In_ HGDIOBJ hobj)
Definition: gditools.c:68

Referenced by SetColorSpace().

◆ GetICMProfileA()

BOOL WINAPI GetICMProfileA ( HDC  hdc,
LPDWORD  pBufSize,
LPSTR  pszFilename 
)

Definition at line 137 of file icm.c.

142{
144 DWORD buflen = MAX_PATH;
145 BOOL ret = FALSE;
146
147 if (!hdc || !pBufSize) return FALSE;
148
149 if (GetICMProfileW(hdc, &buflen, filenameW))
150 {
152
153 if (!pszFilename)
154 {
155 *pBufSize = len;
156 return FALSE;
157 }
158
159 if (*pBufSize >= len)
160 {
161 WideCharToMultiByte(CP_ACP, 0, filenameW, -1, pszFilename, *pBufSize, NULL, NULL);
162 ret = TRUE;
163 }
165 *pBufSize = len;
166 }
167
168 return ret;
169}
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define TRUE
Definition: types.h:120
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
HDC hdc
Definition: main.c:9
static const WCHAR filenameW[]
Definition: amstream.c:41
uint32_t ULONG
Definition: typedefs.h:59
int ret
BOOL WINAPI GetICMProfileW(_In_ HDC hdc, _Inout_ LPDWORD pBufSize, _Out_writes_opt_(*pBufSize) LPWSTR pszFilename)
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ GetICMProfileW()

BOOL WINAPI GetICMProfileW ( HDC  hdc,
LPDWORD  size,
LPWSTR  filename 
)

Definition at line 177 of file icm.c.

182{
183 if (!hdc || !size || !filename) return FALSE;
184
187 return FALSE;
188}
GLsizeiptr size
Definition: glext.h:5919
const char * filename
Definition: ioapi.h:137

◆ IntCreateColorSpaceW()

HCOLORSPACE FASTCALL IntCreateColorSpaceW ( LPLOGCOLORSPACEW  lplcpw,
BOOL  Ascii 
)

Definition at line 9 of file icm.c.

13{
14 LOGCOLORSPACEEXW lcpeexw;
15
16 if ((lplcpw->lcsSignature != LCS_SIGNATURE) ||
17 (lplcpw->lcsVersion != 0x400) ||
18 (lplcpw->lcsSize != sizeof(LOGCOLORSPACEW)))
19 {
21 return NULL;
22 }
23 RtlCopyMemory(&lcpeexw.lcsColorSpace, lplcpw, sizeof(LOGCOLORSPACEW));
24
25 return NtGdiCreateColorSpace(&lcpeexw);
26}
__kernel_entry W32KAPI HANDLE APIENTRY NtGdiCreateColorSpace(_In_ PLOGCOLORSPACEEXW pLogColorSpace)
LOGCOLORSPACEW lcsColorSpace
Definition: ntgdi.h:65
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263

Referenced by CreateColorSpaceA(), and CreateColorSpaceW().

◆ SetColorSpace()

HCOLORSPACE WINAPI SetColorSpace ( HDC  hDC,
HCOLORSPACE  hCS 
)

Definition at line 102 of file icm.c.

106{
107 HCOLORSPACE rhCS = GetColorSpace(hDC);
108
110 {
111 if (NtGdiSetColorSpace(hDC, hCS)) return rhCS;
112 }
113#if 0
115 {
116 PLDC pLDC = GdiGetLDC(hDC);
117 if ( !pLDC )
118 {
120 return NULL;
121 }
122 if (pLDC->iType == LDC_EMFLDC && !EMFDC_SetColorSpace( pLDC, hCS ))
123 {
124 return NULL;
125 }
126 }
127#endif
128 return NULL;
129}
PLDC FASTCALL GdiGetLDC(HDC hDC)
Definition: misc.c:785
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
#define LDC_EMFLDC
Definition: gdi_private.h:105
@ GDILoObjType_LO_METADC16_TYPE
Definition: gdi_private.h:49
@ GDILoObjType_LO_DC_TYPE
Definition: gdi_private.h:34
__kernel_entry W32KAPI BOOL APIENTRY NtGdiSetColorSpace(_In_ HDC hdc, _In_ HCOLORSPACE hColorSpace)
Definition: ntgdihdl.h:263
INT iType
Definition: ntgdihdl.h:266
HCOLORSPACE WINAPI GetColorSpace(HDC hDC)
Definition: icm.c:84

◆ SetICMMode()

int WINAPI SetICMMode ( HDC  hdc,
int  iEnableICM 
)

Definition at line 316 of file icm.c.

320{
321 /*FIXME: Assume that ICM is always off, and cannot be turned on */
322 if (iEnableICM == ICM_OFF) return ICM_OFF;
323 if (iEnableICM == ICM_ON) return 0;
324 if (iEnableICM == ICM_QUERY) return ICM_OFF;
325
328 return 0;
329}
#define ICM_QUERY
Definition: wingdi.h:983
#define ICM_OFF
Definition: wingdi.h:982
#define ICM_ON
Definition: wingdi.h:981

◆ SetICMProfileA()

BOOL WINAPI SetICMProfileA ( HDC  a0,
LPSTR  a1 
)

Definition at line 196 of file icm.c.

200{
203 return FALSE;
204}

◆ SetICMProfileW()

BOOL WINAPI SetICMProfileW ( HDC  a0,
LPWSTR  a1 
)

Definition at line 212 of file icm.c.

216{
219 return FALSE;
220}

◆ UpdateICMRegKeyA()

BOOL WINAPI UpdateICMRegKeyA ( DWORD  a0,
LPSTR  a1,
LPSTR  a2,
UINT  a3 
)

Definition at line 281 of file icm.c.

287{
290 return FALSE;
291}

◆ UpdateICMRegKeyW()

BOOL WINAPI UpdateICMRegKeyW ( DWORD  a0,
LPWSTR  a1,
LPWSTR  a2,
UINT  a3 
)

Definition at line 299 of file icm.c.

305{
308 return FALSE;
309}