Commit 5f139f14 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Factor out get_icm_profile.

And move it to dc.c. Signed-off-by: 's avatarJacek Caban <jacek@codeweavers.com> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 6403e881
......@@ -1241,3 +1241,20 @@ DWORD WINAPI NtGdiSetLayout( HDC hdc, LONG wox, DWORD layout )
return old_layout;
}
/**********************************************************************
* get_icm_profile (win32u.@)
*/
BOOL get_icm_profile( HDC hdc, BOOL allow_default, DWORD *size, WCHAR *filename )
{
PHYSDEV physdev;
DC *dc;
BOOL ret;
if (!(dc = get_dc_ptr(hdc))) return FALSE;
physdev = GET_DC_PHYSDEV( dc, pGetICMProfile );
ret = physdev->funcs->pGetICMProfile( physdev, allow_default, size, filename );
release_dc_ptr(dc);
return ret;
}
......@@ -278,6 +278,8 @@ extern HENHMETAFILE EMF_Create_HENHMETAFILE( ENHMETAHEADER *emh, DWORD filesize,
extern BOOL get_brush_bitmap_info( HBRUSH handle, BITMAPINFO *info, void *bits,
UINT *usage ) DECLSPEC_HIDDEN;
extern BOOL get_icm_profile( HDC hdc, BOOL allow_default, DWORD *size,
WCHAR *filename ) DECLSPEC_HIDDEN;
static inline int get_dib_stride( int width, int bpp )
{
......
......@@ -19,16 +19,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "gdi_private.h"
#include "winnls.h"
#include "winreg.h"
#include "ntgdi_private.h"
#include "wine/debug.h"
......@@ -78,20 +70,13 @@ INT WINAPI EnumICMProfilesW(HDC hdc, ICMENUMPROCW func, LPARAM lparam)
{
WCHAR profile[MAX_PATH];
DWORD size = ARRAYSIZE(profile);
DC *dc;
BOOL ret = FALSE;
TRACE( "%p, %p, 0x%08lx\n", hdc, func, lparam );
if (!func) return -1;
if ((dc = get_dc_ptr(hdc)))
{
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pGetICMProfile );
ret = physdev->funcs->pGetICMProfile( physdev, FALSE, &size, profile );
release_dc_ptr(dc);
}
if (!get_icm_profile( hdc, FALSE, &size, profile )) return -1;
/* FIXME: support multiple profiles */
return ret ? func( profile, lparam ) : -1;
return func( profile, lparam );
}
/**********************************************************************
......@@ -144,18 +129,9 @@ BOOL WINAPI GetICMProfileA(HDC hdc, LPDWORD size, LPSTR filename)
*/
BOOL WINAPI GetICMProfileW(HDC hdc, LPDWORD size, LPWSTR filename)
{
BOOL ret = FALSE;
DC *dc = get_dc_ptr(hdc);
TRACE("%p, %p, %p\n", hdc, size, filename);
if (dc)
{
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pGetICMProfile );
ret = physdev->funcs->pGetICMProfile( physdev, TRUE, size, filename );
release_dc_ptr(dc);
}
return ret;
return get_icm_profile( hdc, TRUE, size, filename );
}
/**********************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment