mirror of
https://github.com/reactos/reactos.git
synced 2024-08-04 10:30:59 +00:00
- Cleanup and fix OffsetViewport/WindowOrgEx.
svn path=/trunk/; revision=37026
This commit is contained in:
parent
3b5595b0a8
commit
220a689732
|
@ -10,33 +10,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*
|
||||
*/
|
||||
BOOL
|
||||
STDCALL
|
||||
OffsetViewportOrgEx(HDC hdc,
|
||||
int nXOffset,
|
||||
int nYOffset,
|
||||
LPPOINT lpPoint)
|
||||
{
|
||||
return NtGdiOffsetViewportOrgEx(hdc, nXOffset, nYOffset, lpPoint);
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*
|
||||
*/
|
||||
BOOL
|
||||
STDCALL
|
||||
OffsetWindowOrgEx(HDC hdc,
|
||||
int nXOffset,
|
||||
int nYOffset,
|
||||
LPPOINT lpPoint)
|
||||
{
|
||||
return NtGdiOffsetWindowOrgEx(hdc, nXOffset, nYOffset, lpPoint);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -701,4 +701,125 @@ SetLayoutWidth(HDC hdc,LONG wox,DWORD dwLayout)
|
|||
return NtGdiSetLayout( hdc, wox, dwLayout);
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*
|
||||
*/
|
||||
BOOL
|
||||
STDCALL
|
||||
OffsetViewportOrgEx(HDC hdc,
|
||||
int nXOffset,
|
||||
int nYOffset,
|
||||
LPPOINT lpPoint)
|
||||
{
|
||||
#if 0
|
||||
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_OffsetViewportOrgEx(hdc, nXOffset, nYOffset, lpPoint);
|
||||
else
|
||||
{
|
||||
PLDC pLDC = GdiGetLDC(hdc);
|
||||
if ( !pLDC )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
return EMFDRV_OffsetWindowOrgEx(hdc, nXOffset, nYOffset, lpPoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE;
|
||||
|
||||
if ( lpPoint )
|
||||
{
|
||||
*lpPoint = (POINT)Dc_Attr->ptlViewportOrg;
|
||||
if ( Dc_Attr->dwLayout & LAYOUT_RTL) lpPoint->x = -lpPoint->x;
|
||||
}
|
||||
|
||||
if ( nXOffset || nYOffset != nXOffset )
|
||||
{
|
||||
if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG)hdc)
|
||||
{
|
||||
if (Dc_Attr->ulDirty_ & DC_MODE_DIRTY)
|
||||
{
|
||||
NtGdiFlush();
|
||||
Dc_Attr->ulDirty_ &= ~DC_MODE_DIRTY;
|
||||
}
|
||||
}
|
||||
Dc_Attr->flXform |= (PAGE_XLATE_CHANGED|DEVICE_TO_WORLD_INVALID);
|
||||
if ( Dc_Attr->dwLayout & LAYOUT_RTL) nXOffset = -nXOffset;
|
||||
Dc_Attr->ptlViewportOrg.x += nXOffset;
|
||||
Dc_Attr->ptlViewportOrg.y += nYOffset;
|
||||
}
|
||||
return TRUE;
|
||||
#endif
|
||||
return NtGdiOffsetViewportOrgEx(hdc, nXOffset, nYOffset, lpPoint);
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*
|
||||
*/
|
||||
BOOL
|
||||
STDCALL
|
||||
OffsetWindowOrgEx(HDC hdc,
|
||||
int nXOffset,
|
||||
int nYOffset,
|
||||
LPPOINT lpPoint)
|
||||
{
|
||||
#if 0
|
||||
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_OffsetWindowOrgEx(hdc, nXOffset, nYOffset, lpPoint);
|
||||
else
|
||||
{
|
||||
PLDC pLDC = GdiGetLDC(hdc);
|
||||
if ( !pLDC )
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pLDC->iType == LDC_EMFLDC)
|
||||
{
|
||||
return EMFDRV_OffsetWindowOrgEx(hdc, nXOffset, nYOffset, lpPoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE;
|
||||
|
||||
if ( lpPoint )
|
||||
{
|
||||
*lpPoint = (POINT)Dc_Attr->ptlWindowOrg;
|
||||
lpPoint->x = Dc_Attr->lWindowOrgx;
|
||||
}
|
||||
|
||||
if ( nXOffset || nYOffset != nXOffset )
|
||||
{
|
||||
if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG)hdc)
|
||||
{
|
||||
if (Dc_Attr->ulDirty_ & DC_MODE_DIRTY)
|
||||
{
|
||||
NtGdiFlush();
|
||||
Dc_Attr->ulDirty_ &= ~DC_MODE_DIRTY;
|
||||
}
|
||||
}
|
||||
Dc_Attr->flXform |= (PAGE_XLATE_CHANGED|DEVICE_TO_WORLD_INVALID);
|
||||
Dc_Attr->ptlWindowOrg.x += nXOffset;
|
||||
Dc_Attr->ptlWindowOrg.y += nYOffset;
|
||||
Dc_Attr->lWindowOrgx += nXOffset;
|
||||
}
|
||||
return TRUE;
|
||||
#endif
|
||||
return NtGdiOffsetWindowOrgEx(hdc, nXOffset, nYOffset, lpPoint);
|
||||
}
|
||||
|
||||
|
|
|
@ -404,6 +404,7 @@ NtGdiOffsetViewportOrgEx(HDC hDC,
|
|||
1);
|
||||
UnsafePoint->x = Dc_Attr->ptlViewportOrg.x;
|
||||
UnsafePoint->y = Dc_Attr->ptlViewportOrg.y;
|
||||
if ( Dc_Attr->dwLayout & LAYOUT_RTL ) UnsafePoint->x = -UnsafePoint->x;
|
||||
}
|
||||
_SEH_HANDLE
|
||||
{
|
||||
|
@ -419,6 +420,7 @@ NtGdiOffsetViewportOrgEx(HDC hDC,
|
|||
}
|
||||
}
|
||||
|
||||
if ( Dc_Attr->dwLayout & LAYOUT_RTL ) XOffset = -XOffset;
|
||||
Dc_Attr->ptlViewportOrg.x += XOffset;
|
||||
Dc_Attr->ptlViewportOrg.y += YOffset;
|
||||
DC_UpdateXforms(dc);
|
||||
|
|
Loading…
Reference in a new issue