From dfe58a3a5cf0bfa8ac484062ba374e686031aacc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Tue, 27 May 2003 07:23:05 +0000 Subject: [PATCH] Implement OffsetViewportOrgEx() svn path=/trunk/; revision=4765 --- reactos/lib/gdi32/misc/stubs.c | 18 +---------- reactos/lib/gdi32/objects/dc.c | 12 ++++++++ reactos/subsys/win32k/ntuser/painting.c | 4 +-- reactos/subsys/win32k/objects/coord.c | 41 +++++++++++++++++++++---- 4 files changed, 49 insertions(+), 26 deletions(-) diff --git a/reactos/lib/gdi32/misc/stubs.c b/reactos/lib/gdi32/misc/stubs.c index b5a6b41bcad..dccc3cdf6d7 100644 --- a/reactos/lib/gdi32/misc/stubs.c +++ b/reactos/lib/gdi32/misc/stubs.c @@ -1,4 +1,4 @@ -/* $Id: stubs.c,v 1.17 2003/05/03 13:39:06 gvg Exp $ +/* $Id: stubs.c,v 1.18 2003/05/27 07:23:04 gvg Exp $ * * reactos/lib/gdi32/misc/stubs.c * @@ -2125,22 +2125,6 @@ SetWindowExtEx( - -BOOL -STDCALL -OffsetViewportOrgEx( - HDC a0, - int a1, - int a2, - LPPOINT a3 - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - - BOOL STDCALL OffsetWindowOrgEx( diff --git a/reactos/lib/gdi32/objects/dc.c b/reactos/lib/gdi32/objects/dc.c index 7232dbcdc5a..137aa4ee860 100644 --- a/reactos/lib/gdi32/objects/dc.c +++ b/reactos/lib/gdi32/objects/dc.c @@ -162,6 +162,18 @@ SetViewportOrgEx( return W32kSetViewportOrgEx( a0, a1, a2, a3 ); } +BOOL +STDCALL +OffsetViewportOrgEx( + HDC DC, + int XOffset, + int YOffset, + LPPOINT Point + ) +{ + return W32kOffsetViewportOrgEx(DC, XOffset, YOffset, Point); +} + BOOL STDCALL SetWindowOrgEx( diff --git a/reactos/subsys/win32k/ntuser/painting.c b/reactos/subsys/win32k/ntuser/painting.c index 1c758484246..ab789b72ae2 100644 --- a/reactos/subsys/win32k/ntuser/painting.c +++ b/reactos/subsys/win32k/ntuser/painting.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: painting.c,v 1.15 2003/05/26 18:52:37 gvg Exp $ +/* $Id: painting.c,v 1.16 2003/05/27 07:23:05 gvg Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -315,7 +315,6 @@ PaintUpdateRgns(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags, { if ((HRGN) 1 == Window->UpdateRegion) { -#if 0 /* If no NCPAINT needed or if we're going to turn it off the special value 1 means the whole client rect */ if (0 == (Window->Flags & WINDOWOBJECT_NEED_NCPAINT) || @@ -326,7 +325,6 @@ PaintUpdateRgns(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags, Rect.right = Window->ClientRect.right - Window->WindowRect.left; Rect.bottom = Window->ClientRect.bottom - Window->WindowRect.top; } -#endif Window->UpdateRegion = UnsafeW32kCreateRectRgnIndirect(&Rect); } diff --git a/reactos/subsys/win32k/objects/coord.c b/reactos/subsys/win32k/objects/coord.c index fa4399ee17a..af47c288cf0 100644 --- a/reactos/subsys/win32k/objects/coord.c +++ b/reactos/subsys/win32k/objects/coord.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: coord.c,v 1.11 2003/05/18 17:16:18 ea Exp $ +/* $Id: coord.c,v 1.12 2003/05/27 07:23:05 gvg Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -32,6 +32,7 @@ #include #include #include +#include #define NDEBUG #include @@ -259,12 +260,40 @@ W32kModifyWorldTransform(HDC hDC, BOOL STDCALL -W32kOffsetViewportOrgEx(HDC hDC, - int XOffset, - int YOffset, - LPPOINT Point) +W32kOffsetViewportOrgEx(HDC hDC, + int XOffset, + int YOffset, + LPPOINT UnsafePoint) { - UNIMPLEMENTED; + DC *dc = DC_HandleToPtr(hDC); + POINT Point; + NTSTATUS Status; + + if (NULL == dc) + { + return FALSE; + } + + if (NULL != UnsafePoint) + { + Point.x = dc->vportOrgX; + Point.y = dc->vportOrgY; + Status = MmCopyToCaller(UnsafePoint, &Point, sizeof(POINT)); + if (! NT_SUCCESS(Status)) + { + SetLastNtError(Status); + return FALSE; + } + } + + dc->vportOrgX += XOffset; + dc->vportOrgY += YOffset; + DC_UpdateXforms(dc); + + dc->w.DCOrgX += XOffset; + dc->w.DCOrgY += YOffset; + + return TRUE; } BOOL