gdi32: Add null driver entry points for the color management functions.

This commit is contained in:
Alexandre Julliard 2011-03-11 12:33:34 +01:00
parent 806d0c4f86
commit 0c33f1dd89
3 changed files with 39 additions and 48 deletions

View File

@ -1509,8 +1509,8 @@ BOOL WINAPI GetDeviceGammaRamp(HDC hDC, LPVOID ptr)
if( dc ) if( dc )
{ {
if (dc->funcs->pGetDeviceGammaRamp) PHYSDEV physdev = GET_DC_PHYSDEV( dc, pGetDeviceGammaRamp );
ret = dc->funcs->pGetDeviceGammaRamp(dc->physDev, ptr); ret = physdev->funcs->pGetDeviceGammaRamp( physdev, ptr );
release_dc_ptr( dc ); release_dc_ptr( dc );
} }
return ret; return ret;
@ -1526,8 +1526,8 @@ BOOL WINAPI SetDeviceGammaRamp(HDC hDC, LPVOID ptr)
if( dc ) if( dc )
{ {
if (dc->funcs->pSetDeviceGammaRamp) PHYSDEV physdev = GET_DC_PHYSDEV( dc, pSetDeviceGammaRamp );
ret = dc->funcs->pSetDeviceGammaRamp(dc->physDev, ptr); ret = physdev->funcs->pSetDeviceGammaRamp( physdev, ptr );
release_dc_ptr( dc ); release_dc_ptr( dc );
} }
return ret; return ret;

View File

