mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +00:00
[NtGDI]
- Implement internal functions for setting and retrieving DC origin. Related to CORE-13110. - Code fix ups. svn path=/trunk/; revision=74543
This commit is contained in:
parent
d4534e81e1
commit
5e9d1bc628
3 changed files with 54 additions and 2 deletions
|
@ -1335,6 +1335,56 @@ GreGetDCPoint(
|
|||
return Ret;
|
||||
}
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
GreSetDCOrg(
|
||||
_In_ HDC hdc,
|
||||
_In_ LONG x,
|
||||
_In_ LONG y,
|
||||
_In_opt_ PRECTL Rect)
|
||||
{
|
||||
PDC dc;
|
||||
|
||||
dc = DC_LockDc(hdc);
|
||||
if (!dc) return FALSE;
|
||||
|
||||
/* Set DC Origin */
|
||||
dc->ptlDCOrig.x = x;
|
||||
dc->ptlDCOrig.y = y;
|
||||
|
||||
/* Recalculate Fill Origin */
|
||||
dc->ptlFillOrigin.x = dc->dclevel.ptlBrushOrigin.x + x;
|
||||
dc->ptlFillOrigin.y = dc->dclevel.ptlBrushOrigin.y + y;
|
||||
|
||||
/* Set DC Window Rectangle */
|
||||
if (Rect)
|
||||
dc->erclWindow = *Rect;
|
||||
|
||||
DC_UnlockDc(dc);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
GreGetDCOrgEx(
|
||||
_In_ HDC hdc,
|
||||
_Out_ PPOINTL Point,
|
||||
_Out_ PRECTL Rect)
|
||||
{
|
||||
PDC dc;
|
||||
|
||||
dc = DC_LockDc(hdc);
|
||||
if (!dc) return FALSE;
|
||||
|
||||
/* Retrieve DC Window Rectangle without a check */
|
||||
*Rect = dc->erclWindow;
|
||||
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
/* Use default call for DC Origin and parameter checking */
|
||||
return GreGetDCPoint( hdc, GdiGetDCOrg, Point);
|
||||
}
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
GreGetWindowExtEx(
|
||||
|
|
|
@ -166,3 +166,5 @@ BOOL APIENTRY GreGetDCPoint(HDC,UINT,PPOINTL);
|
|||
BOOL WINAPI GreGetWindowExtEx( _In_ HDC hdc, _Out_ LPSIZE lpSize);
|
||||
BOOL WINAPI GreGetViewportExtEx( _In_ HDC hdc, _Out_ LPSIZE lpSize);
|
||||
BOOL FASTCALL GreSetViewportOrgEx(HDC,int,int,LPPOINT);
|
||||
BOOL WINAPI GreGetDCOrgEx(_In_ HDC, _Out_ PPOINTL, _Out_ PRECTL);
|
||||
BOOL WINAPI GreSetDCOrg(_In_ HDC, _In_ LONG, _In_ LONG, _In_opt_ PRECTL);
|
||||
|
|
|
@ -396,8 +396,8 @@ IntSetDefaultRegion(PDC pdc)
|
|||
pdc->erclWindow = rclWnd;
|
||||
pdc->erclClip = rclClip;
|
||||
/* Might be an InitDC or DCE... */
|
||||
pdc->ptlFillOrigin.x = pdc->dcattr.VisRectRegion.Rect.right;
|
||||
pdc->ptlFillOrigin.y = pdc->dcattr.VisRectRegion.Rect.bottom;
|
||||
pdc->ptlFillOrigin.x = pdc->dcattr.ptlBrushOrigin.x;
|
||||
pdc->ptlFillOrigin.y = pdc->dcattr.ptlBrushOrigin.y;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue