Bug 514992 - Remove nsIWidget::Invalidate(PRBool aIsSynchronous). r=roc
--HG-- extra : rebase_source : dfdf06c8547b00744647d4a285809a57cdbfe1f4
This commit is contained in:
Родитель
a2d8b4317d
Коммит
b7fd900405
|
@ -281,25 +281,27 @@ nsEventStatus HandleEvent(nsGUIEvent *aEvent)
|
|||
(ke->isControl?"Pressed":"Released"),
|
||||
(ke->isAlt?"Pressed":"Released"));
|
||||
printf("%s\n", str);
|
||||
nsIntRect clientRect;
|
||||
gWindow->GetClientBounds(clientRect);
|
||||
switch(ke->keyCode) {
|
||||
case 'U':
|
||||
gOffsetY -= 9;
|
||||
gWindow->Invalidate(PR_FALSE);
|
||||
gWindow->Invalidate(clientRect, PR_FALSE);
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
gOffsetY += 10;
|
||||
gWindow->Invalidate(PR_FALSE);
|
||||
gWindow->Invalidate(clientRect, PR_FALSE);
|
||||
break;
|
||||
|
||||
case 'R':
|
||||
gOffsetX += 9;
|
||||
gWindow->Invalidate(PR_FALSE);
|
||||
gWindow->Invalidate(clientRect, PR_FALSE);
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
gOffsetX -= 10;
|
||||
gWindow->Invalidate(PR_FALSE);
|
||||
gWindow->Invalidate(clientRect, PR_FALSE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -664,15 +664,6 @@ class nsIWidget : public nsISupports {
|
|||
*/
|
||||
NS_IMETHOD MakeFullScreen(PRBool aFullScreen) = 0;
|
||||
|
||||
/**
|
||||
* Invalidate the widget and repaint it.
|
||||
*
|
||||
* @param aIsSynchronous PR_TRUE then repaint synchronously. If PR_FALSE repaint later.
|
||||
* @see #Update()
|
||||
*/
|
||||
|
||||
NS_IMETHOD Invalidate(PRBool aIsSynchronous) = 0;
|
||||
|
||||
/**
|
||||
* Invalidate a specified rect for a widget and repaints it.
|
||||
*
|
||||
|
|
|
@ -1417,40 +1417,6 @@ NS_METHOD nsWindow::SetCursor(nsCursor aCursor)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Invalidate this component visible area
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsWindow::Invalidate(PRBool aIsSynchronous)
|
||||
{
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
// Asynchronous painting is performed with via nsViewBeOS::Draw() call and its message queue.
|
||||
// All update rects are collected in nsViewBeOS member "paintregion".
|
||||
// Flushing of paintregion happens in nsViewBeOS::GetPaintRegion(),
|
||||
// cleanup - in nsViewBeOS::Validate(), called in OnPaint().
|
||||
BRegion reg;
|
||||
reg.MakeEmpty();
|
||||
if (mView && mView->LockLooper())
|
||||
{
|
||||
if (PR_TRUE == aIsSynchronous)
|
||||
{
|
||||
mView->paintregion.Include(mView->Bounds());
|
||||
reg.Include(mView->Bounds());
|
||||
}
|
||||
else
|
||||
{
|
||||
mView->Draw(mView->Bounds());
|
||||
rv = NS_OK;
|
||||
}
|
||||
mView->UnlockLooper();
|
||||
}
|
||||
// Instant repaint.
|
||||
if (PR_TRUE == aIsSynchronous)
|
||||
rv = OnPaint(®);
|
||||
return rv;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Invalidate this component visible area
|
||||
|
|
|
@ -151,7 +151,6 @@ public:
|
|||
NS_IMETHOD GetScreenBounds(nsRect &aRect);
|
||||
NS_IMETHOD SetBackgroundColor(const nscolor &aColor);
|
||||
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);
|
||||
|
|
|
@ -338,7 +338,6 @@ public:
|
|||
NS_IMETHOD SetFocus(PRBool aRaise);
|
||||
NS_IMETHOD GetBounds(nsIntRect &aRect);
|
||||
|
||||
NS_IMETHOD Invalidate(PRBool aIsSynchronous);
|
||||
NS_IMETHOD Invalidate(const nsIntRect &aRect, PRBool aIsSynchronous);
|
||||
|
||||
virtual void* GetNativeData(PRUint32 aDataType);
|
||||
|
|
|
@ -1593,31 +1593,6 @@ static void blinkRgn(RgnHandle rgn)
|
|||
|
||||
#endif
|
||||
|
||||
// Invalidate this component's visible area
|
||||
NS_IMETHODIMP nsChildView::Invalidate(PRBool aIsSynchronous)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
||||
if (!mView || !mVisible)
|
||||
return NS_OK;
|
||||
|
||||
if (aIsSynchronous) {
|
||||
[mView display];
|
||||
}
|
||||
else if ([NSView focusView]) {
|
||||
// if a view is focussed (i.e. being drawn), then postpone the invalidate so that we
|
||||
// don't lose it.
|
||||
[mView setNeedsPendingDisplay];
|
||||
}
|
||||
else {
|
||||
[mView setNeedsDisplay:YES];
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
// Invalidate this component's visible area
|
||||
NS_IMETHODIMP nsChildView::Invalidate(const nsIntRect &aRect, PRBool aIsSynchronous)
|
||||
{
|
||||
|
|
|
@ -223,7 +223,6 @@ public:
|
|||
NS_IMETHOD SetTitle(const nsAString& aTitle);
|
||||
|
||||
NS_IMETHOD Invalidate(const nsIntRect &aRect, PRBool aIsSynchronous);
|
||||
NS_IMETHOD Invalidate(PRBool aIsSynchronous);
|
||||
NS_IMETHOD Update();
|
||||
virtual nsresult ConfigureChildren(const nsTArray<Configuration>& aConfigurations);
|
||||
virtual void Scroll(const nsIntPoint& aDelta,
|
||||
|
|
|
@ -1145,14 +1145,6 @@ NS_IMETHODIMP nsCocoaWindow::Invalidate(const nsIntRect & aRect, PRBool aIsSynch
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::Invalidate(PRBool aIsSynchronous)
|
||||
{
|
||||
if (mPopupContentView)
|
||||
return mPopupContentView->Invalidate(aIsSynchronous);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::Update()
|
||||
{
|
||||
if (mPopupContentView)
|
||||
|
|
|
@ -1676,28 +1676,6 @@ nsWindow::SetCursor(imgIContainer* aCursor,
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindow::Invalidate(PRBool aIsSynchronous)
|
||||
{
|
||||
if (!mGdkWindow || !CanBeSeen())
|
||||
return NS_OK;
|
||||
|
||||
GdkRectangle rect;
|
||||
rect.x = mBounds.x;
|
||||
rect.y = mBounds.y;
|
||||
rect.width = mBounds.width;
|
||||
rect.height = mBounds.height;
|
||||
|
||||
LOGDRAW(("Invalidate (all) [%p]: %d %d %d %d\n", (void *)this,
|
||||
rect.x, rect.y, rect.width, rect.height));
|
||||
|
||||
gdk_window_invalidate_rect(mGdkWindow, &rect, FALSE);
|
||||
if (aIsSynchronous)
|
||||
gdk_window_process_updates(mGdkWindow, FALSE);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindow::Invalidate(const nsIntRect &aRect,
|
||||
PRBool aIsSynchronous)
|
||||
|
|
|
@ -181,7 +181,6 @@ public:
|
|||
NS_IMETHOD SetCursor(nsCursor aCursor);
|
||||
NS_IMETHOD SetCursor(imgIContainer* aCursor,
|
||||
PRUint32 aHotspotX, PRUint32 aHotspotY);
|
||||
NS_IMETHOD Invalidate(PRBool aIsSynchronous);
|
||||
NS_IMETHOD Invalidate(const nsIntRect &aRect,
|
||||
PRBool aIsSynchronous);
|
||||
NS_IMETHOD Update();
|
||||
|
|
|
@ -1330,8 +1330,8 @@ NS_METHOD nsWindow::Resize(PRInt32 aX,
|
|||
|
||||
if (!WinSetWindowPos(GetMainWindow(), 0, ptl.x, ptl.y, w, h,
|
||||
SWP_MOVE | SWP_SIZE)) {
|
||||
if (aRepaint) {
|
||||
Invalidate(PR_FALSE);
|
||||
if (aRepaint && mWnd) {
|
||||
WinInvalidateRect( mWnd, 0, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1860,26 +1860,6 @@ NS_IMETHODIMP nsWindow::HideWindowChrome(PRBool aShouldHide)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Invalidate this component visible area
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsWindow::Invalidate(PRBool aIsSynchronous)
|
||||
{
|
||||
if (mWnd)
|
||||
{
|
||||
WinInvalidateRect( mWnd, 0, FALSE);
|
||||
#if 0
|
||||
if( PR_TRUE == aIsSynchronous) {
|
||||
Update();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Invalidate this component visible area
|
||||
|
@ -2116,8 +2096,8 @@ nsWindow::Scroll(const nsIntPoint& aDelta,
|
|||
if (w->mBounds.Intersects(affectedRect)) {
|
||||
if (!ClipRegionContainedInRect(configuration.mClipRegion,
|
||||
affectedRect - (w->mBounds.TopLeft()
|
||||
+ aDelta))) {
|
||||
w->Invalidate(PR_FALSE);
|
||||
+ aDelta)) && mWnd) {
|
||||
WinInvalidateRect( mWnd, 0, FALSE);
|
||||
}
|
||||
|
||||
// Send a WM_VRNDISABLED to the plugin child of this widget.
|
||||
|
|
|
@ -165,7 +165,6 @@ class nsWindow : public nsBaseWidget
|
|||
NS_IMETHOD HideWindowChrome(PRBool aShouldHide);
|
||||
NS_IMETHOD SetTitle( const nsAString& aTitle);
|
||||
NS_IMETHOD SetIcon(const nsAString& aIconSpec);
|
||||
NS_IMETHOD Invalidate( PRBool aIsSynchronous);
|
||||
NS_IMETHOD Invalidate( const nsIntRect & aRect, PRBool aIsSynchronous);
|
||||
NS_IMETHOD Update();
|
||||
virtual nsresult ConfigureChildren(const nsTArray<Configuration>& aConfigurations);
|
||||
|
|
|
@ -562,17 +562,6 @@ NS_METHOD nsWidget::SetCursor( nsCursor aCursor ) {
|
|||
}
|
||||
|
||||
|
||||
NS_METHOD nsWidget::Invalidate( PRBool aIsSynchronous ) {
|
||||
|
||||
// mWidget will be null during printing
|
||||
if( !mWidget || !PtWidgetIsRealized( mWidget ) ) return NS_OK;
|
||||
|
||||
PtWidget_t *aWidget = (PtWidget_t *)GetNativeData(NS_NATIVE_WIDGET);
|
||||
PtDamageWidget( aWidget );
|
||||
if( aIsSynchronous ) PtFlush();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsWidget::Invalidate( const nsRect & aRect, PRBool aIsSynchronous ) {
|
||||
|
||||
if( !mWidget ) return NS_OK; // mWidget will be null during printing
|
||||
|
|
|
@ -172,7 +172,6 @@ public:
|
|||
NS_IMETHOD CaptureMouse(PRBool aCapture) { return NS_ERROR_FAILURE; }
|
||||
|
||||
|
||||
NS_IMETHOD Invalidate(PRBool aIsSynchronous);
|
||||
NS_IMETHOD Invalidate(const nsRect &aRect, PRBool aIsSynchronous);
|
||||
NS_IMETHOD InvalidateRegion(const nsIRegion *aRegion, PRBool aIsSynchronous);
|
||||
inline NS_IMETHOD Update(void)
|
||||
|
|
|
@ -634,22 +634,6 @@ nsWindow::SetCursor(imgIContainer* aCursor,
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindow::Invalidate(PRBool aIsSynchronous)
|
||||
{
|
||||
LOGDRAW(("Invalidate (all) [%p]: \n", (void *)this));
|
||||
|
||||
if (!mWidget)
|
||||
return NS_OK;
|
||||
|
||||
if (aIsSynchronous && !mWidget->paintingActive())
|
||||
mWidget->repaint();
|
||||
else
|
||||
mWidget->update();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindow::Invalidate(const nsIntRect &aRect,
|
||||
PRBool aIsSynchronous)
|
||||
|
|
|
@ -165,7 +165,6 @@ public:
|
|||
NS_IMETHOD GetHasTransparentBackground(PRBool& aTransparent);
|
||||
NS_IMETHOD HideWindowChrome(PRBool aShouldHide);
|
||||
NS_IMETHOD MakeFullScreen(PRBool aFullScreen);
|
||||
NS_IMETHOD Invalidate(PRBool aIsSynchronous);
|
||||
NS_IMETHOD Invalidate(const nsIntRect &aRect,
|
||||
PRBool aIsSynchronous);
|
||||
NS_IMETHOD Update();
|
||||
|
|
Загрузка…
Ссылка в новой задаче