void CWsWindow::AbortDsaIfRequired(const TRegion& aNewRegion, const TRegion* aTop) { if (!iDSAs.IsEmpty()) { // If the top visible region of this window has changed, DSA clients may need // to be sent a DSA abort, as they may be drawing to a different region STACK_REGION newTopVisible; newTopVisible.Copy(aNewRegion); // new visible region if (aTop!=NULL) { newTopVisible.Intersect(*aTop); // area of new visible region not obscured by any other opaque or translucent windows } // Build a list of DSA clients that need to be sent a DSA abort TSglQue<CWsDirectScreenAccess> dsaList(_FOFF(CWsDirectScreenAccess,iAbortLink)); TSglQueIter<CWsDirectScreenAccess> iter(iDSAs); CWsDirectScreenAccess* dsa; while ((dsa=iter++)!=NULL) { if (dsa->IsAbortRequired(newTopVisible)) { dsaList.AddLast(*dsa); } } if (!dsaList.IsEmpty()) { iScreen->AbortDSAs(RDirectScreenAccess::ETerminateRegion, dsaList); } newTopVisible.Close(); } }
void CWsWindow::SetVisibleRegion(const TRegion& aNewRegion, const TRegion* aTop, TRegion& aNewFadableRegion) { STACK_REGION difference; TBool diffs = EFalse; difference.Copy(iVisibleRegion); difference.SubRegion(aNewRegion); if (!difference.IsEmpty()) { diffs = ETrue; if (IsTranslucent()) { // Andy - If this is a client window (what else could it be) we can also subtract the // user defined opaque region before doing this: iScreen->AddRedrawRegion(difference, EFalse); } } difference.Copy(aNewRegion); if (HasBeenDrawnToScreen()) { difference.SubRegion(iVisibleRegion); } if (!difference.IsEmpty()) { diffs = ETrue; STACK_REGION topDiff; topDiff.Copy(difference); WS_ASSERT_DEBUG(aTop,EWsPanicRegion); topDiff.Intersect(*aTop); difference.SubRegion(topDiff); iScreen->AddRedrawRegion(topDiff, EFalse, ERedrawTopOnly); iScreen->AddRedrawRegion(difference, EFalse, ERedrawAll); topDiff.Close(); } difference.Close(); AbortDsaIfRequired(aNewRegion, aTop); if (diffs) { ResetVisibleRegion(); iVisibleRegion.Copy(aNewRegion); PossibleVisibilityChangedEvent(EFalse); } iFadableRegion.Copy( aNewFadableRegion ); // Just because the visible region (screen coordinates) didn't change doesn't // mean the invalid region (window coordinates) didn't change, so we always call this. iRedraw->VisibleRegionChange(); }
void CWsWindow::SetVisibleRegion(const TRegion& aNewRegion, const TRegion* aTop) { WS_ASSERT_DEBUG(iScreen, EWsPanicNoScreen); STACK_REGION difference; TBool diffs = EFalse; difference.Copy(iVisibleRegion); difference.SubRegion(aNewRegion); if (!difference.IsEmpty()) { diffs = ETrue; if (IsTranslucent()) { iScreen->AddRedrawRegion(difference, EFalse); } } difference.Copy(aNewRegion); if (HasBeenDrawnToScreen()) { difference.SubRegion(iVisibleRegion); } if (!difference.IsEmpty()) { diffs = ETrue; if(!iScreen->ChangeTracking()) { //the following code will restart animations STACK_REGION topDiff; topDiff.Copy(difference); WS_ASSERT_DEBUG(aTop,EWsPanicRegion); topDiff.Intersect(*aTop); difference.SubRegion(topDiff); iScreen->AddRedrawRegion(topDiff, EFalse, ERedrawTopOnly); iScreen->AddRedrawRegion(difference, EFalse, ERedrawAll); topDiff.Close(); } else if(IsVisible()) { RestartAnimations(aNewRegion); } } difference.Close(); AbortDsaIfRequired(aNewRegion, aTop); if (diffs) { ResetVisibleRegion(); iVisibleRegion.Copy(aNewRegion); PossibleVisibilityChangedEvent(EFalse); if (Redraw()->HasElement()) { WS_ASSERT_DEBUG(WinType()==EWinTypeClient,EWsPanicWindowType); if (WinType()==EWinTypeClient) { iScreen->WindowElements().SetVisibleRegion(*static_cast<CWsClientWindow*>(this)); } } } // Just because the visible region (screen coordinates) didn't change doesn't // mean the invalid region (window coordinates) didn't change, so we always call this. iRedraw->VisibleRegionChange(); }