コード例 #1
0
void CWsGceCscBase::SetCompositionMode(RWindow& aWindow, TDisplayMode aMode)
	{
		iDisplayMode = (TDisplayMode)aWindow.SetRequiredDisplayMode(aMode);
		aWindow.Invalidate();
		aWindow.BeginRedraw();
		aWindow.EndRedraw();
	}
コード例 #2
0
void CWsGceCscBase::SetBackgroundColorWindow(RWindow& aWindow, const TRgb& aColor)
	{
	aWindow.Invalidate();
	aWindow.SetBackgroundColor(aColor);
	aWindow.BeginRedraw();
	iGc->Activate(aWindow);
	iGc->Deactivate();
	aWindow.EndRedraw();
	}
コード例 #3
0
/**
BitBlts a bitmap to the windows GC.

@param aSession is the windows server session
@param aWindow is a reference to the window
@param aGc is the graphics context of the window
@param aImage is the bitmap to bitblt
*/		
void CAlphaBlendTest::BitBlt(RWsSession& aSession, RWindow& aWindow, CWindowGc* aGc, CFbsBitmap& aImage)
	{
	aWindow.Invalidate();
	aWindow.BeginRedraw();
	aGc->Activate(aWindow);
	aGc->BitBlt(TPoint(0,0), &aImage);
	aGc->Deactivate();
	aWindow.EndRedraw();	
	aSession.Flush();	
	}
コード例 #4
0
/**
Clears the window to a colour

@param aSession is the windows server session
@param aWindow is a reference to the window
@param aGc is the graphics context of the window
@param aColor is the colour to clear the window with
*/
void CAlphaBlendTest::ClearWindow(RWsSession& aSession, RWindow& aWindow, CWindowGc* aGc, TRgb aColor)
{
	// clear so we can see bitmap version has completed
	aWindow.Invalidate();
	aWindow.BeginRedraw();
	aGc->Activate(aWindow);
	aGc->SetBrushColor(aColor);
	aGc->Clear();
	aGc->Deactivate();
	aWindow.EndRedraw();
	aSession.Flush();
}
コード例 #5
0
void CWsGceCscBase::ConstructOpaqueWindowL(RWindow& aWindow, 
		                                   const TRgb& aColor, 
		                                   TInt aPos,
		                                   const TPoint &aPoint, 
		                                   const TSize &aSize)
	{
	ASSERT_EQUALS_X(aWindow.Construct(iGroup, ++iWindowHandle), KErrNone);
	aWindow.SetRequiredDisplayMode(iDisplayMode);
	aWindow.SetExtent(aPoint, aSize);
	aWindow.SetBackgroundColor(aColor);
	aWindow.SetOrdinalPosition(aPos);	
	aWindow.Activate();
	aWindow.BeginRedraw();
	iGc->Activate(aWindow);
	iGc->Deactivate();
	aWindow.EndRedraw();
	}
コード例 #6
0
void CWsGraphicShareBase::DoTestDrawGraphicCompareL(TPtrC aShare)
	{
	// UID of the shared graphic
	TUid uid1 = {0x12000021};
	TWsGraphicId twsGraphicId1(uid1);

	_LIT8(KTestData,"HelloWorld");
	
	CFbsBitmap bitmap1;
	CFbsBitmap mask1;
	
	TSize screenSize = iScreen->SizeInPixels();
	User::LeaveIfError(bitmap1.Load(MY_TEST_BITMAP,0));
	mask1.Create(bitmap1.SizeInPixels(),iScreen->DisplayMode());
	
		CWsGraphicBitmap* bTest = CWsGraphicBitmap::NewL(&bitmap1,&mask1);
	
	// divide the screen into two equal rectangles
	TRect position1(0,0,screenSize.iWidth/2,screenSize.iHeight);
	TRect position2(screenSize.iWidth/2,0,screenSize.iWidth,screenSize.iHeight);
	
	// draw the new graphic and attempt to draw the shared graphic
	iGc->Activate(*iWin);
	iWin->Invalidate();
	iWin->BeginRedraw();
	iGc->Clear(position1);
	iGc->Clear(position2);

	iGc->DrawWsGraphic(bTest->Id(),position1,KTestData);
	iGc->DrawWsGraphic(twsGraphicId1.Uid(),position2,KTestData);

	iGc->Deactivate();	
	iWin->EndRedraw();
	
	iWs.Flush();
	iWs.Finish();
	// compare the graphic in both positions
	if (aShare==_L("false"))
		Test(!iScreen->RectCompare(position1,position2));
	else
		Test(iScreen->RectCompare(position1,position2));	
		
	delete bTest;
	}
コード例 #7
0
void CWsGraphicShareBase::ConstructL()
	{
	User::LeaveIfError(iWs.Connect());
	iScreen=new(ELeave) CWsScreenDevice(iWs);
	User::LeaveIfError(iScreen->Construct(iScreenNumber));
	iGc=new(ELeave) CWindowGc(iScreen);
	User::LeaveIfError(iGc->Construct());
	iGroupWin=new(ELeave) RWindowGroup(iWs);
	iGroupWin->Construct(1);
		
	iWin=new(ELeave) RWindow(iWs);
	iWin->Construct(*iGroupWin,ENullWsHandle);
	iWin->SetRequiredDisplayMode(EColor256);
	iWin->SetExtent(TPoint(0,0),iScreen->SizeInPixels());
	iWin->Activate();
	iWin->BeginRedraw();
	iWin->EndRedraw();
	iWs.Flush();
	}	
コード例 #8
0
/**
Draw an ellipse to the window and fade the window.
@param aWin The window object
*/
void CT_WServGenericpluginStepLoad::DrawShape(RWindow& aWin)
	{
	TUint8 white = 255;
	TUint8 black = 128;
	
	aWin.BeginRedraw(KEllipseRect);
	iGc->Activate(aWin);
	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
	iGc->SetBrushColor(KRgbWhite);
	iGc->DrawEllipse(KEllipseRect);
	aWin.EndRedraw();
	iWsSession.Flush();	
	User::After(KDelay);
	
	aWin.SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly,black,white);
	iWsSession.Flush();	
	User::After(KDelay);

	iGc->Deactivate();
	}