Author: jimtabor
Date: Tue Jan 5 04:05:50 2010
New Revision: 44943
URL:
http://svn.reactos.org/svn/reactos?rev=44943&view=rev
Log:
[gdi32]
- Run full Attribute and GdiBatch for Region support. Leaving Enh/Meta and mirroring
support for regions.
Modified:
trunk/reactos/dll/win32/gdi32/objects/region.c
Modified: trunk/reactos/dll/win32/gdi32/objects/region.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/re…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/region.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdi32/objects/region.c [iso-8859-1] Tue Jan 5 04:05:50 2010
@@ -104,7 +104,6 @@
FASTCALL
DeleteRegion( HRGN hRgn )
{
-#if 0
PRGN_ATTR Rgn_Attr;
if ((GdiGetHandleUserData((HGDIOBJ) hRgn, GDI_OBJECT_TYPE_REGION, (PVOID)
&Rgn_Attr)) &&
@@ -128,7 +127,6 @@
}
}
}
-#endif
return NtGdiDeleteObjectApp((HGDIOBJ) hRgn);
}
@@ -204,7 +202,6 @@
HRGN hSrc2,
INT CombineMode)
{
-#if 0
PRGN_ATTR pRgn_Attr_Dest = NULL;
PRGN_ATTR pRgn_Attr_Src1 = NULL;
PRGN_ATTR pRgn_Attr_Src2 = NULL;
@@ -218,9 +215,8 @@
!pRgn_Attr_Dest ||
!pRgn_Attr_Src1 ||
pRgn_Attr_Src1->Flags > SIMPLEREGION )
-#endif
return NtGdiCombineRgn(hDest, hSrc1, hSrc2, CombineMode);
-#if 0
+
/* Handle COPY and use only src1. */
if ( CombineMode == RGN_COPY )
{
@@ -274,19 +270,29 @@
DPRINT1("RGN_COPY was handled! CombineMode %d\n",CombineMode);
return NtGdiCombineRgn(hDest, hSrc1, hSrc2, CombineMode);
}
-
- if ( pRgn_Attr_Src1->Flags != NULLREGION &&
- pRgn_Attr_Src2->Flags != NULLREGION )
+ /* Now handle DIFF. */
+ if ( pRgn_Attr_Src1->Flags == NULLREGION )
+ {
+ if (SetRectRgn( hDest, 0, 0, 0, 0))
+ return NULLREGION;
+ goto ERROR_Exit;
+ }
+
+ if ( pRgn_Attr_Src2->Flags != NULLREGION )
{
Complexity = ComplexityFromRects( &pRgn_Attr_Src1->Rect,
&pRgn_Attr_Src2->Rect);
- /* If same or overlapping and norm just go K. */
- if (Complexity == SAME_RGN || Complexity == OVERLAPPING_RGN)
- return NtGdiCombineRgn(hDest, hSrc1, hSrc2, CombineMode);
+
+ if ( Complexity != DIFF_RGN )
+ {
+ if ( Complexity != INVERTED_RGN)
+ /* If same or overlapping and norm just go K. */
+ return NtGdiCombineRgn(hDest, hSrc1, hSrc2, CombineMode);
+
+ if (SetRectRgn( hDest, 0, 0, 0, 0))
+ return NULLREGION;
+ goto ERROR_Exit;
+ }
}
- /* Just NULL rgn. */
- if (SetRectRgn( hDest, 0, 0, 0, 0))
- return NULLREGION;
- goto ERROR_Exit;
}
else /* Handle OR or XOR. */
{
@@ -389,7 +395,6 @@
/* Even on error the flag is set dirty and force server side to redraw. */
pRgn_Attr_Dest->AttrFlags |= ATTR_RGN_DIRTY;
return ERROR;
-#endif
}
/*
@@ -634,13 +639,11 @@
GetRgnBox(HRGN hrgn,
LPRECT prcOut)
{
-#if 0
PRGN_ATTR Rgn_Attr;
if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID)
&Rgn_Attr))
-#endif
return NtGdiGetRgnBox(hrgn, prcOut);
-#if 0
+
if (Rgn_Attr->Flags == NULLREGION)
{
prcOut->left = 0;
@@ -656,7 +659,6 @@
RtlCopyMemory( prcOut, &Rgn_Attr->Rect, sizeof(RECT));
}
return Rgn_Attr->Flags;
-#endif
}
/*
@@ -747,14 +749,12 @@
int nXOffset,
int nYOffset)
{
-#if 0
PRGN_ATTR pRgn_Attr;
int nLeftRect, nTopRect, nRightRect, nBottomRect;
if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID)
&pRgn_Attr))
-#endif
return NtGdiOffsetRgn(hrgn,nXOffset,nYOffset);
-#if 0
+
if ( pRgn_Attr->Flags == NULLREGION)
return pRgn_Attr->Flags;
@@ -792,7 +792,6 @@
}
}
return pRgn_Attr->Flags;
-#endif
}
/*
@@ -804,13 +803,11 @@
int x,
int y)
{
-#if 0
PRGN_ATTR pRgn_Attr;
if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID)
&pRgn_Attr))
-#endif
return NtGdiPtInRegion(hrgn,x,y);
-#if 0
+
if ( pRgn_Attr->Flags == NULLREGION)
return FALSE;
@@ -818,7 +815,6 @@
return NtGdiPtInRegion(hrgn,x,y);
return INRECT( pRgn_Attr->Rect, x, y);
-#endif
}
/*
@@ -829,14 +825,12 @@
RectInRegion(HRGN hrgn,
LPCRECT prcl)
{
-#if 0
PRGN_ATTR pRgn_Attr;
RECTL rc;
if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID)
&pRgn_Attr))
-#endif
return NtGdiRectInRegion(hrgn, (LPRECT) prcl);
-#if 0
+
if ( pRgn_Attr->Flags == NULLREGION)
return FALSE;
@@ -870,7 +864,6 @@
return TRUE;
return FALSE;
-#endif
}
/*
@@ -896,13 +889,11 @@
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->AttrFlags |= ATTR_RGN_DIRTY;
@@ -931,7 +922,6 @@
Rgn_Attr->AttrFlags |= ATTR_RGN_DIRTY ;
Rgn_Attr->Flags = SIMPLEREGION;
return TRUE;
-#endif
}
/*