Author: jimtabor Date: Thu Dec 24 00:10:32 2009 New Revision: 44746
URL: http://svn.reactos.org/svn/reactos?rev=44746&view=rev Log: [gdi32] - Move region code from stubs into the appropriate file. - Enable and fix SetRectRgn user code.
Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c trunk/reactos/dll/win32/gdi32/objects/region.c
Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs.... ============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/stubs.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/misc/stubs.c [iso-8859-1] Thu Dec 24 00:10:32 2009 @@ -18,32 +18,6 @@ #define SIZEOF_DEVMODEW_400 212 #define SIZEOF_DEVMODEW_500 220
- -/* - * @unimplemented - */ -BOOL -WINAPI -PtInRegion(IN HRGN hrgn, - int x, - int y) -{ - /* FIXME some stuff at user mode need be fixed */ - return NtGdiPtInRegion(hrgn,x,y); -} - -/* - * @unimplemented - */ -BOOL -WINAPI -RectInRegion(HRGN hrgn, - LPCRECT prcl) -{ - /* FIXME some stuff at user mode need be fixed */ - return NtGdiRectInRegion(hrgn, (LPRECT) prcl); -} - /* * @unimplemented */ @@ -66,8 +40,6 @@ /* FIXME Sharememory */ return NtGdiSaveDC(hdc); } - -
/* * @implemented @@ -194,8 +166,6 @@ return Result; }
- - /* * @implemented */ @@ -209,7 +179,6 @@ { return NtGdiGetBoundsRect(hdc,lprcBounds,flags & DCB_RESET); } -
/* * @unimplemented @@ -1559,21 +1528,6 @@ return 0; }
- -/* - * @unimplemented - */ -INT -WINAPI -CombineRgn(HRGN hDest, - HRGN hSrc1, - HRGN hSrc2, - INT CombineMode) -{ - /* FIXME some part should be done in user mode */ - return NtGdiCombineRgn(hDest, hSrc1, hSrc2, CombineMode); -} - /* * @unimplemented */ @@ -1636,29 +1590,6 @@ { UNIMPLEMENTED; SetLastError(ERROR_CALL_NOT_IMPLEMENTED); -} - - -/* - * @implemented - */ -INT -WINAPI -ExcludeClipRect(IN HDC hdc, IN INT xLeft, IN INT yTop, IN INT xRight, IN INT yBottom) -{ - /* FIXME some part need be done on user mode size */ - return NtGdiExcludeClipRect(hdc, xLeft, yTop, xRight, yBottom); -} - -/* - * @implemented - */ -INT -WINAPI -ExtSelectClipRgn( IN HDC hdc, IN HRGN hrgn, IN INT iMode) -{ - /* FIXME some part need be done on user mode size */ - return NtGdiExtSelectClipRgn(hdc,hrgn, iMode); }
/* @@ -1792,119 +1723,6 @@ return NtGdiGetRegionData(hrgn,nCount,lpRgnData); }
- -/* - * @implemented - * - */ -INT -WINAPI -GetRgnBox(HRGN hrgn, - LPRECT prcOut) -{ -#if 0 - PRGN_ATTR Rgn_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hRgn, GDI_OBJECT_TYPE_REGION, (PVOID) &Rgn_Attr)) - return NtGdiGetRgnBox(hrgn, prcOut); - if (Rgn_Attr->Flags == NULLREGION) - { - prcOut->left = 0; - prcOut->top = 0; - prcOut->right = 0; - prcOut->bottom = 0; - } - else - { - if (Rgn_Attr->Flags != SIMPLEREGION) return NtGdiGetRgnBox(hrgn, prcOut); - *prcOut = Rgn_Attr->Rect; - } - return Rgn_Attr->Flags; -#endif - return NtGdiGetRgnBox(hrgn, prcOut); -} - - -/* - * @implemented - * - */ -INT -WINAPI -OffsetRgn( HRGN hrgn, - int nXOffset, - int nYOffset) -{ - /* FIXME some part are done in user mode */ - return NtGdiOffsetRgn(hrgn,nXOffset,nYOffset); -} - -/* - * @implemented - */ -INT -WINAPI -IntersectClipRect(HDC hdc, - int nLeftRect, - int nTopRect, - int nRightRect, - int nBottomRect) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) - return MFDRV_IntersectClipRect( hdc, nLeftRect, nTopRect, nRightRect, nBottomRect); - else - { - PLDC pLDC = GdiGetLDC(hdc); - if ( pLDC ) - { - if (pLDC->iType != LDC_EMFLDC || EMFDRV_IntersectClipRect( hdc, nLeftRect, nTopRect, nRightRect, nBottomRect)) - return NtGdiIntersectClipRect(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect); - } - else - SetLastError(ERROR_INVALID_HANDLE); - return 0; - } - } -#endif - return NtGdiIntersectClipRect(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect); -} - -/* - * @implemented - */ -INT -WINAPI -OffsetClipRgn(HDC hdc, - int nXOffset, - int nYOffset) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) - return MFDRV_OffsetClipRgn( hdc, nXOffset, nYOffset ); - else - { - PLDC pLDC = GdiGetLDC(hdc); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return 0; - } - if (pLDC->iType == LDC_EMFLDC && !EMFDRV_OffsetClipRgn( hdc, nXOffset, nYOffset )) - return 0; - return NtGdiOffsetClipRgn( hdc, nXOffset, nYOffset); - } - } -#endif - return NtGdiOffsetClipRgn( hdc, nXOffset, nYOffset); -} - - INT WINAPI NamedEscape(HDC hdc, @@ -1922,8 +1740,6 @@ return NtGdiExtEscape(NULL,pDriver,wcslen(pDriver),iEsc,cjIn,pjIn,cjOut,pjOut); }
- - /* * @unimplemented */
Modified: trunk/reactos/dll/win32/gdi32/objects/region.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/reg... ============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/region.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/objects/region.c [iso-8859-1] Thu Dec 24 00:10:32 2009 @@ -1,5 +1,4 @@ #include "precomp.h" -
static VOID @@ -136,6 +135,20 @@ /* FUNCTIONS *****************************************************************/
/* + * @unimplemented + */ +INT +WINAPI +CombineRgn(HRGN hDest, + HRGN hSrc1, + HRGN hSrc2, + INT CombineMode) +{ + /* FIXME some part should be done in user mode */ + return NtGdiCombineRgn(hDest, hSrc1, hSrc2, CombineMode); +} + +/* * @implemented */ HRGN @@ -144,7 +157,6 @@ { return (HRGN) NtGdiPolyPolyDraw( (HDC) fnPolyFillMode, (PPOINT) lppt, (PULONG) &cPoints, 1, GdiPolyPolyRgn); } -
/* * @implemented @@ -159,7 +171,6 @@ return (HRGN) NtGdiPolyPolyDraw( (HDC) fnPolyFillMode, (PPOINT) lppt, (PULONG) lpPolyCounts, (ULONG) nCount, GdiPolyPolyRgn ); }
- /* * @implemented */ @@ -197,6 +208,17 @@ /* Notes if prc is NULL it will crash on All Windows NT I checked 2000/XP/VISTA */ return CreateRectRgn(prc->left, prc->top, prc->right, prc->bottom);
+} + +/* + * @implemented + */ +INT +WINAPI +ExcludeClipRect(IN HDC hdc, IN INT xLeft, IN INT yTop, IN INT xRight, IN INT yBottom) +{ + /* FIXME some part need be done on user mode size */ + return NtGdiExcludeClipRect(hdc, xLeft, yTop, xRight, yBottom); }
/* @@ -226,6 +248,17 @@ /* * @implemented */ +INT +WINAPI +ExtSelectClipRgn( IN HDC hdc, IN HRGN hrgn, IN INT iMode) +{ + /* FIXME some part need be done on user mode size */ + return NtGdiExtSelectClipRgn(hdc,hrgn, iMode); +} + +/* + * @implemented + */ int WINAPI GetClipRgn( @@ -254,6 +287,70 @@
/* * @implemented + * + */ +INT +WINAPI +GetRgnBox(HRGN hrgn, + LPRECT prcOut) +{ +#if 0 + PRGN_ATTR Rgn_Attr; + if (!GdiGetHandleUserData((HGDIOBJ) hRgn, GDI_OBJECT_TYPE_REGION, (PVOID) &Rgn_Attr)) + return NtGdiGetRgnBox(hrgn, prcOut); + if (Rgn_Attr->Flags == NULLREGION) + { + prcOut->left = 0; + prcOut->top = 0; + prcOut->right = 0; + prcOut->bottom = 0; + } + else + { + if (Rgn_Attr->Flags != SIMPLEREGION) return NtGdiGetRgnBox(hrgn, prcOut); + *prcOut = Rgn_Attr->Rect; + } + return Rgn_Attr->Flags; +#endif + return NtGdiGetRgnBox(hrgn, prcOut); +} + +/* + * @implemented + */ +INT +WINAPI +IntersectClipRect(HDC hdc, + int nLeftRect, + int nTopRect, + int nRightRect, + int nBottomRect) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) + return MFDRV_IntersectClipRect( hdc, nLeftRect, nTopRect, nRightRect, nBottomRect); + else + { + PLDC pLDC = GdiGetLDC(hdc); + if ( pLDC ) + { + if (pLDC->iType != LDC_EMFLDC || EMFDRV_IntersectClipRect( hdc, nLeftRect, nTopRect, nRightRect, nBottomRect)) + return NtGdiIntersectClipRect(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect); + } + else + SetLastError(ERROR_INVALID_HANDLE); + return 0; + } + } +#endif + return NtGdiIntersectClipRect(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect); +} + +/* + * @implemented */ BOOL WINAPI @@ -262,6 +359,77 @@ RECT Rect; GetWindowRect(hwnd, &Rect); return MirrorRgnByWidth(hrgn, Rect.right - Rect.left, NULL); +} + +/* + * @implemented + */ +INT +WINAPI +OffsetClipRgn(HDC hdc, + int nXOffset, + int nYOffset) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) + return MFDRV_OffsetClipRgn( hdc, nXOffset, nYOffset ); + else + { + PLDC pLDC = GdiGetLDC(hdc); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return 0; + } + if (pLDC->iType == LDC_EMFLDC && !EMFDRV_OffsetClipRgn( hdc, nXOffset, nYOffset )) + return 0; + return NtGdiOffsetClipRgn( hdc, nXOffset, nYOffset); + } + } +#endif + return NtGdiOffsetClipRgn( hdc, nXOffset, nYOffset); +} + +/* + * @implemented + * + */ +INT +WINAPI +OffsetRgn( HRGN hrgn, + int nXOffset, + int nYOffset) +{ + /* FIXME some part are done in user mode */ + return NtGdiOffsetRgn(hrgn,nXOffset,nYOffset); +} + +/* + * @unimplemented + */ +BOOL +WINAPI +PtInRegion(IN HRGN hrgn, + int x, + int y) +{ + /* FIXME some stuff at user mode need be fixed */ + return NtGdiPtInRegion(hrgn,x,y); +} + +/* + * @unimplemented + */ +BOOL +WINAPI +RectInRegion(HRGN hrgn, + LPCRECT prcl) +{ + /* FIXME some stuff at user mode need be fixed */ + return NtGdiRectInRegion(hrgn, (LPRECT) prcl); }
/* @@ -287,42 +455,39 @@ int nRightRect, int nBottomRect) { -#if 0 PRGN_ATTR Rgn_Attr;
if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID) &Rgn_Attr)) -#endif return NtGdiSetRectRgn(hrgn, nLeftRect, nTopRect, nRightRect, nBottomRect); -#if 0 + if ((nLeftRect == nRightRect) || (nTopRect == nBottomRect)) { - Rgn_Attr->flFlags |= DIRTY_RGNATTR; - Rgn_Attr->dwType = RGNATTR_INIT; - Rgn_Attr->rcBound.left = Rgn_Attr->rcBound.top = - Rgn_Attr->rcBound.right = Rgn_Attr->rcBound.bottom = 0; + Rgn_Attr->AttrFlags |= ATTR_RGN_DIRTY; + Rgn_Attr->Flags = NULLREGION; + Rgn_Attr->Rect.left = Rgn_Attr->Rect.top = + Rgn_Attr->Rect.right = Rgn_Attr->Rect.bottom = 0; return TRUE; }
- Rgn_Attr->rcBound.left = nLeftRect; - Rgn_Attr->rcBound.top = nTopRect; - Rgn_Attr->rcBound.right = nRightRect; - Rgn_Attr->rcBound.bottom = nBottomRect; + Rgn_Attr->Rect.left = nLeftRect; + Rgn_Attr->Rect.top = nTopRect; + Rgn_Attr->Rect.right = nRightRect; + Rgn_Attr->Rect.bottom = nBottomRect;
if(nLeftRect > nRightRect) { - Rgn_Attr->rcBound.left = nRightRect; - Rgn_Attr->rcBound.right = nLeftRect; + Rgn_Attr->Rect.left = nRightRect; + Rgn_Attr->Rect.right = nLeftRect; } if(nTopRect > nBottomRect) { - Rgn_Attr->rcBound.top = nBottomRect; - Rgn_Attr->rcBound.bottom = nTopRect; - } - - Rgn_Attr->flFlags |= DIRTY_RGNATTR; - Rgn_Attr->dwType = RGNATTR_SET; + Rgn_Attr->Rect.top = nBottomRect; + Rgn_Attr->Rect.bottom = nTopRect; + } + + Rgn_Attr->AttrFlags |= ATTR_RGN_DIRTY ; + Rgn_Attr->Flags = SIMPLEREGION; return TRUE; -#endif }
/*