diff --git a/reactos/include/win32k/region.h b/reactos/include/win32k/region.h index 0f621f295bd..0b3acd22d0b 100644 --- a/reactos/include/win32k/region.h +++ b/reactos/include/win32k/region.h @@ -151,12 +151,5 @@ STDCALL NtGdiGetRegionData(HRGN hrgn, DWORD count, LPRGNDATA rgndata); - -HRGN STDCALL REGION_CropRgn(HRGN hDst, HRGN hSrc, const PRECT lpRect, PPOINT lpPt); - -HRGN FASTCALL UnsafeIntCreateRectRgnIndirect(CONST PRECT rc); -INT FASTCALL UnsafeIntGetRgnBox(PROSRGNDATA Rgn, LPRECT pRect); -VOID FASTCALL UnsafeIntUnionRectWithRgn(PROSRGNDATA RgnDest, CONST PRECT Rect); -BOOL FASTCALL UnsafeIntRectInRegion(PROSRGNDATA Rgn, CONST LPRECT rc); #endif diff --git a/reactos/lib/gdi32/misc/stubs.c b/reactos/lib/gdi32/misc/stubs.c index 6a5c5d928fa..d6e5fd8ac54 100644 --- a/reactos/lib/gdi32/misc/stubs.c +++ b/reactos/lib/gdi32/misc/stubs.c @@ -1,4 +1,4 @@ -/* $Id: stubs.c,v 1.53 2004/04/23 13:34:04 weiden Exp $ +/* $Id: stubs.c,v 1.54 2004/04/24 14:21:36 weiden Exp $ * * reactos/lib/gdi32/misc/stubs.c * @@ -209,23 +209,6 @@ ExtCreateRegion( return 0; } -/* - * @unimplemented - */ -BOOL -STDCALL -FrameRgn( - HDC a0, - HRGN a1, - HBRUSH a2, - int a3, - int a4 - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - /* * @unimplemented diff --git a/reactos/lib/gdi32/objects/region.c b/reactos/lib/gdi32/objects/region.c index 292719459e9..e9ad971f3ec 100644 --- a/reactos/lib/gdi32/objects/region.c +++ b/reactos/lib/gdi32/objects/region.c @@ -309,3 +309,19 @@ InvertRgn( { return NtGdiInvertRgn(hDc, hRgn); } + +/* + * @implemented + */ +BOOL +STDCALL +FrameRgn( + HDC hdc, + HRGN hrgn, + HBRUSH hbr, + int nWidth, + int nHeight + ) +{ + return NtGdiFrameRgn(hdc, hrgn, hbr, nWidth, nHeight); +} diff --git a/reactos/subsys/win32k/include/intgdi.h b/reactos/subsys/win32k/include/intgdi.h index 2d62ae20602..3374f5f6a34 100644 --- a/reactos/subsys/win32k/include/intgdi.h +++ b/reactos/subsys/win32k/include/intgdi.h @@ -100,6 +100,13 @@ int FASTCALL IntGdiGetClipBox(HDC hDC, LPRECT rc); +HRGN FASTCALL REGION_CropRgn(HRGN hDst, HRGN hSrc, const PRECT lpRect, PPOINT lpPt); + +HRGN FASTCALL UnsafeIntCreateRectRgnIndirect(CONST PRECT rc); +INT FASTCALL UnsafeIntGetRgnBox(PROSRGNDATA Rgn, LPRECT pRect); +VOID FASTCALL UnsafeIntUnionRectWithRgn(PROSRGNDATA RgnDest, CONST PRECT Rect); +BOOL FASTCALL UnsafeIntRectInRegion(PROSRGNDATA Rgn, CONST LPRECT rc); + /* DC functions */ BOOL FASTCALL diff --git a/reactos/subsys/win32k/ntuser/vis.c b/reactos/subsys/win32k/ntuser/vis.c index 5943c2e0813..d9514b623a8 100644 --- a/reactos/subsys/win32k/ntuser/vis.c +++ b/reactos/subsys/win32k/ntuser/vis.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: vis.c,v 1.26 2004/03/27 15:16:05 gvg Exp $ + * $Id: vis.c,v 1.27 2004/04/24 14:21:36 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -29,6 +29,7 @@ #include #include #include +#include #define NDEBUG #include diff --git a/reactos/subsys/win32k/ntuser/window.c b/reactos/subsys/win32k/ntuser/window.c index 7895d8281be..d8caa86f263 100644 --- a/reactos/subsys/win32k/ntuser/window.c +++ b/reactos/subsys/win32k/ntuser/window.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: window.c,v 1.219 2004/04/17 11:00:14 weiden Exp $ +/* $Id: window.c,v 1.220 2004/04/24 14:21:36 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/reactos/subsys/win32k/ntuser/winpos.c b/reactos/subsys/win32k/ntuser/winpos.c index b96ca05b04a..02289d787bb 100644 --- a/reactos/subsys/win32k/ntuser/winpos.c +++ b/reactos/subsys/win32k/ntuser/winpos.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: winpos.c,v 1.111 2004/04/14 17:19:38 weiden Exp $ +/* $Id: winpos.c,v 1.112 2004/04/24 14:21:36 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -44,6 +44,7 @@ #include #include #include +#include #include #include diff --git a/reactos/subsys/win32k/objects/cliprgn.c b/reactos/subsys/win32k/objects/cliprgn.c index a238e26e6b3..3ba6b6bbfb7 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.31 2004/04/09 20:03:20 navaraf Exp $ */ +/* $Id: cliprgn.c,v 1.32 2004/04/24 14:21:37 weiden Exp $ */ #undef WIN32_LEAN_AND_MEAN #include @@ -27,6 +27,7 @@ #include #include #include +#include #include "../eng/clip.h" #define NDEBUG diff --git a/reactos/subsys/win32k/objects/path.c b/reactos/subsys/win32k/objects/path.c index 6e76b9ae936..1aded6a887d 100644 --- a/reactos/subsys/win32k/objects/path.c +++ b/reactos/subsys/win32k/objects/path.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: path.c,v 1.19 2004/04/05 21:26:25 navaraf Exp $ */ +/* $Id: path.c,v 1.20 2004/04/24 14:21:37 weiden Exp $ */ #undef WIN32_LEAN_AND_MEAN #include #include @@ -31,7 +31,6 @@ #define _WIN32K_PATH_INTERNAL #include #include -#include #include #include @@ -45,6 +44,8 @@ #define GROW_FACTOR_DENOM 1 /* Denominator of grow factor */ +INT FASTCALL +IntGdiGetArcDirection(DC *dc); BOOL STDCALL diff --git a/reactos/subsys/win32k/objects/region.c b/reactos/subsys/win32k/objects/region.c index 82c0cd738e4..4d0f93cd86b 100644 --- a/reactos/subsys/win32k/objects/region.c +++ b/reactos/subsys/win32k/objects/region.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: region.c,v 1.49 2004/04/23 13:34:04 weiden Exp $ */ +/* $Id: region.c,v 1.50 2004/04/24 14:21:37 weiden Exp $ */ #undef WIN32_LEAN_AND_MEAN #include #include @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -103,6 +104,7 @@ typedef struct _POINTBLOCK { struct _POINTBLOCK *next; } POINTBLOCK; +#ifndef NDEBUG /* * This function is left there for debugging purposes. */ @@ -129,6 +131,7 @@ IntDumpRegion(HRGN hRgn) RGNDATA_UnlockRgn(hRgn); } +#endif /* NDEBUG */ static BOOL FASTCALL REGION_CopyRegion(PROSRGNDATA dst, PROSRGNDATA src) { @@ -365,7 +368,7 @@ empty: * * \return hDst if success, 0 otherwise. */ -HRGN STDCALL REGION_CropRgn(HRGN hDst, HRGN hSrc, const PRECT lpRect, PPOINT lpPt) +HRGN FASTCALL REGION_CropRgn(HRGN hDst, HRGN hSrc, const PRECT lpRect, PPOINT lpPt) { PROSRGNDATA objSrc, rgnDst; HRGN hNewDst, hRet = NULL; @@ -1413,7 +1416,99 @@ static void FASTCALL REGION_UnionRectWithRegion(const RECT *rect, ROSRGNDATA *rg } -BOOL STDCALL REGION_LPTODP(HDC hdc, HRGN hDest, HRGN hSrc) +BOOL FASTCALL REGION_CreateFrameRgn(HRGN hDest, HRGN hSrc, INT x, INT y) +{ + PROSRGNDATA srcObj, destObj; + PRECT rc; + INT dx, dy; + ULONG i; + + if(!(srcObj = (PROSRGNDATA)RGNDATA_LockRgn(hSrc))) + { + return FALSE; + } + if(!REGION_NOT_EMPTY(srcObj)) + { + RGNDATA_UnlockRgn(hSrc); + return FALSE; + } + if(!(destObj = (PROSRGNDATA)RGNDATA_LockRgn(hDest))) + { + RGNDATA_UnlockRgn(hSrc); + return FALSE; + } + + EMPTY_REGION(destObj); + if(!REGION_CopyRegion(destObj, srcObj)) + { + RGNDATA_UnlockRgn(hDest); + RGNDATA_UnlockRgn(hSrc); + return FALSE; + } + + /* left-top */ + dx = x * 2; + dy = y * 2; + rc = (PRECT)srcObj->Buffer; + for(i = 0; i < srcObj->rdh.nCount; i++) + { + rc->left += x; + rc->top += y; + rc->right += x; + rc->bottom += y; + rc++; + } + REGION_IntersectRegion(destObj, destObj, srcObj); + + /* right-top */ + rc = (PRECT)srcObj->Buffer; + for(i = 0; i < srcObj->rdh.nCount; i++) + { + rc->left -= dx; + rc->right -= dx; + rc++; + } + REGION_IntersectRegion(destObj, destObj, srcObj); + + /* right-bottom */ + rc = (PRECT)srcObj->Buffer; + for(i = 0; i < srcObj->rdh.nCount; i++) + { + rc->top -= dy; + rc->bottom -= dy; + rc++; + } + REGION_IntersectRegion(destObj, destObj, srcObj); + + /* left-bottom */ + rc = (PRECT)srcObj->Buffer; + for(i = 0; i < srcObj->rdh.nCount; i++) + { + rc->left += dx; + rc->right += dx; + rc++; + } + REGION_IntersectRegion(destObj, destObj, srcObj); + + + rc = (PRECT)srcObj->Buffer; + for(i = 0; i < srcObj->rdh.nCount; i++) + { + rc->left -= x; + rc->top += y; + rc->right -= x; + rc->bottom += y; + rc++; + } + REGION_SubtractRegion(destObj, srcObj, destObj); + + RGNDATA_UnlockRgn(hDest); + RGNDATA_UnlockRgn(hSrc); + return TRUE; +} + + +BOOL FASTCALL REGION_LPTODP(HDC hdc, HRGN hDest, HRGN hSrc) { RECT *pCurRect, *pEndRect; PROSRGNDATA srcObj = NULL; @@ -1893,13 +1988,25 @@ NtGdiFillRgn(HDC hDC, HRGN hRgn, HBRUSH hBrush) BOOL STDCALL -NtGdiFrameRgn(HDC hDC, - HRGN hRgn, - HBRUSH hBrush, - INT Width, - INT Height) +NtGdiFrameRgn(HDC hDC, HRGN hRgn, HBRUSH hBrush, INT Width, INT Height) { - UNIMPLEMENTED; + HRGN FrameRgn; + BOOL Ret; + + if(!(FrameRgn = NtGdiCreateRectRgn(0, 0, 0, 0))) + { + return FALSE; + } + if(!REGION_CreateFrameRgn(FrameRgn, hRgn, Width, Height)) + { + NtGdiDeleteObject(FrameRgn); + return FALSE; + } + + Ret = NtGdiFillRgn(hDC, FrameRgn, hBrush); + + NtGdiDeleteObject(FrameRgn); + return Ret; } INT FASTCALL