implements InvalidateRegion(). r=kmcclusk

git-svn-id: svn://10.0.0.236/trunk@54080 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
beard%netscape.com 1999-11-20 22:33:42 +00:00
parent 763bf1361e
commit 6c9ae2df08
2 changed files with 25 additions and 0 deletions

View File

@ -55,6 +55,7 @@
#include "nsNativeDragTarget.h"
#include "nsIRollupListener.h"
#include "nsIRegion.h"
// we define the following because there are some MS sample code say
// we should do it. We are not sure we really need it.
@ -1506,6 +1507,29 @@ NS_METHOD nsWindow::Invalidate(const nsRect & aRect, PRBool aIsSynchronous)
return NS_OK;
}
NS_IMETHODIMP
nsWindow::InvalidateRegion(const nsIRegion *aRegion, PRBool aIsSynchronous)
{
nsresult rv = NS_OK;
if (mWnd) {
HRGN nativeRegion;
rv = aRegion->GetNativeRegion((void *&)nativeRegion);
if (nativeRegion) {
if (NS_SUCCEEDED(rv)) {
VERIFY(::InvalidateRgn(mWnd, nativeRegion, TRUE));
if (aIsSynchronous) {
VERIFY(::UpdateWindow(mWnd));
}
}
} else {
rv = NS_ERROR_FAILURE;
}
}
return rv;
}
//-------------------------------------------------------------------------
//
// Force a synchronous repaint of the window

View File

@ -120,6 +120,7 @@ public:
NS_IMETHOD SetCursor(nsCursor aCursor);
NS_IMETHOD Invalidate(PRBool aIsSynchronous);
NS_IMETHOD Invalidate(const nsRect & aRect, PRBool aIsSynchronous);
NS_IMETHOD InvalidateRegion(const nsIRegion *aRegion, PRBool aIsSynchronous);
NS_IMETHOD Update();
virtual void* GetNativeData(PRUint32 aDataType);
virtual void FreeNativeData(void * data, PRUint32 aDataType);//~~~