gdi32: Move EnumICMProfiles to the driver.
This commit is contained in:
parent
971ce6c44a
commit
0839dabdab
|
@ -96,6 +96,7 @@ static struct graphics_driver *create_driver( HMODULE module )
|
||||||
GET_FUNC(EndPage);
|
GET_FUNC(EndPage);
|
||||||
GET_FUNC(EndPath);
|
GET_FUNC(EndPath);
|
||||||
GET_FUNC(EnumDeviceFonts);
|
GET_FUNC(EnumDeviceFonts);
|
||||||
|
GET_FUNC(EnumICMProfiles);
|
||||||
GET_FUNC(ExcludeClipRect);
|
GET_FUNC(ExcludeClipRect);
|
||||||
GET_FUNC(ExtDeviceMode);
|
GET_FUNC(ExtDeviceMode);
|
||||||
GET_FUNC(ExtEscape);
|
GET_FUNC(ExtEscape);
|
||||||
|
|
|
@ -58,6 +58,7 @@ static const DC_FUNCTIONS EMFDRV_Funcs =
|
||||||
NULL, /* pEndPage */
|
NULL, /* pEndPage */
|
||||||
EMFDRV_EndPath, /* pEndPath */
|
EMFDRV_EndPath, /* pEndPath */
|
||||||
NULL, /* pEnumDeviceFonts */
|
NULL, /* pEnumDeviceFonts */
|
||||||
|
NULL, /* pEnumICMProfiles */
|
||||||
EMFDRV_ExcludeClipRect, /* pExcludeClipRect */
|
EMFDRV_ExcludeClipRect, /* pExcludeClipRect */
|
||||||
NULL, /* pExtDeviceMode */
|
NULL, /* pExtDeviceMode */
|
||||||
NULL, /* pExtEscape */
|
NULL, /* pExtEscape */
|
||||||
|
|
|
@ -99,6 +99,7 @@ typedef struct tagDC_FUNCS
|
||||||
INT (CDECL *pEndDoc)(PHYSDEV);
|
INT (CDECL *pEndDoc)(PHYSDEV);
|
||||||
INT (CDECL *pEndPage)(PHYSDEV);
|
INT (CDECL *pEndPage)(PHYSDEV);
|
||||||
BOOL (CDECL *pEndPath)(PHYSDEV);
|
BOOL (CDECL *pEndPath)(PHYSDEV);
|
||||||
|
INT (CDECL *pEnumICMProfiles)(PHYSDEV,ICMENUMPROCW,LPARAM);
|
||||||
BOOL (CDECL *pEnumDeviceFonts)(PHYSDEV,LPLOGFONTW,FONTENUMPROCW,LPARAM);
|
BOOL (CDECL *pEnumDeviceFonts)(PHYSDEV,LPLOGFONTW,FONTENUMPROCW,LPARAM);
|
||||||
INT (CDECL *pExcludeClipRect)(PHYSDEV,INT,INT,INT,INT);
|
INT (CDECL *pExcludeClipRect)(PHYSDEV,INT,INT,INT,INT);
|
||||||
INT (CDECL *pExtDeviceMode)(LPSTR,HWND,LPDEVMODEA,LPSTR,LPSTR,LPDEVMODEA,LPSTR,DWORD);
|
INT (CDECL *pExtDeviceMode)(LPSTR,HWND,LPDEVMODEA,LPSTR,LPSTR,LPDEVMODEA,LPSTR,DWORD);
|
||||||
|
|
|
@ -38,13 +38,60 @@
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(icm);
|
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.@)
|
* EnumICMProfilesA (GDI32.@)
|
||||||
*/
|
*/
|
||||||
INT WINAPI EnumICMProfilesA(HDC hdc, ICMENUMPROCA func, LPARAM lparam)
|
INT WINAPI EnumICMProfilesA(HDC hdc, ICMENUMPROCA func, LPARAM lparam)
|
||||||
{
|
{
|
||||||
FIXME("%p, %p, 0x%08lx stub\n", hdc, func, lparam);
|
INT ret = -1;
|
||||||
return -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)
|
INT WINAPI EnumICMProfilesW(HDC hdc, ICMENUMPROCW func, LPARAM lparam)
|
||||||
{
|
{
|
||||||
FIXME("%p, %p, 0x%08lx stub\n", hdc, func, lparam);
|
INT ret = -1;
|
||||||
return -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
|
|
|
@ -56,6 +56,7 @@ static const DC_FUNCTIONS MFDRV_Funcs =
|
||||||
NULL, /* pEndPage */
|
NULL, /* pEndPage */
|
||||||
MFDRV_EndPath, /* pEndPath */
|
MFDRV_EndPath, /* pEndPath */
|
||||||
NULL, /* pEnumDeviceFonts */
|
NULL, /* pEnumDeviceFonts */
|
||||||
|
NULL, /* pEnumICMProfiles */
|
||||||
MFDRV_ExcludeClipRect, /* pExcludeClipRect */
|
MFDRV_ExcludeClipRect, /* pExcludeClipRect */
|
||||||
NULL, /* pExtDeviceMode */
|
NULL, /* pExtDeviceMode */
|
||||||
MFDRV_ExtEscape, /* pExtEscape */
|
MFDRV_ExtEscape, /* pExtEscape */
|
||||||
|
|
Loading…
Reference in New Issue