mirror of
https://github.com/reactos/reactos.git
synced 2024-07-08 05:35:06 +00:00
Implement Win32k-Gdi32: GetAspectRatioFilter and SetMapperFlags.
svn path=/trunk/; revision=33016
This commit is contained in:
parent
6449849098
commit
7c0ca05a4c
|
@ -254,22 +254,6 @@ SetBoundsRect(HDC hdc,
|
|||
return NtGdiSetBoundsRect(hdc, (LPRECT)prc, flags);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
DWORD
|
||||
STDCALL
|
||||
SetMapperFlags(
|
||||
HDC a0,
|
||||
DWORD a1
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
|
|
|
@ -1677,6 +1677,60 @@ TranslateCharsetInfo(
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
DWORD
|
||||
STDCALL
|
||||
SetMapperFlags(
|
||||
HDC hDC,
|
||||
DWORD flags
|
||||
)
|
||||
{
|
||||
DWORD Ret = GDI_ERROR;
|
||||
PDC_ATTR Dc_Attr;
|
||||
#if 0
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
|
||||
{
|
||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
||||
return MFDRV_SetMapperFlags( hDC, flags);
|
||||
else
|
||||
{
|
||||
PLDC pLDC = Dc_Attr->pvLDC;
|
||||
if ( !pLDC )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return GDI_ERROR;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
return EMFDRV_SetMapperFlags( hDC, flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return GDI_ERROR;
|
||||
|
||||
if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG)hDC)
|
||||
{
|
||||
if (Dc_Attr->ulDirty_ & DC_FONTTEXT_DIRTY)
|
||||
{
|
||||
NtGdiFlush();
|
||||
Dc_Attr->ulDirty_ &= ~(DC_MODE_DIRTY|DC_FONTTEXT_DIRTY);
|
||||
}
|
||||
}
|
||||
|
||||
if ( flags & ~1 )
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
else
|
||||
{
|
||||
Ret = Dc_Attr->flFontMapper;
|
||||
Dc_Attr->flFontMapper = flags;
|
||||
}
|
||||
return Ret;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
|
|
|
@ -1168,8 +1168,24 @@ BOOL FASTCALL
|
|||
IntGetAspectRatioFilter(PDC pDC,
|
||||
LPSIZE AspectRatio)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return FALSE;
|
||||
PDC_ATTR pDc_Attr;
|
||||
|
||||
pDc_Attr = pDC->pDc_Attr;
|
||||
if ( !pDc_Attr ) pDc_Attr = &pDC->Dc_Attr;
|
||||
|
||||
if ( pDc_Attr->flFontMapper & 1 ) // TRUE assume 1.
|
||||
{
|
||||
// "This specifies that Windows should only match fonts that have the
|
||||
// same aspect ratio as the display.", Programming Windows, Fifth Ed.
|
||||
AspectRatio->cx = ((PGDIDEVICE)pDC->pPDev)->GDIInfo.ulLogPixelsX;
|
||||
AspectRatio->cy = ((PGDIDEVICE)pDC->pPDev)->GDIInfo.ulLogPixelsY;
|
||||
}
|
||||
else
|
||||
{
|
||||
AspectRatio->cx = 0;
|
||||
AspectRatio->cy = 0;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL STDCALL
|
||||
|
@ -2262,6 +2278,14 @@ NtGdiGetAndSetDCDword(
|
|||
case GdiGetSetSelectFont:
|
||||
break;
|
||||
case GdiGetSetMapperFlagsInternal:
|
||||
if (dwIn & ~1)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
Ret = FALSE;
|
||||
break;
|
||||
}
|
||||
SafeResult = Dc_Attr->flFontMapper;
|
||||
Dc_Attr->flFontMapper = dwIn;
|
||||
break;
|
||||
case GdiGetSetMapMode:
|
||||
SafeResult = IntGdiSetMapMode( dc, dwIn);
|
||||
|
|
Loading…
Reference in a new issue