Added SetNativeRegion() + fixed 2 small bugs

This commit is contained in:
pierre%netscape.com 1999-02-11 23:50:12 +00:00
parent d281709765
commit b808081b1b
2 changed files with 21 additions and 1 deletions

View File

@ -366,6 +366,21 @@ NS_IMETHODIMP nsRegionMac :: GetNativeRegion(void *&aRegion) const
return NS_OK;
}
nsresult nsRegionMac :: SetNativeRegion(void *aRegion)
{
if (aRegion)
{
mRegion = (RgnHandle)aRegion;
SetRegionType();
}
else
{
Init();
}
return NS_OK;
}
//---------------------------------------------------------------------
NS_IMETHODIMP nsRegionMac :: GetRegionComplexity(nsRegionComplexity &aComplexity) const
@ -382,7 +397,10 @@ void nsRegionMac :: SetRegionType()
if (::EmptyRgn(mRegion) == PR_TRUE)
mRegionType = eRegionComplexity_empty;
else
mRegionType = eRegionComplexity_rect;
if ((*mRegion)->rgnSize == 10)
mRegionType = eRegionComplexity_rect;
else
mRegionType = eRegionComplexity_complex;
}
@ -392,6 +410,7 @@ void nsRegionMac :: SetRegionType()
void nsRegionMac :: SetRegionEmpty()
{
::SetEmptyRgn(mRegion);
SetRegionType();
}
//---------------------------------------------------------------------

View File

@ -49,6 +49,7 @@ public:
NS_IMETHOD GetRects(nsRegionRectSet **aRects);
NS_IMETHOD FreeRects(nsRegionRectSet *aRects);
NS_IMETHOD GetNativeRegion(void *&aRegion) const;
virtual nsresult SetNativeRegion(void *aRegion);
NS_IMETHOD GetRegionComplexity(nsRegionComplexity &aComplexity) const;
private: