Add Invalidate() and OnPaint() skid marks.

This commit is contained in:
ramiro%netscape.com 1999-09-06 03:22:42 +00:00
parent d984a33f47
commit 5e20ce88e3
2 changed files with 67 additions and 0 deletions

View File

@ -745,6 +745,13 @@ nsWidget::DeleteWindowCallback(Window aWindow)
delete window_key;
}
#undef TRACE_PAINT
#undef TRACE_PAINT_FLASH
#ifdef TRACE_PAINT_FLASH
#include "nsXUtils.h" // for nsGtkUtils::gdk_window_flash()
#endif
PRBool
nsWidget::OnPaint(nsPaintEvent &event)
{
@ -764,6 +771,36 @@ nsWidget::OnPaint(nsPaintEvent &event)
else {
result = PR_FALSE;
}
#ifdef TRACE_PAINT
static PRInt32 sPrintCount = 0;
if (event.rect)
{
printf("%4d nsWidget::OnPaint (this=%p,name=%s,xid=%p,rect=%d,%d,%d,%d)\n",
sPrintCount++,
(void *) this,
(const char *) nsCAutoString(mName),
(void *) mBaseWindow,
event.rect->x,
event.rect->y,
event.rect->width,
event.rect->height);
}
else
{
printf("%4d nsWidget::OnPaint (this=%p,name=%s,xid=%p,rect=none)\n",
sPrintCount++,
(void *) this,
(const char *) nsCAutoString(mName),
(void *) mBaseWindow);
}
#endif
#ifdef TRACE_PAINT_FLASH
nsXUtils::FlashWindow(mDisplay,mBaseWindow,2,100000);
#endif
}
return result;
}

View File

@ -102,6 +102,11 @@ nsWindow::GetEventMask()
return event_mask;
}
#undef TRACE_INVALIDATE
#ifdef TRACE_INVALIDATE
static PRInt32 sInvalidatePrintCount = 0;
#endif
NS_IMETHODIMP nsWindow::Invalidate(PRBool aIsSynchronous)
{
@ -114,6 +119,16 @@ NS_IMETHODIMP nsWindow::Invalidate(PRBool aIsSynchronous)
mBounds.width, mBounds.height);
// XXX fix this
pevent.time = 0;
#ifdef TRACE_INVALIDATE
printf("%4d nsWindow::Invalidate(this=%p,name=%s,xid=%p,sync=%s)\n",
sInvalidatePrintCount++,
(void *) this,
(const char *) nsCAutoString(mName),
(void *) mBaseWindow,
aIsSynchronous ? "yes" : "no");
#endif
AddRef();
OnPaint(pevent);
Release();
@ -132,6 +147,21 @@ NS_IMETHODIMP nsWindow::Invalidate(const nsRect & aRect, PRBool aIsSynchronous)
pevent.rect = new nsRect(aRect);
// XXX fix this
pevent.time = 0;
#ifdef TRACE_INVALIDATE
printf("%4d nsWidget::Invalidate(this=%p,name=%s,xid=%p,sync=%s,rect=%d,%d,%d,%d)\n",
sInvalidatePrintCount++,
(void *) this,
(const char *) nsCAutoString(mName),
(void *) mBaseWindow,
aIsSynchronous ? "yes" : "no",
aRect.x,
aRect.y,
aRect.width,
aRect.height);
#endif
AddRef();
OnPaint(pevent);
Release();