示例#1
0
void RWindows::Update(const TRegion& aRgn,const TSize& aSize)
	{
	if(aRgn.CheckError())
		UpdateRect(TRect(aSize),aSize);
	else
		for(TInt count=0;count<aRgn.Count();count++)
			UpdateRect(aRgn[count],aSize);
	}
示例#2
0
void CWsSpriteManager::CalcFloatingSpriteRgn( TRegion& aResultRgn, const TRect& aDefaultRect )
	{
	aResultRgn.Clear();
	for (TInt i=0 ; i<iFloatingSprites.Count() && !aResultRgn.CheckError(); i++)
		{
		CWsSpriteBase* sprite = iFloatingSprites[i]; 
		if ( sprite->CanBeSeen() && ( sprite->IsActive() || sprite->IsActivated() ) )
			{
			aResultRgn.AddRect( sprite->Rect() );
			}
		}
	aResultRgn.Tidy();
	if ( aResultRgn.CheckError() && iFloatingSprites.Count() > 0 )
		{
		aResultRgn.Clear();
		aResultRgn.AddRect( aDefaultRect );
		}
	}
示例#3
0
void RWsTextCursor::doDraw(CFbsBitGc* aGc, const TRegion& aRegion)
	{
	TRegionFix<1> justInCase;
	const TRegion *pr= &aRegion;
	if (aRegion.CheckError())
		{
		justInCase.AddRect(iWin->AbsRect());
		pr= &justInCase;
		}
	if (!pr->IsEmpty())
		{
		aGc->SetUserDisplayMode(iWin->DisplayMode());
		aGc->SetDitherOrigin(iWin->Origin());
		aGc->SetDrawMode(CGraphicsContext::EDrawModeXOR);
		switch (iType)
			{
			case TTextCursor::ETypeRectangle:
				{
				aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
				aGc->SetPenStyle(CGraphicsContext::ENullPen);
				aGc->SetBrushColor(iColor);
				}
				break;
			case TTextCursor::ETypeHollowRectangle:
				{
				aGc->SetBrushStyle(CGraphicsContext::ENullBrush);
				aGc->SetPenStyle(CGraphicsContext::ESolidPen);
				aGc->SetPenColor(iColor);
				}
				break;
			default:
				WS_PANIC_ALWAYS(EWsPanicInvalidCursorType);
			}
		aGc->SetClippingRegion(pr);
		aGc->DrawRect(RectRelativeToScreen());
		aGc->SetUserDisplayMode(ENone);

		TWindowServerEvent::NotifyScreenDrawingEvent(pr);
		}
	}