gdi32: Factor out get_icm_profile.
And move it to dc.c. Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6403e88140
commit
5f139f1411
|
@ -1241,3 +1241,20 @@ DWORD WINAPI NtGdiSetLayout( HDC hdc, LONG wox, DWORD layout )
|
||||||
|
|
||||||
return old_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,
|
extern BOOL get_brush_bitmap_info( HBRUSH handle, BITMAPINFO *info, void *bits,
|
||||||
UINT *usage ) DECLSPEC_HIDDEN;
|
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 )
|
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
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include "gdi_private.h"
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "windef.h"
|
|
||||||
#include "winbase.h"
|
|
||||||
#include "wingdi.h"
|
|
||||||
#include "winnls.h"
|
#include "winnls.h"
|
||||||
#include "winreg.h"
|
|
||||||
|
|
||||||
#include "ntgdi_private.h"
|
|
||||||
|
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
|
|
||||||
|
@ -78,20 +70,13 @@ INT WINAPI EnumICMProfilesW(HDC hdc, ICMENUMPROCW func, LPARAM lparam)
|
||||||
{
|
{
|
||||||
WCHAR profile[MAX_PATH];
|
WCHAR profile[MAX_PATH];
|
||||||
DWORD size = ARRAYSIZE(profile);
|
DWORD size = ARRAYSIZE(profile);
|
||||||
DC *dc;
|
|
||||||
BOOL ret = FALSE;
|
|
||||||
|
|
||||||
TRACE( "%p, %p, 0x%08lx\n", hdc, func, lparam );
|
TRACE( "%p, %p, 0x%08lx\n", hdc, func, lparam );
|
||||||
|
|
||||||
if (!func) return -1;
|
if (!func) return -1;
|
||||||
if ((dc = get_dc_ptr(hdc)))
|
if (!get_icm_profile( hdc, FALSE, &size, profile )) return -1;
|
||||||
{
|
|
||||||
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pGetICMProfile );
|
|
||||||
ret = physdev->funcs->pGetICMProfile( physdev, FALSE, &size, profile );
|
|
||||||
release_dc_ptr(dc);
|
|
||||||
}
|
|
||||||
/* FIXME: support multiple profiles */
|
/* 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 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);
|
TRACE("%p, %p, %p\n", hdc, size, filename);
|
||||||
|
|
||||||
if (dc)
|
return get_icm_profile( hdc, TRUE, size, filename );
|
||||||
{
|
|
||||||
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pGetICMProfile );
|
|
||||||
ret = physdev->funcs->pGetICMProfile( physdev, TRUE, size, filename );
|
|
||||||
release_dc_ptr(dc);
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
|
|
Loading…
Reference in New Issue