diff --git a/reactos/lib/gdi32/misc/stubs.c b/reactos/lib/gdi32/misc/stubs.c index cba5f52b32a..96bb3a60e92 100644 --- a/reactos/lib/gdi32/misc/stubs.c +++ b/reactos/lib/gdi32/misc/stubs.c @@ -1,4 +1,4 @@ -/* $Id: stubs.c,v 1.57 2004/04/25 15:52:31 weiden Exp $ +/* $Id: stubs.c,v 1.58 2004/04/25 16:06:20 weiden Exp $ * * reactos/lib/gdi32/misc/stubs.c * @@ -176,24 +176,6 @@ Escape( } -/* - * @unimplemented - */ -int -STDCALL -ExcludeClipRect( - HDC a0, - int a1, - int a2, - int a3, - int a4 - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - /* * @unimplemented */ diff --git a/reactos/lib/gdi32/objects/clip.c b/reactos/lib/gdi32/objects/clip.c index adb324fa6eb..9ba8170b0aa 100644 --- a/reactos/lib/gdi32/objects/clip.c +++ b/reactos/lib/gdi32/objects/clip.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: clip.c,v 1.5 2004/04/25 14:46:54 weiden Exp $ +/* $Id: clip.c,v 1.6 2004/04/25 16:06:20 weiden Exp $ * * PROJECT: ReactOS gdi32.dll * FILE: lib/gdi32/objects/clip.c @@ -55,4 +55,18 @@ IntersectClipRect( return NtGdiIntersectClipRect(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect); } - +/* + * @implemented + */ +int +STDCALL +ExcludeClipRect( + HDC hdc, + int nLeftRect, + int nTopRect, + int nRightRect, + int nBottomRect + ) +{ + return NtGdiExcludeClipRect(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect); +} diff --git a/reactos/subsys/win32k/objects/cliprgn.c b/reactos/subsys/win32k/objects/cliprgn.c index b9718b199bc..135c0b62f41 100644 --- a/reactos/subsys/win32k/objects/cliprgn.c +++ b/reactos/subsys/win32k/objects/cliprgn.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: cliprgn.c,v 1.33 2004/04/25 15:52:31 weiden Exp $ */ +/* $Id: cliprgn.c,v 1.34 2004/04/25 16:06:20 weiden Exp $ */ #undef WIN32_LEAN_AND_MEAN #include @@ -149,15 +149,6 @@ NtGdiSelectVisRgn(HDC hdc, HRGN hrgn) return retval; } -int STDCALL NtGdiExcludeClipRect(HDC hDC, - int LeftRect, - int TopRect, - int RightRect, - int BottomRect) -{ - UNIMPLEMENTED; -} - int STDCALL NtGdiExtSelectClipRgn(HDC hDC, HRGN hrgn, int fnMode) @@ -217,6 +208,53 @@ int STDCALL NtGdiGetMetaRgn(HDC hDC, UNIMPLEMENTED; } +int STDCALL NtGdiExcludeClipRect(HDC hDC, + int LeftRect, + int TopRect, + int RightRect, + int BottomRect) +{ + INT Result; + RECT Rect; + HRGN NewRgn; + PDC dc = DC_LockDc(hDC); + + if (!dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return ERROR; + } + + Rect.left = LeftRect; + Rect.top = TopRect; + Rect.right = RightRect; + Rect.bottom = BottomRect; + + IntLPtoDP(dc, (LPPOINT)&Rect, 2); + + NewRgn = UnsafeIntCreateRectRgnIndirect(&Rect); + if (!NewRgn) + { + Result = ERROR; + } + else if (!dc->w.hClipRgn) + { + dc->w.hClipRgn = NewRgn; + Result = SIMPLEREGION; + } + else + { + Result = NtGdiCombineRgn(dc->w.hClipRgn, dc->w.hClipRgn, NewRgn, RGN_DIFF); + NtGdiDeleteObject(NewRgn); + } + if (Result != ERROR) + CLIPPING_UpdateGCRegion(dc); + + DC_UnlockDc(hDC); + + return Result; +} + int STDCALL NtGdiIntersectClipRect(HDC hDC, int LeftRect, int TopRect,