@ -366,6 +366,11 @@ static INT CDECL nulldrv_EndPage( PHYSDEV dev )
return 0; return 0;
} }
static INT CDECL nulldrv_EnumICMProfiles( PHYSDEV dev, ICMENUMPROCW func, LPARAM lparam )
{
return -1;
}
static INT CDECL nulldrv_ExtDeviceMode( LPSTR buffer, HWND hwnd, DEVMODEA *output, LPSTR device, static INT CDECL nulldrv_ExtDeviceMode( LPSTR buffer, HWND hwnd, DEVMODEA *output, LPSTR device,
LPSTR port, DEVMODEA *input, LPSTR profile, DWORD mode ) LPSTR port, DEVMODEA *input, LPSTR profile, DWORD mode )
{ {
@ -388,6 +393,16 @@ static BOOL CDECL nulldrv_GdiComment( PHYSDEV dev, UINT size, const BYTE *data )
return FALSE; return FALSE;
} }
static BOOL CDECL nulldrv_GetDeviceGammaRamp( PHYSDEV dev, void *ramp )
{
return FALSE;
}
static BOOL CDECL nulldrv_GetICMProfile( PHYSDEV dev, LPDWORD size, LPWSTR filename )
{
return FALSE;
}
static COLORREF CDECL nulldrv_GetPixel( PHYSDEV dev, INT x, INT y ) static COLORREF CDECL nulldrv_GetPixel( PHYSDEV dev, INT x, INT y )
{ {
return 0; return 0;
@ -511,6 +526,11 @@ static DWORD CDECL nulldrv_SetLayout( PHYSDEV dev, DWORD layout )
return layout; return layout;
} }
static BOOL CDECL nulldrv_SetDeviceGammaRamp( PHYSDEV dev, void *ramp )
{
return FALSE;
}
static DWORD CDECL nulldrv_SetMapperFlags( PHYSDEV dev, DWORD flags ) static DWORD CDECL nulldrv_SetMapperFlags( PHYSDEV dev, DWORD flags )
{ {
return flags; return flags;
@ -667,7 +687,7 @@ const DC_FUNCTIONS null_driver =
nulldrv_EndDoc, /* pEndDoc */ nulldrv_EndDoc, /* pEndDoc */
nulldrv_EndPage, /* pEndPage */ nulldrv_EndPage, /* pEndPage */
NULL, /* pEndPath */ NULL, /* pEndPath */
NULL, /* pEnumICMProfiles */ nulldrv_EnumICMProfiles, /* pEnumICMProfiles */
NULL, /* pEnumDeviceFonts */ NULL, /* pEnumDeviceFonts */
nulldrv_ExcludeClipRect, /* pExcludeClipRect */ nulldrv_ExcludeClipRect, /* pExcludeClipRect */
nulldrv_ExtDeviceMode, /* pExtDeviceMode */ nulldrv_ExtDeviceMode, /* pExtDeviceMode */
@ -684,8 +704,8 @@ const DC_FUNCTIONS null_driver =
NULL, /* pGetCharWidth */ NULL, /* pGetCharWidth */
NULL, /* pGetDIBits */ NULL, /* pGetDIBits */
NULL, /* pGetDeviceCaps */ NULL, /* pGetDeviceCaps */
NULL, /* pGetDeviceGammaRamp */ nulldrv_GetDeviceGammaRamp, /* pGetDeviceGammaRamp */
NULL, /* pGetICMProfile */ nulldrv_GetICMProfile, /* pGetICMProfile */
NULL, /* pGetNearestColor */ NULL, /* pGetNearestColor */
nulldrv_GetPixel, /* pGetPixel */ nulldrv_GetPixel, /* pGetPixel */
nulldrv_GetPixelFormat, /* pGetPixelFormat */ nulldrv_GetPixelFormat, /* pGetPixelFormat */
@ -736,7 +756,7 @@ const DC_FUNCTIONS null_driver =
NULL, /* pSetDIBits */ NULL, /* pSetDIBits */
NULL, /* pSetDIBitsToDevice */ NULL, /* pSetDIBitsToDevice */
nulldrv_SetDeviceClipping, /* pSetDeviceClipping */ nulldrv_SetDeviceClipping, /* pSetDeviceClipping */
NULL, /* pSetDeviceGammaRamp */ nulldrv_SetDeviceGammaRamp, /* pSetDeviceGammaRamp */
nulldrv_SetLayout, /* pSetLayout */ nulldrv_SetLayout, /* pSetLayout */
nulldrv_SetMapMode, /* pSetMapMode */ nulldrv_SetMapMode, /* pSetMapMode */
nulldrv_SetMapperFlags, /* pSetMapperFlags */ nulldrv_SetMapperFlags, /* pSetMapperFlags */

View File

@ -40,30 +40,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(icm);
struct enum_profiles struct enum_profiles
{ {
BOOL unicode; ICMENUMPROCA funcA;
union
{
ICMENUMPROCA funcA;
ICMENUMPROCW funcW;
} callback;
LPARAM data; LPARAM data;
}; };
INT CALLBACK enum_profiles_callback( LPWSTR filename, LPARAM lparam ) static INT CALLBACK enum_profiles_callbackA( LPWSTR filename, LPARAM lparam )
{ {
int len, ret = -1; int len, ret = -1;
struct enum_profiles *ep = (struct enum_profiles *)lparam; struct enum_profiles *ep = (struct enum_profiles *)lparam;
char *filenameA; char *filenameA;
if (ep->unicode)
return ep->callback.funcW( filename, ep->data );
len = WideCharToMultiByte( CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL ); len = WideCharToMultiByte( CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL );
filenameA = HeapAlloc( GetProcessHeap(), 0, len ); filenameA = HeapAlloc( GetProcessHeap(), 0, len );
if (filenameA) if (filenameA)
{ {
WideCharToMultiByte( CP_ACP, 0, filename, -1, filenameA, len, NULL, NULL ); WideCharToMultiByte( CP_ACP, 0, filename, -1, filenameA, len, NULL, NULL );
ret = ep->callback.funcA( filenameA, ep->data ); ret = ep->funcA( filenameA, ep->data );
HeapFree( GetProcessHeap(), 0, filenameA ); HeapFree( GetProcessHeap(), 0, filenameA );
} }
return ret; return ret;
@ -74,26 +66,12 @@ INT CALLBACK enum_profiles_callback( LPWSTR filename, LPARAM lparam )
*/ */
INT WINAPI EnumICMProfilesA(HDC hdc, ICMENUMPROCA func, LPARAM lparam) INT WINAPI EnumICMProfilesA(HDC hdc, ICMENUMPROCA func, LPARAM lparam)
{ {
DC *dc; struct enum_profiles ep;
INT ret = -1;
TRACE("%p, %p, 0x%08lx\n", hdc, func, lparam);
if (!func) return -1; if (!func) return -1;
if ((dc = get_dc_ptr(hdc))) ep.funcA = func;
{ ep.data = lparam;
if (dc->funcs->pEnumICMProfiles) return EnumICMProfilesW( hdc, enum_profiles_callbackA, (LPARAM)&ep );
{
struct enum_profiles ep;
ep.unicode = FALSE;
ep.callback.funcA = func;
ep.data = lparam;
ret = dc->funcs->pEnumICMProfiles(dc->physDev, enum_profiles_callback, (LPARAM)&ep);
}
release_dc_ptr(dc);
}
return ret;
} }
/*********************************************************************** /***********************************************************************
@ -109,15 +87,8 @@ INT WINAPI EnumICMProfilesW(HDC hdc, ICMENUMPROCW func, LPARAM lparam)
if (!func) return -1; if (!func) return -1;
if ((dc = get_dc_ptr(hdc))) if ((dc = get_dc_ptr(hdc)))
{ {
if (dc->funcs->pEnumICMProfiles) PHYSDEV physdev = GET_DC_PHYSDEV( dc, pEnumICMProfiles );
{ ret = physdev->funcs->pEnumICMProfiles( physdev, func, lparam );
struct enum_profiles ep;
ep.unicode = TRUE;
ep.callback.funcW = func;
ep.data = lparam;
ret = dc->funcs->pEnumICMProfiles(dc->physDev, enum_profiles_callback, (LPARAM)&ep);
}
release_dc_ptr(dc); release_dc_ptr(dc);
} }
return ret; return ret;
@ -173,8 +144,8 @@ BOOL WINAPI GetICMProfileW(HDC hdc, LPDWORD size, LPWSTR filename)
if (dc) if (dc)
{ {
if (dc->funcs->pGetICMProfile) PHYSDEV physdev = GET_DC_PHYSDEV( dc, pGetICMProfile );
ret = dc->funcs->pGetICMProfile(dc->physDev, size, filename); ret = physdev->funcs->pGetICMProfile( physdev, size, filename );
release_dc_ptr(dc); release_dc_ptr(dc);
} }
return ret; return ret;