gdi32: Move EnumICMProfiles to the driver.

This commit is contained in:
Hans Leidekker 2010-10-26 12:40:41 +02:00 committed by Alexandre Julliard
parent 971ce6c44a
commit 0839dabdab
5 changed files with 71 additions and 4 deletions

View File

@ -96,6 +96,7 @@ static struct graphics_driver *create_driver( HMODULE module )
GET_FUNC(EndPage);
GET_FUNC(EndPath);
GET_FUNC(EnumDeviceFonts);
GET_FUNC(EnumICMProfiles);
GET_FUNC(ExcludeClipRect);
GET_FUNC(ExtDeviceMode);
GET_FUNC(ExtEscape);

View File

@ -58,6 +58,7 @@ static const DC_FUNCTIONS EMFDRV_Funcs =
NULL, /* pEndPage */
EMFDRV_EndPath, /* pEndPath */
NULL, /* pEnumDeviceFonts */
NULL, /* pEnumICMProfiles */
EMFDRV_ExcludeClipRect, /* pExcludeClipRect */
NULL, /* pExtDeviceMode */
NULL, /* pExtEscape */

View File

@ -99,6 +99,7 @@ typedef struct tagDC_FUNCS
INT (CDECL *pEndDoc)(PHYSDEV);
INT (CDECL *pEndPage)(PHYSDEV);
BOOL (CDECL *pEndPath)(PHYSDEV);
INT (CDECL *pEnumICMProfiles)(PHYSDEV,ICMENUMPROCW,LPARAM);
BOOL (CDECL *pEnumDeviceFonts)(PHYSDEV,LPLOGFONTW,FONTENUMPROCW,LPARAM);
INT (CDECL *pExcludeClipRect)(PHYSDEV,INT,INT,INT,INT);
INT (CDECL *pExtDeviceMode)(LPSTR,HWND,LPDEVMODEA,LPSTR,LPSTR,LPDEVMODEA,LPSTR,DWORD);

View File

@ -38,13 +38,60 @@
WINE_DEFAULT_DEBUG_CHANNEL(icm);
struct enum_profiles
{
BOOL unicode;
union
{
ICMENUMPROCA funcA;
ICMENUMPROCW funcW;
} callback;
LPARAM data;
};
INT CALLBACK enum_profiles_callback( LPWSTR filename, LPARAM lparam )
{
int len, ret = -1;
struct enum_profiles *ep = (struct enum_profiles *)lparam;
char *filenameA;
if (ep->unicode)
return ep->callback.funcW( filename, ep->data );
len = WideCharToMultiByte( CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL );
filenameA = HeapAlloc( GetProcessHeap(), 0, len );
if (filenameA)
{
WideCharToMultiByte( CP_ACP, 0, filename, -1, filenameA, len, NULL, NULL );
ret = ep->callback.funcA( filenameA, ep->data );
HeapFree( GetProcessHeap(), 0, filenameA );
}
return ret;
}
/***********************************************************************
* EnumICMProfilesA (GDI32.@)
*/
INT WINAPI EnumICMProfilesA(HDC hdc, ICMENUMPROCA func, LPARAM lparam)
{
FIXME("%p, %p, 0x%08lx stub\n", hdc, func, lparam);
return -1;
INT ret = -1;
DC *dc = get_dc_ptr(hdc);
TRACE("%p, %p, 0x%08lx\n", hdc, func, lparam);
if (dc)
{
if (dc->funcs->pEnumICMProfiles)
{
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;
}
/***********************************************************************
@ -52,8 +99,24 @@ INT WINAPI EnumICMProfilesA(HDC hdc, ICMENUMPROCA func, LPARAM lparam)
*/
INT WINAPI EnumICMProfilesW(HDC hdc, ICMENUMPROCW func, LPARAM lparam)
{
FIXME("%p, %p, 0x%08lx stub\n", hdc, func, lparam);
return -1;
INT ret = -1;
DC *dc = get_dc_ptr(hdc);
TRACE("%p, %p, 0x%08lx\n", hdc, func, lparam);
if (dc)
{
if (dc->funcs->pEnumICMProfiles)
{
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);
}
return ret;
}
/**********************************************************************

View File

@ -56,6 +56,7 @@ static const DC_FUNCTIONS MFDRV_Funcs =
NULL, /* pEndPage */
MFDRV_EndPath, /* pEndPath */
NULL, /* pEnumDeviceFonts */
NULL, /* pEnumICMProfiles */
MFDRV_ExcludeClipRect, /* pExcludeClipRect */
NULL, /* pExtDeviceMode */
MFDRV_ExtEscape, /* pExtEscape */